This commit is contained in:
@jyuhsin
2025-12-12 14:32:39 +08:00
parent 5390a52e3c
commit 564219caa1
5 changed files with 225 additions and 100 deletions
@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.ghkh.model.*;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
@@ -15,6 +16,7 @@ import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.DaoUp;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@@ -132,19 +134,46 @@ public class GhkhXghshController {
return null;
}
int score = 0;
// 查询当前用户能够审核的指标
List<kh_nr> nrList = khzpService.dao().query(kh_nr.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("auditUser", "=", SecurityUtil.getUserLoginname()));
if(Lang.isEmpty(nrList)) {
return Result.success();
}
List<String> contentIds = nrList.stream().map(kh_nr::getId).toList();
// Sys_user sys_user = (Sys_user) ShiroUtil.getPrincipal();
khXghshService.dao().clear(Kh_xghsh.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("flatid", "=", pf[0].getFlatid()));
for (Kh_xghsh p : pf) {
khzpService.dao().insert(p);
score += p.getSchools() != null ? p.getSchools() : 0;
khXghshService.dao().clear(Kh_xghsh.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("flatid", "=", pf[0].getFlatid()).and("nr_id", "in", contentIds));
int score = 0;
for (Kh_xghsh p : pf) {
if(contentIds.contains(p.getNr_id())) {
khzpService.dao().insert(p);
score += p.getSchools() != null ? p.getSchools() : 0;
}
}
Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("union_id", "=", pf[0].getFlatid()));
Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("union_id", "=", pf[0].getFlatid()));
if (record != null && "submit".equals(type)) {
record.setXgh_score(score);
baseService.dao().update(record);
}
return Result.success();
}
if (record != null) {
record.setXgh_score(score);
@At
@POST
@SaCheckPermission("ghkh.xghsh")
public Result submit(String id) {
Kh_record record = khZbService.dao().fetch(Kh_record.class, id);
if (record != null) {
List<Kh_xghsh> schoolAuditList = khZbService.dao().query(Kh_xghsh.class, Cnd.where("zb_id", "=", record.getZb_id()).and("flatid", "=", record.getUnion_id()));
Integer score = 0;
for (Kh_xghsh xghsh : schoolAuditList) {
score += xghsh.getSchools();
}
record.setXgh_score(score);
ExamConfig config = baseService.dao().fetch(ExamConfig.class, Cnd.NEW());
if(config.getOnLine() != null) {
record.setOnLineFinalScore(score * config.getOnLine() * 0.01);
@@ -152,18 +181,15 @@ public class GhkhXghshController {
record.setOnLineFinalScore((double) score);
}
record.setTotalScore(record.getOnLineFinalScore());
if("submit".equals(type)) {
record.setState(3);
record.setState(3);
baseService.dao().update(record);
List<Kh_record> list = khZbService.dao().query(Kh_record.class, Cnd.where("zb_id", "=", record.getZb_id()).desc("totalScore"));
for (int i = 0; i < list.size(); i++) {
list.get(i).setSort(i + 1);
}
baseService.dao().update(record);
}
List<Kh_record> list = khZbService.dao().query(Kh_record.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).desc("totalScore"));
for (int i = 0; i < list.size(); i++) {
list.get(i).setSort(i + 1);
khZbService.dao().update(list);
}
khZbService.dao().update(list);
return Result.success();
}
return Result.success();
}
}
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -9,12 +10,19 @@ import com.budwk.app.zhgh.dayofficework.ghkh.model.kh_nr;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhBzService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhNrService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@@ -64,6 +72,31 @@ public class GhkhXjkhzbController {
@At
public Result getZbList() {
return Result.success(khZbService.query());
}
@At
@SaCheckLogin
public Result getUserByKeyWord(@Valid String keyWord) {
Sql sql = Sqls.create("""
SELECT
t1.id,
t1.username AS userName,
t1.loginName AS loginName,
t2.NAME AS unitName,
t1.mobile,
t1.email
FROM
`sys_user` t1
LEFT JOIN sys_unit t2 ON t2.id = t1.unitId
$condition
limit 0, 50
""");
sql.setParam("keyWord", "%" + keyWord + "%");
Cnd cnd = Cnd.NEW();
SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("t1.username", keyWord).orLike("t1.loginname", keyWord);
cnd.and(group);
sql.setCondition(cnd);
return Result.success(khZbService.listMap(sql));
}
}
@@ -54,5 +54,8 @@ public class kh_nr extends BaseModel {
})
private Integer location;
@Column
@Comment("审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String auditUser;
}
@@ -79,13 +79,25 @@
<el-form-item label="" label-width="0" v-for="(nr,idx) in formData.nrs" :key="idx">
<el-row type="flex" justify="space-between">
<el-input v-model="nr.content" v-if="!is_view" maxlength="30" style="width: 50%" placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
<span style="background-color: #F6F7FA;" v-else>{{ idx + 1 }}&nbsp;&nbsp;{{ nr.content }}</span>
<div style="width: 80%">
<el-input v-model="nr.content" :disabled="is_view" maxlength="30" style="width: 68%" placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
<el-select v-model="nr.auditUser" :disabled="is_view" placeholder="请根据姓名或工号选择审核人" style="width: 300px"
remote reserve-keyword :remote-method="selectUser"
clearable filterable>
<el-option
v-for="item in userOptions"
:key="item.loginName"
:label="item.userName + item.loginName + '(' + item.unitName + ')'"
:value="item.loginName">
</el-option>
</el-select>
</div>
<div style="display: flex; gap: 10px;">
<el-button v-if="!is_view" size="small" icon="el-icon-plus" type="primary"
@click="formData.nrs.push({bzs:[{}]})">
@click="formData.nrs.push({bzs:[{}], auditUser: ''})">
添加内容
</el-button>
<el-button v-if="!is_view" size="small" :disabled="formData.nrs.length<=1" type="danger"
@@ -195,7 +207,7 @@
<el-table-column v-if="!is_view" label="操作" width="100px">
<template v-slot="{row,$index}">
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger" icon="el-icon-delete"
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id !== null)" type="danger" icon="el-icon-delete"
@click="nr.bzs.splice($index,1)"></el-button>
</template>
</el-table-column>
@@ -232,7 +244,8 @@ module.exports = {
default: function() {
return {
nrs: [{
bzs: [{}]
bzs: [{}],
auditUser: '',
}],
};
}
@@ -265,10 +278,23 @@ module.exports = {
{moduleName:'二级教代会',id:'secteameet'},
{moduleName:'慰问/补助',id:'ConandDif'},
],
formData:{}
formData:{},
userOptions: [],
}
},
methods: {
async selectUser(query) {
if (query) {
this.userOptions = []
this.userOptions = await this.getUserList(query)
}
},
async getUserList(query) {
const resp = await this.$axios.post("/platform/ghkh/Xjkhzb/getUserByKeyWord", {
keyWord: query,
})
return resp.data
},
async getByZbData() {
this.$axios.post('/platform/ghkh/khzb/edit', {id: this.formData.zbId}).then(res => {
if (res.code === 0) {
@@ -328,16 +354,17 @@ module.exports = {
return sums;
}
},
created() {
async created() {
this.getZbList()
if (!this.form_data || !Object.keys(this.form_data).length) {
this.formData = {
nrs: [{
bzs: [{}]
bzs: [{}],
auditUser: '',
}],
}
}else{
this.formData=this.form_data
} else {
this.formData = this.form_data
// 初始化时间范围数据用于编辑
if (this.formData.startDateTime && this.formData.endDateTime) {
this.$set(this.formData, 'fillTimeRange', [this.formData.startDateTime, this.formData.endDateTime]);
@@ -345,6 +372,19 @@ module.exports = {
if (this.formData.startApplyTime && this.formData.endApplyTime) {
this.$set(this.formData, 'appealTimeRange', [this.formData.startApplyTime, this.formData.endApplyTime]);
}
// 回显审核人
if (this.formData.nrs.length > 0) {
const users = [...new Set(
this.formData.nrs
.map(o => o.auditUser)
.filter(o => o != null && o !== '')
)]
let array = []
for (const o of users) {
array = array.concat(await this.getUserList(o))
}
this.userOptions = array
}
}
}
}
@@ -90,11 +90,14 @@ layout("/layouts/platform.html"){
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
fixed="right" width="120px">
fixed="right" width="160px">
<template scope="scope">
<el-button size="mini" :disabled="scope.row.state==3" type="primary"
@click="openShGh(scope.row)">评分
</el-button>
<el-button size="mini" type="primary" :disabled="scope.row.state==3"
@click="doSubmit(scope.row)">提交
</el-button>
</template>
</el-table-column>
</el-table>
@@ -124,80 +127,81 @@ layout("/layouts/platform.html"){
<table-tool label="考核内容" class="mt10"></table-tool>
<el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" readonly maxlength="30" placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary size="small" :summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号"
type="index" width="60">
</el-table-column>
<template v-if="nr?.auditUser === $store.state.user.loginname">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" readonly maxlength="30" placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary size="small" :summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号"
type="index" width="60">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection"
header-align="center" align="center">
<template scope="{row}">
<el-input v-model="row.inspection"
readonly placeholder="请填写考核标准"></el-input>
</template>
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection"
header-align="center" align="center">
<template scope="{row}">
<el-input v-model="row.inspection"
readonly placeholder="请填写考核标准"></el-input>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input>
</template>
</el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center"
align="center" v-if="examConfig.selfAssessment === true">
<template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf"
maxlength="4"
readonly placeholder="请填写自评分"></el-input>
<el-table-column label="自评得分" prop="zpf" header-align="center"
align="center" v-if="examConfig.selfAssessment === true">
<template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf"
maxlength="4"
readonly placeholder="请填写自评分"></el-input>
<el-input v-else value="暂无" maxlength="4"
readonly></el-input>
</template>
</el-table-column>
<el-input v-else value="暂无" maxlength="4"
readonly></el-input>
</template>
</el-table-column>
<el-table-column label="校工会评分" prop="schools" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model.number="row.schools" maxlength="4"
placeholder="请填写评分"></el-input>
</template>
</el-table-column>
<el-table-column label="校工会评分" prop="schools" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model.number="row.schools" maxlength="4"
placeholder="请填写评分"></el-input>
</template>
</el-table-column>
<el-table-column label="加、减原因" prop="addition" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model.number="row.addition" maxlength="50"
placeholder="请填写加、减原因"></el-input>
</template>
</el-table-column>
<el-table-column label="加、减原因" prop="addition" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model.number="row.addition" maxlength="50"
placeholder="请填写加、减原因"></el-input>
</template>
</el-table-column>
<el-table-column label="佐证材料数量" header-align="center" align="center" width="100" prop="fileCount">
<template scope="scope">
<el-table-column label="佐证材料数量" header-align="center" align="center" width="100" prop="fileCount">
<template scope="scope">
<span v-if="scope.row.zp?.files?.length > 0" class="text-success" style="font-weight: bolder; font-size: 16px">
{{ scope.row.zp?.files?.length || 0 }}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column label="佐证材料" header-align="center" align="center" prop="files">
<template scope="{row, $index}">
<el-button type="primary" plain size="small"
@click="doView(nr.content,row.inspection,row, $index, idx)">
查看佐证材料
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column label="佐证材料" header-align="center" align="center" prop="files">
<template scope="{row, $index}">
<el-button type="primary" plain size="small"
@click="doView(nr.content,row.inspection,row, $index, idx)">
查看佐证材料
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</template>
</el-form-item>
</el-form>
</template>
@@ -245,6 +249,7 @@ layout("/layouts/platform.html"){
window.vue = new Vue({
el: '#app',
store,
mixins: [initTableMixins],
data() {
return {
@@ -356,6 +361,24 @@ layout("/layouts/platform.html"){
loading.close()
})
},
doSubmit(row) {
this.$confirm('提交后不可修改,您确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(()=>{
this.$axios
.post("/platform/ghkh/xghsh/submit", {id: row.record_id})
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.doSearch()
} else {
this.$message.error(resp.msg)
}
})
})
},
doView(nr, bz, row, index, idx) {
this.dialog = true
this.viewRow = row