Commit 8781144f authored by 姬鋆屾's avatar 姬鋆屾
parents defbf877 db02f1e3
......@@ -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
......@@ -20,16 +24,28 @@ public class AppealReq extends BaseReq {
private Integer appealResult;
private Integer processStatus;
/**
* 当前员工id
*/
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;
}
......@@ -60,5 +60,10 @@ public class PerformInfo {
*/
private String performType;
/**
* 申诉状态(0.未申诉,1.申诉中,2.申诉拒绝,3.申诉通过)
*/
private Integer appealStatus;
}
......@@ -80,8 +80,9 @@ public class ApiLoginController extends BaseJsonBodyController {
data.put("userType", userEntity.getUserType());
HashSet<Integer> set = new HashSet<>();
set.add(1);
set.add(0);
set.add(2);
set.add(3);
if (ObjectUtils.isEmpty(userEntity.getUserType()) || !set.contains(userEntity.getUserType())) {
throw new AppException("当前用户不支持H5登录!");
......@@ -89,7 +90,7 @@ public class ApiLoginController extends BaseJsonBodyController {
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
userEntity.setExpireTime(DateUtils.addCurrDate(3).getTime());
String token = authTokenService.createToken(userEntity);
data.put("token", token);
ret.put(KEY_RESULT_DATA, data);
......
......@@ -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,62 @@ 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 appealEntity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(req.getId()));
if (!ObjectUtils.isEmpty(appealEntity) && appealEntity.getProcessStatus() == ProcessStatusEnum.未处理.getValue()) {
throw new AppException("当前绩效核查已经存在正在进行中的申诉记录!");
}
PerformAttendAppealEntity entity = new PerformAttendAppealEntity();
entity.initAttrValue();
if (PerformTypeEnum.考勤绩效.getValue().equals(req.getPerformType())) {
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);
BeanUtils.copyProperties(checkEntity, entity, BeanUtil.getNullPropertyNames(checkEntity));
} else if (PerformTypeEnum.评价投诉绩效.getValue().equals(req.getPerformType())) {
CheckComplainRecordEntity checkEntity = checkComplainRecordService.get(req.getId(), context);
BeanUtils.copyProperties(checkEntity, entity, BeanUtil.getNullPropertyNames(checkEntity));
} else if (PerformTypeEnum.办件绩效.getValue().equals(req.getPerformType())) {
CheckGoworkRecordEntity checkEntity = checkGoworkRecordService.get(req.getId(), context);
BeanUtils.copyProperties(checkEntity, entity, BeanUtil.getNullPropertyNames(checkEntity));
} else if (PerformTypeEnum.效能绩效.getValue().equals(req.getPerformType())) {
CheckEffectRecordEntity checkEntity = checkEffectRecordService.get(req.getId(), context);
BeanUtils.copyProperties(checkEntity, entity, BeanUtil.getNullPropertyNames(checkEntity));
} else if (PerformTypeEnum.其它绩效.getValue().equals(req.getPerformType())) {
CheckOtherRecordEntity checkEntity = checkOtherRecordService.get(req.getId(), context);
BeanUtils.copyProperties(checkEntity, entity, BeanUtil.getNullPropertyNames(checkEntity));
} else {
throw new AppException("不支持当前绩效类型");
}
entity.setPerformType(req.getPerformType());
entity.setPerformAttendAppealFilesList(req.getPerformAttendAppealFilesList());
entity.setProcessStatus(1);
entity.setAppealDesc(req.getAppealDesc());
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;
}
......
......@@ -16,13 +16,20 @@ 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.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.*;
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;
......@@ -65,6 +72,11 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
@Autowired
private CheckAllRecordService checkAllRecordService;
@Autowired
private PerformAttendAppealService appealService;
/**
......@@ -119,6 +131,24 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PageInfo pageInfo = buildPageInfo(performReq);
//todo 查询全部扣分绩效
if (PerformTypeEnum.全部.getValue().equals(performReq.getPerformType())) {
CheckAllRecordQuery query = new CheckAllRecordQuery();
query.setCheckTimeStart(performReq.getPerformStartDate());
query.setCheckTimeEnd(performReq.getPerformEndDate());
query.setStaffId(context.getUser().getCustomerId());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
} else if (PerformTypeEnum.考勤绩效.getValue().equals(performReq.getPerformType())) {
CheckAttendRecordQuery query = new CheckAttendRecordQuery();
......@@ -131,8 +161,15 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
performInfo.setPerformType(PerformTypeEnum.考勤绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
......@@ -147,6 +184,11 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
performInfo.setPerformType(PerformTypeEnum.评价差评绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......@@ -163,6 +205,11 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
performInfo.setPerformType(PerformTypeEnum.评价投诉绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......@@ -179,6 +226,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
performInfo.setPerformType(PerformTypeEnum.办件绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......@@ -195,6 +246,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
performInfo.setPerformType(PerformTypeEnum.效能绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......@@ -211,6 +266,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
performInfo.setPerformType(PerformTypeEnum.其它绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......@@ -221,7 +280,6 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
}
rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
......@@ -230,6 +288,22 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
return rest;
}
private static void updateAppealStatus(PerformInfo performInfo, Boolean bool, Integer processStatus, Integer appealResult) {
if (!bool) {
performInfo.setAppealStatus(AppealStatusEnum.未申诉.getValue());
} else {
if (ProcessStatusEnum.未处理.getValue() == processStatus) {
performInfo.setAppealStatus(AppealStatusEnum.申诉中.getValue());
} else {
if (AppealResultEnum.通过.getValue() == appealResult) {
performInfo.setAppealStatus(AppealStatusEnum.申诉通过.getValue());
} else if (AppealResultEnum.不通过.getValue() == appealResult) {
performInfo.setAppealStatus(AppealStatusEnum.申诉拒绝.getValue());
}
}
}
}
/**
* 详细
......@@ -278,7 +352,6 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
}
public static void main(String[] args) {
}
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 申诉状态(0.未申诉,1.申诉中,2.申诉拒绝,3.申诉通过)
*
* @author zxfei
*/
public enum AppealStatusEnum {
未申诉(0, "未申诉"),
申诉中(1, "申诉中"),
申诉拒绝(2, "申诉拒绝"),
申诉通过(3, "申诉通过");
private Integer value;
private String desc;
AppealStatusEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static AppealStatusEnum getByValue(Integer value) {
for (AppealStatusEnum deviceStatusEnum : AppealStatusEnum.values()) {
if (deviceStatusEnum.getValue() == value) {
return deviceStatusEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (AppealStatusEnum item : AppealStatusEnum.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;
}
}
\ No newline at end of file
......@@ -8,11 +8,10 @@ import java.util.Map;
*/
public enum CheckTypeEnum {
考勤绩效(1, "考勤绩效"),
效能绩效(2, "效能绩效"),
评价绩效(3, "评价绩效"),
办件绩效(4, "办件绩效"),
差评绩效(5, "差评绩效"),
其它绩效(6, "其它绩效"),
评价绩效(2, "评价绩效"),
办件绩效(3, "办件绩效"),
效能绩效(4, "效能绩效"),
其它绩效(5, "其它绩效"),
;
private Integer value;
private String desc;
......
......@@ -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;
......
......@@ -11,7 +11,8 @@ import java.util.Map;
public enum UserType {
SYSTEM(0, "系统用户"),
WORK(1, "后台管理"),
WORK_PERSON(2, "工作人员");
WORK_PERSON(2, "工作人员"),
INSPECT_PERSON(3, "巡查人员");;
private int value;
private String desc;
......
......@@ -133,7 +133,7 @@ public class CheckAttendRecordEntity extends CheckAttendRecordVo {
*/
private Long categoryId;
/**
* 规则名称
* 规则分类名称
*/
private String categoryName;
@Override
......
package com.mortals.xhx.module.feedback.service.impl;
import com.mortals.xhx.module.feedback.model.FeedbackStaffEntity;
import com.mortals.xhx.module.feedback.service.FeedbackStaffService;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -11,6 +13,8 @@ import com.mortals.xhx.module.feedback.model.FeedbackQuestionEntity;
import com.mortals.xhx.module.feedback.model.FeedbackQuestionQuery;
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;
......@@ -27,6 +31,8 @@ import lombok.extern.slf4j.Slf4j;
public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, FeedbackEntity, Long> implements FeedbackService {
@Autowired
private FeedbackQuestionService feedbackQuestionService;
@Autowired
private FeedbackStaffService feedbackStaffService;
@Override
protected void saveAfter(FeedbackEntity entity, Context context) throws AppException {
......@@ -38,6 +44,18 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe
}).count();
feedbackQuestionService.save(entity.getFeedbackQuestionList());
}
if(!ObjectUtils.isEmpty(entity.getStaffList())){
List<FeedbackStaffEntity> staffEntityList = new ArrayList<>();
for(Long staffId:entity.getStaffList()){
FeedbackStaffEntity feedbackStaffEntity = new FeedbackStaffEntity();
feedbackStaffEntity.setFeedbackId(entity.getId());
feedbackStaffEntity.setStaffId(staffId);
feedbackStaffEntity.setCreateTime(new Date());
feedbackStaffEntity.setCreateUserId(this.getContextUserId(context));
staffEntityList.add(feedbackStaffEntity);
}
feedbackStaffService.save(staffEntityList,context);
}
super.saveAfter(entity, context);
}
......
......@@ -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
......@@ -7,34 +7,34 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.vo.PerformPerposeDeptVo;
import lombok.Data;
/**
* 部门考核目标详细信息实体对象
*
* @author zxfei
* @date 2023-05-16
*/
* 部门考核目标详细信息实体对象
*
* @author zxfei
* @date 2023-07-12
*/
@Data
public class PerformPerposeDeptEntity extends PerformPerposeDeptVo {
private static final long serialVersionUID = 1L;
/**
* 考核目标id
*/
* 考核目标id
*/
private Long purposeConfId;
/**
* 部门id
*/
* 部门id
*/
private Long deptId;
/**
* 部门名称
*/
* 部门名称
*/
private String deptName;
/**
* 备注
*/
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -42,7 +42,7 @@ public class PerformPerposeDeptEntity extends PerformPerposeDeptVo {
if (obj instanceof PerformPerposeDeptEntity) {
PerformPerposeDeptEntity tmp = (PerformPerposeDeptEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -50,12 +50,12 @@ public class PerformPerposeDeptEntity extends PerformPerposeDeptVo {
public void initAttrValue(){
this.purposeConfId = -1L;
this.purposeConfId = -1L;
this.deptId = -1L;
this.deptId = -1L;
this.deptName = "";
this.deptName = "";
this.remark = "";
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.vo.PerformPerposeDeptStatVo;
import lombok.Data;
/**
* 部门目标统计实体对象
*
* @author zxfei
* @date 2023-05-16
*/
* 部门目标统计实体对象
*
* @author zxfei
* @date 2023-07-12
*/
@Data
public class PerformPerposeDeptStatEntity extends PerformPerposeDeptStatVo {
private static final long serialVersionUID = 1L;
/**
* 部门id号
*/
* 部门id号
*/
private Long deptId;
/**
* 部门名称
*/
* 部门名称
*/
private String deptName;
/**
* 旷工率
*/
* 旷工率
*/
private BigDecimal absentRate;
/**
* 缺卡率
*/
* 缺卡率
*/
private BigDecimal absenceRate;
/**
* 迟到率
*/
* 迟到率
*/
private BigDecimal lateRate;
/**
* 早退率
*/
* 早退率
*/
private BigDecimal earlyRate;
/**
* 请假率
*/
* 请假率
*/
private BigDecimal leaveRate;
/**
* 离岗率
*/
* 离岗率
*/
private BigDecimal turnoverRate;
/**
* 睡觉率
*/
* 睡觉率
*/
private BigDecimal sleepRate;
/**
* 玩手机率
*/
* 玩手机率
*/
private BigDecimal playPhoneRate;
/**
* 办件超期率
*/
* 办件超期率
*/
private BigDecimal expireWorkRate;
/**
* 差评率
*/
* 差评率
*/
private BigDecimal negaReviewRate;
/**
* 备注
*/
* 备注
*/
private String remark;
/**
* 年
*/
* 年
*/
private Integer year;
/**
* 月
*/
* 月
*/
private Integer month;
/**
* 日
*/
* 日
*/
private Integer day;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -91,7 +94,7 @@ public class PerformPerposeDeptStatEntity extends PerformPerposeDeptStatVo {
if (obj instanceof PerformPerposeDeptStatEntity) {
PerformPerposeDeptStatEntity tmp = (PerformPerposeDeptStatEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -99,36 +102,36 @@ public class PerformPerposeDeptStatEntity extends PerformPerposeDeptStatVo {
public void initAttrValue(){
this.deptId = 0L;
this.deptId = 0L;
this.deptName = "";
this.deptName = "";
this.absentRate = BigDecimal.valueOf(0.00);
this.absentRate = BigDecimal.valueOf(0.00);
this.absenceRate = BigDecimal.valueOf(0.00);
this.absenceRate = BigDecimal.valueOf(0.00);
this.lateRate = BigDecimal.valueOf(0.00);
this.lateRate = BigDecimal.valueOf(0.00);
this.earlyRate = BigDecimal.valueOf(0.00);
this.earlyRate = BigDecimal.valueOf(0.00);
this.leaveRate = BigDecimal.valueOf(0.00);
this.leaveRate = BigDecimal.valueOf(0.00);
this.turnoverRate = BigDecimal.valueOf(0.00);
this.turnoverRate = BigDecimal.valueOf(0.00);
this.sleepRate = BigDecimal.valueOf(0.00);
this.sleepRate = BigDecimal.valueOf(0.00);
this.playPhoneRate = BigDecimal.valueOf(0.00);
this.playPhoneRate = BigDecimal.valueOf(0.00);
this.expireWorkRate = BigDecimal.valueOf(0.00);
this.expireWorkRate = BigDecimal.valueOf(0.00);
this.negaReviewRate = BigDecimal.valueOf(0.00);
this.negaReviewRate = BigDecimal.valueOf(0.00);
this.remark = "";
this.remark = "";
this.year = -1;
this.year = DateUtil.year(new Date());
this.month = -1;
this.month = DateUtil.month(new Date())+1;
this.day = -1;
this.day = DateUtil.dayOfMonth(new Date());
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
......@@ -111,9 +114,9 @@ public class PerformPerposeEntity extends PerformPerposeVo {
this.periodType = 1;
this.year = -1;
this.year = DateUtil.year(new Date());
this.month = -1;
this.month =DateUtil.month(new Date())+1;
this.halfYear = 1;
......
......@@ -7,38 +7,38 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.vo.PerformPerposeStaffVo;
import lombok.Data;
/**
* 员工考核目标详细信息实体对象
*
* @author zxfei
* @date 2023-05-16
*/
* 员工考核目标详细信息实体对象
*
* @author zxfei
* @date 2023-07-12
*/
@Data
public class PerformPerposeStaffEntity extends PerformPerposeStaffVo {
private static final long serialVersionUID = 1L;
/**
* 考核目标id
*/
* 考核目标id
*/
private Long purposeConfId;
/**
* 员工id
*/
* 员工id
*/
private Long staffId;
/**
* 员工名称
*/
* 员工名称
*/
private String staffName;
/**
* 工号
*/
* 工号
*/
private String number;
/**
* 备注
*/
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -46,7 +46,7 @@ public class PerformPerposeStaffEntity extends PerformPerposeStaffVo {
if (obj instanceof PerformPerposeStaffEntity) {
PerformPerposeStaffEntity tmp = (PerformPerposeStaffEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -54,14 +54,14 @@ public class PerformPerposeStaffEntity extends PerformPerposeStaffVo {
public void initAttrValue(){
this.purposeConfId = -1L;
this.purposeConfId = -1L;
this.staffId = -1L;
this.staffId = -1L;
this.staffName = "";
this.staffName = "";
this.number = "";
this.number = "";
this.remark = "";
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
......@@ -11,7 +14,7 @@ import lombok.Data;
* 员工目标统计实体对象
*
* @author zxfei
* @date 2023-07-11
* @date 2023-07-12
*/
@Data
public class PerformPerposeStaffStatEntity extends PerformPerposeStaffStatVo {
......@@ -131,10 +134,10 @@ public class PerformPerposeStaffStatEntity extends PerformPerposeStaffStatVo {
this.remark = "";
this.year = -1;
this.year = DateUtil.year(new Date());
this.month = -1;
this.month = DateUtil.month(new Date())+1;
this.day = -1;
this.day = DateUtil.dayOfMonth(new Date());
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.perform.model.PerformPerposeStaffStatEntity;
* 员工目标统计查询对象
*
* @author zxfei
* @date 2023-07-11
* @date 2023-07-12
*/
public class PerformPerposeStaffStatQuery extends PerformPerposeStaffStatEntity {
/** 开始 主键ID,主键,自增长 */
......
......@@ -11,7 +11,7 @@ import java.util.Date;
* 绩效记录申诉信息视图对象
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
@Data
public class PerformAttendAppealVo extends BaseEntityLong {
......
......@@ -13,6 +13,7 @@ import lombok.Data;
@Data
public class PerformDeptConfDetailVo extends BaseEntityLong {
/** 分类Id */
private Long categoryId;
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity;
import com.mortals.xhx.module.perform.model.PerformDeptConfEntity;
import java.util.ArrayList;
import java.util.List;
......@@ -13,6 +14,7 @@ import lombok.Data;
@Data
public class PerformDeptConfVo extends BaseEntityLong {
/** 部门考核内容详细信息 */
List<PerformDeptConfDetailEntity> deptConfDetail;
}
\ No newline at end of file
......@@ -4,15 +4,16 @@ import com.mortals.xhx.module.perform.model.PerformPerposeDeptStatEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 部门目标统计视图对象
*
* @author zxfei
* @date 2023-05-16
* @date 2023-07-12
*/
@Data
public class PerformPerposeDeptStatVo extends BaseEntityLong {
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ import java.util.Date;
* 员工目标统计视图对象
*
* @author zxfei
* @date 2023-07-11
* @date 2023-07-12
*/
@Data
public class PerformPerposeStaffStatVo 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 List<PerformPerposeStaffEntity> perposeStaffList;
/**
* 部门目标
*/
private List<PerformPerposeDeptEntity> perposeDeptList;
private String staffPerpose;
private String deptPerpose;
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import lombok.Data;
@Data
public class PerformStaffConfDetailVo extends BaseEntityLong {
/** 分类Id */
private Long categoryId;
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.PerformStaffConfDetailEntity;
import com.mortals.xhx.module.perform.model.PerformStaffConfEntity;
import java.util.ArrayList;
import java.util.List;
......@@ -12,7 +13,7 @@ import lombok.Data;
*/
@Data
public class PerformStaffConfVo extends BaseEntityLong {
/** 人员自动考核内容详细信息 */
private List<PerformStaffConfDetailEntity> staffConfDetail;
}
\ No newline at end of file
......@@ -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>{
......
package com.mortals.xhx.module.perform.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity;
import com.mortals.xhx.module.perform.dao.PerformDeptConfDetailDao;
......@@ -13,4 +15,12 @@ import com.mortals.xhx.module.perform.dao.PerformDeptConfDetailDao;
public interface PerformDeptConfDetailService extends ICRUDService<PerformDeptConfDetailEntity,Long>{
PerformDeptConfDetailDao getDao();
/**
* 启用停用规则
* @param id
* @return
* @throws AppException
*/
int enable(Long id, Context context) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.perform.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.perform.model.PerformStaffConfDetailEntity;
import com.mortals.xhx.module.perform.dao.PerformStaffConfDetailDao;
......@@ -13,4 +15,12 @@ import com.mortals.xhx.module.perform.dao.PerformStaffConfDetailDao;
public interface PerformStaffConfDetailService extends ICRUDService<PerformStaffConfDetailEntity,Long>{
PerformStaffConfDetailDao getDao();
/**
* 启用停用规则
* @param id
* @return
* @throws AppException
*/
int enable(Long id, Context context) throws AppException;
}
\ No newline at end of file
......@@ -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.xhx.common.code.EnabledEnum;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -7,6 +8,9 @@ import com.mortals.xhx.module.perform.dao.PerformDeptConfDetailDao;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity;
import com.mortals.xhx.module.perform.service.PerformDeptConfDetailService;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
/**
* PerformDeptConfDetailService
* 部门考核内容详细信息 service实现
......@@ -17,5 +21,27 @@ import lombok.extern.slf4j.Slf4j;
@Service("performDeptConfDetailService")
@Slf4j
public class PerformDeptConfDetailServiceImpl extends AbstractCRUDServiceImpl<PerformDeptConfDetailDao, PerformDeptConfDetailEntity, Long> implements PerformDeptConfDetailService {
@Override
public int enable(Long id, Context context) throws AppException {
if(id == null){
throw new AppException("考核内容详细Id不能为空");
}
PerformDeptConfDetailEntity temp = this.get(id);
if(temp == null){
throw new AppException("考核内容详细Id不正确");
}
PerformDeptConfDetailEntity entity = new PerformDeptConfDetailEntity();
entity.setId(id);
if(temp.getEnable() == EnabledEnum.停止.getValue()){
entity.setEnable(EnabledEnum.启用.getValue());
}else {
entity.setEnable(EnabledEnum.停止.getValue());
}
if(context!=null && context.getUser()!=null){
entity.setUpdateTime(new Date());
entity.setUpdateUserId(context.getUser().getId());
}
return this.dao.update(entity);
}
}
\ 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);
}
......
This diff is collapsed.
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