Commit c118e33d authored by “yiyousong”'s avatar “yiyousong”
parents d8a78bc6 7a7e9e0a
......@@ -194,10 +194,24 @@ export default {
// 格式化单元格数据
formatter(row, column, val) {
const content = formatter(this.tableData, column, val);
return content ? (
<el-tag type={"info"} size="mini">
{content}
</el-tag>
return content == 0 ? (
<p>{content}</p>
) : content ? (
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
);
......
......@@ -46,7 +46,7 @@ const formatterAmount = (row, column) => {
const formatterDate = (row, column) => {
const property = column.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 Y = date.getFullYear() + '-';
let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
......
......@@ -12,7 +12,7 @@
:empty-text="emptytxt ? emptytxt : emptyText"
border
style="width: 100%"
height="520"
height="570"
>
<el-table-column
v-for="column in columns"
......@@ -112,13 +112,21 @@ export default {
return !this.loading && !this.tableData.length ? "暂无数据" : "加载中...";
},
},
mounted() {
},
mounted() {},
watch: {
tableData(val) {
val.length == 0 || val.length > 0
? (this.emptytxt = "暂无数据")
: (this.emptytxt = "加载中...");
// if (val.length > 0) {
// val.forEach((v) => {
// for (let key in v) {
// v[key] ? "" : (v[key] = "--");
// }
// });
// console.log(val);
// }
},
},
methods: {},
......
......@@ -49,18 +49,23 @@
>
</el-row>
<el-row>
<el-col :span="12"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col
<el-col :span="12">
{{ form.subAddType == 1 ? "加分方式:" : "扣分方式:" }}
{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
>
<el-col :span="12"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
<el-col :span="12">
{{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
>
</el-row>
<el-row>
<el-col :span="12"
>扣分人员:{{
form.deductPerson ? form.deductPerson : "--"
}}</el-col
<el-col :span="12">
{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
{{ form.deductPerson ? form.deductPerson : "--" }}</el-col
>
<el-col :span="12"
>图片凭证:{{
......@@ -135,11 +140,16 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item label="加分/扣除分值:">
<el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<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 v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -368,7 +378,8 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/attend/record/examine'}//重写核查地址
subMethodObj: {},
urls: { saveUrl: "/check/attend/record/examine" }, //重写核查地址
};
},
computed: {},
......@@ -384,7 +395,9 @@ export default {
return (
<el-image
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"
></el-image>
);
......@@ -409,38 +422,48 @@ export default {
});
},
/** 编辑 */
edit(row) {
async edit(row) {
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/attend/record/edit";
// this.getData();
this.$get("/check/attend/record/info", { id: row.id }).then((res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/attend/record/info", { id: row.id }).then(
(res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
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";
row.view == "核查"
? (this.title = "考勤绩效记录核查")
......@@ -455,36 +478,39 @@ export default {
this.title = "新增考勤绩效记录核查信息";
},
/** 查看*/
view(row) {
async view(row) {
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/attend/record/view";
// this.getData();
this.$get("/check/attend/record/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/attend/record/info", { id: row.id }).then(
(res) => {
if (res.code == 1) {
this.form = res.data;
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.title = "考勤绩效记录核查信息详细";
},
......
......@@ -218,17 +218,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
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: "处理状态",
......
......@@ -65,18 +65,23 @@
>
</el-row>
<el-row>
<el-col :span="12"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col
>
<el-col :span="12"
>扣分人员:{{
form.deductPerson ? form.deductPerson : "--"
<el-col :span="12">
{{ form.subAddType == 1 ? "加分方式:" : "扣分方式:" }}
{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
>
<el-col :span="12">
{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
{{ form.deductPerson ? form.deductPerson : "--" }}</el-col
>
</el-row>
<el-row>
<el-col :span="12"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
<el-col :span="12">
{{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
>
<el-col :span="12"
>图片凭证:{{
......@@ -151,11 +156,16 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item label="加分/扣除分值:">
<el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<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 v-else>{{form.subAddType==1?'+':'-'}} {{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -285,7 +295,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -293,13 +303,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -404,7 +414,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
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 {
return (
<el-image
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"
></el-image>
);
......@@ -442,38 +454,50 @@ export default {
});
},
/** 编辑 */
edit(row) {
async edit(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/complain/record/edit";
// this.getData();
this.$get("/check/complain/record/info", { id: row.id }).then((res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/complain/record/info", { id: row.id }).then(
(res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
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";
row.view == "核查"
? (this.title = "评价绩效投诉核查")
......@@ -488,37 +512,42 @@ export default {
this.title = "新增评价绩效投诉核查信息";
},
/** 查看*/
view(row) {
async view(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/complain/record/view";
// this.getData();
this.$get("/check/complain/record/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/complain/record/info", { id: row.id }).then(
(res) => {
if (res.code == 1) {
this.form = res.data;
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.title = "评价绩效投诉核查信息详细";
},
......
......@@ -225,17 +225,33 @@ export default {
{ label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
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: "处理状态",
......
......@@ -56,13 +56,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -41,19 +41,22 @@
<el-col :span="12"
>报警时间:{{ form.alarmTime ? form.alarmTime : "--" }}</el-col
>
<el-col :span="12"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col
<el-col :span="12">
{{ form.subAddType == 1 ? "加分方式:" : "扣分方式:" }}
{{
form.subMethod ? dict.subMethod[form.subMethod] : "--"
}}</el-col
>
</el-row>
<el-row>
<el-col :span="12"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
<el-col :span="12">
{{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
>
<el-col :span="12">
扣分人员:{{
form.deductPerson ? form.deductPerson : "--"
}}</el-col
{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
{{ form.deductPerson ? form.deductPerson : "--" }}</el-col
>
</el-row>
<el-row>
......@@ -130,11 +133,16 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item label="加分/扣除分值:">
<el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<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 v-else>{{form.subAddType==1?'+':'-'}} {{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -258,7 +266,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -266,13 +274,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -377,7 +385,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
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 {
});
},
/** 编辑 */
edit(row) {
async edit(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/effect/record/edit";
// this.getData();
this.$get("/check/effect/record/info", { id: row.id }).then((res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/effect/record/info", { id: row.id }).then(
(res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
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";
row.view == "核查"
? (this.title = "效能绩效核查")
......@@ -463,37 +485,44 @@ export default {
this.title = "新增效能绩效核查信息";
},
/** 查看*/
view(row) {
async view(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/effect/record/view";
// this.getData();
this.$get("/check/effect/record/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/effect/record/info", { id: row.id }).then(
(res) => {
if (res.code == 1) {
this.form = res.data;
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.title = "效能绩效核查信息详细";
},
......
......@@ -225,17 +225,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
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: "处理状态",
......
......@@ -50,13 +50,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -44,18 +44,21 @@
>办件时间:{{ form.goworkTime ? form.goworkTime : "--" }}</el-col
>
<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-col :span="12"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
<el-col :span="12">
{{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}</el-col
>
<el-col :span="12">
扣分人员:{{
form.deductPerson ? form.deductPerson : "--"
}}</el-col
{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
{{ form.deductPerson ? form.deductPerson : "--" }}</el-col
>
</el-row>
<el-row>
......@@ -132,11 +135,16 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item label="加分/扣除分值:">
<el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<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 v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -253,7 +261,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -261,13 +269,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -372,7 +380,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
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 {
return (
<el-image
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"
></el-image>
);
......@@ -410,38 +420,50 @@ export default {
});
},
/** 编辑 */
edit(row) {
async edit(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/gowork/record/edit";
// this.getData();
this.$get("/check/gowork/record/info", { id: row.id }).then((res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
} 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))
: "";
await this.$get("/check/gowork/record/info", { id: row.id }).then(
(res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
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 == "goworkTime"
? (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 == "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";
row.view == "核查"
? (this.title = "办件绩效核查")
......@@ -456,37 +478,41 @@ export default {
this.title = "新增办件绩效核查信息";
},
/** 查看*/
view(row) {
async view(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/gowork/record/view";
// this.getData();
this.$get("/check/gowork/record/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
} 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))
: "";
await this.$get("/check/gowork/record/info", { id: row.id }).then(
(res) => {
if (res.code == 1) {
this.form = res.data;
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 == "goworkTime"
? (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 == "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.title = "办件绩效核查信息详细";
},
......
......@@ -213,17 +213,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
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: "处理状态",
......
......@@ -47,13 +47,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -41,15 +41,20 @@
<el-row>
<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">
扣分时间:{{ form.deductTime ? form.deductTime : "--" }}
{{ form.subAddType == 1 ? "加分时间:" : "扣分时间:" }}
{{ form.deductTime ? form.deductTime : "--" }}
</el-col>
</el-row>
<el-row>
<el-col :span="24">
扣分人员:{{ form.deductPerson ? form.deductPerson : "--" }}
{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:" }}
{{ form.deductPerson ? form.deductPerson : "--" }}
</el-col>
</el-row>
<el-row>
......@@ -126,11 +131,16 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item label="加分/扣除分值:">
<el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<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 v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -248,7 +258,7 @@
placeholder="请输入评分标准"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -256,13 +266,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -367,7 +377,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
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 {
});
},
/** 编辑 */
edit(row) {
async edit(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/other/record/edit";
// this.getData();
this.$get("/check/other/record/info", { id: row.id }).then((res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/other/record/info", { id: row.id }).then(
(res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
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";
row.view == "核查"
? (this.title = "其它绩效核查")
......@@ -453,37 +477,44 @@ export default {
this.title = "新增其它绩效核查信息";
},
/** 查看*/
view(row) {
async view(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/other/record/view";
// this.getData();
this.$get("/check/other/record/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
} 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))
: "";
await this.$get("/check/other/record/info", { id: row.id }).then(
(res) => {
if (res.code == 1) {
this.form = res.data;
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;
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
});
);
this.pageInfo.type = "view";
this.title = "其它绩效核查信息详细";
},
......
......@@ -221,17 +221,33 @@ export default {
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
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: "处理状态",
......
......@@ -47,13 +47,13 @@
<el-descriptions-item label="评分标准" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleDesc}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -45,17 +45,20 @@
>评价时间:{{ form.reviewTime ? form.reviewTime : "--" }}</el-col
>
<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-col :span="12"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
>{{ form.subAddType == 1 ? "加分时间:" : "扣分时间:"
}}{{ form.deductTime ? form.deductTime : "--" }}</el-col
>
<el-col :span="12"
>扣分人员:{{
form.deductPerson ? form.deductPerson : "--"
}}</el-col
>{{ form.subAddType == 1 ? "加分人员:" : "扣分人员:"
}}{{ form.deductPerson ? form.deductPerson : "--" }}</el-col
>
</el-row>
......@@ -133,11 +136,16 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item label="加分/扣除分值:">
<el-form-item
:label="form.subAddType == 1 ? '加分分值:' : '扣分分值:'"
>
<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 v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -256,7 +264,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -264,13 +272,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -374,7 +382,7 @@ export default {
form: {},
kaoqinCateArr: [],
kaoqinArr: [],
urls:{saveUrl:'/check/review/record/examine'}//重写核查地址
urls: { saveUrl: "/check/review/record/examine" }, //重写核查地址
};
},
......@@ -412,38 +420,50 @@ export default {
});
},
/** 编辑 */
edit(row) {
async edit(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/review/record/edit";
// this.getData();
this.$get("/check/review/record/info", { id: row.id }).then((res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
} else {
this.form = row;
await this.$get("/check/review/record/info", { id: row.id }).then(
(res) => {
console.log(res.data);
if (res.code == 1) {
this.form = res.data;
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";
row.view == "核查"
? (this.title = "评价差评绩效核查")
......@@ -458,37 +478,42 @@ export default {
this.title = "新增评价差评绩效核查信息";
},
/** 查看*/
view(row) {
async view(row) {
this.form = row;
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "check/review/record/view";
// this.getData();
this.$get("/check/review/record/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
} 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))
: "";
await this.$get("/check/review/record/info", { id: row.id }).then(
(res) => {
if (res.code == 1) {
this.form = res.data;
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.view = "查看";
console.log(this.form);
this.open = true;
}
this.form.view = "查看";
console.log(this.form);
this.open = true;
});
);
this.pageInfo.type = "view";
this.title = "评价差评绩效核查信息详细";
},
......
......@@ -222,17 +222,33 @@ export default {
{ label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
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: "处理状态",
......
......@@ -47,13 +47,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -55,15 +55,15 @@
}}</el-col
>
<el-col :span="5"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col
>加分/扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col
>
</el-row>
<el-row>
<el-col :span="8"
>扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
>加分/扣分时间:{{ form.deductTime ? form.deductTime : "--" }}</el-col
>
<el-col :span="8"
>扣分人员:{{
>加分/扣分人员:{{
form.deductPerson ? form.deductPerson : "--"
}}</el-col
>
......@@ -255,12 +255,12 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
:enumData="dict.subMethod"
placeholder="请选择扣分方式"
placeholder="请选择加分/扣分方式"
/>
<Field
label="增减类型"
......
......@@ -78,11 +78,11 @@
{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},
......
......@@ -42,7 +42,7 @@
<!-- <bar-charts
:title="'部门扣分排名TOP10'"
:id="'koufen_10'"
:legendName="'部门扣分分值'"
:legendName="'部门分值'"
:styleObj="{ width: '100%', height: '300px' }"
/> -->
<drawer-show ref="drawerform" @ok="getData" />
......@@ -174,15 +174,15 @@ export default {
{ label: "违规类型", prop: "irregularOtherType" },
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "attendanceDate",
formatter: this.formatterDate,
},
{ label: "扣分分值", prop: "score", formatter: this.formatter },
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "申诉时间",
......
......@@ -41,7 +41,7 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</el-descriptions-item>
<el-descriptions-item label="增减类型" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -174,7 +174,7 @@
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="扣分分值:">
<el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p>
</el-form-item>
</el-col>
......@@ -274,7 +274,7 @@
placeholder="请输入异常处理结果"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -282,13 +282,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -429,8 +429,8 @@ export default {
this.form.score = arr && arr[0].score;
this.form.checkStatus == 1 ? (this.form.checkStatus = 2) : "";
},
cateChange() {
this.$post("/perform/rules/list", {
async cateChange() {
await this.$post("/perform/rules/list", {
page: 1,
size: -1,
categoryId: this.form.categoryId,
......@@ -482,7 +482,13 @@ export default {
this.form.processStatus = 2;
this.form.view = "核查";
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.pageInfo.type = "edit";
......
......@@ -226,17 +226,17 @@ export default {
{ label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "扣分人员", prop: "deductPerson" },
{ label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter },
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "处理状态",
......@@ -251,9 +251,6 @@ export default {
return row.processStatus == 1 ? (
<table-buttons
noAdd
noView
noEdit
reCheck
row={row}
onEdit={this.toEdit}
onView={this.toView}
......
......@@ -198,12 +198,12 @@ export default {
{ 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",
formatter: this.formatterDate,
},
......
......@@ -50,13 +50,13 @@
<el-descriptions-item label="异常处理结果" label-class-name="labelClass" content-class-name="contentClass">
{{form.errorResult}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="增减类型" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -225,7 +225,7 @@
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="扣分分值:">
<el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p>
</el-form-item>
</el-col>
......@@ -327,7 +327,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -335,13 +335,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -544,6 +544,13 @@ export default {
this.form.processStatus = 2;
this.form.view = "核查";
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.pageInfo.type = "edit";
......
......@@ -194,12 +194,12 @@ export default {
{ 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",
formatter: this.formatterDate,
},
......
......@@ -232,17 +232,17 @@ export default {
{ label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "扣分人员", prop: "deductPerson" },
{ label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter },
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "处理状态",
......@@ -257,9 +257,6 @@ export default {
return row.processStatus == 1 ? (
<table-buttons
noAdd
noView
noEdit
reCheck
row={row}
onEdit={this.toEdit}
onView={this.toView}
......
......@@ -53,13 +53,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -199,7 +199,7 @@
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="扣分分值:">
<el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p>
</el-form-item>
</el-col>
......@@ -296,7 +296,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -304,13 +304,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -518,6 +518,13 @@ export default {
this.form.processStatus = 2;
this.form.view = "核查";
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;
});
......
......@@ -232,17 +232,17 @@ export default {
},
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "扣分人员", prop: "deductPerson" },
{ label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter },
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "处理状态",
......@@ -257,9 +257,6 @@ export default {
return row.processStatus == 1 ? (
<table-buttons
noAdd
noView
noEdit
reCheck
row={row}
onEdit={this.toEdit}
onView={this.toView}
......
......@@ -206,12 +206,12 @@ export default {
{ 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",
formatter: this.formatterDate,
},
......
......@@ -47,13 +47,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -177,7 +177,7 @@
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="扣分分值:">
<el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p>
</el-form-item>
</el-col>
......@@ -267,7 +267,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -275,13 +275,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -486,7 +486,13 @@ export default {
this.form.processStatus = 2;
this.form.view = "核查";
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.pageInfo.type = "edit";
......
......@@ -219,17 +219,17 @@ export default {
},
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "扣分人员", prop: "deductPerson" },
{ label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter },
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "处理状态",
......@@ -244,9 +244,6 @@ export default {
return row.processStatus == 1 ? (
<table-buttons
noAdd
noView
noEdit
reCheck
row={row}
onEdit={this.toEdit}
onView={this.toView}
......
......@@ -186,12 +186,12 @@ export default {
{ 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",
formatter: this.formatterDate,
},
......
......@@ -44,13 +44,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -137,7 +137,7 @@
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="扣分分值:">
<el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p>
</el-form-item>
</el-col>
......@@ -228,7 +228,7 @@
placeholder="请输入评分标准"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -236,13 +236,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -448,7 +448,13 @@ export default {
this.form.snapPath ? "" : (this.form.snapPath = "");
this.form.view = "核查";
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.pageInfo.type = "edit";
......
......@@ -228,17 +228,17 @@ export default {
},
{ label: "绩效规则", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "扣分人员", prop: "deductPerson" },
{ label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter },
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "处理状态",
......@@ -253,9 +253,6 @@ export default {
return row.processStatus == 1 ? (
<table-buttons
noAdd
noView
noEdit
reCheck
row={row}
onEdit={this.toEdit}
onView={this.toView}
......
......@@ -200,12 +200,12 @@ export default {
{ 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",
formatter: this.formatterDate,
},
......
......@@ -44,13 +44,13 @@
<el-descriptions-item label="评分标准" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleDesc}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -190,7 +190,7 @@
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="扣分分值:">
<el-form-item label="加分/扣分分值:">
<p>{{ form.score }}</p>
</el-form-item>
</el-col>
......@@ -282,7 +282,7 @@
placeholder="请输入规则名称"
/>
<Field
label="扣分方式"
label="加分/扣分方式"
prop="subMethod"
v-model="form.subMethod"
type="select"
......@@ -290,13 +290,13 @@
placeholder="请选择扣分方式"
/>
<Field
label="扣分人员"
label="加分/扣分人员"
prop="deductPerson"
v-model="form.deductPerson"
placeholder="请输入扣分人员"
/>
<Field
label="扣分时间"
label="加分/扣分时间"
prop="deductTime"
v-model="form.deductTime"
type="date"
......@@ -501,7 +501,13 @@ export default {
this.form.processStatus = 2;
this.form.view = "核查";
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.pageInfo.type = "edit";
......
......@@ -230,17 +230,17 @@ export default {
{ label: "绩效规则", prop: "ruleNme" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "扣分人员", prop: "deductPerson" },
{ label: "加分/扣分人员", prop: "deductPerson" },
{ label: "扣分分值", prop: "score", formatter: this.formatter },
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "处理状态",
......@@ -255,9 +255,6 @@ export default {
return row.processStatus == 1 ? (
<table-buttons
noAdd
noView
noEdit
reCheck
row={row}
onEdit={this.toEdit}
onView={this.toView}
......
......@@ -194,10 +194,10 @@ export default {
{ label: "规则名称", prop: "ruleName" },
{ label: "扣分方式", prop: "subMethod", formatter: this.formatter },
{ label: "加分/扣分方式", prop: "subMethod", formatter: this.formatter },
{
label: "扣分时间",
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
......
......@@ -44,13 +44,13 @@
<el-descriptions-item label="规则名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.ruleName}}
</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) }}
</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}}
</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)}}
</el-descriptions-item>
<el-descriptions-item label="扣分或增加分值" label-class-name="labelClass" content-class-name="contentClass">
......
......@@ -116,6 +116,8 @@ export default {
{ label: "分类", prop: "categoryId", formatter: this.formatter },
{ label: "考核名称", prop: "name" },
{ label: "考核编码", prop: "ruleCode" },
{ label: "评分标准", prop: "content" },
{ label: "增减类型", prop: "subAddType", formatter: this.formatter },
......
......@@ -70,7 +70,7 @@
:title="'部门扣分排名TOP10'"
:id="'koufen_10'"
:parameter="depStatObj.totalSubScore"
:legendName="'部门扣分分值'"
:legendName="'部门分值'"
:styleObj="{ width: '100%', height: '300px' }"
/>
</div>
......
......@@ -29,11 +29,18 @@
<profiles.log.level>info</profiles.log.level>
<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.apiId>k6BVS1PEbyzcJAE4</profiles.sms.apiId>
<profiles.hik.host>8.136.255.30:8001</profiles.hik.host>
<profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey>
<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>
<skipUi>false</skipUi>
</properties>
......@@ -59,6 +66,12 @@
<profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey>
<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>
<skipUi>false</skipUi>
</properties>
......@@ -81,6 +94,12 @@
<profiles.hik.protocol>https://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey>
<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>
<skipUi>false</skipUi>
</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 {
*/
private Long customerId;
/**
* 钉钉userId
*/
private String dingUserId;
public String getDingUserId() {
return dingUserId;
}
public void setDingUserId(String dingUserId) {
this.dingUserId = dingUserId;
}
public UserEntity(){}
/**
......
......@@ -162,6 +162,14 @@ public class UserQuery extends UserEntity {
/** 最后一次登录地址排除列表 */
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) */
private List<UserQuery> orConditionList;
......@@ -1606,4 +1614,23 @@ public class UserQuery extends UserEntity {
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>
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Autowired
private PerformRulesCategoryService categoryService;
/**
......@@ -219,6 +221,11 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setDeductTime(new Date());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformAttendRecordEntity save = attendRecordService.save(recordEntity);
return save.newEntity();
......@@ -249,6 +256,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setDeductTime(new Date());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformReviewRecordEntity save = reviewRecordService.save(recordEntity);
return save.newEntity();
......@@ -278,6 +287,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformComplainRecordEntity save = complainRecordService.save(recordEntity);
return save.newEntity();
......@@ -307,6 +318,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformGoworkRecordEntity save = performGoworkRecordService.save(recordEntity);
return save.newEntity();
......@@ -336,6 +349,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformEffectRecordEntity save = effectRecordService.save(recordEntity);
return save.newEntity();
}
......@@ -366,6 +381,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformRulesCategoryEntity categoryEntity = categoryService.get(rule.getCategoryId());
recordEntity.setCategoryName(categoryEntity == null ? "" : categoryEntity.getName());
PerformOtherRecordEntity save = otherRecordService.save(recordEntity);
return save.newEntity();
}
......
......@@ -114,7 +114,7 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
//未设置时间的情况,默认为当月
appealReq.setApperalStartDate(DateUtil.beginOfMonth(new Date()).toDateStr());
appealReq.setAppealEndDate(DateUtil.today());
}else{
} else {
//格式化到指定日期的当月
appealReq.setApperalStartDate(DateUtil.beginOfMonth(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> {
entity.setStaffId(context.getUser().getCustomerId());
entity.setCreateUserId(context.getUser().getId());
entity.setCheckRecordId(req.getId());
entity.setAppealTime(new Date());
PerformAttendAppealEntity saveEntity = appealService.save(entity, context);
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;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.h5.req.FeedbackReq;
import com.mortals.xhx.busiz.h5.req.FeedbackSaveReq;
import com.mortals.xhx.common.code.YesNoEnum;
......@@ -75,17 +76,19 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
feedbackReq.setFeedBackEndDate(DateUtil.endOfMonth(DateUtil.parse(feedbackReq.getFeedBackStartDate()).toJdkDate()).toDateStr());
}
//PageInfo pageInfo = buildPageInfo(feedbackReq);
//todo
PageInfo pageAllInfo = new PageInfo();
PageInfo pageAllInfo = buildPageInfo(feedbackReq);
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());
FeedbackQuery feedbackQuery = new FeedbackQuery();
feedbackQuery.setIdList(feedbackIdList);
List<FeedbackEntity> feedbackEntities = feedbackService.find(feedbackQuery);
model.put(KEY_RESULT_DATA, feedbackEntities);
pageAllInfo.setTotalResult(feedbackEntities.size());
Result<FeedbackEntity> result = feedbackService.find(feedbackQuery, pageAllInfo, null);
model.put(PAGEINFO_KEY, result.getPageInfo());
model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo());
} else {
//未反馈
//查询我的反馈 但是还未回答的
......@@ -96,17 +99,16 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
feedbackStaffQuery.setStaffId(context.getUser().getCustomerId());
List<Long> unfinFeedbackList = feedbackStaffService.find(feedbackStaffQuery).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList());
model.put(KEY_RESULT_DATA, unfinFeedbackList);
pageAllInfo.setTotalResult(unfinFeedbackList.size());
}
FeedbackQuery feedbackQuery = new FeedbackQuery();
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);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
......
package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.h5.req.InspectSaveReq;
import com.mortals.xhx.busiz.h5.req.PerformReq;
import com.mortals.xhx.busiz.h5.rsp.InspectStatInfo;
......@@ -30,10 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.*;
......@@ -86,7 +85,6 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
private CheckOtherRecordService checkOtherRecordService;
/**
* 个人巡查效统计
*/
......@@ -103,8 +101,8 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
try {
//todo
InspectStatInfo performStatInfo = new InspectStatInfo();
performStatInfo.setTotalTimes(12);
performStatInfo.setTodayTimes(4);
performStatInfo.setTotalTimes(RandomUtil.randomInt(40,50));
performStatInfo.setTodayTimes(RandomUtil.randomInt(1,5));
rest.setData(performStatInfo);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
......@@ -142,60 +140,49 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
query.setCheckTimeStart(performReq.getPerformStartDate());
query.setCheckTimeEnd(performReq.getPerformEndDate());
query.setCreateUserId(context.getUser().getCustomerId());
PageInfo pageInfo = buildPageInfo(performReq);
if (PerformTypeEnum.全部.getValue().equals(performReq.getPerformType())) {
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query, pageInfo);
List<CheckAllRecordVo> allCheckRecord = result.getList();
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
}
if(!ObjectUtils.isEmpty(performReq.getProcessStatus())){
if (!ObjectUtils.isEmpty(performReq.getProcessStatus())) {
query.setCheckStatus(performReq.getProcessStatus());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query, pageInfo);
List<CheckAllRecordVo> allCheckRecord = result.getList();
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
}
if(!ObjectUtils.isEmpty(performReq.getScoreType())){
if (!ObjectUtils.isEmpty(performReq.getScoreType())) {
query.setSubAddType(performReq.getScoreType());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query, pageInfo);
List<CheckAllRecordVo> allCheckRecord = result.getList();
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
}
// model.put(KEY_RESULT_DATA, result.getList());
// model.put(PAGEINFO_KEY, result.getPageInfo());
// parsePageInfo(model, result.getPageInfo());
rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
......@@ -215,7 +202,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(req));
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
// req.setStaffId(context.getUser().getCustomerId());
// req.setStaffId(context.getUser().getCustomerId());
try {
//根据状态 查询 当前是否已经存在正在进行的申诉
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
......@@ -224,22 +211,22 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
if (ObjectUtils.isEmpty(req.getPerformType())) throw new AppException("绩效类型不能为空!");
if (PerformTypeEnum.考勤绩效.getValue().equals(req.getPerformType())) {
boolean bool = attend(req,context);
boolean bool = attend(req, context);
if (bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.评价差评绩效.getValue().equals(req.getPerformType())) {
boolean bool = review(req,context);
boolean bool = review(req, context);
if (bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.评价投诉绩效.getValue().equals(req.getPerformType())) {
boolean bool = complain(req,context);
boolean bool = complain(req, context);
if (bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.办件绩效.getValue().equals(req.getPerformType())) {
boolean bool = gowork(req,context);
boolean bool = gowork(req, context);
if (bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.效能绩效.getValue().equals(req.getPerformType())) {
boolean bool = effect(req,context);
boolean bool = effect(req, context);
if (bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.其它绩效.getValue().equals(req.getPerformType())) {
boolean bool = other(req,context);
boolean bool = other(req, context);
if (bool) throw new AppException(busiDesc + "失败!");
} else {
throw new AppException("不支持当前绩效类型");
......@@ -254,10 +241,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
}
private boolean attend(InspectSaveReq req,Context context) throws AppException {
private boolean attend(InspectSaveReq req, Context context) throws AppException {
//考勤保存
PerformRulesEntity rule = getRule(req.getRuleId().toString());
StaffEntity staffEntity = getStaff(req.getStaffId().toString());
......@@ -271,6 +255,9 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
recordEntity.setDeptId(staffEntity.getDeptId());
recordEntity.setDeptName(staffEntity.getDeptName());
recordEntity.setDeductTime(new Date());
recordEntity.setDeductPerson(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
......@@ -288,7 +275,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
}
private boolean review(InspectSaveReq req,Context context) throws AppException {
private boolean review(InspectSaveReq req, Context context) throws AppException {
//评价保存
StaffEntity staffEntity = getStaff(req.getStaffId().toString());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
......@@ -297,9 +284,12 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
// recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setDeductTime(new Date());
recordEntity.setDeductPerson(staffEntity.getName());
recordEntity.setDeptId(staffEntity.getDeptId());
recordEntity.setDeptName(staffEntity.getDeptName());
recordEntity.setSubAddType(rule.getSubAddType());
......@@ -316,7 +306,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
}
private boolean complain(InspectSaveReq req,Context context) throws AppException {
private boolean complain(InspectSaveReq req, Context context) throws AppException {
//投诉保存
StaffEntity staffEntity = getStaff(req.getStaffId().toString());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
......@@ -325,12 +315,15 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
// recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setDeptId(staffEntity.getDeptId());
recordEntity.setDeptName(staffEntity.getDeptName());
recordEntity.setDeductTime(new Date());
recordEntity.setDeductPerson(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
......@@ -347,7 +340,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
}
private boolean gowork(InspectSaveReq req,Context context) throws AppException {
private boolean gowork(InspectSaveReq req, Context context) throws AppException {
//办件保存
StaffEntity staffEntity = getStaff(req.getStaffId().toString());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
......@@ -356,9 +349,12 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
// recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setDeductTime(new Date());
recordEntity.setDeductPerson(staffEntity.getName());
recordEntity.setDeptId(staffEntity.getDeptId());
recordEntity.setDeptName(staffEntity.getDeptName());
recordEntity.setSubAddType(rule.getSubAddType());
......@@ -375,7 +371,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
}
private boolean effect(InspectSaveReq req,Context context) throws AppException {
private boolean effect(InspectSaveReq req, Context context) throws AppException {
//效能保存
StaffEntity staffEntity = getStaff(req.getStaffId().toString());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
......@@ -387,6 +383,10 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
//recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setDeductTime(new Date());
recordEntity.setDeductPerson(staffEntity.getName());
recordEntity.setDeptId(staffEntity.getDeptId());
recordEntity.setDeptName(staffEntity.getDeptName());
recordEntity.setSubAddType(rule.getSubAddType());
......@@ -402,7 +402,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
return save.newEntity();
}
private boolean other(InspectSaveReq req,Context context) throws AppException {
private boolean other(InspectSaveReq req, Context context) throws AppException {
//其它保存
StaffEntity staffEntity = getStaff(req.getStaffId().toString());
......@@ -415,6 +415,9 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
//recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setDeductTime(new Date());
recordEntity.setDeductPerson(staffEntity.getName());
recordEntity.setDeptId(staffEntity.getDeptId());
recordEntity.setDeptName(staffEntity.getDeptName());
recordEntity.setSubAddType(rule.getSubAddType());
......
......@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -88,10 +89,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
try {
//todo
PerformStatInfo performStatInfo = new PerformStatInfo();
performStatInfo.setTotalScore(new BigDecimal("15.9"));
performStatInfo.setTotalTimes(12);
performStatInfo.setTodayScore(new BigDecimal("12.6"));
performStatInfo.setTodayTimes(4);
performStatInfo.setTotalScore(RandomUtil.randomBigDecimal(new BigDecimal("15"),new BigDecimal("45")));
performStatInfo.setTotalTimes(RandomUtil.randomInt(10,40));
performStatInfo.setTodayScore(RandomUtil.randomBigDecimal(new BigDecimal("2"),new BigDecimal("10")));
performStatInfo.setTodayTimes(RandomUtil.randomInt(10));
rest.setData(performStatInfo);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
......@@ -133,19 +134,15 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
query.setCheckTimeEnd(performReq.getPerformEndDate());
query.setStaffId(context.getUser().getCustomerId());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query, pageInfo);
List<CheckAllRecordVo> allCheckRecord = result.getList();List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
} else if (PerformTypeEnum.考勤绩效.getValue().equals(performReq.getPerformType())) {
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 {
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 String ERROR_TOKEN_EXPIRED_CONTENT = "用户登录过期,请重新登录!";
public static final int ERROR_TOKEN_UNAUTHORIZED = 9002;
......
......@@ -9,18 +9,11 @@ public class RedisKey {
* 登录 key
*/
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";
public static final String KEY_PRODUCT_CACHE = "productDict";
/**
* 钉钉 访问token
*/
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;
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.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import java.util.List;
......@@ -10,5 +14,18 @@ import java.util.List;
*/
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;
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.model.CheckAllRecordQuery;
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.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -30,8 +37,44 @@ public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements Check
}
@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;
*/
@Data
public class StaffCheckSummaryQuery {
/** 汇总方式 1按年,2按月,3按天*/
private Integer summaryType;
/**员工ID*/
private Long staffId;
/** 开始 核查时间 */
......
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.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import java.util.List;
......@@ -10,5 +14,18 @@ import java.util.List;
*/
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;
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.xhx.common.code.SummaryTopTypeEnum;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
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.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.CheckAllRecordService;
import com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -21,7 +28,7 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService {
private CheckAllRecordDao checkAllRecordDao;
@Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) {
public Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query,PageInfo pageInfo) {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
......@@ -32,6 +39,11 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService {
query.setCheckTimeStart(startTime);
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;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
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.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.module.check.dao.CheckAttendRecordDao;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.check.service.CheckAttendRecordService;
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.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -29,38 +41,73 @@ import java.util.Date;
import java.util.List;
/**
* CheckAttendRecordService
* 考勤绩效记录核查信息 service实现
*
* @author zxfei
* @date 2023-07-10
*/
* CheckAttendRecordService
* 考勤绩效记录核查信息 service实现
*
* @author zxfei
* @date 2023-07-10
*/
@Service("checkAttendRecordService")
@Slf4j
public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckAttendRecordDao, CheckAttendRecordEntity, Long> implements CheckAttendRecordService {
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override
protected void saveAfter(CheckAttendRecordEntity entity, Context context) throws AppException {
try{
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
query.setCheckTimeEnd(query.getCheckTimeStart());
summaryCheck(query);
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
}
private void sendCheckDingTalk(CheckAttendRecordEntity 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.getErrorTime() == null ? new Date() : entity.getErrorTime()));
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
public void examine(CheckAttendRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
if (context != null && context.getUser()!=null) {
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setCheckPerson(user.getRealName());
......@@ -69,23 +116,24 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
try{
sendCheckDingTalk(entity);
try {
CheckAttendRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
if (temp != null) {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
}
@Override
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
......@@ -94,27 +142,27 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
query.setCheckTimeEnd(endTime);
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){
for(StaffCheckSummaryVo vo:summaryVoList){
if (CollectionUtils.isNotEmpty(summaryVoList)) {
for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
BeanUtils.copyProperties(vo,staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
BeanUtils.copyProperties(vo, staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
staffPerformSummaryEntity.setAttendScore(vo.getSumScore());
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(vo.getStaffId());
summaryQuery.setYear(vo.getYear());
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if(temp!=null){
if(temp.getReviewScore()==null){
if (temp != null) {
if (temp.getReviewScore() == null) {
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
}
if(temp.getOtherScore()==null){
if (temp.getOtherScore() == null) {
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
}
if(temp.getGoworkScore()==null){
if (temp.getGoworkScore() == null) {
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
}
if(temp.getEffectScore()==null){
if (temp.getEffectScore() == null) {
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0);
......@@ -129,7 +177,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
}else {
} else {
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
......
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.model.Context;
import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
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.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.module.check.dao.CheckComplainRecordDao;
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.StaffCheckSummaryVo;
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.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -41,9 +53,20 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override
protected void saveAfter(CheckComplainRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try{
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
......@@ -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
public void examine(CheckComplainRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){
......@@ -69,6 +118,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
sendCheckDingTalk(entity);
try{
CheckComplainRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
......
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.model.Context;
import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
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.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.module.check.dao.CheckEffectRecordDao;
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.StaffCheckSummaryVo;
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.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -41,9 +53,20 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override
protected void saveAfter(CheckEffectRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try{
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
......@@ -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
public void examine(CheckEffectRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){
......@@ -69,6 +118,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
sendCheckDingTalk(entity);
try{
CheckEffectRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
......
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.model.Context;
import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
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.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.module.check.dao.CheckGoworkRecordDao;
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.StaffCheckSummaryVo;
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.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -41,9 +53,20 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override
protected void saveAfter(CheckGoworkRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try{
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
......@@ -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
public void examine(CheckGoworkRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){
......@@ -69,6 +116,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
//发送钉钉通知信息
sendCheckDingTalk(entity);
try{
CheckGoworkRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
......
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.util.DateUtils;
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.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.module.check.model.CheckReviewRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
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.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -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.service.CheckOtherRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -28,12 +41,12 @@ import java.util.Date;
import java.util.List;
/**
* CheckOtherRecordService
* 其它绩效核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
* CheckOtherRecordService
* 其它绩效核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
@Service("checkOtherRecordService")
@Slf4j
public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOtherRecordDao, CheckOtherRecordEntity, Long> implements CheckOtherRecordService {
......@@ -41,25 +54,65 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override
protected void saveAfter(CheckOtherRecordEntity entity, Context context) throws AppException {
try{
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
query.setCheckTimeEnd(query.getCheckTimeStart());
summaryCheck(query);
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception 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
public void examine(CheckOtherRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
if (context != null && context.getUser()!=null) {
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setCheckPerson(user.getRealName());
......@@ -68,23 +121,26 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
try{
//发送钉钉通知信息
sendCheckDingTalk(entity);
try {
CheckOtherRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
if (temp != null) {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
}
@Override
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
......@@ -93,27 +149,27 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
query.setCheckTimeEnd(endTime);
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){
for(StaffCheckSummaryVo vo:summaryVoList){
if (CollectionUtils.isNotEmpty(summaryVoList)) {
for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
BeanUtils.copyProperties(vo,staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
BeanUtils.copyProperties(vo, staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
staffPerformSummaryEntity.setOtherScore(vo.getSumScore());
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(vo.getStaffId());
summaryQuery.setYear(vo.getYear());
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if(temp!=null){
if(temp.getReviewScore()==null){
if (temp != null) {
if (temp.getReviewScore() == null) {
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
}
if(temp.getAttendScore()==null){
if (temp.getAttendScore() == null) {
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
}
if(temp.getGoworkScore()==null){
if (temp.getGoworkScore() == null) {
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
}
if(temp.getEffectScore()==null){
if (temp.getEffectScore() == null) {
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0);
......@@ -131,7 +187,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
}else {
} else {
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
......
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.util.DateUtils;
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.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.module.check.model.vo.StaffCheckSummaryQuery;
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.Msg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
......@@ -55,6 +59,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Override
......@@ -70,44 +76,38 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
}
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
//绩效核查通知
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);
sendCheckDingTalk(entity);
}
workMsgReq.setUseridList(personRest.getMsg());
Rest<String> sendWorkRest = dingPersonService.sendWorkMsg(workMsgReq);
if (YesNoEnum.YES.getValue() == sendWorkRest.getCode()) {
String requestId = sendWorkRest.getData();
}
} else {
log.error("发送工作消息失败,msg:{}", sendWorkRest.getMsg());
}
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
private void sendCheckDingTalk(CheckReviewRecordEntity 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.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 {
log.error("员工未找到,staffId:{}", entity.getStaffId());
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
}
}
@Override
public void examine(CheckReviewRecordEntity entity, Context context) throws AppException {
if (entity.getId() == null) {
......@@ -122,6 +122,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
//发送钉钉通知信息
sendCheckDingTalk(entity);
try {
CheckReviewRecordEntity temp = this.get(entity.getId());
if (temp != null) {
......
package com.mortals.xhx.module.check.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
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.xhx.common.code.CheckStatusEnum;
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.common.code.*;
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.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.CheckAllRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
......@@ -18,6 +22,12 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.List;
import java.util.Map;
......@@ -45,14 +55,14 @@ public class CheckAllRecordController extends BaseJsonBodyController {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询所类型绩效核查信息";
String busiDesc = "查询所类型绩效核查信息";
int code=1;
try {
PageInfo pageInfo = new PageInfo(-1);
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query,pageInfo);
List<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query);
model.put("data", result);
model.put("data", result.getList());
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
......@@ -70,4 +80,130 @@ public class CheckAllRecordController extends BaseJsonBodyController {
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
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;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.mortals.framework.common.Rest;
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.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.util.ObjectUtils;
......@@ -32,7 +35,7 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
protected Long agentId;
/**
* AgentId
* domain
*/
@Value("${dingtalk.domain:https://oapi.dingtalk.com}")
protected String domain;
......@@ -49,43 +52,38 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
@Value("${dingtalk.AppSecret:''}")
protected String appSecret;
/**
* getToken
*/
@Value("${dingtalk.gettoken:https://oapi.dingtalk.com/gettoken}")
protected String getTokneUrl;
protected String dingToken;
@Autowired
private ICacheService cacheService;
protected DingTalkClient getDingTalkClient(String path) {
DingTalkClient client = new DefaultDingTalkClient(domain + path);
return client;
}
protected void checkToken() {
if (ObjectUtils.isEmpty(dingToken)) {
dingToken = getToken().getData();
}
}
@Override
public Rest<String> getToken() {
public String getToken() {
try {
DingTalkClient client = getDingTalkClient("/gettoken");
OapiGettokenRequest req = new OapiGettokenRequest();
req.setAppkey(appKey);
req.setAppsecret(appSecret);
OapiGettokenResponse rsp = client.execute(req);
log.info("OapiGettokenResponse:{}",rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getAccessToken());
String dingToken = cacheService.get(RedisKey.KEY_DINGTALK_ACCESSTOKEN_CACHE);
if (ObjectUtils.isEmpty(dingToken)) {
DingTalkClient client = getDingTalkClient("/gettoken");
OapiGettokenRequest req = new OapiGettokenRequest();
req.setAppkey(appKey);
req.setAppsecret(appSecret);
OapiGettokenResponse rsp = client.execute(req);
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 {
throw new AppException(rsp.getMessage());
return dingToken;
}
} catch (Exception 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;
import com.mortals.framework.common.Rest;
public interface IDingTalkService {
Rest<String> getToken();
String getToken();
}
......@@ -25,6 +25,14 @@ public interface IDingPersonService extends IDingTalkService {
*/
Rest<String> getPersonByMobile(String mobile);
/**
* 根据code获取钉钉用户id
*
* @param code
* @return
*/
Rest<String> getPersonByCode(String code);
/**
* 发送工作消息
......
......@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
import com.dingtalk.api.request.OapiV2UserGetbymobileRequest;
import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest;
import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response;
import com.dingtalk.api.response.OapiV2UserGetbymobileResponse;
import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.dingding.AbstractDingTalkService;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
......@@ -24,12 +26,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
public Rest<String> getPersonByMobile(String mobile) {
try {
DingTalkClient client = getDingTalkClient("/topapi/v2/user/getbymobile");
checkToken();
OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
req.setMobile(mobile);
log.info("getPersonByMobile:{}",mobile);
OapiV2UserGetbymobileResponse rsp = client.execute(req, dingToken);
log.info("OapiV2UserGetbymobileResponse:{}",rsp.getBody());
log.info("getPersonByMobile:{}", mobile);
OapiV2UserGetbymobileResponse rsp = client.execute(req, getToken());
log.info("OapiV2UserGetbymobileResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getResult().getUserid());
} else {
......@@ -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
public Rest<String> sendWorkMsg(WorkMsgReq workMsgReq) {
try {
DingTalkClient client = getDingTalkClient("/topapi/message/corpconversation/asyncsend_v2");
checkToken();
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
req.setAgentId(agentId);
req.setUseridList(workMsgReq.getUseridList());
req.setMsg(JSON.toJSONString(workMsgReq.getMsg()));
log.info("sendWorkMsg:{}", JSON.toJSONString(workMsgReq));
OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, dingToken);
log.info("OapiMessageResponse:{}",rsp.getBody());
OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, getToken());
log.info("OapiMessageResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getMsg(), rsp.getRequestId());
} 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
package com.mortals.xhx.module.hik.face.model.req.group;
import lombok.Data;
import java.util.List;
@Data
public class FaceGroupReq {
private String name;
private String description;
//分组标识
private List<String> indexCodes;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.img;
import lombok.Data;
@Data
public class ImgReq {
private String svrIndexCode;
private String picUri;
private String url;
}
package com.mortals.xhx.module.hik.face.model.req.plan;
import lombok.Data;
import java.util.List;
@Data
public class PlanRecognListReq {
private List<String> faceGroupIndexCodes;
private String name;
private String description;
private String status;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.plan;
import lombok.Data;
import java.util.List;
@Data
public class PlanRecognReq {
private String indexCode;
private List<String> cameraIndexCodes;
private List<String> faceGroupIndexCodes;
private String name;
private String description;
private List<String> recognitionResourceIndexCodes;
private String recognitionResourceType;
private int threshold;
private List<TimeBlockListItem> timeBlockList;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.plan;
import lombok.Data;
import java.util.List;
@Data
public class TimeBlockListItem{
private String dayOfWeek;
private List<TimeRangeItem> timeRange;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.plan;
import lombok.Data;
@Data
public class TimeRangeItem{
private String startTime;
private String endTime;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.resource;
import lombok.Data;
import java.util.List;
@Data
public class ResourceReq{
private String name;
private String recognitionResourceType;
private List<String> indexCodes;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.rsp.face;
import com.mortals.xhx.module.hik.face.model.req.face.FaceInfo;
import com.mortals.xhx.module.hik.face.model.req.face.FacePic;
import lombok.Data;
@Data
public class FaceDataInfo {
private String faceGroupIndexCode;
private String indexCode;
private FaceInfo faceInfo;
private FacePic facePic;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.rsp.face;
import lombok.Data;
@Data
public class ResRecognDataInfo{
private String name;
private String indexCode;
private String recognitionResourceType;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.rsp.group;
import lombok.Data;
@Data
public class FaceGroupDataInfo {
private String name;
private String indexCode;
private String description;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.rsp.plan;
import lombok.Data;
import java.util.List;
@Data
public class PlanRecognInfo {
private List<String> cameraIndexCodes;
private boolean available;
private String indexCode;
private String description;
private int threshold;
private String recognitionPlanType;
private int usingTime;
private List<String> faceGroupIndexCodes;
private String name;
private List<String> recognitionResourceIndexCodes;
private String recognitionResourceType;
private String startTime;
private String status;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.rsp.resource;
import lombok.Data;
@Data
public class ResourceDataInfo{
private String name;
private String indexCode;
private String recognitionResourceType;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.service;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.face.model.req.face.FaceListReq;
import com.mortals.xhx.module.hik.face.model.req.face.FaceReq;
import com.mortals.xhx.module.hik.face.model.req.face.ResRecognReq;
import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.model.req.resource.ResourceReq;
import com.mortals.xhx.module.hik.face.model.rsp.face.FaceDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.face.ResRecognDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.resource.ResourceDataInfo;
import java.io.InputStream;
import java.util.List;
/**
* 海康门禁接口对接类
*
* @author:
* @date: 2023/4/12 17:47
*/
public interface IHikFaceService {
/**
* 查询人脸
*
* @param faceListReq
* @return
*/
Rest<List<FaceDataInfo>> findFaceList(FaceListReq faceListReq);
/**
* 添加单个人脸
*
* @param faceReq
* @return
*/
Rest<FaceDataInfo> faceSingleAdd(FaceReq faceReq);
/**
* 修改单个人脸
*
* @param faceReq
* @return
*/
Rest<Boolean> faceSingleUpdate(FaceReq faceReq);
/**
* 删除单个人脸
*
* @param faceReq
* @return
*/
Rest<Boolean> faceSingleDel(FaceReq faceReq);
/**
* 查询人脸分组
*
* @param faceGroupReq
* @return
*/
Rest<List<FaceGroupDataInfo>> findFaceGroupList(FaceGroupReq faceGroupReq);
/**
* 添加人脸分组
*
* @param faceGroupReq
* @return
*/
Rest<FaceGroupDataInfo> faceGroupSingleAdd(FaceGroupReq faceGroupReq);
/**
* 删除人脸分组
*
* @param faceGroupReq
* @return
*/
Rest<Boolean> faceGroupSingleDel(FaceGroupReq faceGroupReq);
/**
* 查询人脸资源
*
* @param recognReq
* @return
*/
Rest<List<ResRecognDataInfo>> findResRecognList(ResRecognReq recognReq);
/**
* 下载抓拍人脸图片
*
* @param imgReq
* @return
*/
Rest<String> downloadPicture(ImgReq imgReq);
/**
* 获取识别资源
*
* @param recognReq
* @return
*/
Rest<List<ResourceDataInfo>> getResourceRecognition(ResourceReq recognReq);
InputStream callPostImgs(ImgReq imgReq) throws Exception;
}
package com.mortals.xhx.module.hik.face.service;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognListReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq;
import com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo;
import java.util.List;
/**
* 海康门禁接口对接类
*
* @author:
* @date: 2023/4/12 17:47
*/
public interface IHikPlanService {
/**
* 查询重点识别计划
*
* @param planRecognListReq
* @return
*/
Rest<List<PlanRecognInfo>> findPlanRecognBlackList(PlanRecognListReq planRecognListReq);
/**
* 添加人员监视计划
*
* @param planRecognReq
* @return
*/
Rest<String> planRecognBlackAdd(PlanRecognReq planRecognReq);
/**
* 人员监视计划删除
*
* @param planRecognReq
* @return
*/
Rest<Boolean> planRecognBlackDel(PlanRecognReq planRecognReq);
/**
* 查询陌生人识别计划
*
* @param planRecognListReq
* @return
*/
Rest<List<PlanRecognInfo>> findPlanRecognWhiteList(PlanRecognListReq planRecognListReq);
/**
* 添加陌生人监视计划
*
* @param planRecognReq
* @return
*/
Rest<String> planRecognWhiteAdd(PlanRecognReq planRecognReq);
/**
* 更新陌生人监视计划
*
* @param planRecognReq
* @return
*/
Rest<Boolean> planRecognWhiteUpdate(PlanRecognReq planRecognReq);
/**
* 陌生人人员监视计划删除
*
* @param planRecognReq
* @return
*/
Rest<Boolean> planRecognWhiteDel(PlanRecognReq planRecognReq);
/**
* 陌生人监视计划重新下发
*
* @param planRecognReq
* @return
*/
Rest<Boolean> planRecognWhiteReStart(PlanRecognReq planRecognReq);
}
package com.mortals.xhx.module.hik.face.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.AbstractHikService;
import com.mortals.xhx.module.hik.HikApiRest;
import com.mortals.xhx.module.hik.face.model.req.face.FaceListReq;
import com.mortals.xhx.module.hik.face.model.req.face.FaceReq;
import com.mortals.xhx.module.hik.face.model.req.face.ResRecognReq;
import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.model.req.resource.ResourceReq;
import com.mortals.xhx.module.hik.face.model.rsp.face.FaceDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.face.ResRecognDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.resource.ResourceDataInfo;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.springframework.stereotype.Service;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.hikvision.artemis.sdk.util.HttpUtil.wrapClient;
/**
* 海康人员接口类
*
* @author: zxfei
* @date: 2023/4/12 17:51
*/
@Service("hikFaceService")
@Slf4j
public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceService {
@Override
public Rest<List<FaceDataInfo>> findFaceList(FaceListReq faceListReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/face";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(faceListReq), null, null, "application/json");
HikApiRest<List<FaceDataInfo>> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<List<FaceDataInfo>>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("face single error resp=>", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<FaceDataInfo> faceSingleAdd(FaceReq faceReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/face/single/addition";
path.put(protocol, getCamsApi);
try {
//log.info("face single add req=>{}", JSON.toJSONString(faceReq));
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(faceReq), null, null, "application/json");
log.info("face single add resp=>{}", respJson);
HikApiRest<FaceDataInfo> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<FaceDataInfo>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<Boolean> faceSingleUpdate(FaceReq faceReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/face/single/update";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(faceReq), null, null, "application/json");
HikApiRest<Boolean> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<Boolean>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("face single error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<Boolean> faceSingleDel(FaceReq faceReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/face/deletion";
path.put(protocol, getCamsApi);
try {
log.info("face single delete req=>{}", JSON.toJSONString(faceReq));
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(faceReq), null, null, "application/json");
HikApiRest<Boolean> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<Boolean>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("face single delete error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<List<FaceGroupDataInfo>> findFaceGroupList(FaceGroupReq faceGroupReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/group";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(faceGroupReq), null, null, "application/json");
HikApiRest<List<FaceGroupDataInfo>> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<List<FaceGroupDataInfo>>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("face group list error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face group list error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<FaceGroupDataInfo> faceGroupSingleAdd(FaceGroupReq faceGroupReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/face/group/single/addition";
path.put(protocol, getCamsApi);
try {
log.info("face single req=>{}", JSON.toJSONString(faceGroupReq));
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(faceGroupReq), null, null, "application/json");
log.info("face single resp=>{}", respJson);
HikApiRest<FaceGroupDataInfo> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<FaceGroupDataInfo>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<Boolean> faceGroupSingleDel(FaceGroupReq faceGroupReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/face/single/update";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(faceGroupReq), null, null, "application/json");
HikApiRest<Boolean> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<Boolean>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("face single error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face add error异常", e);
return Rest.fail(e.getMessage());
}
}
/**
* 识别计划需要人脸资源
*
* @param recognReq
* @return
*/
@Override
public Rest<List<ResRecognDataInfo>> findResRecognList(ResRecognReq recognReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/resource/recognition";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(recognReq), null, null, "application/json");
HikApiRest<List<ResRecognDataInfo>> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<List<ResRecognDataInfo>>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("face res list error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("face res list error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<String> downloadPicture(ImgReq imgReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/application/picture";
path.put(protocol, getCamsApi);
try {
// log.info("download img req=>{}", JSON.toJSONString(imgReq));
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(imgReq), null, null, "application/json");
//log.info("download img resp=>{}", respJson);
HikApiRest<String> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<String>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getMsg(), rest.getData());
} else {
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("img download error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<List<ResourceDataInfo>> getResourceRecognition(ResourceReq recognReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/resource/recognition";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(recognReq), null, null, "application/json");
HikApiRest<List<ResourceDataInfo>> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<List<ResourceDataInfo>>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("resource recognition list error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("resource recognition", e);
return Rest.fail(e.getMessage());
}
}
//下载图片
@Override
public InputStream callPostImgs(ImgReq imgReq) throws Exception {
ArtemisConfig config = getArtemisConfig();
String getSecurityApi = ARTEMIS_PATH + "/api/visitor/v1/record/pictures";
path.put(protocol, getSecurityApi);
//ArtemisHttpUtil.doPostStringImgArtemis(config, path, JSON.toJSONString(recognReq), null, null, "application/json");
Map<String, String> query = new HashMap<String, String>(2) { //get请求的head参数
{
put("domainId", "0");
}
};
//参数根据接口实际情况设置
HttpResponse result = ArtemisHttpUtil.doPostStringImgArtemis(config, path, JSON.toJSONString(imgReq), query, null, "application/json", null);
HttpResponse resp = result;
if (302 == resp.getStatusLine().getStatusCode()) {
Header header = resp.getFirstHeader("location");
String newUrl = header.getValue();
//本地测试
String replace = StrUtil.replace(newUrl, "https://10.12.177.245:6114", "http://8.136.255.30:8002");
HttpGet httpget = new HttpGet(replace);
//HttpGet httpget = new HttpGet(newUrl);
HttpClient httpClient = wrapClient(httpget.getURI().getScheme() + "://" + httpget.getURI().getHost());
HttpResponse execute = httpClient.execute(httpget);
HttpEntity entity = execute.getEntity();
InputStream in = entity.getContent();
return in;
} else {
System.out.println("下载出错");
return null;
}
}
}
package com.mortals.xhx.module.hik.face.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.AbstractHikService;
import com.mortals.xhx.module.hik.HikApiRest;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognListReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq;
import com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo;
import com.mortals.xhx.module.hik.face.service.IHikPlanService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 海康人员接口类
*
* @author: zxfei
* @date: 2023/4/12 17:51
*/
@Service("hikPlanService")
@Slf4j
public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanService {
@Override
public Rest<List<PlanRecognInfo>> findPlanRecognBlackList(PlanRecognListReq planRecognBlackListReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/black";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognBlackListReq), null, null, "application/json");
HikApiRest<List<PlanRecognInfo>> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<List<PlanRecognInfo>>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("plan recognize balck list error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize balck list error异常", e);
return Rest.fail(e.getMessage());
}
}
/**
* a)该接口可以新增一条重点人员识别计划,以实现将若干抓拍点抓拍到的人脸,
* 通过若干识别资源同若干分组内的人脸比较,并将命中结果以事件形式上报。
* b)配置一条识别计划需要人脸分组集合(通过”按条件查询人脸分组”接口获取)
* ,抓拍点集合(通过LDAP服务获取监控点,并通过型号确定抓拍点),
* 识别资源集合(通过”按条件查询识别资源”接口获取)。
* c)一条重点人员识别计划只能配置一种识别资源类别:深眸或脸谱或超脑。
* d)一条重点人员识别计划,可以配置多个超脑作为识别资源或一个脸谱作为识别资源。
* e)一条重点人员识别计划如果配置深眸作为识别资源,则recognitionResourceIndexCodes可以传空
* 。因为深眸的抓拍点就是识别资源本身,人脸监控应用服务会根据抓拍点自动匹配正确的识别资源。
* f)人脸监控应用服务会校验抓拍点的有效性。校验规则如下:超脑作为识别资源时,
* 抓拍点必须是超脑的通道;脸谱作为识别资源时,脸谱作为识别资源时,抓拍点一般为深眸或其他人脸抓拍机通道;
* 深眸作为识别资源时,抓拍点必须是深眸的通道;一个通道是否是深眸/超脑/抓拍机的通道,取决于通道所属设备的型号,
* 详见详见附录I 人脸监控应用服务支持设备型号列表。
* g)重点人员识别计划配置有以下限制,这些限制会在添加时作为特殊错误返回:超脑的一个通道只能配置一次重点人员识别计划;
* 同一个抓拍点不能同时配置在多个脸谱上;抓拍点或识别资源没有同步到IAC前,无法配置识别计划。
* h)识别计划的配置为异步过程,调用接口成功后,人脸监控应用服务会在后台自动下发人脸分组并执行布控操作,
* 可以通过接口”单个查询重点人员识别计划详情”查询该识别计划的下发结果。 i) 识别计划支持配置时间计划模板,
* 当时间计划参数不传时,默认全天候。当传入此参数时,时间计划规则如下:按周计划进行配置,每一天的时间段上限为8,每一个时间段的开始时间必须小于结束时间。
* j)同一个深眸支持配置多个识别计划。
* k)若设备上人脸分组达到上限,则有可能导致下发失败。
*
* @param planRecognBlackReq
* @return
*/
@Override
public Rest<String> planRecognBlackAdd(PlanRecognReq planRecognBlackReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/black/addition";
path.put(protocol, getCamsApi);
try {
log.info("plan recognize balck req=>{}", JSON.toJSONString(planRecognBlackReq));
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognBlackReq), null, null, "application/json");
log.info("plan recognize balck resp=>{}", respJson);
HikApiRest<String> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<String>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("plan recognize balck error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize balck add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<Boolean> planRecognBlackDel(PlanRecognReq planRecognBlackReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/black/deletion";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognBlackReq), null, null, "application/json");
HikApiRest<Boolean> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<Boolean>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("plan recognize balck error del resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize balck del error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<List<PlanRecognInfo>> findPlanRecognWhiteList(PlanRecognListReq planRecognWhiteListReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/white";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognWhiteListReq), null, null, "application/json");
HikApiRest<List<PlanRecognInfo>> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<List<PlanRecognInfo>>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("plan recognize white list error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize white list error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<String> planRecognWhiteAdd(PlanRecognReq planRecognWhiteReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/white/addition";
path.put(protocol, getCamsApi);
try {
log.info("plan recognize white req=>{}", JSON.toJSONString(planRecognWhiteReq));
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognWhiteReq), null, null, "application/json");
log.info("plan recognize white resp=>{}", respJson);
HikApiRest<String> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<String>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getMsg(),rest.getData());
} else {
log.info("plan recognize white add error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize white add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<Boolean> planRecognWhiteUpdate(PlanRecognReq planRecognWhiteReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/white/update";
path.put(protocol, getCamsApi);
try {
log.info("plan recognize white req=>{}", JSON.toJSONString(planRecognWhiteReq));
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognWhiteReq), null, null, "application/json");
log.info("plan recognize white resp=>{}", respJson);
HikApiRest<Boolean> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<Boolean>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("plan recognize white add error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize white add error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<Boolean> planRecognWhiteDel(PlanRecognReq planRecognWhiteReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/white/deletion";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognWhiteReq), null, null, "application/json");
HikApiRest<Boolean> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<Boolean>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("plan recognize white error del resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize white del error异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<Boolean> planRecognWhiteReStart(PlanRecognReq planRecognReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/plan/recognition/white/restart";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(planRecognReq), null, null, "application/json");
HikApiRest<Boolean> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<Boolean>>() {
});
if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData());
} else {
log.info("plan recognize white error restart resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("plan recognize white erstart error异常", e);
return Rest.fail(e.getMessage());
}
}
}
......@@ -11,236 +11,245 @@ import com.mortals.xhx.module.perform.model.vo.PerformAttendAppealVo;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import lombok.Data;
/**
* 绩效记录申诉信息实体对象
*
* @author zxfei
* @date 2023-07-12
*/
* 绩效记录申诉信息实体对象
*
* @author zxfei
* @date 2023-07-15
*/
@Data
public class PerformAttendAppealEntity extends PerformAttendAppealVo {
private static final long serialVersionUID = 1L;
/**
* 核查记录Id
*/
* 核查记录Id
*/
private Long checkRecordId;
/**
* 员工ID
*/
* 员工ID
*/
private Long staffId;
/**
* 员工姓名
*/
* 员工姓名
*/
private String staffName;
/**
* 工号
*/
* 工号
*/
private String workNum;
/**
* 所属部门
*/
* 所属部门
*/
private Long deptId;
/**
* 所属部门名称
*/
* 所属部门名称
*/
private String deptName;
/**
* 所属考勤组ID
*/
* 所属考勤组ID
*/
private Long attendanceGroupId;
/**
* 所属考勤组名称
*/
* 所属考勤组名称
*/
private String attendanceGroupName;
/**
* 扣分时间
*/
* 扣分时间
*/
private Date attendanceDate;
/**
* 绩效规则id
*/
* 绩效规则id
*/
private Long ruleId;
/**
* 规则名称
*/
* 规则名称
*/
private String ruleName;
/**
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)
*/
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)
*/
private Integer subMethod;
/**
* 增减类型(1.增加,2.扣除)
*/
* 增减类型(1.增加,2.扣除)
*/
private Integer subAddType;
/**
* 扣分或增加分值
*/
* 扣分或增加分值
*/
private BigDecimal score;
/**
* 上下班时间
*/
* 上下班时间
*/
private String goOffTimeStr;
/**
* 异常时间
*/
* 异常时间
*/
private Date errorTime;
/**
* 实际打卡时间
*/
* 实际打卡时间
*/
private Date actualAttendTime;
/**
* 异常处理结果
*/
* 异常处理结果
*/
private String errorResult;
/**
* 核查人员
*/
* 核查人员
*/
@Excel(name = "核查人员")
private String checkPerson;
/**
* 核查时间
*/
* 核查时间
*/
private Date checkTime;
/**
* 核查说明
*/
* 核查说明
*/
@Excel(name = "核查说明")
private String checkDesc;
/**
* 核查结果
*/
* 核查结果
*/
@Excel(name = "核查结果")
private String checkResult;
/**
* 处理状态(1.未处理,2.已处理)
*/
* 处理状态(1.未处理,2.已处理)
*/
private Integer processStatus;
/**
* 申诉说明
*/
* 申诉说明
*/
@Excel(name = "申诉说明")
private String appealDesc;
/**
* 申诉时间
*/
* 申诉时间
*/
private Date appealTime;
/**
* 申诉结果(1.通过,2.不通过)
*/
* 申诉结果(1.通过,2.不通过)
*/
private Integer appealResult;
/**
* 说明
*/
* 说明
*/
@Excel(name = "说明")
private String remark;
/**
* 违规类型,
*/
* 违规类型,
*/
private String violationType;
/**
* 评价结果(1.非常不满意,2.差评)
*/
* 评价结果(1.非常不满意,2.差评)
*/
private Integer reviewResult;
/**
* 评价时间
*/
* 评价时间
*/
private Date reviewTime;
/**
* 评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)
*/
* 评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)
*/
@Excel(name = "评价来源", readConverterExp = "评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)")
private String reviewSource;
/**
* 评价设备
*/
* 评价设备
*/
private String reviewDevice;
/**
* 投诉标题
*/
* 投诉标题
*/
@Excel(name = "投诉标题")
private String complainTitle;
/**
* 投诉内容
*/
* 投诉内容
*/
@Excel(name = "投诉内容")
private String complainContent;
/**
* 投诉人真实姓名
*/
* 投诉人真实姓名
*/
private String complainRealName;
/**
* 联系电话
*/
* 联系电话
*/
@Excel(name = "联系电话")
private String contact;
/**
* 投诉时间
*/
* 投诉时间
*/
private Date complainTime;
/**
* 投诉来源
*/
* 投诉来源
*/
private String complainSource;
/**
* 投诉设备
*/
* 投诉设备
*/
private String complainDevice;
/**
* 办件编码
*/
* 办件编码
*/
@Excel(name = "办件编码")
private String goworkCode;
/**
* 办件所属部门
*/
* 办件所属部门
*/
@Excel(name = "办件所属部门")
private String goworkDepts;
/**
* 事项名称
*/
* 事项名称
*/
@Excel(name = "事项名称")
private String matterlName;
/**
* 办理时间
*/
* 办理时间
*/
@Excel(name = "办理时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date goworkTime;
/**
* 违规类型(1.脱岗,2.离岗,3.玩手机,4.睡觉)
*/
* 违规类型(1.脱岗,2.离岗,3.玩手机,4.睡觉)
*/
@Excel(name = "违规类型", readConverterExp = "1=脱岗,2.离岗,3.玩手机,4.睡觉")
private Integer irregularType;
/**
* 发生时间
*/
* 发生时间
*/
@Excel(name = "发生时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date happenTime;
/**
* 持续时间,秒
*/
* 持续时间,秒
*/
private Integer duration;
/**
* 报警时间
*/
* 报警时间
*/
private Date alarmTime;
/**
* 图片凭证地址
*/
* 图片凭证地址
*/
private String snapPath;
/**
* 违规类型(1.工作纪律)
*/
* 违规类型(1.工作纪律)
*/
private Integer irregularOtherType;
/**
* 绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】
*/
* 绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】
*/
private String performType;
/**
* 绩效记录申诉附件信息信息
*/
* 扣分人员
*/
@Excel(name = "扣分人员")
private String deductPerson;
/**
* 扣分时间
*/
private Date deductTime;
/**
* 绩效记录申诉附件信息信息
*/
private List<PerformAttendAppealFilesEntity> performAttendAppealFilesList=new ArrayList<>();;
public List<PerformAttendAppealFilesEntity> getPerformAttendAppealFilesList(){
return performAttendAppealFilesList;
return performAttendAppealFilesList;
}
public void setPerformAttendAppealFilesList(List<PerformAttendAppealFilesEntity> performAttendAppealFilesList){
......@@ -248,7 +257,7 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo {
}
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -256,7 +265,7 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo {
if (obj instanceof PerformAttendAppealEntity) {
PerformAttendAppealEntity tmp = (PerformAttendAppealEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -264,104 +273,108 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo {
public void initAttrValue(){
this.checkRecordId = -1L;
this.checkRecordId = -1L;
this.staffId = -1L;
this.staffName = "";
this.staffId = -1L;
this.workNum = "";
this.staffName = "";
this.deptId = -1L;
this.workNum = "";
this.deptName = "";
this.deptId = -1L;
this.attendanceGroupId = -1L;
this.deptName = "";
this.attendanceGroupName = "";
this.attendanceGroupId = -1L;
this.attendanceDate = null;
this.attendanceGroupName = "";
this.ruleId = -1L;
this.attendanceDate = null;
this.ruleName = "";
this.ruleId = -1L;
this.subMethod = 1;
this.ruleName = "";
this.subAddType = 1;
this.subMethod = 1;
this.score = BigDecimal.valueOf(0.00);
this.subAddType = 1;
this.goOffTimeStr = "";
this.score = BigDecimal.valueOf(0.00);
this.errorTime = null;
this.goOffTimeStr = "";
this.actualAttendTime = null;
this.errorTime = null;
this.errorResult = "";
this.actualAttendTime = null;
this.checkPerson = "";
this.errorResult = "";
this.checkTime = null;
this.checkPerson = "";
this.checkDesc = "";
this.checkTime = null;
this.checkResult = "";
this.checkDesc = "";
this.processStatus = 1;
this.checkResult = "";
this.appealDesc = "";
this.processStatus = 1;
this.appealTime = null;
this.appealDesc = "";
this.appealResult = 2;
this.appealTime = null;
this.remark = "";
this.appealResult = 2;
this.violationType = "";
this.remark = "";
this.reviewResult = -1;
this.violationType = "";
this.reviewTime = null;
this.reviewResult = -1;
this.reviewSource = "";
this.reviewTime = null;
this.reviewDevice = "";
this.reviewSource = "";
this.complainTitle = "";
this.reviewDevice = "";
this.complainContent = "";
this.complainTitle = "";
this.complainRealName = "";
this.complainContent = "";
this.contact = "";
this.complainRealName = "";
this.complainTime = null;
this.contact = "";
this.complainSource = "";
this.complainTime = null;
this.complainDevice = "";
this.complainSource = "";
this.goworkCode = "";
this.complainDevice = "";
this.goworkDepts = "";
this.goworkCode = "";
this.matterlName = "";
this.goworkDepts = "";
this.goworkTime = null;
this.matterlName = "";
this.irregularType = -1;
this.goworkTime = null;
this.happenTime = null;
this.irregularType = -1;
this.duration = 0;
this.happenTime = null;
this.alarmTime = null;
this.duration = 0;
this.snapPath = "";
this.alarmTime = null;
this.irregularOtherType = -1;
this.snapPath = "";
this.performType = "";
this.irregularOtherType = -1;
this.deductPerson = "";
this.performType = "";
this.deductTime = null;
}
}
\ No newline at end of file
......@@ -22,4 +22,8 @@ public class PerformAttendAppealVo extends BaseEntityLong {
*/
private Integer statType;
private String categoryName;
private String performTypeStr;
}
\ No newline at end of file
......@@ -8,18 +8,22 @@ import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesQuery;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealFilesService;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import com.mortals.xhx.module.perform.service.PerformRulesCategoryService;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -57,6 +61,41 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
@Autowired
private PerformAttendAppealFilesService performAttendAppealFilesService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Autowired
private MessageService messageService;
@Autowired
private PerformRulesCategoryService categoryService;
@Autowired
private PerformRulesService rulesService;
private void sendCheckDingTalk(PerformAttendAppealEntity entity) {
String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.getByValue(entity.getPerformType()).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.getAppealTime() == null ? new Date() : entity.getAppealTime()));
checkDingMsg.setRuleStr(ruleStr);
checkDingMsg.setScore(entity.getScore().toString());
checkDingMsg.setAppealResult(entity.getAppealResult());
checkDingMsg.setAppealDesc(entity.getAppealDesc());
Rest<String> msgRest = messageService.sendDingTalkAppealMsg(checkDingMsg);
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
}
}
@Override
public Rest<Void> audit(PerformAttendAppealEntity appeal, Context context) {
......@@ -73,6 +112,15 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
appealEntity.setUpdateTime(new Date());
this.getDao().update(appealEntity);
PerformRulesEntity ruleCache = rulesService.getCache(appealEntity.getRuleId().toString());
if (!ObjectUtils.isEmpty(ruleCache)) {
PerformRulesCategoryEntity categoryEntity = categoryService.get(ruleCache.getCategoryId());
if (!ObjectUtils.isEmpty(categoryEntity)) {
appealEntity.setCategoryName(categoryEntity.getName());
}
}
String appealMsg = "申诉成功,返回所扣分数,申诉ID:" + appeal.getId().toString();
if (appeal.getAppealResult() == AppealResultEnum.通过.getValue()) {
if (appeal.getSubAddType() == SubAddTypeEnum.扣除.getValue()) {
......@@ -149,6 +197,9 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
}
}
}
sendCheckDingTalk(appealEntity);
return Rest.ok();
}
......@@ -183,10 +234,10 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
query.setSummaryType(SummaryTopTypeEnum..getValue());
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy")+"-01-01");
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy") + "-01-01");
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy-MM")+"-01");
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy-MM") + "-01");
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrStrDate());
......
......@@ -85,7 +85,7 @@ public class WindowOwnerEntity extends WindowOwnerVo {
this.phone = "";
this.windowCount = -1;
this.windowCount = 0;
this.remark = "";
}
......
package com.mortals.xhx.module.window.service.impl;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import org.springframework.stereotype.Service;
......@@ -13,17 +14,20 @@ import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity;
import com.mortals.xhx.module.window.model.WindowOwnerDetailQuery;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
* WindowOwnerService
* 窗口负责人 service实现
*
* @author zxfei
* @date 2023-07-12
*/
* WindowOwnerService
* 窗口负责人 service实现
*
* @author zxfei
* @date 2023-07-12
*/
@Service("windowOwnerService")
@Slf4j
public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerDao, WindowOwnerEntity, Long> implements WindowOwnerService {
......@@ -31,37 +35,54 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
private WindowOwnerDetailService windowOwnerDetailService;
@Autowired
private DeptService deptService;
@Override
protected void saveBefore(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.setWindowCount(entity.getWindowOwnerDetailList().size());
}
DeptEntity deptEntity = deptService.get(entity.getId());
entity.setDeptName(deptEntity == null ? "" : deptEntity.getDeptName());
}
@Override
protected void updateBefore(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.setWindowCount(entity.getWindowOwnerDetailList().size());
}
}
@Override
protected void saveAfter(WindowOwnerEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())){
entity.getWindowOwnerDetailList().stream().peek(item->{
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.getWindowOwnerDetailList().stream().peek(item -> {
item.setOwnerId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
DeptEntity deptEntity = deptService.get(entity.getId());
entity.setDeptName(deptEntity==null?"":deptEntity.getDeptName());
entity.setNumber(entity.getWindowOwnerDetailList().size()+"");
windowOwnerDetailService.save(entity.getWindowOwnerDetailList());
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(WindowOwnerEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())){
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
Long[] windowOwnerDetailIds = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerId(entity.getId())).stream().map(WindowOwnerDetailEntity::getId).toArray(Long[]::new);
windowOwnerDetailService.remove(windowOwnerDetailIds,context);
entity.getWindowOwnerDetailList().stream().peek(item ->{
windowOwnerDetailService.remove(windowOwnerDetailIds, context);
entity.getWindowOwnerDetailList().stream().peek(item -> {
item.setOwnerId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date());
}).count();
entity.setNumber(entity.getWindowOwnerDetailList().size()+"");
entity.setNumber(entity.getWindowOwnerDetailList().size() + "");
windowOwnerDetailService.save(entity.getWindowOwnerDetailList());
}
super.updateAfter(entity, context);
......@@ -70,7 +91,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<WindowOwnerDetailEntity> windowOwnerDetaillist = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerIdList(Arrays.asList(ids)));
windowOwnerDetailService.removeList(windowOwnerDetaillist,context);
windowOwnerDetailService.removeList(windowOwnerDetaillist, context);
super.removeAfter(ids, context, result);
}
}
\ No newline at end of file
......@@ -36,6 +36,12 @@ public class WorkmanEntity extends WorkmanVo {
* 电话号码
*/
private String phone;
/**
* 电话号码
*/
private String mobile;
/**
* 照片
*/
......@@ -129,8 +135,13 @@ public class WorkmanEntity extends WorkmanVo {
this.photoPath = photoPath;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
@Override
public int hashCode() {
......
......@@ -68,8 +68,9 @@ hik:
# domain: https://oapi.dingtalk.com
dingtalk:
agentId: 2625340030
AppKey: dingjcqjqjh1j82ho5zx
AppSecret: _wNw2J6sxTYcu3ddNkFlG3U-3UlQ-P_7ufLSJ4wRxgdUflm3lPf8LIODCQOGkydy
domain: https://oapi.dingtalk.com
domain: @profiles.dingtalk.domain@
agentId: @profiles.dingtalk.agentId@
AppKey: @profiles.dingtalk.appKey@
AppSecret: @profiles.dingtalk.appSecret@
webUrl: @profiles.webUrl@
......@@ -15,10 +15,6 @@
<result property="email" column="email" />
<result property="qq" column="qq" />
<result property="userType" column="userType" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
<result property="siteIds" column="siteIds" />
<result property="areaCodes" column="areaCodes" />
<result property="status" column="status" />
<result property="customerId" column="customerId" />
<result property="createTime" column="createTime" />
......@@ -26,6 +22,11 @@
<result property="createUserName" column="createUserName" />
<result property="lastLoginTime" column="lastLoginTime" />
<result property="lastLoginAddress" column="lastLoginAddress" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
<result property="siteIds" column="siteIds" />
<result property="areaCodes" column="areaCodes" />
<result property="dingUserId" column="dingUserId" />
</resultMap>
......@@ -63,18 +64,6 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('userType') or colPickMode == 1 and data.containsKey('userType')))">
a.userType,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteIds') or colPickMode == 1 and data.containsKey('siteIds')))">
a.siteIds,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaCodes') or colPickMode == 1 and data.containsKey('areaCodes')))">
a.areaCodes,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
a.status,
</if>
......@@ -96,23 +85,38 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))">
a.lastLoginAddress,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteIds') or colPickMode == 1 and data.containsKey('siteIds')))">
a.siteIds,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaCodes') or colPickMode == 1 and data.containsKey('areaCodes')))">
a.areaCodes,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dingUserId') or colPickMode == 1 and data.containsKey('dingUserId')))">
a.dingUserId,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,deptId,deptName,siteIds,areaCodes,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress)
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,dingUserId)
VALUES
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress})
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{dingUserId})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,deptId,deptName,siteIds,areaCodes,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress)
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,dingUserId)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress})
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.dingUserId})
</foreach>
</insert>
......@@ -152,21 +156,6 @@
<if test="(colPickMode==0 and data.containsKey('userTypeIncrement')) or (colPickMode==1 and !data.containsKey('userTypeIncrement'))">
a.userType=ifnull(a.userType,0) + #{data.userTypeIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIds')) or (colPickMode==1 and !data.containsKey('siteIds'))">
a.siteIds=#{data.siteIds},
</if>
<if test="(colPickMode==0 and data.containsKey('areaCodes')) or (colPickMode==1 and !data.containsKey('areaCodes'))">
a.areaCodes=#{data.areaCodes},
</if>
<if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
a.status=#{data.status},
</if>
......@@ -197,6 +186,24 @@
<if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))">
a.lastLoginAddress=#{data.lastLoginAddress},
</if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIds')) or (colPickMode==1 and !data.containsKey('siteIds'))">
a.siteIds=#{data.siteIds},
</if>
<if test="(colPickMode==0 and data.containsKey('areaCodes')) or (colPickMode==1 and !data.containsKey('areaCodes'))">
a.areaCodes=#{data.areaCodes},
</if>
<if test="(colPickMode==0 and data.containsKey('dingUserId')) or (colPickMode==1 and !data.containsKey('dingUserId'))">
a.dingUserId=#{data.dingUserId},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -277,39 +284,6 @@
</choose>
</foreach>
</trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
<trim prefix="siteIds=(case" suffix="ELSE siteIds end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('siteIds')) or (colPickMode==1 and !item.containsKey('siteIds'))">
when a.id=#{item.id} then #{item.siteIds}
</if>
</foreach>
</trim>
<trim prefix="areaCodes=(case" suffix="ELSE areaCodes end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('areaCodes')) or (colPickMode==1 and !item.containsKey('areaCodes'))">
when a.id=#{item.id} then #{item.areaCodes}
</if>
</foreach>
</trim>
<trim prefix="status=(case" suffix="ELSE status end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
......@@ -374,6 +348,46 @@
</if>
</foreach>
</trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
<trim prefix="siteIds=(case" suffix="ELSE siteIds end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('siteIds')) or (colPickMode==1 and !item.containsKey('siteIds'))">
when a.id=#{item.id} then #{item.siteIds}
</if>
</foreach>
</trim>
<trim prefix="areaCodes=(case" suffix="ELSE areaCodes end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('areaCodes')) or (colPickMode==1 and !item.containsKey('areaCodes'))">
when a.id=#{item.id} then #{item.areaCodes}
</if>
</foreach>
</trim>
<trim prefix="dingUserId=(case" suffix="ELSE dingUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('dingUserId')) or (colPickMode==1 and !item.containsKey('dingUserId'))">
when a.id=#{item.id} then #{item.dingUserId}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -712,96 +726,6 @@
${_conditionType_} a.userType <![CDATA[ <= ]]> #{${_conditionParam_}.userTypeEnd}
</if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIds')">
<if test="conditionParamRef.siteIds != null and conditionParamRef.siteIds != ''">
${_conditionType_} a.siteIds like #{${_conditionParam_}.siteIds}
</if>
<if test="conditionParamRef.siteIds == null">
${_conditionType_} a.siteIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdsList') and conditionParamRef.siteIdsList.size() > 0">
${_conditionType_} a.siteIds in
<foreach collection="conditionParamRef.siteIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdsNotList') and conditionParamRef.siteIdsNotList.size() > 0">
${_conditionType_} a.siteIds not in
<foreach collection="conditionParamRef.siteIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodes')">
<if test="conditionParamRef.areaCodes != null and conditionParamRef.areaCodes != ''">
${_conditionType_} a.areaCodes like #{${_conditionParam_}.areaCodes}
</if>
<if test="conditionParamRef.areaCodes == null">
${_conditionType_} a.areaCodes is null
</if>
</if>
<if test="conditionParamRef.containsKey('areaCodesList') and conditionParamRef.areaCodesList.size() > 0">
${_conditionType_} a.areaCodes in
<foreach collection="conditionParamRef.areaCodesList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodesNotList') and conditionParamRef.areaCodesNotList.size() > 0">
${_conditionType_} a.areaCodes not in
<foreach collection="conditionParamRef.areaCodesNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('status')">
<if test="conditionParamRef.status != null ">
${_conditionType_} a.status = #{${_conditionParam_}.status}
......@@ -955,6 +879,117 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIds')">
<if test="conditionParamRef.siteIds != null and conditionParamRef.siteIds != ''">
${_conditionType_} a.siteIds like #{${_conditionParam_}.siteIds}
</if>
<if test="conditionParamRef.siteIds == null">
${_conditionType_} a.siteIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdsList') and conditionParamRef.siteIdsList.size() > 0">
${_conditionType_} a.siteIds in
<foreach collection="conditionParamRef.siteIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdsNotList') and conditionParamRef.siteIdsNotList.size() > 0">
${_conditionType_} a.siteIds not in
<foreach collection="conditionParamRef.siteIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodes')">
<if test="conditionParamRef.areaCodes != null and conditionParamRef.areaCodes != ''">
${_conditionType_} a.areaCodes like #{${_conditionParam_}.areaCodes}
</if>
<if test="conditionParamRef.areaCodes == null">
${_conditionType_} a.areaCodes is null
</if>
</if>
<if test="conditionParamRef.containsKey('areaCodesList') and conditionParamRef.areaCodesList.size() > 0">
${_conditionType_} a.areaCodes in
<foreach collection="conditionParamRef.areaCodesList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodesNotList') and conditionParamRef.areaCodesNotList.size() > 0">
${_conditionType_} a.areaCodes not in
<foreach collection="conditionParamRef.areaCodesNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dingUserId')">
<if test="conditionParamRef.dingUserId != null and conditionParamRef.dingUserId != ''">
${_conditionType_} a.dingUserId like #{${_conditionParam_}.dingUserId}
</if>
<if test="conditionParamRef.dingUserId == null">
${_conditionType_} a.dingUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('dingUserIdList') and conditionParamRef.dingUserIdList.size() > 0">
${_conditionType_} a.dingUserId in
<foreach collection="conditionParamRef.dingUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dingUserIdNotList') and conditionParamRef.dingUserIdNotList.size() > 0">
${_conditionType_} a.dingUserId not in
<foreach collection="conditionParamRef.dingUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -1018,26 +1053,6 @@
<if test='orderCol.userType != null and "DESC".equalsIgnoreCase(orderCol.userType)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('siteIds')">
a.siteIds
<if test='orderCol.siteIds != null and "DESC".equalsIgnoreCase(orderCol.siteIds)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('areaCodes')">
a.areaCodes
<if test='orderCol.areaCodes != null and "DESC".equalsIgnoreCase(orderCol.areaCodes)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('status')">
a.status
<if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if>
......@@ -1073,6 +1088,31 @@
<if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('siteIds')">
a.siteIds
<if test='orderCol.siteIds != null and "DESC".equalsIgnoreCase(orderCol.siteIds)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('areaCodes')">
a.areaCodes
<if test='orderCol.areaCodes != null and "DESC".equalsIgnoreCase(orderCol.areaCodes)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('dingUserId')">
a.dingUserId
<if test='orderCol.dingUserId != null and "DESC".equalsIgnoreCase(orderCol.dingUserId)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
......@@ -4,6 +4,7 @@
<mapper namespace="com.mortals.xhx.module.check.dao.ibatis.CheckAllRecordDaoImpl">
<select id="getList" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="com.mortals.xhx.module.check.model.vo.CheckAllRecordVo">
SELECT * FROM (
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
......@@ -57,5 +58,115 @@
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
) AS a
</select>
<select id="getListCount" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="int">
SELECT count(1) FROM (
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,4 AS checkType ,'effect' AS performType FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,6 AS checkType ,'complain' AS performType FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,3 AS checkType ,'gowork' AS performType FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,2 AS checkType ,'review' AS performType FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,5 AS checkType ,'other' AS performType FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
) AS a
</select>
<select id="getScoreSummary" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo">
SELECT sum(0-a.initScore) AS initScore,sum(0-a.checkScore) AS checkScore,sum(a.appealScore) AS appealScore,sum(0-a.checkScore-a.appealScore) AS total FROM (
SELECT sum(CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) as initScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) ELSE 0 END) checkScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) ELSE 0 END) ELSE 0 END) appealScore
FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
UNION
SELECT sum(CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) as initScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) ELSE 0 END) checkScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) ELSE 0 END) ELSE 0 END) appealScore
FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
UNION
SELECT sum(CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) as initScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) ELSE 0 END) checkScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) ELSE 0 END) ELSE 0 END) appealScore
FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
UNION
SELECT sum(CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) as initScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) ELSE 0 END) checkScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) ELSE 0 END) ELSE 0 END) appealScore
FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
UNION
SELECT sum(CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) as initScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) ELSE 0 END) checkScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) ELSE 0 END) ELSE 0 END) appealScore
FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
UNION
SELECT sum(CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) as initScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN 0 ELSE (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) END) ELSE 0 END) checkScore,
sum(CASE checkStatus WHEN 2 THEN (CASE subMethod WHEN 4 THEN (CASE subAddType WHEN 1 THEN score ELSE score*-1 END) ELSE 0 END) ELSE 0 END) appealScore
FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
) AS a
</select>
</mapper>
\ No newline at end of file
......@@ -641,3 +641,13 @@ CREATE TABLE mortals_xhx_staff_perform_summary(
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='员工绩效统计';
-- ----------------------------
2023-7-15
-- ----------------------------
ALTER TABLE mortals_xhx_perform_attend_appeal ADD COLUMN `deductPerson` varchar(128) DEFAULT '' COMMENT '扣分人员' AFTER subMethod;
ALTER TABLE mortals_xhx_perform_attend_appeal ADD COLUMN `deductTime` datetime COMMENT '扣分时间' AFTER deductPerson;
ALTER TABLE mortals_xhx_user ADD COLUMN `dingUserId` varchar(64) DEFAULT '' COMMENT '钉钉userId' AFTER customerId;
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