Commit 75b6fd77 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 1d405114 d50c9bd0
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
</el-form-item> </el-form-item>
<div style="text-align: center;"> <div style="text-align: center;">
<el-button size="small" @click="$router.back()">取消</el-button> <el-button size="small" @click="$router.back()">取消</el-button>
<el-button type="primary" size="small" @click="createForm('titleForm')">立即创建</el-button> <el-button type="primary" size="small" @click="createForm('titleForm')">立即{{ !editStyle ? '创建' :
'修改' }}</el-button>
</div> </div>
</el-form> </el-form>
</div> </div>
...@@ -25,6 +26,9 @@ ...@@ -25,6 +26,9 @@
<ElButton style="margin-left: 10px;" icon="el-icon-upload" type="primary" size="small" <ElButton style="margin-left: 10px;" icon="el-icon-upload" type="primary" size="small"
@click="issueBtn" round>问卷发布 @click="issueBtn" round>问卷发布
</ElButton> </ElButton>
<!-- <ElButton style="margin-left: 10px;" icon="el-icon-upload" type="primary" size="small"
@click="issueBtn" round>外部链接
</ElButton> -->
<ElButton icon="el-icon-view" type="success" size="small" @click="showDrawer" round>手机模拟预览 <ElButton icon="el-icon-view" type="success" size="small" @click="showDrawer" round>手机模拟预览
</ElButton> </ElButton>
</template> </template>
...@@ -180,23 +184,27 @@ export default { ...@@ -180,23 +184,27 @@ export default {
checkedUser: [], checkedUser: [],
checkAll: false, checkAll: false,
checkAllArr: [], checkAllArr: [],
editStyle: false,
} }
}, },
mounted() { mounted() {
this.getDeptData() this.getDeptData()
// let query = this.$route let query = this.$route
// if (query.query.id) { console.log(query)
// this.feedbackId = query.query.id if (query.query.id) {
// let editFeedback = JSON.parse(localStorage.getItem("editFeedback")) this.editStyle = true
// console.log(editFeedback) this.feedbackId = query.query.id
// this.titleForm.title = editFeedback.title let editFeedback = JSON.parse(localStorage.getItem("editFeedback"))
// this.titleForm.remark = editFeedback.remark console.log(editFeedback)
// this.Frule = formCreate.parseJson(editFeedback.formContent) this.titleForm.title = editFeedback.title
// this.Fopthion = formCreate.parseJson(editFeedback.ruleContent) this.titleForm.remark = editFeedback.remark
// console.log(this.Frule, '***********', this.Fopthion) this.Frule = formCreate.parseJson(editFeedback.formContent)
// this.$refs.designer.setRule(this.Frule) this.Fopthion = formCreate.parseJson(editFeedback.ruleContent)
// this.$refs.designer.setOption(this.Fopthion) console.log(this.Frule, '***********', this.Fopthion)
// } this.$refs.designer.setRule(this.Frule)
this.$refs.designer.setOption(this.Fopthion)
}
}, },
methods: { methods: {
subUser() { subUser() {
...@@ -207,6 +215,7 @@ export default { ...@@ -207,6 +215,7 @@ export default {
this.$message.warning('请选择人员') this.$message.warning('请选择人员')
} }
}, },
//人员全选
handleCheckAllChange(val) { handleCheckAllChange(val) {
console.log(val, this.userOptions) console.log(val, this.userOptions)
if (val) { if (val) {
...@@ -331,7 +340,7 @@ export default { ...@@ -331,7 +340,7 @@ export default {
this.$post('/feedback/save', sub).then(res => { this.$post('/feedback/save', sub).then(res => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
this.$message.success('新增表单成功'); this.$message.success(res.msg);
} }
setTimeout(() => { setTimeout(() => {
this.$router.back() this.$router.back()
...@@ -374,6 +383,7 @@ export default { ...@@ -374,6 +383,7 @@ export default {
this.$refs.designer.removeMenuItem("fc-editor") this.$refs.designer.removeMenuItem("fc-editor")
this.$refs.designer.removeMenuItem("el-button") this.$refs.designer.removeMenuItem("el-button")
this.$refs.designer.removeMenuItem("el-divider") this.$refs.designer.removeMenuItem("el-divider")
if (!this.editStyle) {
// 配置组件生成规则---直接配置显示在页面上 // 配置组件生成规则---直接配置显示在页面上
const rule = [{ const rule = [{
"type": "span", "type": "span",
...@@ -386,6 +396,8 @@ export default { ...@@ -386,6 +396,8 @@ export default {
}] }]
this.$refs.designer.setRule(rule) this.$refs.designer.setRule(rule)
} }
}
} }
} }
</script> </script>
......
...@@ -92,11 +92,11 @@ export default { ...@@ -92,11 +92,11 @@ export default {
{ {
label: "状态", prop: "processStatus", formatter: (row) => { label: "状态", prop: "processStatus", formatter: (row) => {
let str="未开始" let str = "未开始"
if(row.processStatus==1){ if (row.processStatus == 1) {
str="进行中" str = "进行中"
}else if (row.processStatus==2){ } else if (row.processStatus == 2) {
str="已结束" str = "已结束"
} }
return ( return (
<el-tag type={row.processStatus ? row.processStatus == 2 ? 'success' : 'info' : 'danger'} size="small"> <el-tag type={row.processStatus ? row.processStatus == 2 ? 'success' : 'info' : 'danger'} size="small">
...@@ -124,10 +124,17 @@ export default { ...@@ -124,10 +124,17 @@ export default {
label: "操作", label: "操作",
width: 240, width: 240,
formatter: row => { formatter: row => {
if (row.processStatus == 0) {
return (
<table-buttons noAdd noView row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
} else {
return ( return (
<table-buttons noAdd noEdit row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> <table-buttons noAdd noEdit row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
); );
} }
}
} }
] ]
} }
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
data: this.chartsData.map(i => { data: this.chartsData.map(i => {
console.log(i) // console.log(i)
if(this.title == "申诉次数部门排名TOP20") return i.deptName if(this.title == "申诉次数部门排名TOP20") return i.deptName
if(this.title == "申诉次数个人排名TOP20") return i.staffName if(this.title == "申诉次数个人排名TOP20") return i.staffName
if(this.title == "申诉次数规则排名TOP20") return i.ruleName if(this.title == "申诉次数规则排名TOP20") return i.ruleName
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-form-item label="姓名:"> <el-form-item label="姓名:">
<p v-if="form.view == '查看'">{{ form.staffName }}</p> <p v-if="form.view == '查看'">{{ form.staffName }}</p>
<el-select <el-select
v-model="form.staffName" v-model="form.staffId"
filterable filterable
@change="staffChange" @change="staffChange"
style="width: 100%;" style="width: 100%;"
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item :label="form.subAddType==1?'加分分值':'扣分分值'"> <el-form-item :label="form.subAddType == 1 ? '加分分值' : '扣分分值'">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-form-item label="姓名:"> <el-form-item label="姓名:">
<p v-if="form.view == '查看'">{{ form.staffName }}</p> <p v-if="form.view == '查看'">{{ form.staffName }}</p>
<el-select <el-select
v-model="form.staffName" v-model="form.staffId"
filterable filterable
@change="staffChange" @change="staffChange"
style="width: 100%;" style="width: 100%;"
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item :label="form.subAddType==1?'加分分值':'扣分分值'"> <el-form-item :label="form.subAddType == 1 ? '加分分值' : '扣分分值'">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-form-item label="姓名:"> <el-form-item label="姓名:">
<p v-if="form.view == '查看'">{{ form.staffName }}</p> <p v-if="form.view == '查看'">{{ form.staffName }}</p>
<el-select <el-select
v-model="form.staffName" v-model="form.staffId"
filterable filterable
@change="staffChange" @change="staffChange"
style="width: 100%;" style="width: 100%;"
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item :label="form.subAddType==1?'加分分值':'扣分分值'"> <el-form-item :label="form.subAddType == 1 ? '加分分值' : '扣分分值'">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-form-item label="姓名:"> <el-form-item label="姓名:">
<p v-if="form.view == '查看'">{{ form.staffName }}</p> <p v-if="form.view == '查看'">{{ form.staffName }}</p>
<el-select <el-select
v-model="form.staffName" v-model="form.staffId"
filterable filterable
@change="staffChange" @change="staffChange"
style="width: 100%;" style="width: 100%;"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-form-item label="姓名:"> <el-form-item label="姓名:">
<p v-if="form.view == '查看'">{{ form.staffName }}</p> <p v-if="form.view == '查看'">{{ form.staffName }}</p>
<el-select <el-select
v-model="form.staffName" v-model="form.staffId"
filterable filterable
@change="staffChange" @change="staffChange"
style="width: 100%;" style="width: 100%;"
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item :label="form.subAddType==1?'加分分值':'扣分分值'"> <el-form-item :label="form.subAddType == 1 ? '加分分值' : '扣分分值'">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -26,6 +26,14 @@ export default { ...@@ -26,6 +26,14 @@ export default {
parameter: { parameter: {
type: Object, type: Object,
default: () => { } default: () => { }
},
markLine: {
type: Number,
default: () => 0
},
option: {
type: Object,
default: () => { }
} }
}, },
data() { data() {
...@@ -35,7 +43,7 @@ export default { ...@@ -35,7 +43,7 @@ export default {
}, },
watch: { watch: {
title(val) { title(val) {
this.myChart && this.myChart.setOption({title:{text:val}}) this.myChart && this.myChart.setOption({ title: { text: val } })
}, },
parameter: { parameter: {
handler: function (v) { handler: function (v) {
...@@ -58,22 +66,48 @@ export default { ...@@ -58,22 +66,48 @@ export default {
}, },
series: [ series: [
{ {
data: obj.y, name: this.legendName,
data: obj.y
}, },
] ]
}) })
if (this.markLine) {
this.myChart.setOption({
series: [
{
markLine: {
data: [{
name: '目标线',
yAxis: this.markLine,
label: {
formatter: '{b}:'+this.legendName+'不高于20.0%,',
position: 'insideStartTop'
},
lineStyle: {
color: "red",
}
}],
label: {
color: "red",
distance: [20, 8]
}
}
},
]
})
}
return return
} }
// 基于dom,初始化echarts实例 // 基于dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById(this.id)); let myChart = this.$echarts.init(document.getElementById(this.id));
this.myChart = myChart this.myChart = myChart
// 绘制图表 // 绘制图表
myChart.setOption({ const option = {
title: { title: {
text: this.title, text: this.title,
left: this.legendName == "旷工率" ? "center" : "left", left: "left",
textStyle: { textStyle: {
fontSize: this.legendName == "旷工率" ? 24 : 18, fontSize: 18,
}, },
}, },
color: '#6e98ed', color: '#6e98ed',
...@@ -89,6 +123,20 @@ export default { ...@@ -89,6 +123,20 @@ export default {
color: "#000", color: "#000",
}, },
}, },
dataZoom: [
{
show: true,
realtime: true,
start: 0,
end: 100
},
{
type: 'inside',
realtime: true,
start: 0,
end: 100
}
],
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
data: [], data: [],
...@@ -96,7 +144,7 @@ export default { ...@@ -96,7 +144,7 @@ export default {
grid: { grid: {
left: "5%", left: "5%",
right: "4%", right: "4%",
bottom: "2%", bottom: 40,
containLabel: true, containLabel: true,
}, },
// color:[ "#61a0a8",], // color:[ "#61a0a8",],
...@@ -107,14 +155,39 @@ export default { ...@@ -107,14 +155,39 @@ export default {
type: "bar", type: "bar",
data: [], data: [],
itemStyle: { itemStyle: {
lineStyle: { lineStyle: {
type: "dotted", //'dotted'虚线 'solid'实线 type: "dotted", //'dotted'虚线 'solid'实线
}, },
}, },
}, },
], ],
}); }
myChart.setOption(Object.assign({}, option, this.option));
if (this.markLine) {
myChart.setOption({
series: [
{
markLine: {
data: [{
name: '目标线',
yAxis: this.markLine,
label: {
formatter: '{b}:旷工率不高于20.0%,',
position: 'insideStartTop'
},
lineStyle: {
color: "red",
}
}],
label: {
color: "red",
distance: [20, 8]
}
}
},
]
})
}
}, },
}, },
}; };
......
...@@ -21,11 +21,11 @@ export default { ...@@ -21,11 +21,11 @@ export default {
}, },
styleObj: { styleObj: {
type: Object, type: Object,
default: () => {}, default: () => { },
}, },
parameter: { parameter: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
data() { data() {
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
}, },
watch: { watch: {
title(val) { title(val) {
this.myChart && this.myChart.setOption({title:{text:val}}) this.myChart && this.myChart.setOption({ title: { text: val } })
}, },
parameter: { parameter: {
handler: function (v) { handler: function (v) {
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
}, },
}, },
tooltip: {}, tooltip: {},
color:'#6e98ed', color: '#6e98ed',
xAxis: { xAxis: {
type: "category", type: "category",
data: [], data: [],
...@@ -91,9 +91,23 @@ export default { ...@@ -91,9 +91,23 @@ export default {
grid: { grid: {
left: "3%", left: "3%",
right: "4%", right: "4%",
bottom: "2%", bottom: 40,
containLabel: true, containLabel: true,
}, },
dataZoom: [
{
show: true,
realtime: true,
start: 0,
end: 100
},
{
type: 'inside',
realtime: true,
start: 0,
end: 100
}
],
yAxis: {}, yAxis: {},
series: [ series: [
{ {
......
...@@ -125,7 +125,9 @@ ...@@ -125,7 +125,9 @@
<bar-charts <bar-charts
:title="`${type1 == 1 ? '各部门' : '个人'}${StatQuery.month}月${alignmentName}对齐情况`" :title="`${type1 == 1 ? '各部门' : '个人'}${StatQuery.month}月${alignmentName}对齐情况`"
:id="'bar_content'" :id="'bar_content'"
:legendName="'旷工率'" :legendName="alignmentName"
:option="{title:{left:'center',textStyle:{fontSize:24}}}"
:markLine="0.2"
:parameter="depStatObj.alignment" :parameter="depStatObj.alignment"
:styleObj="{ width: '1800px', height: '650px' }" :styleObj="{ width: '1800px', height: '650px' }"
/> />
......
package com.mortals.xhx.module.attendance.dingmsg;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author ZYW
* @date 2023-07-18 15:05
*/
@NoArgsConstructor
@Data
public class EventEntity {
@JsonProperty("processInstanceId")
private String processInstanceId; //审批实例id。
@JsonProperty("finishTime")
private Long finishTime; //结束审批实例时间。时间戳,单位毫秒。
@JsonProperty("corpId")
private String corpId; //审批实例对应的企业corpId。
@JsonProperty("EventType")
private String eventType; //事件类型。
@JsonProperty("businessId")
private String businessId;
@JsonProperty("title")
private String title; //实例标题。
@JsonProperty("type")
private String type; //finish:审批正常结束(同意或拒绝)terminate:审批终止(发起人撤销审批单)
@JsonProperty("url")
private String url; //审批实例url,可在钉钉内跳转到审批页面。
@JsonProperty("result")
private String result; //正常结束时result为agree,拒绝时result为refuse,审批终止时没这个值。
@JsonProperty("createTime")
private Long createTime; //创建审批实例时间。时间戳,单位毫秒。
@JsonProperty("processCode")
private String processCode; //审批模板的唯一码。
@JsonProperty("bizCategoryId")
private String bizCategoryId;
@JsonProperty("staffId")
private String staffId; //发起审批实例的员工userId。
@JsonProperty("remark")
private String remark; //remark表示操作时写的评论内容。
}
...@@ -7,13 +7,16 @@ import com.dingtalk.api.DingTalkClient; ...@@ -7,13 +7,16 @@ import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiGettokenRequest; import com.dingtalk.api.request.OapiGettokenRequest;
import com.dingtalk.api.response.OapiGettokenResponse; import com.dingtalk.api.response.OapiGettokenResponse;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.xhx.common.pdu.ApiRespPdu; import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.module.attendance.dingmsg.DingCallbackCrypto; import com.mortals.xhx.module.attendance.dingmsg.DingCallbackCrypto;
import com.mortals.xhx.module.attendance.dingmsg.dingmsgreq.DingResponsMeassageReq; import com.mortals.xhx.module.attendance.dingmsg.dingmsgreq.DingResponsMeassageReq;
import com.mortals.xhx.module.attendance.dingmsg.dingmsgreq.EncryptReq; import com.mortals.xhx.module.attendance.dingmsg.dingmsgreq.EncryptReq;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -33,6 +36,9 @@ import java.util.Map; ...@@ -33,6 +36,9 @@ import java.util.Map;
@Slf4j @Slf4j
public class DingMessageController { public class DingMessageController {
@Autowired
private IDingPersonService dingPersonService;
/** /**
* appKey * appKey
*/ */
...@@ -61,23 +67,18 @@ public class DingMessageController { ...@@ -61,23 +67,18 @@ public class DingMessageController {
@RequestParam(value = "timestamp", required = false) String timeStamp, @RequestParam(value = "timestamp", required = false) String timeStamp,
@RequestParam(value = "nonce", required = false) String nonce, @RequestParam(value = "nonce", required = false) String nonce,
@RequestBody(required = false) JSONObject json) { @RequestBody(required = false) JSONObject json) {
log.info("钉钉推送参数" + msg_signature+"---"+timeStamp+"---"+nonce+"---"+json.toJSONString() );
try { try {
// 1. 从http请求中获取加解密参数 // 从http请求中获取加解密参数
// 2. 使用加解密类型
// Constant.OWNER_KEY 说明:
// 1、开发者后台配置的订阅事件为应用级事件推送,此时OWNER_KEY为应用的APP_KEY。
// 2、调用订阅事件接口订阅的事件为企业级事件推送,
// 此时OWNER_KEY为:企业的appkey(企业内部应用)或SUITE_KEY(三方应用)
DingCallbackCrypto callbackCrypto = new DingCallbackCrypto(token, aesKey, appKey); DingCallbackCrypto callbackCrypto = new DingCallbackCrypto(token, aesKey, appKey);
String encryptMsg = json.getString("encrypt"); String encryptMsg = json.getString("encrypt");
String decryptMsg = callbackCrypto.getDecryptMsg(msg_signature, timeStamp, nonce, encryptMsg); String decryptMsg = callbackCrypto.getDecryptMsg(msg_signature, timeStamp, nonce, encryptMsg);
// 3. 反序列化回调事件json数据 // 反序列化回调事件json数据
JSONObject eventJson = JSON.parseObject(decryptMsg); JSONObject eventJson = JSON.parseObject(decryptMsg);
String eventType = eventJson.getString("EventType"); String eventType = eventJson.getString("EventType");
// 4. 根据EventType分类处理 // 根据EventType分类处理
if ("check_url".equals(eventType)) { if ("check_url".equals(eventType)) {
// 测试回调url的正确性 // 测试回调url的正确性
log.info("测试回调url的正确性"); log.info("测试回调url的正确性");
...@@ -85,8 +86,12 @@ public class DingMessageController { ...@@ -85,8 +86,12 @@ public class DingMessageController {
else if("bpms_instance_change".equals(eventType)){ //请假等需要审批的消息 else if("bpms_instance_change".equals(eventType)){ //请假等需要审批的消息
// 处理审批实例始末(审批任务开始、结束) // 处理审批实例始末(审批任务开始、结束)
// 存入数据库 // 存入数据库
log.info("发生了:" + eventType + "事件" ); // log.info("发生了:" + eventType + "事件" );
log.info("返回处理参数:" + eventJson.toJSONString() ); // log.info("返回处理参数:" + eventJson.toJSONString() );
if(eventJson.getString("processInstanceId") != null){
Rest<String> rest = dingPersonService.getOaRecordsById(eventJson.getString("processInstanceId"));
log.info("审批详情:" + rest.getData());
}
} }
else { else {
// 添加其他已注册的 // 添加其他已注册的
......
...@@ -41,5 +41,12 @@ public interface IDingPersonService extends IDingTalkService { ...@@ -41,5 +41,12 @@ public interface IDingPersonService extends IDingTalkService {
*/ */
Rest<String> sendWorkMsg(WorkMsgReq workMsgReq); Rest<String> sendWorkMsg(WorkMsgReq workMsgReq);
/**
* 审批详情
* @param processInstanceId 审批实例ID。
* @return
*/
Rest<String> getOaRecordsById(String processInstanceId);
} }
package com.mortals.xhx.module.dingding.personal.service.impl; package com.mortals.xhx.module.dingding.personal.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponse;
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.OapiV2UserGetbymobileRequest; import com.dingtalk.api.request.OapiV2UserGetbymobileRequest;
...@@ -14,6 +16,7 @@ import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq; ...@@ -14,6 +16,7 @@ import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.taobao.api.ApiException; import com.taobao.api.ApiException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -98,5 +101,34 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -98,5 +101,34 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
} }
} }
/**
* 使用 Token 初始化账号Client
* @return Client
* @throws Exception
*/
public static com.aliyun.dingtalkworkflow_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
return new com.aliyun.dingtalkworkflow_1_0.Client(config);
}
@Override
public Rest<String> getOaRecordsById(String processInstanceId) {
try {
com.aliyun.dingtalkworkflow_1_0.Client client = createClient();
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders getProcessInstanceHeaders = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders();
getProcessInstanceHeaders.xAcsDingtalkAccessToken = getToken();
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest()
.setProcessInstanceId(processInstanceId);
GetProcessInstanceResponse rsp = client.getProcessInstanceWithOptions(getProcessInstanceRequest, getProcessInstanceHeaders, new com.aliyun.teautil.models.RuntimeOptions());
log.info("根据id查询审批详情:", rsp.getBody().getResult().toString());
return Rest.ok("成功", rsp.getBody().getResult().toString());
} catch (Exception e) {
log.info("根据用户查询审批详情失败", e);
return Rest.fail(e.getMessage());
}
}
} }
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