Commit 7ab15622 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 8b0d63ed 4d55a953
...@@ -32,6 +32,7 @@ export default { ...@@ -32,6 +32,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
#app { #app {
height:100vh;
.loading { .loading {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
str = "已结束" str = "已结束"
} }
return ( return (
<el-tag type={row.processStatus ? row.processStatus == 2 ? 'success' : 'info' : 'danger'} size="small"> <el-tag type={row.processStatus ? row.processStatus == 1 ? 'success' : 'info' : 'danger'} size="small">
{str} {str}
</el-tag> </el-tag>
) )
......
...@@ -15,9 +15,8 @@ ...@@ -15,9 +15,8 @@
</div> </div>
<div style="margin: 10px 0;"> <div style="margin: 10px 0;">
<el-tag <el-tag
:type="feedbackData.processStatus ? feedbackData.processStatus = 1 ? 'success' : 'info' : 'danger'"> :type="feedbackData.processStatus ? feedbackData.processStatus == 1 ? 'success' : 'info' : 'danger'">
{{ feedbackData.processStatus ? feedbackData.processStatus {{ feedbackData.processStatus ? feedbackData.processStatus == 1 ? '进行中' : '已结束' : '未开始' }}</el-tag>
== 1 ? '进行中' : '已结束' : '未开始' }}</el-tag>
反馈时间:{{ feedbackData.timeStart }} ~ {{ feedbackData.timeEnd }} 反馈时间:{{ feedbackData.timeStart }} ~ {{ feedbackData.timeEnd }}
</div> </div>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
label="分组" label="分组"
prop="groupId" prop="groupId"
v-model="form.groupId" v-model="form.groupId"
:enumData="dict.group" :enumData="dict.groupId"
type="select" type="select"
placeholder="请选择分组" placeholder="请选择分组"
/> />
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
groupId: null, groupId: "",
groupName: "", groupName: "",
jobCode: "", jobCode: "",
jobName: "", jobName: "",
......
...@@ -20,6 +20,9 @@ import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordEntity; ...@@ -20,6 +20,9 @@ import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordEntity;
import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordQuery; import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordQuery;
import com.mortals.xhx.module.attendance.service.AttendanceLeaveRecordService; import com.mortals.xhx.module.attendance.service.AttendanceLeaveRecordService;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
...@@ -54,7 +57,8 @@ public class DingMessageController { ...@@ -54,7 +57,8 @@ public class DingMessageController {
private IDingPersonService dingPersonService; private IDingPersonService dingPersonService;
@Autowired @Autowired
private AttendanceLeaveRecordService attendanceLeaveRecordService; private AttendanceLeaveRecordService attendanceLeaveRecordService;
@Autowired
private StaffService staffService;
/** /**
* appKey * appKey
...@@ -109,15 +113,22 @@ public class DingMessageController { ...@@ -109,15 +113,22 @@ public class DingMessageController {
AttendanceLeaveRecordEntity leaveRecordEntity = new AttendanceLeaveRecordEntity(); AttendanceLeaveRecordEntity leaveRecordEntity = new AttendanceLeaveRecordEntity();
leaveRecordEntity.initAttrValue(); leaveRecordEntity.initAttrValue();
leaveRecordEntity.setRemark(processInstanceId); //将钉钉的事物id作为备注填入数据库 leaveRecordEntity.setRemark(processInstanceId); //将钉钉的事物id作为备注填入数据库
leaveRecordEntity.setLeavePersonId(Long.parseLong(result.getOriginatorUserId()));
leaveRecordEntity.setLeavePerson(result.getTitle().substring(0,result.getTitle().indexOf("提交")));
leaveRecordEntity.setDeptId(Long.parseLong(result.getOriginatorDeptId()));
leaveRecordEntity.setDeptName(result.getOriginatorDeptName());
Rest<String> mobileRest = dingPersonService.getPersonById(result.getOriginatorUserId());
if(mobileRest.getCode() == Rest.SUCCESS) {
String mobile = mobileRest.getData();
StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(mobile));
if(!ObjectUtils.isEmpty(staffEntity)){
leaveRecordEntity.setLeavePersonId(staffEntity.getId());
leaveRecordEntity.setLeavePerson(staffEntity.getName());
leaveRecordEntity.setDeptId(staffEntity.getDeptId());
leaveRecordEntity.setDeptName(staffEntity.getDeptName());
leaveRecordEntity.setPhoneNumber(staffEntity.getPhoneNumber());
if(result.getTasks().size() >0 ){ if(result.getTasks().size() >0 ){
Date startTime = dateFormat(result.getTasks().get(0).getCreateTime()); Date startTime = dateFormat(result.getTasks().get(0).getCreateTime());
Date endTime = dateFormat(result.getTasks().get(0).getFinishTime()); Date endTime = dateFormat(result.getTasks().get(0).getFinishTime());
leaveRecordEntity.setStartTime(startTime); leaveRecordEntity.setStartTime(startTime);
leaveRecordEntity.setEndTime(endTime); leaveRecordEntity.setEndTime(endTime);
...@@ -207,20 +218,33 @@ public class DingMessageController { ...@@ -207,20 +218,33 @@ public class DingMessageController {
} }
} else if (result.getFormComponentValues().size() > 1) { //请假理由
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResultFormComponentValues resonEntity = result.getFormComponentValues().get(1);
if(resonEntity.getName().equals("请假事由")){
leaveRecordEntity.setReason(resonEntity.getValue());
}
}else if (result.getFormComponentValues().size() > 2) { //上传的附件
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResultFormComponentValues picEntity = result.getFormComponentValues().get(2);
if(picEntity.getName().equals("图片") && picEntity.getValue() != null){
leaveRecordEntity.setReason(picEntity.getValue());
}
} }
if(result.getStatus().equals("NEW") || result.getStatus().equals("RUNNING")){
if(result.getStatus().compareToIgnoreCase("NEW") == 0 || result.getStatus().compareToIgnoreCase("RUNNING") == 0){
leaveRecordEntity.setProcessStatus(1); leaveRecordEntity.setProcessStatus(1);
}else if(result.getStatus().equals("COMPLETED") || result.getStatus().equals("CANCELED") || result.getStatus().equals("TERMINATED")){ }else if(result.getStatus().compareToIgnoreCase("COMPLETED") == 0 || result.getStatus().compareToIgnoreCase("CANCELED") == 0
|| result.getStatus().compareToIgnoreCase("TERMINATED") == 0){
leaveRecordEntity.setProcessStatus(2); leaveRecordEntity.setProcessStatus(2);
} }
if(result.getResult().equals("AGREE")){ if(result.getResult().compareToIgnoreCase("AGREE") == 0){
leaveRecordEntity.setAuditResult(1); leaveRecordEntity.setAuditResult(1);
}else { }else {
leaveRecordEntity.setAuditResult(2); leaveRecordEntity.setAuditResult(2);
} }
log.info("钉钉返回的result:"+result.getResult()+"\nauditresult:"+leaveRecordEntity.getAuditResult());
leaveRecordEntity.setAuditDesc(result.getOperationRecords().get(0).getRemark()); leaveRecordEntity.setAuditDesc(result.getOperationRecords().get(0).getRemark());
AttendanceLeaveRecordEntity recordEntity = attendanceLeaveRecordService.selectOne(new AttendanceLeaveRecordQuery().remark(processInstanceId)); AttendanceLeaveRecordEntity recordEntity = attendanceLeaveRecordService.selectOne(new AttendanceLeaveRecordQuery().remark(processInstanceId));
...@@ -239,6 +263,20 @@ public class DingMessageController { ...@@ -239,6 +263,20 @@ public class DingMessageController {
} }
}else {
log.info("该号码("+mobile +")未在本系统绑定");
}
}else {
log.info("根据id在钉钉平台查询电话失败"+mobileRest.getMsg());
}
} }
} }
......
...@@ -227,7 +227,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -227,7 +227,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.add(erro));
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -238,7 +238,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -238,7 +238,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
......
...@@ -222,7 +222,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -222,7 +222,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.add(erro));
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -236,7 +236,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -236,7 +236,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
......
...@@ -222,7 +222,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -222,7 +222,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.add(erro));
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -236,7 +236,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -236,7 +236,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
......
...@@ -221,7 +221,7 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -221,7 +221,7 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.add(erro));
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -235,7 +235,7 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -235,7 +235,7 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
......
...@@ -226,7 +226,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -226,7 +226,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.add(erro));
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -240,7 +240,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -240,7 +240,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
......
...@@ -226,7 +226,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -226,7 +226,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
erro = erro.add(staffPerformSummaryEntity.getComplainScore()); erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.add(erro));
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
...@@ -240,7 +240,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -240,7 +240,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
staffPerformSummaryEntity.setCreateUserId(1l); staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date()); staffPerformSummaryEntity.setCreateTime(new Date());
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
......
...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.dingding.personal.service; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.dingding.personal.service;
import com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponseBody; import com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponseBody;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.dingding.IDingTalkService; import com.mortals.xhx.module.dingding.IDingTalkService;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq; import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
...@@ -27,6 +28,14 @@ public interface IDingPersonService extends IDingTalkService { ...@@ -27,6 +28,14 @@ public interface IDingPersonService extends IDingTalkService {
*/ */
Rest<String> getPersonByMobile(String mobile); Rest<String> getPersonByMobile(String mobile);
/**
* 根据id获取用户电话
*
* @param id
* @return
*/
Rest<String> getPersonById(String id);
/** /**
* 根据code获取钉钉用户id * 根据code获取钉钉用户id
* *
......
...@@ -6,9 +6,11 @@ import com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponseBody; ...@@ -6,9 +6,11 @@ import com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponseBody;
import com.aliyun.tea.TeaException; import com.aliyun.tea.TeaException;
import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request; import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
import com.dingtalk.api.request.OapiV2UserGetRequest;
import com.dingtalk.api.request.OapiV2UserGetbymobileRequest; import com.dingtalk.api.request.OapiV2UserGetbymobileRequest;
import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest; import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest;
import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserGetbymobileResponse; import com.dingtalk.api.response.OapiV2UserGetbymobileResponse;
import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse; import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
...@@ -50,6 +52,26 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -50,6 +52,26 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
} }
} }
@Override
public Rest<String> getPersonById(String id) {
try {
DingTalkClient client = getDingTalkClient("/topapi/v2/user/get");
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
req.setUserid(id); //用户id
log.info("getPersonByID:{}",id);
OapiV2UserGetResponse rsp = client.execute(req, getToken());
log.info("钉钉返回用户信息:{}", rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok("成功", rsp.getResult().getMobile());
} 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 @Override
public Rest<String> getPersonByCode(String code) { public Rest<String> getPersonByCode(String code) {
try { try {
...@@ -120,11 +142,9 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -120,11 +142,9 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
*/ */
public com.aliyun.dingtalkworkflow_1_0.Client createClient() throws Exception { public com.aliyun.dingtalkworkflow_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config(); com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
//config.protocol = "https"; config.protocol = "http";
config.protocol = "https";
config.regionId = "central"; config.regionId = "central";
//config.endpoint = domain.replace("http://", ""); config.endpoint = oaUrl;
//config.endpoint = oaUrl;
return new com.aliyun.dingtalkworkflow_1_0.Client(config); return new com.aliyun.dingtalkworkflow_1_0.Client(config);
} }
...@@ -136,9 +156,7 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -136,9 +156,7 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
getProcessInstanceHeaders.xAcsDingtalkAccessToken = getToken(); getProcessInstanceHeaders.xAcsDingtalkAccessToken = getToken();
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
getProcessInstanceHeaders.setCommonHeaders(map); getProcessInstanceHeaders.setCommonHeaders(map);
getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113"); getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113:8919");
getProcessInstanceHeaders.getCommonHeaders().put("port", "8919");
getProcessInstanceHeaders.getCommonHeaders().put("protocol", "http");
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest() com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest()
.setProcessInstanceId(processInstanceId); .setProcessInstanceId(processInstanceId);
......
...@@ -124,11 +124,11 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -124,11 +124,11 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
sendCheckDingTalk(appealEntity); sendCheckDingTalk(appealEntity);
log.info(appealMsg); log.info(appealMsg);
if (appeal.getAppealResult() == AppealResultEnum.通过.getValue()) { if (appealEntity.getAppealResult() == AppealResultEnum.通过.getValue()) {
if (appeal.getSubAddType() == SubAddTypeEnum.扣除.getValue()) { if (appealEntity.getSubAddType() == SubAddTypeEnum.扣除.getValue()) {
//需增一条记录后 冲销相关核查的记录 //需增一条记录后 冲销相关核查的记录
if (PerformTypeEnum.考勤绩效.getValue().equals(appeal.getPerformType())) { if (PerformTypeEnum.考勤绩效.getValue().equals(appealEntity.getPerformType())) {
CheckAttendRecordEntity checkEntity = checkAttendRecordService.get(appeal.getCheckRecordId(), context); CheckAttendRecordEntity checkEntity = checkAttendRecordService.get(appealEntity.getCheckRecordId(), context);
CheckAttendRecordEntity checkAttendRecordEntity = new CheckAttendRecordEntity(); CheckAttendRecordEntity checkAttendRecordEntity = new CheckAttendRecordEntity();
checkAttendRecordEntity.initAttrValue(); checkAttendRecordEntity.initAttrValue();
...@@ -137,8 +137,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -137,8 +137,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
checkAttendRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue()); checkAttendRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue());
checkAttendRecordEntity.setRemark(appealMsg); checkAttendRecordEntity.setRemark(appealMsg);
checkAttendRecordService.save(checkAttendRecordEntity, context); checkAttendRecordService.save(checkAttendRecordEntity, context);
} else if (PerformTypeEnum.评价差评绩效.getValue().equals(appeal.getPerformType())) { } else if (PerformTypeEnum.评价差评绩效.getValue().equals(appealEntity.getPerformType())) {
CheckReviewRecordEntity checkEntity = checkReviewRecordService.get(appeal.getCheckRecordId(), context); CheckReviewRecordEntity checkEntity = checkReviewRecordService.get(appealEntity.getCheckRecordId(), context);
CheckReviewRecordEntity checkRecordEntity = new CheckReviewRecordEntity(); CheckReviewRecordEntity checkRecordEntity = new CheckReviewRecordEntity();
checkRecordEntity.initAttrValue(); checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"}); BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
...@@ -148,8 +148,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -148,8 +148,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
checkRecordEntity.setCreateTime(new Date()); checkRecordEntity.setCreateTime(new Date());
checkRecordEntity.setCreateUserId(this.getContextUserId(context)); checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkReviewRecordService.save(checkRecordEntity, context); checkReviewRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.评价投诉绩效.getValue().equals(appeal.getPerformType())) { } else if (PerformTypeEnum.评价投诉绩效.getValue().equals(appealEntity.getPerformType())) {
CheckComplainRecordEntity checkEntity = checkComplainRecordService.get(appeal.getCheckRecordId(), context); CheckComplainRecordEntity checkEntity = checkComplainRecordService.get(appealEntity.getCheckRecordId(), context);
CheckComplainRecordEntity checkRecordEntity = new CheckComplainRecordEntity(); CheckComplainRecordEntity checkRecordEntity = new CheckComplainRecordEntity();
checkRecordEntity.initAttrValue(); checkRecordEntity.initAttrValue();
...@@ -161,8 +161,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -161,8 +161,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
checkRecordEntity.setCreateUserId(this.getContextUserId(context)); checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkComplainRecordService.save(checkRecordEntity, context); checkComplainRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.办件绩效.getValue().equals(appeal.getPerformType())) { } else if (PerformTypeEnum.办件绩效.getValue().equals(appealEntity.getPerformType())) {
CheckGoworkRecordEntity checkEntity = checkGoworkRecordService.get(appeal.getCheckRecordId(), context); CheckGoworkRecordEntity checkEntity = checkGoworkRecordService.get(appealEntity.getCheckRecordId(), context);
CheckGoworkRecordEntity checkRecordEntity = new CheckGoworkRecordEntity(); CheckGoworkRecordEntity checkRecordEntity = new CheckGoworkRecordEntity();
checkRecordEntity.initAttrValue(); checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"}); BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
...@@ -173,8 +173,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -173,8 +173,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
checkRecordEntity.setCreateUserId(this.getContextUserId(context)); checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkGoworkRecordService.save(checkRecordEntity, context); checkGoworkRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.效能绩效.getValue().equals(appeal.getPerformType())) { } else if (PerformTypeEnum.效能绩效.getValue().equals(appealEntity.getPerformType())) {
CheckEffectRecordEntity checkEntity = checkEffectRecordService.get(appeal.getCheckRecordId(), context); CheckEffectRecordEntity checkEntity = checkEffectRecordService.get(appealEntity.getCheckRecordId(), context);
CheckEffectRecordEntity checkRecordEntity = new CheckEffectRecordEntity(); CheckEffectRecordEntity checkRecordEntity = new CheckEffectRecordEntity();
checkRecordEntity.initAttrValue(); checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"}); BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
...@@ -185,8 +185,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -185,8 +185,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
checkRecordEntity.setCreateUserId(this.getContextUserId(context)); checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkEffectRecordService.save(checkRecordEntity, context); checkEffectRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.其它绩效.getValue().equals(appeal.getPerformType())) { } else if (PerformTypeEnum.其它绩效.getValue().equals(appealEntity.getPerformType())) {
CheckOtherRecordEntity checkEntity = checkOtherRecordService.get(appeal.getCheckRecordId(), context); CheckOtherRecordEntity checkEntity = checkOtherRecordService.get(appealEntity.getCheckRecordId(), context);
CheckOtherRecordEntity checkRecordEntity = new CheckOtherRecordEntity(); CheckOtherRecordEntity checkRecordEntity = new CheckOtherRecordEntity();
checkRecordEntity.initAttrValue(); checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"}); BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
......
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