Commit c118e33d authored by “yiyousong”'s avatar “yiyousong”
parents d8a78bc6 7a7e9e0a
...@@ -194,10 +194,24 @@ export default { ...@@ -194,10 +194,24 @@ export default {
// 格式化单元格数据 // 格式化单元格数据
formatter(row, column, val) { formatter(row, column, val) {
const content = formatter(this.tableData, column, val); const content = formatter(this.tableData, column, val);
return content ? ( return content == 0 ? (
<el-tag type={"info"} size="mini"> <p>{content}</p>
{content} ) : content ? (
</el-tag> content == "未处理" ? (
<el-tag type={"danger"} size="mini">
{content}
</el-tag>
) : content == "已处理" ? (
<el-tag type={"success"} size="mini">
{content}
</el-tag>
) : row.subAddType == 1 && column.label.includes("分值") ? (
<p>{content}</p>
) : row.subAddType == 2 && column.label.includes("分值") ? (
<p>{-content}</p>
) : (
<p>{content}</p>
)
) : ( ) : (
val val
); );
......
...@@ -46,7 +46,7 @@ const formatterAmount = (row, column) => { ...@@ -46,7 +46,7 @@ const formatterAmount = (row, column) => {
const formatterDate = (row, column) => { const formatterDate = (row, column) => {
const property = column.property; const property = column.property;
const time = row[property]; const time = row[property];
if(!time) return '-'; if(!time) return '--';
let date = time.length<13?new Date(Number(time) * 1000) : new Date(Number(time)); let date = time.length<13?new Date(Number(time) * 1000) : new Date(Number(time));
let Y = date.getFullYear() + '-'; let Y = date.getFullYear() + '-';
let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
:empty-text="emptytxt ? emptytxt : emptyText" :empty-text="emptytxt ? emptytxt : emptyText"
border border
style="width: 100%" style="width: 100%"
height="520" height="570"
> >
<el-table-column <el-table-column
v-for="column in columns" v-for="column in columns"
...@@ -112,13 +112,21 @@ export default { ...@@ -112,13 +112,21 @@ export default {
return !this.loading && !this.tableData.length ? "暂无数据" : "加载中..."; return !this.loading && !this.tableData.length ? "暂无数据" : "加载中...";
}, },
}, },
mounted() { mounted() {},
},
watch: { watch: {
tableData(val) { tableData(val) {
val.length == 0 || val.length > 0 val.length == 0 || val.length > 0
? (this.emptytxt = "暂无数据") ? (this.emptytxt = "暂无数据")
: (this.emptytxt = "加载中..."); : (this.emptytxt = "加载中...");
// if (val.length > 0) {
// val.forEach((v) => {
// for (let key in v) {
// v[key] ? "" : (v[key] = "--");
// }
// });
// console.log(val);
// }
}, },
}, },
methods: {}, methods: {},
......
...@@ -49,18 +49,23 @@ ...@@ -49,18 +49,23 @@
> >
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12" <el-col :span="12">
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col {{ form.subAddType == 1 ? "加分方式:" : "扣分方式:" }}
{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
> >
<el-col :span="12" <el-col :span="12">
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col {{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
> >
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12" <el-col :span="12">
>扣分人员:{{ {{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
form.deductPerson ? form.deductPerson : "--" {{ form.deductPerson ? form.deductPerson : "--" }}</el-col
}}</el-col
> >
<el-col :span="12" <el-col :span="12"
>图片凭证:{{ >图片凭证:{{
...@@ -135,11 +140,16 @@ ...@@ -135,11 +140,16 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="加分/扣除分值:"> <el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<p v-if="form.view == '查看'"> <p v-if="form.view == '查看'">
{{form.subAddType==1?'+':'-'}} {{ form.score ? form.score : "--" }} {{ form.subAddType == 1 ? "+" : "-"
}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>
{{ form.subAddType == 1 ? "+" : "-" }}{{ form.score }}
</p> </p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-row> </el-row>
</div> </div>
...@@ -368,7 +378,8 @@ export default { ...@@ -368,7 +378,8 @@ export default {
kaoqinCateArr: [], kaoqinCateArr: [],
kaoqinArr: [], kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/", baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/attend/record/examine'}//重写核查地址 subMethodObj: {},
urls: { saveUrl: "/check/attend/record/examine" }, //重写核查地址
}; };
}, },
computed: {}, computed: {},
...@@ -384,7 +395,9 @@ export default { ...@@ -384,7 +395,9 @@ export default {
return ( return (
<el-image <el-image
src={val.indexOf("http") == -1 ? this.baseUrl + val : val} src={val.indexOf("http") == -1 ? this.baseUrl + val : val}
preview-src-list={val.indexOf("http") == -1 ? this.baseUrl + val : val} preview-src-list={
val.indexOf("http") == -1 ? this.baseUrl + val : val
}
style="width: 100px" style="width: 100px"
></el-image> ></el-image>
); );
...@@ -409,38 +422,48 @@ export default { ...@@ -409,38 +422,48 @@ export default {
}); });
}, },
/** 编辑 */ /** 编辑 */
edit(row) { async edit(row) {
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/attend/record/edit"; // this.urls.currUrl = "check/attend/record/edit";
// this.getData(); // this.getData();
this.$get("/check/attend/record/info", { id: row.id }).then((res) => { await this.$get("/check/attend/record/info", { id: row.id }).then(
console.log(res.data); (res) => {
if (res.code == 1) { console.log(res.data);
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.form.view = "核查";
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.form.view = "核查";
this.open = true;
});
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
row.view == "核查" row.view == "核查"
? (this.title = "考勤绩效记录核查") ? (this.title = "考勤绩效记录核查")
...@@ -455,36 +478,39 @@ export default { ...@@ -455,36 +478,39 @@ export default {
this.title = "新增考勤绩效记录核查信息"; this.title = "新增考勤绩效记录核查信息";
}, },
/** 查看*/ /** 查看*/
view(row) { async view(row) {
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/attend/record/view"; // this.urls.currUrl = "check/attend/record/view";
// this.getData(); // this.getData();
this.$get("/check/attend/record/info", { id: row.id }).then((res) => { await this.$get("/check/attend/record/info", { id: row.id }).then(
if (res.code == 1) { (res) => {
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
});
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "考勤绩效记录核查信息详细"; this.title = "考勤绩效记录核查信息详细";
}, },
......
...@@ -218,17 +218,33 @@ export default { ...@@ -218,17 +218,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, {
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "核查结果", prop: "checkResult", formatter: this.formatter },
{ label: "说明", prop: "checkDesc" },
{ label: "核查人员", prop: "checkPerson" },
{
label: "核查时间",
prop: "checkTime",
formatter: this.formatterDate,
},
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
......
...@@ -65,18 +65,23 @@ ...@@ -65,18 +65,23 @@
> >
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12" <el-col :span="12">
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col {{ form.subAddType == 1 ? "加分方式:" : "扣分方式:" }}
>
<el-col :span="12" {{
>扣分人员:{{ form.subMethod ? dict.subMethod[form.subMethod] : "--"
form.deductPerson ? form.deductPerson : "--"
}}</el-col }}</el-col
> >
<el-col :span="12">
{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
{{ form.deductPerson ? form.deductPerson : "--" }}</el-col
>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12" <el-col :span="12">
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col {{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
> >
<el-col :span="12" <el-col :span="12"
>图片凭证:{{ >图片凭证:{{
...@@ -151,11 +156,16 @@ ...@@ -151,11 +156,16 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="加分/扣除分值:"> <el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<p v-if="form.view == '查看'"> <p v-if="form.view == '查看'">
{{form.subAddType==1?'+':'-'}} {{ form.score ? form.score : "--" }} {{ form.subAddType == 1 ? "+" : "-"
}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>
{{ form.subAddType == 1 ? "+" : "-" }}{{ form.score }}
</p> </p>
<p v-else>{{form.subAddType==1?'+':'-'}} {{ form.score }}</p>
</el-form-item> </el-form-item>
</el-row> </el-row>
</div> </div>
...@@ -285,7 +295,7 @@ ...@@ -285,7 +295,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -293,13 +303,13 @@ ...@@ -293,13 +303,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -404,7 +414,7 @@ export default { ...@@ -404,7 +414,7 @@ export default {
kaoqinCateArr: [], kaoqinCateArr: [],
kaoqinArr: [], kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/", baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/complain/record/examine'}//重写核查地址 urls: { saveUrl: "/check/complain/record/examine" }, //重写核查地址
}; };
}, },
...@@ -418,7 +428,9 @@ export default { ...@@ -418,7 +428,9 @@ export default {
return ( return (
<el-image <el-image
src={val.indexOf("http") == -1 ? this.baseUrl + val : val} src={val.indexOf("http") == -1 ? this.baseUrl + val : val}
preview-src-list={val.indexOf("http") == -1 ? this.baseUrl + val : val} preview-src-list={
val.indexOf("http") == -1 ? this.baseUrl + val : val
}
style="width: 100px" style="width: 100px"
></el-image> ></el-image>
); );
...@@ -442,38 +454,50 @@ export default { ...@@ -442,38 +454,50 @@ export default {
}); });
}, },
/** 编辑 */ /** 编辑 */
edit(row) { async edit(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/complain/record/edit"; // this.urls.currUrl = "check/complain/record/edit";
// this.getData(); // this.getData();
this.$get("/check/complain/record/info", { id: row.id }).then((res) => { await this.$get("/check/complain/record/info", { id: row.id }).then(
console.log(res.data); (res) => {
if (res.code == 1) { console.log(res.data);
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "complainTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.form.view = "核查";
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.form.view = "核查";
this.open = true;
});
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
row.view == "核查" row.view == "核查"
? (this.title = "评价绩效投诉核查") ? (this.title = "评价绩效投诉核查")
...@@ -488,37 +512,42 @@ export default { ...@@ -488,37 +512,42 @@ export default {
this.title = "新增评价绩效投诉核查信息"; this.title = "新增评价绩效投诉核查信息";
}, },
/** 查看*/ /** 查看*/
view(row) { async view(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/complain/record/view"; // this.urls.currUrl = "check/complain/record/view";
// this.getData(); // this.getData();
this.$get("/check/complain/record/info", { id: row.id }).then((res) => { await this.$get("/check/complain/record/info", { id: row.id }).then(
if (res.code == 1) { (res) => {
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "complainTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
});
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "评价绩效投诉核查信息详细"; this.title = "评价绩效投诉核查信息详细";
}, },
......
...@@ -225,17 +225,33 @@ export default { ...@@ -225,17 +225,33 @@ export default {
{ label: "绩效规则", prop: "ruleNme" }, { label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, {
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "核查结果", prop: "checkResult", formatter: this.formatter },
{ label: "说明", prop: "checkDesc" },
{ label: "核查人员", prop: "checkPerson" },
{
label: "核查时间",
prop: "checkTime",
formatter: this.formatterDate,
},
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
......
...@@ -56,13 +56,13 @@ ...@@ -56,13 +56,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -41,19 +41,22 @@ ...@@ -41,19 +41,22 @@
<el-col :span="12" <el-col :span="12"
>报警时间:{{ form.alarmTime ? form.alarmTime : "--" }}</el-col >报警时间:{{ form.alarmTime ? form.alarmTime : "--" }}</el-col
> >
<el-col :span="12" <el-col :span="12">
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col {{ form.subAddType == 1 ? "加分方式:" : "扣分方式:" }}
{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
> >
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12" <el-col :span="12">
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col {{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
> >
<el-col :span="12"> <el-col :span="12">
扣分人员:{{ {{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
form.deductPerson ? form.deductPerson : "--" {{ form.deductPerson ? form.deductPerson : "--" }}</el-col
}}</el-col
> >
</el-row> </el-row>
<el-row> <el-row>
...@@ -130,11 +133,16 @@ ...@@ -130,11 +133,16 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="加分/扣除分值:"> <el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<p v-if="form.view == '查看'"> <p v-if="form.view == '查看'">
{{form.subAddType==1?'+':'-'}} {{ form.score ? form.score : "--" }} {{ form.subAddType == 1 ? "+" : "-"
}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>
{{ form.subAddType == 1 ? "+" : "-" }}{{ form.score }}
</p> </p>
<p v-else>{{form.subAddType==1?'+':'-'}} {{ form.score }}</p>
</el-form-item> </el-form-item>
</el-row> </el-row>
</div> </div>
...@@ -258,7 +266,7 @@ ...@@ -258,7 +266,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -266,13 +274,13 @@ ...@@ -266,13 +274,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -377,7 +385,7 @@ export default { ...@@ -377,7 +385,7 @@ export default {
kaoqinCateArr: [], kaoqinCateArr: [],
kaoqinArr: [], kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/", baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/effect/record/examine'}//重写核查地址 urls: { saveUrl: "/check/effect/record/examine" }, //重写核查地址
}; };
}, },
...@@ -417,38 +425,52 @@ export default { ...@@ -417,38 +425,52 @@ export default {
}); });
}, },
/** 编辑 */ /** 编辑 */
edit(row) { async edit(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/effect/record/edit"; // this.urls.currUrl = "check/effect/record/edit";
// this.getData(); // this.getData();
this.$get("/check/effect/record/info", { id: row.id }).then((res) => { await this.$get("/check/effect/record/info", { id: row.id }).then(
console.log(res.data); (res) => {
if (res.code == 1) { console.log(res.data);
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "alarmTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "happenTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.form.view = "核查";
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.form.view = "核查";
this.open = true;
});
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
row.view == "核查" row.view == "核查"
? (this.title = "效能绩效核查") ? (this.title = "效能绩效核查")
...@@ -463,37 +485,44 @@ export default { ...@@ -463,37 +485,44 @@ export default {
this.title = "新增效能绩效核查信息"; this.title = "新增效能绩效核查信息";
}, },
/** 查看*/ /** 查看*/
view(row) { async view(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/effect/record/view"; // this.urls.currUrl = "check/effect/record/view";
// this.getData(); // this.getData();
this.$get("/check/effect/record/info", { id: row.id }).then((res) => { await this.$get("/check/effect/record/info", { id: row.id }).then(
if (res.code == 1) { (res) => {
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "alarmTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "happenTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
});
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "效能绩效核查信息详细"; this.title = "效能绩效核查信息详细";
}, },
......
...@@ -225,17 +225,33 @@ export default { ...@@ -225,17 +225,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, {
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "核查结果", prop: "checkResult", formatter: this.formatter },
{ label: "说明", prop: "checkDesc" },
{ label: "核查人员", prop: "checkPerson" },
{
label: "核查时间",
prop: "checkTime",
formatter: this.formatterDate,
},
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
......
...@@ -50,13 +50,13 @@ ...@@ -50,13 +50,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -44,18 +44,21 @@ ...@@ -44,18 +44,21 @@
>办件时间:{{ form.goworkTime ? form.goworkTime : "--" }}</el-col >办件时间:{{ form.goworkTime ? form.goworkTime : "--" }}</el-col
> >
<el-col :span="12" <el-col :span="12"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col >{{ form.subAddType == 1 ? "加分方式:" : "扣分方式:"
}}{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
> >
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12" <el-col :span="12">
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col {{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
> >
<el-col :span="12"> <el-col :span="12">
扣分人员:{{ {{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
form.deductPerson ? form.deductPerson : "--" {{ form.deductPerson ? form.deductPerson : "--" }}</el-col
}}</el-col
> >
</el-row> </el-row>
<el-row> <el-row>
...@@ -132,11 +135,16 @@ ...@@ -132,11 +135,16 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="加分/扣除分值:"> <el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<p v-if="form.view == '查看'"> <p v-if="form.view == '查看'">
{{form.subAddType==1?'+':'-'}}{{ form.score ? form.score : "--" }} {{ form.subAddType == 1 ? "+" : "-"
}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>
{{ form.subAddType == 1 ? "+" : "-" }}{{ form.score }}
</p> </p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-row> </el-row>
</div> </div>
...@@ -253,7 +261,7 @@ ...@@ -253,7 +261,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -261,13 +269,13 @@ ...@@ -261,13 +269,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -372,7 +380,7 @@ export default { ...@@ -372,7 +380,7 @@ export default {
kaoqinCateArr: [], kaoqinCateArr: [],
kaoqinArr: [], kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/", baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/gowork/record/examine'}//重写核查地址 urls: { saveUrl: "/check/gowork/record/examine" }, //重写核查地址
}; };
}, },
...@@ -386,7 +394,9 @@ export default { ...@@ -386,7 +394,9 @@ export default {
return ( return (
<el-image <el-image
src={val.c == -1 ? this.baseUrl + val : val} src={val.c == -1 ? this.baseUrl + val : val}
preview-src-list={val.indexOf("http") == -1 ? this.baseUrl + val : val} preview-src-list={
val.indexOf("http") == -1 ? this.baseUrl + val : val
}
style="width: 100px" style="width: 100px"
></el-image> ></el-image>
); );
...@@ -410,38 +420,50 @@ export default { ...@@ -410,38 +420,50 @@ export default {
}); });
}, },
/** 编辑 */ /** 编辑 */
edit(row) { async edit(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/gowork/record/edit"; // this.urls.currUrl = "check/gowork/record/edit";
// this.getData(); // this.getData();
this.$get("/check/gowork/record/info", { id: row.id }).then((res) => { await this.$get("/check/gowork/record/info", { id: row.id }).then(
console.log(res.data); (res) => {
if (res.code == 1) { console.log(res.data);
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} } else {
for (let key in this.form) { this.form = row;
key == "actualAttendTime" }
? (this.form[key] = timestampToTime(this.form[key], 6)) for (let key in this.form) {
: key == "attendanceDate" key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime" : key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime" : key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime" : key == "goworkTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime" : key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: ""; : key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.form.view = "核查";
this.open = true;
} }
this.form.checkResult = 1; );
this.form.view = "核查";
this.open = true;
});
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
row.view == "核查" row.view == "核查"
? (this.title = "办件绩效核查") ? (this.title = "办件绩效核查")
...@@ -456,37 +478,41 @@ export default { ...@@ -456,37 +478,41 @@ export default {
this.title = "新增办件绩效核查信息"; this.title = "新增办件绩效核查信息";
}, },
/** 查看*/ /** 查看*/
view(row) { async view(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/gowork/record/view"; // this.urls.currUrl = "check/gowork/record/view";
// this.getData(); // this.getData();
this.$get("/check/gowork/record/info", { id: row.id }).then((res) => { await this.$get("/check/gowork/record/info", { id: row.id }).then(
if (res.code == 1) { (res) => {
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} } else {
for (let key in this.form) { this.form = row;
key == "actualAttendTime" }
? (this.form[key] = timestampToTime(this.form[key], 6)) for (let key in this.form) {
: key == "attendanceDate" key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime" : key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime" : key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime" : key == "goworkTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime" : key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: ""; : key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
this.open = true;
} }
this.form.view = "查看"; );
console.log(this.form);
this.open = true;
});
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "办件绩效核查信息详细"; this.title = "办件绩效核查信息详细";
}, },
......
...@@ -213,17 +213,33 @@ export default { ...@@ -213,17 +213,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, {
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "核查结果", prop: "checkResult", formatter: this.formatter },
{ label: "说明", prop: "checkDesc" },
{ label: "核查人员", prop: "checkPerson" },
{
label: "核查时间",
prop: "checkTime",
formatter: this.formatterDate,
},
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
......
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -41,15 +41,20 @@ ...@@ -41,15 +41,20 @@
<el-row> <el-row>
<el-col :span="12" <el-col :span="12"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col >{{ form.subAddType == 1 ? "加分方式:" : "扣分方式:"
}}{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
> >
<el-col :span="12"> <el-col :span="12">
扣分时间:{{ form.deductTime ? form.deductTime : "--" }} {{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
扣分人员:{{ form.deductPerson ? form.deductPerson : "--" }} {{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
{{ form.deductPerson ? form.deductPerson : "--" }}
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -126,11 +131,16 @@ ...@@ -126,11 +131,16 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="加分/扣除分值:"> <el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<p v-if="form.view == '查看'"> <p v-if="form.view == '查看'">
{{form.subAddType==1?'+':'-'}}{{ form.score ? form.score : "--" }} {{ form.subAddType == 1 ? "+" : "-"
}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>
{{ form.subAddType == 1 ? "+" : "-" }}{{ form.score }}
</p> </p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-row> </el-row>
</div> </div>
...@@ -248,7 +258,7 @@ ...@@ -248,7 +258,7 @@
placeholder="请输入评分标准" placeholder="请输入评分标准"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -256,13 +266,13 @@ ...@@ -256,13 +266,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -367,7 +377,7 @@ export default { ...@@ -367,7 +377,7 @@ export default {
kaoqinCateArr: [], kaoqinCateArr: [],
kaoqinArr: [], kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/", baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/other/record/examine'}//重写核查地址 urls: { saveUrl: "/check/other/record/examine" }, //重写核查地址
}; };
}, },
...@@ -407,38 +417,52 @@ export default { ...@@ -407,38 +417,52 @@ export default {
}); });
}, },
/** 编辑 */ /** 编辑 */
edit(row) { async edit(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/other/record/edit"; // this.urls.currUrl = "check/other/record/edit";
// this.getData(); // this.getData();
this.$get("/check/other/record/info", { id: row.id }).then((res) => { await this.$get("/check/other/record/info", { id: row.id }).then(
console.log(res.data); (res) => {
if (res.code == 1) { console.log(res.data);
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "alarmTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "happenTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.form.view = "核查";
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.form.view = "核查";
this.open = true;
});
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
row.view == "核查" row.view == "核查"
? (this.title = "其它绩效核查") ? (this.title = "其它绩效核查")
...@@ -453,37 +477,44 @@ export default { ...@@ -453,37 +477,44 @@ export default {
this.title = "新增其它绩效核查信息"; this.title = "新增其它绩效核查信息";
}, },
/** 查看*/ /** 查看*/
view(row) { async view(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/other/record/view"; // this.urls.currUrl = "check/other/record/view";
// this.getData(); // this.getData();
this.$get("/check/other/record/info", { id: row.id }).then((res) => { await this.$get("/check/other/record/info", { id: row.id }).then(
if (res.code == 1) { (res) => {
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} } else {
for (let key in this.form) { this.form = row;
key == "actualAttendTime" }
? (this.form[key] = timestampToTime(this.form[key], 6)) for (let key in this.form) {
: key == "attendanceDate" key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime" : key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime" : key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime" : key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime" : key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: ""; : key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "alarmTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "happenTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
} }
this.form.view = "查看"; );
console.log(this.form);
this.open = true;
});
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "其它绩效核查信息详细"; this.title = "其它绩效核查信息详细";
}, },
......
...@@ -221,17 +221,33 @@ export default { ...@@ -221,17 +221,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, {
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "核查结果", prop: "checkResult", formatter: this.formatter },
{ label: "说明", prop: "checkDesc" },
{ label: "核查人员", prop: "checkPerson" },
{
label: "核查时间",
prop: "checkTime",
formatter: this.formatterDate,
},
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
......
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
<el-descriptions-item label="评分标准" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="评分标准" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleDesc}} {{form.ruleDesc}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -45,17 +45,20 @@ ...@@ -45,17 +45,20 @@
>评价时间:{{ form.reviewTime ? form.reviewTime : "--" }}</el-col >评价时间:{{ form.reviewTime ? form.reviewTime : "--" }}</el-col
> >
<el-col :span="12" <el-col :span="12"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col >{{ form.subAddType == 1 ? "加分方式:" : "扣分方式:"
}}{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
> >
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12" <el-col :span="12"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col >{{ form.subAddType == 1 ? "加分时间:" : "扣分时间:"
}}{{ form.deductTime ? form.deductTime : "--" }}</el-col
> >
<el-col :span="12" <el-col :span="12"
>扣分人员:{{ >{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:"
form.deductPerson ? form.deductPerson : "--" }}{{ form.deductPerson ? form.deductPerson : "--" }}</el-col
}}</el-col
> >
</el-row> </el-row>
...@@ -133,11 +136,16 @@ ...@@ -133,11 +136,16 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="加分/扣除分值:"> <el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<p v-if="form.view == '查看'"> <p v-if="form.view == '查看'">
{{form.subAddType==1?'+':'-'}}{{ form.score ? form.score : "--" }} {{ form.subAddType == 1 ? "+" : "-"
}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>
{{ form.subAddType == 1 ? "+" : "-" }}{{ form.score }}
</p> </p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-row> </el-row>
</div> </div>
...@@ -256,7 +264,7 @@ ...@@ -256,7 +264,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -264,13 +272,13 @@ ...@@ -264,13 +272,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -374,7 +382,7 @@ export default { ...@@ -374,7 +382,7 @@ export default {
form: {}, form: {},
kaoqinCateArr: [], kaoqinCateArr: [],
kaoqinArr: [], kaoqinArr: [],
urls:{saveUrl:'/check/review/record/examine'}//重写核查地址 urls: { saveUrl: "/check/review/record/examine" }, //重写核查地址
}; };
}, },
...@@ -412,38 +420,50 @@ export default { ...@@ -412,38 +420,50 @@ export default {
}); });
}, },
/** 编辑 */ /** 编辑 */
edit(row) { async edit(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/review/record/edit"; // this.urls.currUrl = "check/review/record/edit";
// this.getData(); // this.getData();
this.$get("/check/review/record/info", { id: row.id }).then((res) => { await this.$get("/check/review/record/info", { id: row.id }).then(
console.log(res.data); (res) => {
if (res.code == 1) { console.log(res.data);
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} else {
this.form = row;
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "reviewTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.form.view = "核查";
this.open = true;
} }
for (let key in this.form) { );
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.checkResult = 1;
this.form.view = "核查";
this.open = true;
});
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
row.view == "核查" row.view == "核查"
? (this.title = "评价差评绩效核查") ? (this.title = "评价差评绩效核查")
...@@ -458,37 +478,42 @@ export default { ...@@ -458,37 +478,42 @@ export default {
this.title = "新增评价差评绩效核查信息"; this.title = "新增评价差评绩效核查信息";
}, },
/** 查看*/ /** 查看*/
view(row) { async view(row) {
this.form = row; this.form = row;
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
// this.urls.currUrl = "check/review/record/view"; // this.urls.currUrl = "check/review/record/view";
// this.getData(); // this.getData();
this.$get("/check/review/record/info", { id: row.id }).then((res) => { await this.$get("/check/review/record/info", { id: row.id }).then(
if (res.code == 1) { (res) => {
this.form = res.data; if (res.code == 1) {
} else { this.form = res.data;
this.form = row; this.dict = res.dict;
} } else {
for (let key in this.form) { this.form = row;
key == "actualAttendTime" }
? (this.form[key] = timestampToTime(this.form[key], 6)) for (let key in this.form) {
: key == "attendanceDate" key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime" : key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime" : key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime" : key == "deductTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime" : key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6)) ? (this.form[key] = timestampToTime(this.form[key], 6))
: ""; : key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "reviewTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
} }
this.form.view = "查看"; );
console.log(this.form);
this.open = true;
});
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "评价差评绩效核查信息详细"; this.title = "评价差评绩效核查信息详细";
}, },
......
...@@ -222,17 +222,33 @@ export default { ...@@ -222,17 +222,33 @@ export default {
{ label: "绩效规则", prop: "ruleNme" }, { label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, {
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "核查结果", prop: "checkResult", formatter: this.formatter },
{ label: "说明", prop: "checkDesc" },
{ label: "核查人员", prop: "checkPerson" },
{
label: "核查时间",
prop: "checkTime",
formatter: this.formatterDate,
},
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
......
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -55,15 +55,15 @@ ...@@ -55,15 +55,15 @@
}}</el-col }}</el-col
> >
<el-col :span="5" <el-col :span="5"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col >加分/扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col
> >
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8" <el-col :span="8"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col >加分/扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
> >
<el-col :span="8" <el-col :span="8"
>扣分人员:{{ >加分/扣分人员:{{
form.deductPerson ? form.deductPerson : "--" form.deductPerson ? form.deductPerson : "--"
}}</el-col }}</el-col
> >
...@@ -255,12 +255,12 @@ ...@@ -255,12 +255,12 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
:enumData="dict.subMethod" :enumData="dict.subMethod"
placeholder="请选择扣分方式" placeholder="请选择加分/扣分方式"
/> />
<Field <Field
label="增减类型" label="增减类型"
......
...@@ -78,11 +78,11 @@ ...@@ -78,11 +78,11 @@
{label: "违规类型", prop: "ruleName"}, {label: "违规类型", prop: "ruleName"},
{label: "绩效规则", prop: "ruleName"}, {label: "绩效规则", prop: "ruleName"},
{label: "扣分方式", prop: "subMethod",formatter: this.formatter}, {label: "加分/扣分方式", prop: "subMethod",formatter: this.formatter},
{label: "扣分时间", prop: "attendanceDate" , formatter: this.formatterDate }, {label: "加分/扣分时间", prop: "attendanceDate" , formatter: this.formatterDate },
{label: "扣分分值", prop: "score", formatter: this.formatter}, {label: "分值", prop: "score", formatter: this.formatter},
{label: "申诉时间", prop: "appealTime", formatter: this.formatterDate}, {label: "申诉时间", prop: "appealTime", formatter: this.formatterDate},
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<!-- <bar-charts <!-- <bar-charts
:title="'部门扣分排名TOP10'" :title="'部门扣分排名TOP10'"
:id="'koufen_10'" :id="'koufen_10'"
:legendName="'部门扣分分值'" :legendName="'部门分值'"
:styleObj="{ width: '100%', height: '300px' }" :styleObj="{ width: '100%', height: '300px' }"
/> --> /> -->
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
...@@ -174,15 +174,15 @@ export default { ...@@ -174,15 +174,15 @@ export default {
{ label: "违规类型", prop: "irregularOtherType" }, { label: "违规类型", prop: "irregularOtherType" },
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "attendanceDate", prop: "attendanceDate",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "申诉时间", label: "申诉时间",
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="增减类型" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="增减类型" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="扣分分值:"> <el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
placeholder="请输入异常处理结果" placeholder="请输入异常处理结果"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -282,13 +282,13 @@ ...@@ -282,13 +282,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -429,8 +429,8 @@ export default { ...@@ -429,8 +429,8 @@ export default {
this.form.score = arr && arr[0].score; this.form.score = arr && arr[0].score;
this.form.checkStatus == 1 ? (this.form.checkStatus = 2) : ""; this.form.checkStatus == 1 ? (this.form.checkStatus = 2) : "";
}, },
cateChange() { async cateChange() {
this.$post("/perform/rules/list", { await this.$post("/perform/rules/list", {
page: 1, page: 1,
size: -1, size: -1,
categoryId: this.form.categoryId, categoryId: this.form.categoryId,
...@@ -482,7 +482,13 @@ export default { ...@@ -482,7 +482,13 @@ export default {
this.form.processStatus = 2; this.form.processStatus = 2;
this.form.view = "核查"; this.form.view = "核查";
this.staffChange(this.form.staffId); this.staffChange(this.form.staffId);
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.open = true; this.open = true;
}); });
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
......
...@@ -226,17 +226,17 @@ export default { ...@@ -226,17 +226,17 @@ export default {
{ label: "绩效规则", prop: "ruleNme" }, { label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
...@@ -251,9 +251,6 @@ export default { ...@@ -251,9 +251,6 @@ export default {
return row.processStatus == 1 ? ( return row.processStatus == 1 ? (
<table-buttons <table-buttons
noAdd noAdd
noView
noEdit
reCheck
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
...@@ -198,12 +198,12 @@ export default { ...@@ -198,12 +198,12 @@ export default {
{ label: "异常处理结果", prop: "errorResult" }, { label: "异常处理结果", prop: "errorResult" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
......
...@@ -50,13 +50,13 @@ ...@@ -50,13 +50,13 @@
<el-descriptions-item label="异常处理结果" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="异常处理结果" label-class-name="labelClass" content-class-name="contentClass">
{{form.errorResult}} {{form.errorResult}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="增减类型" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="增减类型" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="扣分分值:"> <el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -327,7 +327,7 @@ ...@@ -327,7 +327,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -335,13 +335,13 @@ ...@@ -335,13 +335,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -544,6 +544,13 @@ export default { ...@@ -544,6 +544,13 @@ export default {
this.form.processStatus = 2; this.form.processStatus = 2;
this.form.view = "核查"; this.form.view = "核查";
this.staffChange(this.form.staffId); this.staffChange(this.form.staffId);
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.open = true; this.open = true;
}); });
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
......
...@@ -194,12 +194,12 @@ export default { ...@@ -194,12 +194,12 @@ export default {
{ label: "规则名称", prop: "ruleName" }, { label: "规则名称", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
......
...@@ -232,17 +232,17 @@ export default { ...@@ -232,17 +232,17 @@ export default {
{ label: "绩效规则", prop: "ruleNme" }, { label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
...@@ -257,9 +257,6 @@ export default { ...@@ -257,9 +257,6 @@ export default {
return row.processStatus == 1 ? ( return row.processStatus == 1 ? (
<table-buttons <table-buttons
noAdd noAdd
noView
noEdit
reCheck
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
...@@ -53,13 +53,13 @@ ...@@ -53,13 +53,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="扣分分值:"> <el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -296,7 +296,7 @@ ...@@ -296,7 +296,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -304,13 +304,13 @@ ...@@ -304,13 +304,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -518,6 +518,13 @@ export default { ...@@ -518,6 +518,13 @@ export default {
this.form.processStatus = 2; this.form.processStatus = 2;
this.form.view = "核查"; this.form.view = "核查";
this.staffChange(this.form.staffId); this.staffChange(this.form.staffId);
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.open = true; this.open = true;
}); });
......
...@@ -232,17 +232,17 @@ export default { ...@@ -232,17 +232,17 @@ export default {
}, },
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
...@@ -257,9 +257,6 @@ export default { ...@@ -257,9 +257,6 @@ export default {
return row.processStatus == 1 ? ( return row.processStatus == 1 ? (
<table-buttons <table-buttons
noAdd noAdd
noView
noEdit
reCheck
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
...@@ -206,12 +206,12 @@ export default { ...@@ -206,12 +206,12 @@ export default {
{ label: "规则名称", prop: "ruleName" }, { label: "规则名称", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
......
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="扣分分值:"> <el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -275,13 +275,13 @@ ...@@ -275,13 +275,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -486,7 +486,13 @@ export default { ...@@ -486,7 +486,13 @@ export default {
this.form.processStatus = 2; this.form.processStatus = 2;
this.form.view = "核查"; this.form.view = "核查";
this.staffChange(this.form.staffId); this.staffChange(this.form.staffId);
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.open = true; this.open = true;
}); });
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
......
...@@ -219,17 +219,17 @@ export default { ...@@ -219,17 +219,17 @@ export default {
}, },
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
...@@ -244,9 +244,6 @@ export default { ...@@ -244,9 +244,6 @@ export default {
return row.processStatus == 1 ? ( return row.processStatus == 1 ? (
<table-buttons <table-buttons
noAdd noAdd
noView
noEdit
reCheck
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
...@@ -186,12 +186,12 @@ export default { ...@@ -186,12 +186,12 @@ export default {
{ label: "规则名称", prop: "ruleName" }, { label: "规则名称", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
......
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="扣分分值:"> <el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
placeholder="请输入评分标准" placeholder="请输入评分标准"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -236,13 +236,13 @@ ...@@ -236,13 +236,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -448,7 +448,13 @@ export default { ...@@ -448,7 +448,13 @@ export default {
this.form.snapPath ? "" : (this.form.snapPath = ""); this.form.snapPath ? "" : (this.form.snapPath = "");
this.form.view = "核查"; this.form.view = "核查";
this.staffChange(this.form.staffId); this.staffChange(this.form.staffId);
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.open = true; this.open = true;
}); });
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
......
...@@ -228,17 +228,17 @@ export default { ...@@ -228,17 +228,17 @@ export default {
}, },
{ label: "绩效规则", prop: "ruleName" }, { label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
...@@ -253,9 +253,6 @@ export default { ...@@ -253,9 +253,6 @@ export default {
return row.processStatus == 1 ? ( return row.processStatus == 1 ? (
<table-buttons <table-buttons
noAdd noAdd
noView
noEdit
reCheck
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
...@@ -200,12 +200,12 @@ export default { ...@@ -200,12 +200,12 @@ export default {
{ label: "评分标准", prop: "ruleDesc" }, { label: "评分标准", prop: "ruleDesc" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
......
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
<el-descriptions-item label="评分标准" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="评分标准" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleDesc}} {{form.ruleDesc}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="扣分分值:"> <el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p> <p>{{ form.score }}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -282,7 +282,7 @@ ...@@ -282,7 +282,7 @@
placeholder="请输入规则名称" placeholder="请输入规则名称"
/> />
<Field <Field
label="扣分方式" label="加分/扣分方式"
prop="subMethod" prop="subMethod"
v-model="form.subMethod" v-model="form.subMethod"
type="select" type="select"
...@@ -290,13 +290,13 @@ ...@@ -290,13 +290,13 @@
placeholder="请选择扣分方式" placeholder="请选择扣分方式"
/> />
<Field <Field
label="扣分人员" label="加分/扣分人员"
prop="deductPerson" prop="deductPerson"
v-model="form.deductPerson" v-model="form.deductPerson"
placeholder="请输入扣分人员" placeholder="请输入扣分人员"
/> />
<Field <Field
label="扣分时间" label="加分/扣分时间"
prop="deductTime" prop="deductTime"
v-model="form.deductTime" v-model="form.deductTime"
type="date" type="date"
...@@ -501,7 +501,13 @@ export default { ...@@ -501,7 +501,13 @@ export default {
this.form.processStatus = 2; this.form.processStatus = 2;
this.form.view = "核查"; this.form.view = "核查";
this.staffChange(this.form.staffId); this.staffChange(this.form.staffId);
this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
}).then((res) => {
this.ruleArr = res.data.data;
});
this.open = true; this.open = true;
}); });
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
......
...@@ -230,17 +230,17 @@ export default { ...@@ -230,17 +230,17 @@ export default {
{ label: "绩效规则", prop: "ruleNme" }, { label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
{ label: "扣分人员", prop: "deductPerson" }, { label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter }, { label: "分值", prop: "score", formatter: this.formatter },
{ {
label: "处理状态", label: "处理状态",
...@@ -255,9 +255,6 @@ export default { ...@@ -255,9 +255,6 @@ export default {
return row.processStatus == 1 ? ( return row.processStatus == 1 ? (
<table-buttons <table-buttons
noAdd noAdd
noView
noEdit
reCheck
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
...@@ -194,10 +194,10 @@ export default { ...@@ -194,10 +194,10 @@ export default {
{ label: "规则名称", prop: "ruleName" }, { label: "规则名称", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter }, { label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{ {
label: "扣分时间", label: "加分/扣分时间",
prop: "deductTime", prop: "deductTime",
formatter: this.formatterDate, formatter: this.formatterDate,
}, },
......
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}} {{form.ruleName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分方式" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分方式" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("subMethod", form.subMethod) }} {{ util_formatters("subMethod", form.subMethod) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分人员" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分人员" label-class-name="labelClass" content-class-name="contentClass">
{{form.deductPerson}} {{form.deductPerson}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分时间" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="加分/扣分时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.deductTime)}} {{ util_formatterDate(form.deductTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
...@@ -116,6 +116,8 @@ export default { ...@@ -116,6 +116,8 @@ export default {
{ label: "分类", prop: "categoryId", formatter: this.formatter }, { label: "分类", prop: "categoryId", formatter: this.formatter },
{ label: "考核名称", prop: "name" }, { label: "考核名称", prop: "name" },
{ label: "考核编码", prop: "ruleCode" },
{ label: "评分标准", prop: "content" }, { label: "评分标准", prop: "content" },
{ label: "增减类型", prop: "subAddType", formatter: this.formatter }, { label: "增减类型", prop: "subAddType", formatter: this.formatter },
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
:title="'部门扣分排名TOP10'" :title="'部门扣分排名TOP10'"
:id="'koufen_10'" :id="'koufen_10'"
:parameter="depStatObj.totalSubScore" :parameter="depStatObj.totalSubScore"
:legendName="'部门扣分分值'" :legendName="'部门分值'"
:styleObj="{ width: '100%', height: '300px' }" :styleObj="{ width: '100%', height: '300px' }"
/> />
</div> </div>
......
...@@ -29,11 +29,18 @@ ...@@ -29,11 +29,18 @@
<profiles.log.level>info</profiles.log.level> <profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.sms.smsSendUrl>http://127.0.0.1:8089/api/index/index</profiles.sms.smsSendUrl> <profiles.sms.smsSendUrl>http://127.0.0.1:8089/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>k6BVS1PEbyzcJAE4</profiles.sms.apiId> <profiles.sms.apiId>k6BVS1PEbyzcJAE4</profiles.sms.apiId>
<profiles.hik.host>8.136.255.30:8001</profiles.hik.host> <profiles.hik.host>8.136.255.30:8001</profiles.hik.host>
<profiles.hik.protocol>http://</profiles.hik.protocol> <profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.dingtalk.domain>https://oapi.dingtalk.com</profiles.dingtalk.domain>
<profiles.dingtalk.agentId>2625340030</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>dingjcqjqjh1j82ho5zx</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>_wNw2J6sxTYcu3ddNkFlG3U-3UlQ-P_7ufLSJ4wRxgdUflm3lPf8LIODCQOGkydy</profiles.dingtalk.appSecret>
<profiles.webUrl>http://8.136.255.30:11039/attendance</profiles.webUrl>
<package.environment>serve</package.environment> <package.environment>serve</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
</properties> </properties>
...@@ -59,6 +66,12 @@ ...@@ -59,6 +66,12 @@
<profiles.hik.protocol>http://</profiles.hik.protocol> <profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.dingtalk.domain>https://oapi.dingtalk.com</profiles.dingtalk.domain>
<profiles.dingtalk.agentId>2652674890</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>dingpqzradgfr4efdi2j</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
<profiles.webUrl>http://8.136.255.30:11039/attendance</profiles.webUrl>
<package.environment>test</package.environment> <package.environment>test</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
</properties> </properties>
...@@ -81,6 +94,12 @@ ...@@ -81,6 +94,12 @@
<profiles.hik.protocol>https://</profiles.hik.protocol> <profiles.hik.protocol>https://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.dingtalk.domain>https://oapi.dingtalk.com</profiles.dingtalk.domain>
<profiles.dingtalk.agentId>2652674890</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>dingpqzradgfr4efdi2j</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
<profiles.webUrl>http://112.19.80.237:11039/attendance</profiles.webUrl>
<package.environment>build</package.environment> <package.environment>build</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
</properties> </properties>
......
package com.mortals.xhx.base.system.message;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.dingding.CheckDingMsg;
public interface MessageService {
Rest<String> sendDingTalkWorkMsg(CheckDingMsg checkDingMsg);
Rest<String> sendDingTalkAppealMsg(CheckDingMsg checkDingMsg);
}
\ No newline at end of file
package com.mortals.xhx.base.system.message.impl;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.AppealResultEnum;
import com.mortals.xhx.common.code.SubAddTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Link;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Msg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Text;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Service("messageService")
@Slf4j
public class MessageServiceImpl implements MessageService {
@Value("${webUrl:''}")
private String webUrl;
@Autowired
private IDingPersonService dingPersonService;
@Override
public Rest<String> sendDingTalkWorkMsg(CheckDingMsg dingMsg) {
WorkMsgReq workMsgReq = new WorkMsgReq();
Msg msg = new Msg();
msg.setMsgtype("link");
Link link = new Link();
link.setPicUrl("");
link.setMessageUrl("webUrl" + dingMsg.getPath());
if (SubAddTypeEnum.增加.getValue() == dingMsg.getSubAddType()) {
link.setText(String.format("你好,经人工核实后你在%%-%s" +
",系统自动增加绩效%s分,如有情况说明请及时向管理人员提交申诉处理,感谢你的配合。", dingMsg.getDateTime(), dingMsg.getRuleStr(), dingMsg.getScore()));
} else {
link.setText(String.format("你好,经人工核实后你在%s违反%s" +
",系统自动扣除绩效%s分,如有情况说明请及时向管理人员提交申诉处理,感谢你的配合。", dingMsg.getDateTime(), dingMsg.getRuleStr(), dingMsg.getScore()));
}
link.setTitle(String.format("%s考核核查通知", dingMsg.getPerformTypeStr()));
msg.setLink(link);
workMsgReq.setUseridList(dingMsg.getUserIds());
Rest<String> sendWorkRest = dingPersonService.sendWorkMsg(workMsgReq);
if (YesNoEnum.YES.getValue() == sendWorkRest.getCode()) {
String requestId = sendWorkRest.getData();
return Rest.ok(requestId);
} else {
log.error("发送工作消息失败,msg:{}", sendWorkRest.getMsg());
return Rest.fail(sendWorkRest.getMsg());
}
}
@Override
public Rest<String> sendDingTalkAppealMsg(CheckDingMsg dingMsg) {
WorkMsgReq workMsgReq = new WorkMsgReq();
Msg msg = new Msg();
msg.setMsgtype("text");
Text text = new Text();
if (AppealResultEnum.通过.getValue() == dingMsg.getAppealResult()) {
text.setContent(String.format("你好,你申诉的在%s违反%s,经人工核查后情况属实,本次申诉成功,将撤销之前的扣除绩效%s。", dingMsg.getDateTime(), dingMsg.getRuleStr(), dingMsg.getScore()));
} else {
text.setContent(String.format("你好,你申诉的在%s违反%s,经人工核查后情况仍继续扣除%s。本次申诉失败,原因:%s,如有疑问请联系相关负责人。", dingMsg.getDateTime(), dingMsg.getRuleStr(), dingMsg.getScore(), dingMsg.getAppealDesc()));
}
msg.setText(text);
workMsgReq.setUseridList(dingMsg.getUserIds());
Rest<String> sendWorkRest = dingPersonService.sendWorkMsg(workMsgReq);
if (YesNoEnum.YES.getValue() == sendWorkRest.getCode()) {
String requestId = sendWorkRest.getData();
return Rest.ok(requestId);
} else {
log.error("发送工作消息失败,msg:{}", sendWorkRest.getMsg());
return Rest.fail(sendWorkRest.getMsg());
}
}
}
\ No newline at end of file
...@@ -91,7 +91,18 @@ public class UserEntity extends UserVo implements IUser { ...@@ -91,7 +91,18 @@ public class UserEntity extends UserVo implements IUser {
*/ */
private Long customerId; private Long customerId;
/**
* 钉钉userId
*/
private String dingUserId;
public String getDingUserId() {
return dingUserId;
}
public void setDingUserId(String dingUserId) {
this.dingUserId = dingUserId;
}
public UserEntity(){} public UserEntity(){}
/** /**
......
...@@ -162,6 +162,14 @@ public class UserQuery extends UserEntity { ...@@ -162,6 +162,14 @@ public class UserQuery extends UserEntity {
/** 最后一次登录地址排除列表 */ /** 最后一次登录地址排除列表 */
private List <String> lastLoginAddressNotList; private List <String> lastLoginAddressNotList;
/** 钉钉userId */
private List<String> dingUserIdList;
/** 钉钉userId排除列表 */
private List <String> dingUserIdNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<UserQuery> orConditionList; private List<UserQuery> orConditionList;
...@@ -1606,4 +1614,23 @@ public class UserQuery extends UserEntity { ...@@ -1606,4 +1614,23 @@ public class UserQuery extends UserEntity {
this.andConditionList = andConditionList; this.andConditionList = andConditionList;
} }
/**
* 设置 钉钉userId
* @param dingUserId
*/
public UserQuery dingUserId(String dingUserId){
setDingUserId(dingUserId);
return this;
}
/**
* 设置 钉钉userId
* @param dingUserIdList
*/
public UserQuery dingUserIdList(List<String> dingUserIdList){
this.dingUserIdList = dingUserIdList;
return this;
}
} }
\ No newline at end of file
package com.mortals.xhx.busiz;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
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 com.mortals.xhx.module.workman.model.WorkmanEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 设备
*
* @author: zxfei
* @date: 2021/8/24 20:28
*/
@RestController
@Slf4j
@RequestMapping("/test")
public class TestController {
@Autowired
private IdgeneratorService idgeneratorService;
@Autowired
private ICacheService cacheService;
@Autowired
private StaffService staffService;
@Autowired
private UserService userService;
@Autowired
private IHikFaceService faceService;
@Autowired
private UploadService uploadService;
// @GetMapping("webservice")@GetMapping("idGens")
// public String idGens() {
// log.info("测试id生成");
//
// String stringId = idgeneratorService.getLongId(IdgeneratorServiceImpl.IdGeneratorKey.EFFECT).toString();
//
//
// return stringId;
// }
public String webservice() {
log.info("测试");
return "ok";
}
//
@GetMapping("updatePersons")
@UnAuth
public String updatePersons() {
log.info("更新用户手机号码");
cacheService.select(1);
Map<String, String> map = cacheService.hgetAll("com:mortals:xhx:module:workman:model:WorkmanEntity");
cacheService.select(14);
Map<String, WorkmanEntity> userMap = new HashMap<>();
map.entrySet().stream().forEach(item -> {
String value = item.getValue();
WorkmanEntity workmanEntity = JSONObject.parseObject(value, WorkmanEntity.class);
userMap.put(workmanEntity.getName(), workmanEntity);
});
List<StaffEntity> staffEntities = staffService.find(new StaffQuery());
ArrayList<StaffEntity> updateList = new ArrayList<>();
for (StaffEntity staffEntity : staffEntities) {
if (ObjectUtils.isEmpty(staffEntity.getPhoneNumber())) {
WorkmanEntity workmanEntity = userMap.get(staffEntity.getName());
if (!ObjectUtils.isEmpty(workmanEntity)) {
staffEntity.setPhoneNumber(workmanEntity.getMobile());
updateList.add(staffEntity);
}
}
}
if (!ObjectUtils.isEmpty(updateList)) {
log.info("更新数量:" + updateList.size());
for (StaffEntity staffEntity : updateList) {
staffService.update(staffEntity);
//更新绑定的系统用户手机号码
UserQuery userQuery = new UserQuery();
userQuery.setCustomerId(staffEntity.getId());
UserEntity userEntity = userService.selectOne(userQuery);
if (userEntity != null) {
Map<String, Object> condition = new HashMap<>(1);
condition.put("id", userEntity.getId());
Map<String, Object> data = new HashMap<>(1);
data.put("mobile", staffEntity.getPhoneNumber());
userService.getUserDao().update(data, condition);
}
}
}
return "更新数量:" + updateList.size();
}
@GetMapping("downPersonsPic")
@UnAuth
public String downPersonsPic() {
List<StaffEntity> staffEntities = staffService.find(new StaffQuery());
ArrayList<StaffEntity> updateList = new ArrayList<>();
for (StaffEntity staffEntity : staffEntities) {
if (!ObjectUtils.isEmpty(staffEntity.getPicUri())) {
ImgReq imgReq = new ImgReq();
imgReq.setUrl(staffEntity.getPicUri());
Rest<String> rest = faceService.downloadPicture(imgReq);
if (YesNoEnum.YES.getValue() == rest.getCode()) {
byte[] bytes = Base64.decode(rest.getData());
if (!org.springframework.util.ObjectUtils.isEmpty(bytes)) {
InputStream inputStream = new ByteArrayInputStream(bytes);
MultipartFile file = ServletUtils.getMultipartFile(inputStream, "snap.jpg");
String filePath = uploadService.saveFileUpload(file, "file/fileupload/snap/" + DateUtil.today(), null);
staffEntity.setPhotoPath(filePath);
updateList.add(staffEntity);
}
}
}
}
return "更新数量:" + updateList.size();
}
public static void main(String[] args) {
}
}
package com.mortals.xhx.busiz.h5.req;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
@Data
public class DingTalkReq extends BaseReq {
/**
* 授权码
*/
private String code;
private String userName;
private String phone;
private String openId;
}
...@@ -42,6 +42,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq> ...@@ -42,6 +42,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
private PerformRulesService rulesService; private PerformRulesService rulesService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired
private PerformRulesCategoryService categoryService;
/** /**
...@@ -219,6 +221,11 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq> ...@@ -219,6 +221,11 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setDeductTime(new Date()); recordEntity.setDeductTime(new Date());
recordEntity.setCreateUserId(1L); recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date()); recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformAttendRecordEntity save = attendRecordService.save(recordEntity); PerformAttendRecordEntity save = attendRecordService.save(recordEntity);
return save.newEntity(); return save.newEntity();
...@@ -249,6 +256,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq> ...@@ -249,6 +256,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setDeductTime(new Date()); recordEntity.setDeductTime(new Date());
recordEntity.setCreateUserId(1L); recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date()); recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformReviewRecordEntity save = reviewRecordService.save(recordEntity); PerformReviewRecordEntity save = reviewRecordService.save(recordEntity);
return save.newEntity(); return save.newEntity();
...@@ -278,6 +287,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq> ...@@ -278,6 +287,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L); recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date()); recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformComplainRecordEntity save = complainRecordService.save(recordEntity); PerformComplainRecordEntity save = complainRecordService.save(recordEntity);
return save.newEntity(); return save.newEntity();
...@@ -307,6 +318,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq> ...@@ -307,6 +318,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L); recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date()); recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformGoworkRecordEntity save = performGoworkRecordService.save(recordEntity); PerformGoworkRecordEntity save = performGoworkRecordService.save(recordEntity);
return save.newEntity(); return save.newEntity();
...@@ -336,6 +349,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq> ...@@ -336,6 +349,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L); recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date()); recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformEffectRecordEntity save = effectRecordService.save(recordEntity); PerformEffectRecordEntity save = effectRecordService.save(recordEntity);
return save.newEntity(); return save.newEntity();
} }
...@@ -366,6 +381,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq> ...@@ -366,6 +381,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L); recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date()); recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformOtherRecordEntity save = otherRecordService.save(recordEntity); PerformOtherRecordEntity save = otherRecordService.save(recordEntity);
return save.newEntity(); return save.newEntity();
} }
......
...@@ -114,7 +114,7 @@ public class AppealApiController extends AbstractBaseController<PerformReq> { ...@@ -114,7 +114,7 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
//未设置时间的情况,默认为当月 //未设置时间的情况,默认为当月
appealReq.setApperalStartDate(DateUtil.beginOfMonth(new Date()).toDateStr()); appealReq.setApperalStartDate(DateUtil.beginOfMonth(new Date()).toDateStr());
appealReq.setAppealEndDate(DateUtil.today()); appealReq.setAppealEndDate(DateUtil.today());
}else{ } else {
//格式化到指定日期的当月 //格式化到指定日期的当月
appealReq.setApperalStartDate(DateUtil.beginOfMonth(DateUtil.parse(appealReq.getApperalStartDate()).toJdkDate()).toDateStr()); appealReq.setApperalStartDate(DateUtil.beginOfMonth(DateUtil.parse(appealReq.getApperalStartDate()).toJdkDate()).toDateStr());
appealReq.setAppealEndDate(DateUtil.endOfMonth(DateUtil.parse(appealReq.getApperalStartDate()).toJdkDate()).toDateStr()); appealReq.setAppealEndDate(DateUtil.endOfMonth(DateUtil.parse(appealReq.getApperalStartDate()).toJdkDate()).toDateStr());
...@@ -224,6 +224,7 @@ public class AppealApiController extends AbstractBaseController<PerformReq> { ...@@ -224,6 +224,7 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
entity.setStaffId(context.getUser().getCustomerId()); entity.setStaffId(context.getUser().getCustomerId());
entity.setCreateUserId(context.getUser().getId()); entity.setCreateUserId(context.getUser().getId());
entity.setCheckRecordId(req.getId()); entity.setCheckRecordId(req.getId());
entity.setAppealTime(new Date());
PerformAttendAppealEntity saveEntity = appealService.save(entity, context); PerformAttendAppealEntity saveEntity = appealService.save(entity, context);
rest.setData(saveEntity); rest.setData(saveEntity);
......
package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.ap.CookieService;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.AESUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.HttpUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.login.web.LoginForm;
import com.mortals.xhx.base.system.menu.model.MenuEntity;
import com.mortals.xhx.base.system.menu.service.MenuService;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.busiz.h5.req.DingTalkReq;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.IDingTalkService;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static com.mortals.xhx.common.key.ErrorCode.*;
/**
* 钉钉授权登录
*
* @author:
* @date: 2023/7/15 10:26
*/
@RestController
@Slf4j
@RequestMapping("dingtalk")
public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<UserService, UserEntity, Long> {
@Autowired
private UserService userService;
@Autowired
private ValidCodeService validCodeService;
@Autowired
private ResourceService resourceService;
@Autowired
private MenuService menuService;
@Autowired
private ICacheService cacheService;
@Autowired
private IAuthTokenService authTokenService;
@Autowired
private StaffService staffService;
@Autowired
private DeptService deptService;
@Autowired
private IDingPersonService dingPersonService;
@RequestMapping("authlogin")
@UnAuth
public String login(@RequestBody DingTalkReq req) throws Exception {
JSONObject ret = new JSONObject();
UserEntity userEntity = null;
try {
if (ObjectUtils.isEmpty(req.getCode())) {
throw new AppException("钉钉code不能为空!");
}
//根据code 查询钉钉用户id
Rest<String> personRest = dingPersonService.getPersonByCode(req.getCode());
if (personRest.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException(String.format("获取钉钉用户异常,%s", personRest.getMsg()));
}
if(ObjectUtils.isEmpty(personRest.getData())) throw new AppException(REGISTER_AUTH_FAIL, "不存在当前匹配的钉钉关联用户!");
//根据钉钉的用户查询系统绑定的用户,获取
UserQuery userQuery = new UserQuery();
userQuery.setDingUserId(personRest.getData());
userEntity = userService.selectOne(userQuery);
if (ObjectUtils.isEmpty(userEntity))
throw new AppException(REGISTER_AUTH_FAIL, "不存在当前匹配的钉钉关联用户!");
JSONObject data = new JSONObject();
data.put("id", userEntity.getId());
data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
String token = authTokenService.createToken(userEntity);
data.put("token", token);
ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
recordSysLog(request, userEntity, "钉钉用户登录系统成功!");
return ret.toJSONString();
} catch (AppException e) {
log.error("dinding login error ", e);
ret.put(KEY_RESULT_CODE, e.getCode());
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
} catch (Exception e) {
log.error("系统异常 error ", e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
@RequestMapping("register")
@UnAuth
public String resgister(@RequestBody DingTalkReq req) {
JSONObject ret = new JSONObject();
UserEntity userEntity = null;
try {
if (ObjectUtils.isEmpty(req.getUserName()))
throw new AppException("用户姓名不能为空!");
if (ObjectUtils.isEmpty(req.getPhone()))
throw new AppException("手机号码不能为空!");
if (ObjectUtils.isEmpty(req.getOpenId()))
throw new AppException("openId不能为空!");
StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(req.getPhone()).name(req.getUserName()));
if (ObjectUtils.isEmpty(staffEntity))
throw new AppException(String.format("系统未找到当前用户,姓名:%s,手机:%s,请联系管理员!", req.getUserName(), req.getPhone()));
UserQuery userQuery = new UserQuery();
userQuery.setCustomerId(staffEntity.getId());
userEntity = userService.selectOne(userQuery);
if (ObjectUtils.isEmpty(userEntity))
throw new AppException(String.format("员工未与系统用户绑定,staffId:%s", staffEntity.getId()));
userEntity.setDingUserId(req.getOpenId());
// userService.update(userEntity);
Map<String, Object> condition = new HashMap<>(1);
condition.put("id", userEntity.getId());
Map<String, Object> data1 = new HashMap<>(1);
data1.put("dingUserId", req.getOpenId());
userService.getUserDao().update(data1, condition);
JSONObject data = new JSONObject();
data.put("id", userEntity.getId());
data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
String token = authTokenService.createToken(userEntity);
data.put("token", token);
ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "钉钉用户登录系统成功!");
recordSysLog(request, userEntity, "钉钉用户登录系统成功!");
return ret.toJSONString();
} catch (AppException e) {
log.error("dinding register error ", e);
ret.put(KEY_RESULT_CODE, e.getCode());
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
} catch (Exception e) {
log.error("系统异常 error ", e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
@RequestMapping("logout")
public void logout(HttpServletRequest request, HttpServletResponse response) {
recordSysLog(request, "退出登录");
super.removeCurrUser(request);
this.deleteBlackCookie(request, response);
}
protected void deleteBlackCookie(HttpServletRequest request, HttpServletResponse response) {
try {
CookieService.deleteCookieForAuth(request, response);
} catch (Throwable e) {
}
}
}
...@@ -7,6 +7,7 @@ import com.mortals.framework.common.Rest; ...@@ -7,6 +7,7 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.h5.req.FeedbackReq; import com.mortals.xhx.busiz.h5.req.FeedbackReq;
import com.mortals.xhx.busiz.h5.req.FeedbackSaveReq; import com.mortals.xhx.busiz.h5.req.FeedbackSaveReq;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
...@@ -75,17 +76,19 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> { ...@@ -75,17 +76,19 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
feedbackReq.setFeedBackEndDate(DateUtil.endOfMonth(DateUtil.parse(feedbackReq.getFeedBackStartDate()).toJdkDate()).toDateStr()); feedbackReq.setFeedBackEndDate(DateUtil.endOfMonth(DateUtil.parse(feedbackReq.getFeedBackStartDate()).toJdkDate()).toDateStr());
} }
//PageInfo pageInfo = buildPageInfo(feedbackReq); //PageInfo pageInfo = buildPageInfo(feedbackReq);
//todo PageInfo pageAllInfo = buildPageInfo(feedbackReq);
PageInfo pageAllInfo = new PageInfo();
if (YesNoEnum.YES.getValue() == feedbackReq.getFeedbackStatus()) { if (YesNoEnum.YES.getValue() == feedbackReq.getFeedbackStatus()) {
//已反馈 //已反馈
//查询我已经回答过的 //查询我已经回答过的
List<Long> feedbackIdList = answerService.find(new FeedbackAnswerQuery().staffId(context.getUser().getCustomerId())).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList()); List<Long> feedbackIdList = answerService.find(new FeedbackAnswerQuery().staffId(context.getUser().getCustomerId())).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList());
FeedbackQuery feedbackQuery = new FeedbackQuery(); FeedbackQuery feedbackQuery = new FeedbackQuery();
feedbackQuery.setIdList(feedbackIdList); feedbackQuery.setIdList(feedbackIdList);
List<FeedbackEntity> feedbackEntities = feedbackService.find(feedbackQuery);
model.put(KEY_RESULT_DATA, feedbackEntities); Result<FeedbackEntity> result = feedbackService.find(feedbackQuery, pageAllInfo, null);
pageAllInfo.setTotalResult(feedbackEntities.size()); model.put(PAGEINFO_KEY, result.getPageInfo());
model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo());
} else { } else {
//未反馈 //未反馈
//查询我的反馈 但是还未回答的 //查询我的反馈 但是还未回答的
...@@ -96,17 +99,16 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> { ...@@ -96,17 +99,16 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
feedbackStaffQuery.setStaffId(context.getUser().getCustomerId()); feedbackStaffQuery.setStaffId(context.getUser().getCustomerId());
List<Long> unfinFeedbackList = feedbackStaffService.find(feedbackStaffQuery).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList()); List<Long> unfinFeedbackList = feedbackStaffService.find(feedbackStaffQuery).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList());
model.put(KEY_RESULT_DATA, unfinFeedbackList); FeedbackQuery feedbackQuery = new FeedbackQuery();
pageAllInfo.setTotalResult(unfinFeedbackList.size()); feedbackQuery.setIdList(unfinFeedbackList);
} Result<FeedbackEntity> result = feedbackService.find(feedbackQuery, pageAllInfo, null);
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
model.put(PAGEINFO_KEY, result.getPageInfo());
model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo());
}
rest.setData(model); rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
log.error(busiDesc, e); log.error(busiDesc, e);
......
...@@ -4,6 +4,7 @@ import java.math.BigDecimal; ...@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -88,10 +89,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> { ...@@ -88,10 +89,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
try { try {
//todo //todo
PerformStatInfo performStatInfo = new PerformStatInfo(); PerformStatInfo performStatInfo = new PerformStatInfo();
performStatInfo.setTotalScore(new BigDecimal("15.9")); performStatInfo.setTotalScore(RandomUtil.randomBigDecimal(new BigDecimal("15"),new BigDecimal("45")));
performStatInfo.setTotalTimes(12); performStatInfo.setTotalTimes(RandomUtil.randomInt(10,40));
performStatInfo.setTodayScore(new BigDecimal("12.6")); performStatInfo.setTodayScore(RandomUtil.randomBigDecimal(new BigDecimal("2"),new BigDecimal("10")));
performStatInfo.setTodayTimes(4); performStatInfo.setTodayTimes(RandomUtil.randomInt(10));
rest.setData(performStatInfo); rest.setData(performStatInfo);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
...@@ -133,19 +134,15 @@ public class PerformApiController extends AbstractBaseController<PerformReq> { ...@@ -133,19 +134,15 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
query.setCheckTimeEnd(performReq.getPerformEndDate()); query.setCheckTimeEnd(performReq.getPerformEndDate());
query.setStaffId(context.getUser().getCustomerId()); query.setStaffId(context.getUser().getCustomerId());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query); Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query, pageInfo);
List<PerformInfo> collect = allCheckRecord.stream().map(item -> { List<CheckAllRecordVo> allCheckRecord = result.getList();List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo(); PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item)); BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo; return performInfo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect); model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo(); model.put(PAGEINFO_KEY, result.getPageInfo());
pageAllInfo.setTotalResult(collect.size()); parsePageInfo(model, result.getPageInfo());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
} else if (PerformTypeEnum.考勤绩效.getValue().equals(performReq.getPerformType())) { } else if (PerformTypeEnum.考勤绩效.getValue().equals(performReq.getPerformType())) {
CheckAttendRecordQuery query = new CheckAttendRecordQuery(); CheckAttendRecordQuery query = new CheckAttendRecordQuery();
......
package com.mortals.xhx.busiz.h5.web;
import com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService;
import com.mortals.xhx.base.system.idgenerator.service.impl.IdgeneratorServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 设备
*
* @author: zxfei
* @date: 2021/8/24 20:28
*/
@RestController
@Slf4j
@RequestMapping("/test")
public class TestController {
@Autowired
private IdgeneratorService idgeneratorService;
// @GetMapping("webservice")@GetMapping("idGens")
// public String idGens() {
// log.info("测试id生成");
//
// String stringId = idgeneratorService.getLongId(IdgeneratorServiceImpl.IdGeneratorKey.EFFECT).toString();
//
//
// return stringId;
// }
public String webservice() {
log.info("测试");
return "ok";
}
//
public static void main(String[] args) {
}
}
...@@ -112,6 +112,10 @@ public interface ErrorCode { ...@@ -112,6 +112,10 @@ public interface ErrorCode {
public static final String TOKEN_AUTH_FAIL_CONTENT = "token认证失败!"; public static final String TOKEN_AUTH_FAIL_CONTENT = "token认证失败!";
public static final int REGISTER_AUTH_FAIL = 1011;
public static final String REGISTER_AUTH_FAIL_CONTENT = "token认证失败!";
public static final int ERROR_TOKEN_EXPIRED = 9001; public static final int ERROR_TOKEN_EXPIRED = 9001;
public static final String ERROR_TOKEN_EXPIRED_CONTENT = "用户登录过期,请重新登录!"; public static final String ERROR_TOKEN_EXPIRED_CONTENT = "用户登录过期,请重新登录!";
public static final int ERROR_TOKEN_UNAUTHORIZED = 9002; public static final int ERROR_TOKEN_UNAUTHORIZED = 9002;
......
...@@ -9,18 +9,11 @@ public class RedisKey { ...@@ -9,18 +9,11 @@ public class RedisKey {
* 登录 key * 登录 key
*/ */
public static final String KEY_MENU_CACHE = "iot:base:MenuCacheKey:"; public static final String KEY_MENU_CACHE = "iot:base:MenuCacheKey:";
/**
* 设备心跳上报
*/
public static final String KEY_DEVICE_ONLINE_CACHE = "device:online:";
public static final String KEY_SITE_CACHE = "siteDict";
public static final String KEY_PLATFORM_CACHE = "platformDict"; /**
* 钉钉 访问token
public static final String KEY_PRODUCT_CACHE = "productDict"; */
public static final String KEY_DINGTALK_ACCESSTOKEN_CACHE = "dingtalk:token:";
public static final String KEY_TOKEN_API_CACHE = "token:api:";
} }
package com.mortals.xhx.module.check.dao; package com.mortals.xhx.module.check.dao;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import java.util.List; import java.util.List;
...@@ -10,5 +14,18 @@ import java.util.List; ...@@ -10,5 +14,18 @@ import java.util.List;
*/ */
public interface CheckAllRecordDao { public interface CheckAllRecordDao {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query); /**
* 获取全部绩效核查信息列表
* @param query
* @param pageInfo
* @return
*/
Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query, PageInfo pageInfo);
/**
* 绩效核查分数情况汇总
* @param query
* @return
*/
CheckAllScoreSummaryVo getScoreSummary(StaffCheckSummaryQuery query);
} }
package com.mortals.xhx.module.check.dao.ibatis; package com.mortals.xhx.module.check.dao.ibatis;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao; import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport; import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -30,8 +37,44 @@ public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements Check ...@@ -30,8 +37,44 @@ public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements Check
} }
@Override @Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery checkAllRecordQuery) { public Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery checkAllRecordQuery, PageInfo pageInfo) {
Result result = new Result();
List list = null;
if (pageInfo.isCountPage()) {
int count = this.getCount(checkAllRecordQuery);
if (count == 0) {
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery, rowBounds);
}
return this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery); pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList((List)list);
} else {
if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery, rowBounds);
}
pageInfo.setTotalResult(-1);
result.setPageInfo(pageInfo);
result.setList(list);
}
return result;
}
private int getCount(CheckAllRecordQuery checkAllRecordQuery) {
return (Integer)this.getSqlSession().selectOne(this.getSqlId("getListCount"), checkAllRecordQuery);
}
@Override
public CheckAllScoreSummaryVo getScoreSummary(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectOne(this.getSqlId("getScoreSummary"), query);
} }
} }
package com.mortals.xhx.module.check.model.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* 绩效分值统计
*/
@Data
public class CheckAllScoreSummaryVo {
/**初始扣分*/
private BigDecimal initScore;
/**核查扣分*/
private BigDecimal checkScore;
/**申诉分值*/
private BigDecimal appealScore;
/**累计扣分*/
private BigDecimal total;
}
...@@ -7,7 +7,8 @@ import lombok.Data; ...@@ -7,7 +7,8 @@ import lombok.Data;
*/ */
@Data @Data
public class StaffCheckSummaryQuery { public class StaffCheckSummaryQuery {
/** 汇总方式 1按年,2按月,3按天*/
private Integer summaryType;
/**员工ID*/ /**员工ID*/
private Long staffId; private Long staffId;
/** 开始 核查时间 */ /** 开始 核查时间 */
......
package com.mortals.xhx.module.check.service; package com.mortals.xhx.module.check.service;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import java.util.List; import java.util.List;
...@@ -10,5 +14,18 @@ import java.util.List; ...@@ -10,5 +14,18 @@ import java.util.List;
*/ */
public interface CheckAllRecordService { public interface CheckAllRecordService {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query); /**
* 获取全部绩效核查信息列表
* @param query
* @param pageInfo
* @return
*/
Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query, PageInfo pageInfo);
/**
* 绩效核查分数情况汇总
* @param query
* @return
*/
CheckAllScoreSummaryVo getScoreSummary(StaffCheckSummaryQuery query);
} }
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.SummaryTopTypeEnum;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao; import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.CheckAllRecordService; import com.mortals.xhx.module.check.service.CheckAllRecordService;
import com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -21,7 +28,7 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService { ...@@ -21,7 +28,7 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService {
private CheckAllRecordDao checkAllRecordDao; private CheckAllRecordDao checkAllRecordDao;
@Override @Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) { public Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query,PageInfo pageInfo) {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){ if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance(); Calendar calendar=Calendar.getInstance();
...@@ -32,6 +39,11 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService { ...@@ -32,6 +39,11 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService {
query.setCheckTimeStart(startTime); query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime); query.setCheckTimeEnd(endTime);
} }
return checkAllRecordDao.getAllCheckRecord(query); return checkAllRecordDao.getAllCheckRecord(query,pageInfo);
}
@Override
public CheckAllScoreSummaryVo getScoreSummary(StaffCheckSummaryQuery query) {
return checkAllRecordDao.getScoreSummary(query);
} }
} }
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.CheckStatusEnum; import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckComplainRecordDao; import com.mortals.xhx.module.check.dao.CheckComplainRecordDao;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity; import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.check.service.CheckComplainRecordService; import com.mortals.xhx.module.check.service.CheckComplainRecordService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery; import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -41,9 +53,20 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -41,9 +53,20 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
@Autowired @Autowired
private StaffPerformSummaryService staffPerformSummaryService; private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override @Override
protected void saveAfter(CheckComplainRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckComplainRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try{ try{
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery(); StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId()); query.setStaffId(entity.getStaffId());
...@@ -55,6 +78,32 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -55,6 +78,32 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
} }
} }
private void sendCheckDingTalk(CheckComplainRecordEntity entity) {
String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.评价投诉绩效.getDesc(), entity.getCategoryName(), entity.getRuleName());
//绩效核查通知
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
if (!ObjectUtils.isEmpty(staffCache)) {
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
CheckDingMsg checkDingMsg = new CheckDingMsg();
checkDingMsg.setUserIds(personRest.getData());
checkDingMsg.setDateTime(DateUtil.formatDateTime(entity.getComplainTime() == null ? new Date() : entity.getComplainTime()));
checkDingMsg.setRuleStr(ruleStr);
checkDingMsg.setPerformTypeStr(PerformTypeEnum.评价投诉绩效.getDesc());
checkDingMsg.setScore(entity.getScore().toString());
checkDingMsg.setSubAddType(entity.getSubAddType());
checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=complain", entity.getId()));
Rest<String> msgRest = messageService.sendDingTalkWorkMsg(checkDingMsg);
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
}
}
@Override @Override
public void examine(CheckComplainRecordEntity entity, Context context) throws AppException { public void examine(CheckComplainRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){ if(entity.getId()==null){
...@@ -69,6 +118,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -69,6 +118,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
entity.setUpdateTime(entity.getCheckTime()); entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理) entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity); dao.update(entity);
sendCheckDingTalk(entity);
try{ try{
CheckComplainRecordEntity temp = this.get(entity.getId()); CheckComplainRecordEntity temp = this.get(entity.getId());
if(temp!=null) { if(temp!=null) {
......
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.CheckStatusEnum; import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckEffectRecordDao; import com.mortals.xhx.module.check.dao.CheckEffectRecordDao;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity; import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.check.service.CheckEffectRecordService; import com.mortals.xhx.module.check.service.CheckEffectRecordService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery; import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -41,9 +53,20 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -41,9 +53,20 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
@Autowired @Autowired
private StaffPerformSummaryService staffPerformSummaryService; private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override @Override
protected void saveAfter(CheckEffectRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckEffectRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try{ try{
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery(); StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId()); query.setStaffId(entity.getStaffId());
...@@ -55,6 +78,32 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -55,6 +78,32 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
} }
} }
private void sendCheckDingTalk(CheckEffectRecordEntity entity) {
String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.效能绩效.getDesc(), entity.getCategoryName(), entity.getRuleName());
//绩效核查通知
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
if (!ObjectUtils.isEmpty(staffCache)) {
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
CheckDingMsg checkDingMsg = new CheckDingMsg();
checkDingMsg.setUserIds(personRest.getData());
checkDingMsg.setDateTime(DateUtil.formatDateTime(entity.getHappenTime() == null ? new Date() : entity.getHappenTime()));
checkDingMsg.setRuleStr(ruleStr);
checkDingMsg.setPerformTypeStr(PerformTypeEnum.办件绩效.getDesc());
checkDingMsg.setScore(entity.getScore().toString());
checkDingMsg.setSubAddType(entity.getSubAddType());
checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=effect", entity.getId()));
Rest<String> msgRest = messageService.sendDingTalkWorkMsg(checkDingMsg);
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
}
}
@Override @Override
public void examine(CheckEffectRecordEntity entity, Context context) throws AppException { public void examine(CheckEffectRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){ if(entity.getId()==null){
...@@ -69,6 +118,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -69,6 +118,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
entity.setUpdateTime(entity.getCheckTime()); entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理) entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity); dao.update(entity);
sendCheckDingTalk(entity);
try{ try{
CheckEffectRecordEntity temp = this.get(entity.getId()); CheckEffectRecordEntity temp = this.get(entity.getId());
if(temp!=null) { if(temp!=null) {
......
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.CheckStatusEnum; import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao; import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao;
import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity; import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.check.service.CheckGoworkRecordService; import com.mortals.xhx.module.check.service.CheckGoworkRecordService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery; import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -41,9 +53,20 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -41,9 +53,20 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
@Autowired @Autowired
private StaffPerformSummaryService staffPerformSummaryService; private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override @Override
protected void saveAfter(CheckGoworkRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckGoworkRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try{ try{
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery(); StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId()); query.setStaffId(entity.getStaffId());
...@@ -55,6 +78,30 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -55,6 +78,30 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
} }
} }
private void sendCheckDingTalk(CheckGoworkRecordEntity entity) {
String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.办件绩效.getDesc(), entity.getCategoryName(), entity.getRuleName());
//绩效核查通知
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
if (!ObjectUtils.isEmpty(staffCache)) {
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
CheckDingMsg checkDingMsg = new CheckDingMsg();
checkDingMsg.setUserIds(personRest.getData());
checkDingMsg.setDateTime(DateUtil.formatDateTime(entity.getGoworkTime() == null ? new Date() : entity.getGoworkTime()));
checkDingMsg.setRuleStr(ruleStr);
checkDingMsg.setPerformTypeStr(PerformTypeEnum.办件绩效.getDesc());
checkDingMsg.setScore(entity.getScore().toString());
checkDingMsg.setSubAddType(entity.getSubAddType());
checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=gowork", entity.getId()));
Rest<String> msgRest = messageService.sendDingTalkWorkMsg(checkDingMsg);
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
}
}
@Override @Override
public void examine(CheckGoworkRecordEntity entity, Context context) throws AppException { public void examine(CheckGoworkRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){ if(entity.getId()==null){
...@@ -69,6 +116,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -69,6 +116,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
entity.setUpdateTime(entity.getCheckTime()); entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理) entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity); dao.update(entity);
//发送钉钉通知信息
sendCheckDingTalk(entity);
try{ try{
CheckGoworkRecordEntity temp = this.get(entity.getId()); CheckGoworkRecordEntity temp = this.get(entity.getId());
if(temp!=null) { if(temp!=null) {
......
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.CheckStatusEnum; import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckReviewRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery; import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,6 +32,7 @@ import com.mortals.xhx.module.check.dao.CheckOtherRecordDao; ...@@ -20,6 +32,7 @@ import com.mortals.xhx.module.check.dao.CheckOtherRecordDao;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity; import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
import com.mortals.xhx.module.check.service.CheckOtherRecordService; import com.mortals.xhx.module.check.service.CheckOtherRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -28,12 +41,12 @@ import java.util.Date; ...@@ -28,12 +41,12 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* CheckOtherRecordService * CheckOtherRecordService
* 其它绩效核查信息 service实现 * 其它绩效核查信息 service实现
* *
* @author zxfei * @author zxfei
* @date 2023-07-11 * @date 2023-07-11
*/ */
@Service("checkOtherRecordService") @Service("checkOtherRecordService")
@Slf4j @Slf4j
public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOtherRecordDao, CheckOtherRecordEntity, Long> implements CheckOtherRecordService { public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOtherRecordDao, CheckOtherRecordEntity, Long> implements CheckOtherRecordService {
...@@ -41,25 +54,65 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -41,25 +54,65 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
@Autowired @Autowired
private StaffPerformSummaryService staffPerformSummaryService; private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override @Override
protected void saveAfter(CheckOtherRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckOtherRecordEntity entity, Context context) throws AppException {
try{
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery(); StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId()); query.setStaffId(entity.getStaffId());
query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime())); query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
query.setCheckTimeEnd(query.getCheckTimeStart()); query.setCheckTimeEnd(query.getCheckTimeStart());
summaryCheck(query); summaryCheck(query);
}catch (Exception e){ } catch (Exception e) {
log.error("汇总已审核的核查记录出错",e); log.error("汇总已审核的核查记录出错", e);
}
}
private void sendCheckDingTalk(CheckOtherRecordEntity entity) {
String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.其它绩效.getDesc(), entity.getCategoryName(), entity.getRuleName());
//绩效核查通知
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
if (!ObjectUtils.isEmpty(staffCache)) {
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
CheckDingMsg checkDingMsg = new CheckDingMsg();
checkDingMsg.setUserIds(personRest.getData());
checkDingMsg.setDateTime(DateUtil.formatDateTime(entity.getHappenTime() == null ? new Date() : entity.getHappenTime()));
checkDingMsg.setRuleStr(ruleStr);
checkDingMsg.setPerformTypeStr(PerformTypeEnum.评价差评绩效.getDesc());
checkDingMsg.setScore(entity.getScore().toString());
checkDingMsg.setSubAddType(entity.getSubAddType());
checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=other", entity.getId()));
Rest<String> msgRest = messageService.sendDingTalkWorkMsg(checkDingMsg);
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
} }
} }
@Override @Override
public void examine(CheckOtherRecordEntity entity, Context context) throws AppException { public void examine(CheckOtherRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){ if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空"); throw new AppException("核查记录ID不能为空");
} }
if (context != null && context.getUser()!=null) { if (context != null && context.getUser() != null) {
IUser user = context.getUser(); IUser user = context.getUser();
entity.setUpdateUserId(user.getId()); entity.setUpdateUserId(user.getId());
entity.setCheckPerson(user.getRealName()); entity.setCheckPerson(user.getRealName());
...@@ -68,23 +121,26 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -68,23 +121,26 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
entity.setUpdateTime(entity.getCheckTime()); entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理) entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity); dao.update(entity);
try{ //发送钉钉通知信息
sendCheckDingTalk(entity);
try {
CheckOtherRecordEntity temp = this.get(entity.getId()); CheckOtherRecordEntity temp = this.get(entity.getId());
if(temp!=null) { if (temp != null) {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery(); StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId()); query.setStaffId(temp.getStaffId());
summaryCheck(query); summaryCheck(query);
} }
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e); } catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
} }
} }
@Override @Override
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException { public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){ if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime()); String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
...@@ -93,27 +149,27 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -93,27 +149,27 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
query.setCheckTimeEnd(endTime); query.setCheckTimeEnd(endTime);
} }
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query); List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){ if (CollectionUtils.isNotEmpty(summaryVoList)) {
for(StaffCheckSummaryVo vo:summaryVoList){ for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
BeanUtils.copyProperties(vo,staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo)); BeanUtils.copyProperties(vo, staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
staffPerformSummaryEntity.setOtherScore(vo.getSumScore()); staffPerformSummaryEntity.setOtherScore(vo.getSumScore());
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery(); StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(vo.getStaffId()); summaryQuery.setStaffId(vo.getStaffId());
summaryQuery.setYear(vo.getYear()); summaryQuery.setYear(vo.getYear());
summaryQuery.setMonth(vo.getMonth()); summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery); StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if(temp!=null){ if (temp != null) {
if(temp.getReviewScore()==null){ if (temp.getReviewScore() == null) {
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0)); staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
} }
if(temp.getAttendScore()==null){ if (temp.getAttendScore() == null) {
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0)); staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
} }
if(temp.getGoworkScore()==null){ if (temp.getGoworkScore() == null) {
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
} }
if(temp.getEffectScore()==null){ if (temp.getEffectScore() == null) {
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
} }
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
...@@ -131,7 +187,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -131,7 +187,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
staffPerformSummaryEntity.setId(temp.getId()); staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date()); staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity); staffPerformSummaryService.update(staffPerformSummaryEntity);
}else { } else {
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0)); staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0)); staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
......
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.CheckStatusEnum; import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum; import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Link; import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Link;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Msg; import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Msg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq; import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
...@@ -55,6 +59,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -55,6 +59,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
private IDingPersonService dingPersonService; private IDingPersonService dingPersonService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired
private MessageService messageService;
@Override @Override
...@@ -70,44 +76,38 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -70,44 +76,38 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
} }
//发送钉钉通知信息 //发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) { if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
//绩效核查通知 sendCheckDingTalk(entity);
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString()); }
if (!ObjectUtils.isEmpty(staffCache)) {
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
WorkMsgReq workMsgReq = new WorkMsgReq();
Msg msg = new Msg();
msg.setMsgtype("link");
Link link = new Link();
link.setPicUrl("测试图片链接");
link.setMessageUrl("测试消息链接");
link.setText("测试文本");
link.setTitle("测试标题");
msg.setLink(link);
workMsgReq.setUseridList(personRest.getMsg()); }
Rest<String> sendWorkRest = dingPersonService.sendWorkMsg(workMsgReq);
if (YesNoEnum.YES.getValue() == sendWorkRest.getCode()) {
String requestId = sendWorkRest.getData();
} else { private void sendCheckDingTalk(CheckReviewRecordEntity entity) {
log.error("发送工作消息失败,msg:{}", sendWorkRest.getMsg()); String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.评价差评绩效.getDesc(), entity.getCategoryName(), entity.getRuleName());
}
} else { //绩效核查通知
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg()); StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
} if (!ObjectUtils.isEmpty(staffCache)) {
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
CheckDingMsg checkDingMsg = new CheckDingMsg();
checkDingMsg.setUserIds(personRest.getData());
checkDingMsg.setDateTime(DateUtil.formatDateTime(entity.getReviewTime() == null ? new Date() : entity.getReviewTime()));
checkDingMsg.setRuleStr(ruleStr);
checkDingMsg.setPerformTypeStr(PerformTypeEnum.评价差评绩效.getDesc());
checkDingMsg.setScore(entity.getScore().toString());
checkDingMsg.setSubAddType(entity.getSubAddType());
checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=review", entity.getId()));
Rest<String> msgRest = messageService.sendDingTalkWorkMsg(checkDingMsg);
} else { } else {
log.error("员工未找到,staffId:{}", entity.getStaffId()); log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
} }
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
} }
} }
@Override @Override
public void examine(CheckReviewRecordEntity entity, Context context) throws AppException { public void examine(CheckReviewRecordEntity entity, Context context) throws AppException {
if (entity.getId() == null) { if (entity.getId() == null) {
...@@ -122,6 +122,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -122,6 +122,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
entity.setUpdateTime(entity.getCheckTime()); entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理) entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity); dao.update(entity);
//发送钉钉通知信息
sendCheckDingTalk(entity);
try { try {
CheckReviewRecordEntity temp = this.get(entity.getId()); CheckReviewRecordEntity temp = this.get(entity.getId());
if (temp != null) { if (temp != null) {
......
package com.mortals.xhx.module.check.web; package com.mortals.xhx.module.check.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.web.BaseJsonBodyController; import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.common.code.CheckStatusEnum; import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.code.SubAddTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.CheckAllRecordService; import com.mortals.xhx.module.check.service.CheckAllRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -18,6 +22,12 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -18,6 +22,12 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -45,14 +55,14 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -45,14 +55,14 @@ public class CheckAllRecordController extends BaseJsonBodyController {
Rest<Object> ret = new Rest(); Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "查询所类型绩效核查信息"; String busiDesc = "查询所类型绩效核查信息";
int code=1; int code=1;
try { try {
PageInfo pageInfo = new PageInfo(-1);
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query,pageInfo);
List<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query); model.put("data", result.getList());
model.put("data", result);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) { if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
...@@ -70,4 +80,130 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -70,4 +80,130 @@ public class CheckAllRecordController extends BaseJsonBodyController {
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString()); ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret; return ret;
} }
/**
* 绩效核查分数情况汇总
* @param query
* @return
*/
@PostMapping({"score/summary"})
@UnAuth
public Rest<Object> getScoreSummary(@RequestBody StaffCheckSummaryQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询绩效核查分数情况汇总";
int code=1;
try {
StaffCheckSummaryQuery lastQuery = new StaffCheckSummaryQuery();
Date now = new Date();
LocalDate localDate = LocalDate.now();
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy")+"-01-01");
query.setCheckTimeEnd(DateUtils.getCurrDateTime("yyyy")+"-12-31");
lastQuery.setCheckTimeStart((localDate.getYear()-1)+"-01-01");
lastQuery.setCheckTimeEnd((localDate.getYear()-1)+"-12-31");
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy-MM")+"-01");
query.setCheckTimeEnd(DateUtils.getDateTime(DateUtils.getMonthLastDate(now,"yyyy-MM-dd"),"yyyy-MM-dd"));
lastQuery.setCheckTimeStart(DateUtils.getDateTime(DateUtils.getLastMonthFirstDate(now,"yyyy-MM-dd"),"yyyy-MM-dd"));
lastQuery.setCheckTimeEnd(DateUtils.getDateTime(DateUtils.getLastMonthLastDate(now,"yyyy-MM-dd"),"yyyy-MM-dd"));
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrStrDate());
query.setCheckTimeEnd(DateUtils.getCurrStrDate());
lastQuery.setCheckTimeStart(DateUtils.getDateTime(DateUtils.addDate(now,-1),"yyyy-MM-dd"));
lastQuery.setCheckTimeEnd(DateUtils.getDateTime(DateUtils.addDate(now,-1),"yyyy-MM-dd"));
}
model.put("initScore",0);
model.put("checkScore",0);
model.put("checkPercent","0%");
model.put("appealPercent","0%");
model.put("appealScore",0);
model.put("total",0);
model.put("huanbi","暂无环比");
model.put("tongbi","暂无同比");
CheckAllScoreSummaryVo current = checkAllRecordService.getScoreSummary(query);
NumberFormat numberFormat = NumberFormat.getPercentInstance();
numberFormat.setMaximumFractionDigits(2);
if(current!=null){
model.put("initScore",current.getInitScore());
model.put("checkScore",current.getCheckScore());
model.put("appealScore",current.getAppealScore());
model.put("total",current.getTotal());
BigDecimal checkPercent = current.getCheckScore().divide(current.getInitScore(),6,BigDecimal.ROUND_HALF_UP);
model.put("checkPercent",numberFormat.format(checkPercent));
BigDecimal appealPercent = current.getAppealScore().divide(current.getInitScore(),6,BigDecimal.ROUND_HALF_UP);
model.put("appealPercent",numberFormat.format(appealPercent));
}
CheckAllScoreSummaryVo last = checkAllRecordService.getScoreSummary(lastQuery);
if(last!=null){
BigDecimal huanbi = current.getTotal().subtract(last.getTotal());
huanbi = huanbi.divide(last.getTotal(),6,BigDecimal.ROUND_HALF_UP);
model.put("huanbi",numberFormat.format(huanbi));
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
if(last!=null){
model.put("tongbi",model.get("huanbi"));
}
}else {
String yyyy = query.getCheckTimeStart().substring(0,4);
int lastyear = DataUtil.converStr2Int(yyyy,0);
lastyear--;
if(query.getCheckTimeStart().substring(4).equals("-02-29")){
lastQuery.setCheckTimeStart(lastyear+"-02-28");
}else {
lastQuery.setCheckTimeStart(lastyear+query.getCheckTimeStart().substring(4));
}
if(query.getCheckTimeEnd().substring(4).equals("-02-29")){
lastQuery.setCheckTimeEnd(lastyear+"-02-28");
}else {
lastQuery.setCheckTimeEnd(lastyear+query.getCheckTimeEnd().substring(4));
}
CheckAllScoreSummaryVo tb = checkAllRecordService.getScoreSummary(lastQuery);
if(tb!=null){
BigDecimal tongbi = current.getTotal().subtract(tb.getTotal());
tongbi = tongbi.divide(last.getTotal(),6,BigDecimal.ROUND_HALF_UP);
model.put("tongbi",numberFormat.format(tongbi));
}
}
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
public static void main(String[] args){
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setCheckTimeStart("2023-02-01");
query.setCheckTimeEnd("2023-02-29");
StaffCheckSummaryQuery lastQuery = new StaffCheckSummaryQuery();
String yyyy = query.getCheckTimeStart().substring(0,4);
String mmdd = query.getCheckTimeStart().substring(4);
int lastyear = DataUtil.converStr2Int(yyyy,0);
lastyear--;
if(query.getCheckTimeStart().substring(4).equals("-02-29")){
lastQuery.setCheckTimeStart(lastyear+"-02-28");
}else {
lastQuery.setCheckTimeStart(lastyear+query.getCheckTimeStart().substring(4));
}
if(query.getCheckTimeEnd().substring(4).equals("-02-29")){
lastQuery.setCheckTimeEnd(lastyear+"-02-28");
}else {
lastQuery.setCheckTimeEnd(lastyear+query.getCheckTimeEnd().substring(4));
}
System.out.println(JSONObject.toJSON(lastQuery).toString());
}
} }
...@@ -7,9 +7,12 @@ import com.dingtalk.api.response.OapiGettokenResponse; ...@@ -7,9 +7,12 @@ import com.dingtalk.api.response.OapiGettokenResponse;
import com.hikvision.artemis.sdk.config.ArtemisConfig; import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.ApiRespPdu; import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -32,7 +35,7 @@ public abstract class AbstractDingTalkService implements IDingPersonService { ...@@ -32,7 +35,7 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
protected Long agentId; protected Long agentId;
/** /**
* AgentId * domain
*/ */
@Value("${dingtalk.domain:https://oapi.dingtalk.com}") @Value("${dingtalk.domain:https://oapi.dingtalk.com}")
protected String domain; protected String domain;
...@@ -49,43 +52,38 @@ public abstract class AbstractDingTalkService implements IDingPersonService { ...@@ -49,43 +52,38 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
@Value("${dingtalk.AppSecret:''}") @Value("${dingtalk.AppSecret:''}")
protected String appSecret; protected String appSecret;
/** @Autowired
* getToken private ICacheService cacheService;
*/
@Value("${dingtalk.gettoken:https://oapi.dingtalk.com/gettoken}")
protected String getTokneUrl;
protected String dingToken;
protected DingTalkClient getDingTalkClient(String path) { protected DingTalkClient getDingTalkClient(String path) {
DingTalkClient client = new DefaultDingTalkClient(domain + path); DingTalkClient client = new DefaultDingTalkClient(domain + path);
return client; return client;
} }
protected void checkToken() {
if (ObjectUtils.isEmpty(dingToken)) {
dingToken = getToken().getData();
}
}
@Override @Override
public Rest<String> getToken() { public String getToken() {
try { try {
DingTalkClient client = getDingTalkClient("/gettoken"); String dingToken = cacheService.get(RedisKey.KEY_DINGTALK_ACCESSTOKEN_CACHE);
OapiGettokenRequest req = new OapiGettokenRequest(); if (ObjectUtils.isEmpty(dingToken)) {
req.setAppkey(appKey); DingTalkClient client = getDingTalkClient("/gettoken");
req.setAppsecret(appSecret); OapiGettokenRequest req = new OapiGettokenRequest();
OapiGettokenResponse rsp = client.execute(req); req.setAppkey(appKey);
log.info("OapiGettokenResponse:{}",rsp.getBody()); req.setAppsecret(appSecret);
if (rsp.getErrcode() == 0) { OapiGettokenResponse rsp = client.execute(req);
return Rest.ok(rsp.getAccessToken()); log.info("OapiGettokenResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) {
cacheService.setex(RedisKey.KEY_DINGTALK_ACCESSTOKEN_CACHE, rsp.getAccessToken(), 4800);
return rsp.getAccessToken();
} else {
throw new AppException(String.format("code:{},errorMsg:{}", rsp.getErrcode(), rsp.getErrmsg()));
}
} else { } else {
throw new AppException(rsp.getMessage()); return dingToken;
} }
} catch (Exception e) { } catch (Exception e) {
log.error("获取TOKEN异常", e); log.error("获取TOKEN异常", e);
return Rest.fail(e.getMessage()); throw new AppException(e.getMessage());
} }
} }
......
package com.mortals.xhx.module.dingding;
import lombok.Data;
@Data
public class CheckDingMsg {
private String userIds;
private String dateTime;
private String ruleStr;
private String performTypeStr;
private String score;
private Integer subAddType;
private String path; //请求路径相对地址
private Integer appealResult;
private String appealDesc;
}
...@@ -3,5 +3,5 @@ package com.mortals.xhx.module.dingding; ...@@ -3,5 +3,5 @@ package com.mortals.xhx.module.dingding;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
public interface IDingTalkService { public interface IDingTalkService {
Rest<String> getToken(); String getToken();
} }
...@@ -25,6 +25,14 @@ public interface IDingPersonService extends IDingTalkService { ...@@ -25,6 +25,14 @@ public interface IDingPersonService extends IDingTalkService {
*/ */
Rest<String> getPersonByMobile(String mobile); Rest<String> getPersonByMobile(String mobile);
/**
* 根据code获取钉钉用户id
*
* @param code
* @return
*/
Rest<String> getPersonByCode(String code);
/** /**
* 发送工作消息 * 发送工作消息
......
...@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON; ...@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON;
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;
import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest;
import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response;
import com.dingtalk.api.response.OapiV2UserGetbymobileResponse; import com.dingtalk.api.response.OapiV2UserGetbymobileResponse;
import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.dingding.AbstractDingTalkService; import com.mortals.xhx.module.dingding.AbstractDingTalkService;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq; import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
...@@ -24,12 +26,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -24,12 +26,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
public Rest<String> getPersonByMobile(String mobile) { public Rest<String> getPersonByMobile(String mobile) {
try { try {
DingTalkClient client = getDingTalkClient("/topapi/v2/user/getbymobile"); DingTalkClient client = getDingTalkClient("/topapi/v2/user/getbymobile");
checkToken();
OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest(); OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
req.setMobile(mobile); req.setMobile(mobile);
log.info("getPersonByMobile:{}",mobile); log.info("getPersonByMobile:{}", mobile);
OapiV2UserGetbymobileResponse rsp = client.execute(req, dingToken); OapiV2UserGetbymobileResponse rsp = client.execute(req, getToken());
log.info("OapiV2UserGetbymobileResponse:{}",rsp.getBody()); log.info("OapiV2UserGetbymobileResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) { if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getResult().getUserid()); return Rest.ok(rsp.getResult().getUserid());
} else { } else {
...@@ -41,18 +42,38 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -41,18 +42,38 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
} }
} }
@Override
public Rest<String> getPersonByCode(String code) {
try {
DingTalkClient client = getDingTalkClient("/topapi/v2/user/getuserinfo");
OapiV2UserGetuserinfoRequest req = new OapiV2UserGetuserinfoRequest();
req.setCode(code);
log.info("getPersonByCode:{}", code);
OapiV2UserGetuserinfoResponse rsp = client.execute(req, getToken());
log.info("OapiV2UserGetuserinfoResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getResult().getUserid());
} else {
return Rest.fail(String.format("code:%s,msg:%s", rsp.getErrcode(), rsp.getErrmsg()));
}
} catch (ApiException e) {
log.info("根据code查询人员异常", e);
return Rest.fail(e.getMessage());
}
}
@Override @Override
public Rest<String> sendWorkMsg(WorkMsgReq workMsgReq) { public Rest<String> sendWorkMsg(WorkMsgReq workMsgReq) {
try { try {
DingTalkClient client = getDingTalkClient("/topapi/message/corpconversation/asyncsend_v2"); DingTalkClient client = getDingTalkClient("/topapi/message/corpconversation/asyncsend_v2");
checkToken();
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request(); OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
req.setAgentId(agentId); req.setAgentId(agentId);
req.setUseridList(workMsgReq.getUseridList()); req.setUseridList(workMsgReq.getUseridList());
req.setMsg(JSON.toJSONString(workMsgReq.getMsg())); req.setMsg(JSON.toJSONString(workMsgReq.getMsg()));
log.info("sendWorkMsg:{}", JSON.toJSONString(workMsgReq)); log.info("sendWorkMsg:{}", JSON.toJSONString(workMsgReq));
OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, dingToken); OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, getToken());
log.info("OapiMessageResponse:{}",rsp.getBody()); log.info("OapiMessageResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) { if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getMsg(), rsp.getRequestId()); return Rest.ok(rsp.getMsg(), rsp.getRequestId());
} else { } else {
......
package com.mortals.xhx.module.hik.face.model.req.face;
import lombok.Data;
@Data
public class FaceInfo{
private String sex;
private String name;
private String certificateNum;
private String certificateType;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.face;
import lombok.Data;
import java.util.List;
@Data
public class FaceListReq{
private String faceGroupIndexCode;
private int pageNo;
private String sex;
private String name;
private int pageSize;
private String certificateNum;
private String certificateType;
private List<String> indexCodes;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.face;
import lombok.Data;
@Data
public class FacePic{
//地址
private String faceUrl;
//base64
private String faceBinaryData;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.face;
import lombok.Data;
import java.util.List;
@Data
public class FaceReq {
private String faceGroupIndexCode;
private FaceInfo faceInfo;
private FacePic facePic;
//人脸集合id
private List<String> indexCodes;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.face;
import lombok.Data;
import java.util.List;
/**
* 人脸资源
*/
@Data
public class ResRecognReq{
private String name;
private String recognitionResourceType;
private List<String> indexCodes;
}
\ No newline at end of file
This diff is collapsed.
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