This commit is contained in:
2025-12-17 15:02:33 +08:00
20 changed files with 376 additions and 344 deletions
@@ -51,7 +51,7 @@ public class ActivitySportsReadingController {
ActivityBasicUnit basicUnit = dao.fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId())); ActivityBasicUnit basicUnit = dao.fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId()));
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("close", "!=", true); cnd.and("close", "!=", true);
cnd.and("YEAR(startTime)", "=", year); cnd.and("YEAR(applyStartTime)", "=", year);
cnd.and("activityLevel", "=", activityLevel); cnd.and("activityLevel", "=", activityLevel);
if (!AuthUtil.hasRoleOr(RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SYSADMIN.name())) { if (!AuthUtil.hasRoleOr(RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SYSADMIN.name())) {
if (activityLevel.equals("40002")) { if (activityLevel.equals("40002")) {
@@ -87,7 +87,10 @@ public class H5ActivitySportsApplyUserController {
ActivitySchoolEvent schoolEvent = dao.fetch(ActivitySchoolEvent.class, schoolEventId); ActivitySchoolEvent schoolEvent = dao.fetch(ActivitySchoolEvent.class, schoolEventId);
ActivityEvent activityEvent = dao.fetch(ActivityEvent.class, eventId); ActivityEvent activityEvent = dao.fetch(ActivityEvent.class, eventId);
ActivitySchool activitySchool = dao.fetch(ActivitySchool.class, activityId); ActivitySchool activitySchool = dao.fetch(ActivitySchool.class, activityId);
ActivitySchoolTeam schoolTeam = dao.fetch(ActivitySchoolTeam.class, teamId); ActivitySchoolTeam schoolTeam = null;
if (teamId != null && !teamId.isEmpty()) {
schoolTeam = dao.fetch(ActivitySchoolTeam.class, teamId);
}
ActivityBasicUnit basicUnit = dao.fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId())); ActivityBasicUnit basicUnit = dao.fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId()));
ActivityBasicUnion basicUnion = dao.fetch(ActivityBasicUnion.class, Cnd.where("id", "=", basicUnit.getUnionId())); ActivityBasicUnion basicUnion = dao.fetch(ActivityBasicUnion.class, Cnd.where("id", "=", basicUnit.getUnionId()));
@@ -105,10 +108,10 @@ public class H5ActivitySportsApplyUserController {
} }
//如果不等于空代表是个人项目 //如果不等于空代表是个人项目
if (ObjectUtil.isNotEmpty(activityEvent.getIsMenWomen())) { if (ObjectUtil.isNotEmpty(activityEvent.getIsMenWomen())) {
if (activityEvent.getIsMenWomen() == 1 && !List.of("","男性").contains(user.getSex())) { if (activityEvent.getIsMenWomen() == 1 && !List.of("", "男性").contains(user.getSex())) {
return Result.error("当前项目只能男性能报名!"); return Result.error("当前项目只能男性能报名!");
} }
if (activityEvent.getIsMenWomen() == 2 && !List.of("","女性").contains(user.getSex())) { if (activityEvent.getIsMenWomen() == 2 && !List.of("", "女性").contains(user.getSex())) {
return Result.error("当前项目只能女性能报名!"); return Result.error("当前项目只能女性能报名!");
} }
} }
@@ -182,8 +185,10 @@ public class H5ActivitySportsApplyUserController {
schoolApply.setStatus(2); schoolApply.setStatus(2);
} }
schoolApply.setUnitname(user.getUnitName()); schoolApply.setUnitname(user.getUnitName());
schoolApply.setTeamId(schoolTeam.getId()); if (schoolTeam != null){
schoolApply.setTeam(schoolTeam.getName()); schoolApply.setTeamId(schoolTeam.getId());
schoolApply.setTeam(schoolTeam.getName());
}
schoolApply.setLoginname(user.getLoginname()); schoolApply.setLoginname(user.getLoginname());
schoolApply.setUsername(user.getUsername()); schoolApply.setUsername(user.getUsername());
schoolApply.setMobile(user.getMobile()); schoolApply.setMobile(user.getMobile());
@@ -205,7 +205,7 @@ public class ActivitySchool extends BaseModel implements Serializable , SysHomeC
sysHomeActivity.setName(this.getName()); sysHomeActivity.setName(this.getName());
sysHomeActivity.setCover(this.getImage()); sysHomeActivity.setCover(this.getImage());
sysHomeActivity.setUrl("/platform/activity/apply"); sysHomeActivity.setUrl("/platform/activity/apply");
sysHomeActivity.setH5Url(null); sysHomeActivity.setH5Url("/platform/activity/apply/h5/index?id=" + this.getId());
sysHomeActivity.setStartDate(DateUtil.parseDate(this.getApplyStartTime())); sysHomeActivity.setStartDate(DateUtil.parseDate(this.getApplyStartTime()));
sysHomeActivity.setEndDate(DateUtil.parseDate(this.getApplyEndTime())); sysHomeActivity.setEndDate(DateUtil.parseDate(this.getApplyEndTime()));
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId()); sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
@@ -2,7 +2,6 @@ package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.dayofficework.ghkh.model.ExamConfig; import com.budwk.app.zhgh.dayofficework.ghkh.model.ExamConfig;
@@ -5,13 +5,11 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService; 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.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_record; import com.budwk.app.zhgh.dayofficework.ghkh.model.*;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService; import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService; import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService;
import com.google.common.util.concurrent.AtomicDouble;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -26,7 +24,6 @@ import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* Created with IntelliJ IDEA. * Created with IntelliJ IDEA.
@@ -85,7 +82,7 @@ public class GhKhZpController {
if (zp.length == 0) { if (zp.length == 0) {
return null; return null;
} }
int score = 0; double score = 0;
for (Kh_zp kh_zp : zp) { for (Kh_zp kh_zp : zp) {
kh_zp.setFlatid(SecurityUtil.getUnionId()); kh_zp.setFlatid(SecurityUtil.getUnionId());
khzpService.dao().insertOrUpdate(kh_zp); khzpService.dao().insertOrUpdate(kh_zp);
@@ -99,7 +96,7 @@ public class GhKhZpController {
record.setZb_id(zp[0].getZb_id()); record.setZb_id(zp[0].getZb_id());
record.setUnion_id(SecurityUtil.getUnionId()); record.setUnion_id(SecurityUtil.getUnionId());
record.setZp_score(score); record.setZp_score(score);
record.setXgh_score(0); record.setXgh_score((double) 0);
record.setState("submit".equals(handletype) ? 2 : 1); record.setState("submit".equals(handletype) ? 2 : 1);
record.setFillTime(DateUtil.now()); record.setFillTime(DateUtil.now());
} else { } else {
@@ -118,14 +115,20 @@ public class GhKhZpController {
public Result openView(String id) { public Result openView(String id) {
Kh_zb khzb = khZbService.khzb(id); Kh_zb khzb = khZbService.khzb(id);
List<Kh_zp> list = khzpService.query(Cnd.where("zb_id", "=", id).and("flatid", "=", SecurityUtil.getUnionId())); List<Kh_zp> list = khzpService.query(Cnd.where("zb_id", "=", id).and("flatid", "=", SecurityUtil.getUnionId()));
khzb.getNrs().forEach(nr -> { for (kh_nr nr : khzb.getNrs()) {
nr.getBzs().forEach(bz -> { for (Kh_bz bz : nr.getBzs()) {
Kh_zp zp = list.stream().filter(v -> v.getBz_id().equals(bz.getId())).findFirst().orElse(null); Kh_zp zp = list.stream().filter(v -> v.getBz_id().equals(bz.getId())).findFirst().orElse(null);
if (zp != null) { if (zp != null) {
bz.setZp(zp); bz.setZp(zp);
} }
}); Kh_xghsh xghsh = khZbService.dao().fetch(Kh_xghsh.class, Cnd.where("zb_id", "=", id).and("bz_id", "=", bz.getId())
}); .and("flatid", "=", SecurityUtil.getUnionId()));
if(xghsh != null) {
bz.setSchools(xghsh.getSchools());
bz.setAddition(xghsh.getAddition());
}
}
}
NutMap nutMap = Lang.obj2nutmap(khzb); NutMap nutMap = Lang.obj2nutmap(khzb);
Kh_record record = khZbService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", id).and("union_id", "=", SecurityUtil.getUnionId())); Kh_record record = khZbService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", id).and("union_id", "=", SecurityUtil.getUnionId()));
if(record != null) { if(record != null) {
@@ -143,7 +146,7 @@ public class GhKhZpController {
throw new RuntimeException("缺少record信息"); throw new RuntimeException("缺少record信息");
} }
AtomicInteger score = new AtomicInteger(); AtomicDouble score = new AtomicDouble();
zb.getNrs().forEach(nr -> { zb.getNrs().forEach(nr -> {
nr.getBzs().forEach(bz -> { nr.getBzs().forEach(bz -> {
@@ -170,7 +173,7 @@ public class GhKhZpController {
public Result subXgh(@Param(value = "zb") Kh_zb zb) { public Result subXgh(@Param(value = "zb") Kh_zb zb) {
Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", zb.getId()).and("union_id", "=", SecurityUtil.getUnionId())); Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", zb.getId()).and("union_id", "=", SecurityUtil.getUnionId()));
AtomicInteger score = new AtomicInteger(); AtomicDouble score = new AtomicDouble();
zb.getNrs().forEach(nr -> { zb.getNrs().forEach(nr -> {
@@ -187,7 +190,7 @@ public class GhKhZpController {
record.setZb_id(zb.getId()); record.setZb_id(zb.getId());
record.setUnion_id(SecurityUtil.getUnionId()); record.setUnion_id(SecurityUtil.getUnionId());
record.setZp_score(score.get()); record.setZp_score(score.get());
record.setXgh_score(0); record.setXgh_score((double) 0);
record.setState(2); record.setState(2);
baseService.dao().insert(record); baseService.dao().insert(record);
return Result.success(); return Result.success();
@@ -2,8 +2,10 @@ package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_bz;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb; import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.kh_nr; 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.KhBzService;
@@ -16,6 +18,7 @@ import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
@@ -23,6 +26,8 @@ import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* Created with IntelliJ IDEA. * Created with IntelliJ IDEA.
@@ -101,21 +106,53 @@ public class GhkhGhzbController {
@SaCheckPermission("ghkh.khzb") @SaCheckPermission("ghkh.khzb")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Result doEdit(@Param(value = "kh_zb") Kh_zb kh_zb, @Param(value = "type") String type) { public Result doEdit(@Param(value = "kh_zb") Kh_zb kh_zb, @Param(value = "type") String type) {
khZbService.updateIgnoreNull(kh_zb); // 查出数据库里面的考核内容和标准,找出需要删除的
List<kh_nr> nrList = khNrService.query(Cnd.where(kh_nr::getZb_id, "=", kh_zb.getId()));
// 查出考核内容(那个傻逼写的,他妈的zb_id都他妈的不存,真的是人才嘞,我踏马还要去根据nrList里面的主键Id去查询)
Set<String> nrIdList = nrList.stream().map(kh_nr::getId).collect(Collectors.toSet());
List<Kh_bz> bzList = khBzService.query(Cnd.where(Kh_bz::getNr_id, "in", nrIdList));
List<kh_nr> query = khNrService.query(Cnd.where("zb_id", "=", kh_zb.getId())); // 构建考核内容
List<kh_nr> nrs = kh_zb.getNrs().stream().peek(v -> v.setZb_id(kh_zb.getId())).toList();
List<String> webNrIdList = nrs.stream().map(kh_nr::getId).toList();
for (kh_nr kh_nr : query) { // 构建考核标准
System.err.println(kh_nr.getZb_id()); List<Kh_bz> bzs = nrs.stream()
khBzService.clear(Cnd.where("nr_id", "=", kh_nr.getId())); .map(v -> {
} return v.getBzs().stream().peek(bz -> {
bz.setNr_id(v.getId());
bz.setZb_id(kh_zb.getId());
}).toList();
}).flatMap(List::stream).toList();
List<String> webBzIdList = bzs.stream().map(Kh_bz::getId).toList();
khNrService.clear(Cnd.where("zb_id", "=", kh_zb.getId()));
for (kh_nr nr : kh_zb.getNrs()) { // 找不同,找出需要删除的内容和标准
nr.setZb_id(kh_zb.getId()); List<kh_nr> deleteNrs = nrList.stream().filter(v -> !webNrIdList.contains(v.getId())).toList();
khNrService.insertWith(nr, "bzs"); List<Kh_bz> deleteBzs = bzList.stream().filter(v -> !webBzIdList.contains(v.getId())).toList();
}
// 找出bzs和nrs中Id是null的
List<kh_nr> insertNrList = nrs.stream().filter(v -> StrUtil.isBlank(v.getId())).toList();
List<Kh_bz> insertBzList = bzs.stream().filter(v -> StrUtil.isBlank(v.getId())).toList();
// 新增数据
khBzService.insert(insertBzList);
khNrService.insert(insertNrList);
// 删除数据
if (Lang.isNotEmpty(deleteNrs)) {
khNrService.delete(deleteNrs.stream().map(kh_nr::getId).toList());
}
if (Lang.isNotEmpty(deleteBzs)) {
khBzService.delete(deleteBzs.stream().map(Kh_bz::getId).toList());
}
// 修改考核指标
khZbService.updateIgnoreNull(kh_zb);
// 新增或修改考核内容
khNrService.updateIgnoreNull(nrs);
// 新增或修改考核标准
khBzService.updateIgnoreNull(bzs);
return Result.success(); return Result.success();
} }
@@ -7,17 +7,17 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil; import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.ghkh.model.ExamConfig; import com.budwk.app.zhgh.dayofficework.ghkh.model.ExamConfig;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_record; import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_record;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService; import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService; import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import io.swagger.models.auth.In;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
@@ -28,6 +28,8 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -66,6 +68,10 @@ public class GhkhKhphController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
boolean isAdmin = AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name());
if(!isAdmin) {
cnd.and("re.union_id", "=", SecurityUtil.getUnionId());
}
cnd.and("re.zb_id ", "=", khid); cnd.and("re.zb_id ", "=", khid);
cnd.and("re.state", "=", 3); cnd.and("re.state", "=", 3);
cnd.andEX("zb.`annual`","=",annual); cnd.andEX("zb.`annual`","=",annual);
@@ -83,16 +89,17 @@ public class GhkhKhphController {
@At @At
@SaCheckLogin @SaCheckLogin
public Result doEditScore(String id, Integer score, String khId) { public Result doEditScore(String id, Double score, String khId) {
Kh_record record = khZbService.dao().fetch(Kh_record.class, id); Kh_record record = khZbService.dao().fetch(Kh_record.class, id);
ExamConfig config = khZbService.dao().fetch(ExamConfig.class, Cnd.NEW()); ExamConfig config = khZbService.dao().fetch(ExamConfig.class, Cnd.NEW());
record.setOffLineScore(score); record.setOffLineScore(score);
if(config.getOffLine() != null) { if(config.getOffLine() != null) {
record.setOffLineFinalScore(score * config.getOffLine() * 0.01); record.setOffLineFinalScore(score * config.getOffLine() * 0.01);
} else { } else {
record.setOffLineFinalScore(Double.valueOf(score)); record.setOffLineFinalScore(score);
} }
record.setTotalScore(record.getOnLineFinalScore() + record.getOffLineFinalScore()); BigDecimal bd = BigDecimal.valueOf(record.getOffLineFinalScore()).setScale(2, RoundingMode.HALF_UP);
record.setTotalScore(record.getOnLineFinalScore() + bd.doubleValue());
khZbService.dao().update(record); khZbService.dao().update(record);
List<Kh_record> list = khZbService.dao().query(Kh_record.class, Cnd.where("zb_id", "=", khId).desc("totalScore")); List<Kh_record> list = khZbService.dao().query(Kh_record.class, Cnd.where("zb_id", "=", khId).desc("totalScore"));
@@ -113,6 +120,10 @@ public class GhkhKhphController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
boolean isAdmin = AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name());
if(!isAdmin) {
cnd.and("re.union_id", "=", SecurityUtil.getUnionId());
}
cnd.and("re.zb_id ", "=", khid); cnd.and("re.zb_id ", "=", khid);
cnd.and("re.state", "=", 3); cnd.and("re.state", "=", 3);
cnd.andEX("zb.`annual`","=",annual); cnd.andEX("zb.`annual`","=",annual);
@@ -130,7 +141,7 @@ public class GhkhKhphController {
List<ExcelExportEntity> exportEntities = new ArrayList<>(); List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("序号", "index", 10)); exportEntities.add(new ExcelExportEntity("序号", "index", 10));
exportEntities.add(new ExcelExportEntity("年度", "annual", 10)); exportEntities.add(new ExcelExportEntity("年度", "annual", 10));
exportEntities.add(new ExcelExportEntity("分工会名称", "unionname", 30)); exportEntities.add(new ExcelExportEntity("分工会名称", "unionName", 30));
exportEntities.add(new ExcelExportEntity("线上得分", "xgh_score", 20)); exportEntities.add(new ExcelExportEntity("线上得分", "xgh_score", 20));
exportEntities.add(new ExcelExportEntity("线上最终得分" + (config.getOnLine() != null ? "" + config.getOnLine() + "%" : ""), "onLineFinalScore", 20)); exportEntities.add(new ExcelExportEntity("线上最终得分" + (config.getOnLine() != null ? "" + config.getOnLine() + "%" : ""), "onLineFinalScore", 20));
exportEntities.add(new ExcelExportEntity("线下得分", "offLineScore", 20)); exportEntities.add(new ExcelExportEntity("线下得分", "offLineScore", 20));
@@ -6,7 +6,6 @@ import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_record;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_xghsh; import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_xghsh;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb; import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp; import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp;
@@ -16,7 +15,6 @@ import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -4,7 +4,7 @@ package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService; 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.model.*;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService; import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService; import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
@@ -12,15 +12,17 @@ import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; 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.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST; import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List; import java.util.List;
/** /**
@@ -50,25 +52,26 @@ public class GhkhXghshController {
@Param(value = "unionid") String unionid, int pageNumber, int pageSize, @Param(value = "unionid") String unionid, int pageNumber, int pageSize,
@Param(value = "pageOrderName") String pageOrderName, @Param(value = "pageOrderName") String pageOrderName,
@Param(value = "pageOrderBy") String pageOrderBy) { @Param(value = "pageOrderBy") String pageOrderBy) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
zb.assessment, zb.assessment,
zb.annual, zb.annual,
un.unionName, un.unionName,
un.unionCode,( un.unionCode,(
SELECT SELECT
sum( score ) sum( score )
FROM FROM
kh_bz kh_bz
WHERE WHERE
nr_id IN ( SELECT id FROM kh_nr WHERE zb_id = zb.id )) bzf, nr_id IN ( SELECT id FROM kh_nr WHERE zb_id = zb.id )) bzf,
re.* re.*,
FROM (select ifnull(sum(schools), 0) from kh_xghsh where flatid = re.union_id and nr_id in (select id from kh_nr where zb_id = re.zb_id and auditUser = @loginName)) as self_score
kh_record re FROM
LEFT JOIN kh_zb zb ON re.zb_id = zb.id kh_record re
LEFT JOIN `vw_user` un ON re.union_id = un.unionId LEFT JOIN kh_zb zb ON re.zb_id = zb.id
$condition LEFT JOIN `vw_user` un ON re.union_id = un.unionId
"""); $condition
""").setParam("loginName", SecurityUtil.getUserLoginname());
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
/*cnd.and("re.state", "=", 2);*/ /*cnd.and("re.state", "=", 2);*/
cnd.and("zb.disabled", "=", true); cnd.and("zb.disabled", "=", true);
@@ -132,38 +135,64 @@ public class GhkhXghshController {
return null; 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()).and("nr_id", "in", contentIds));
khXghshService.dao().clear(Kh_xghsh.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("flatid", "=", pf[0].getFlatid())); double score = 0D;
for (Kh_xghsh p : pf) { for (Kh_xghsh p : pf) {
khzpService.dao().insert(p); if(contentIds.contains(p.getNr_id())) {
score += p.getSchools() != null ? p.getSchools() : 0; khzpService.dao().insert(p);
}
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) {
record.setXgh_score(score);
ExamConfig config = baseService.dao().fetch(ExamConfig.class, Cnd.NEW());
if(config.getOnLine() != null) {
record.setOnLineFinalScore(score * config.getOnLine() * 0.01);
} else {
record.setOnLineFinalScore((double) score);
}
record.setTotalScore(record.getOnLineFinalScore());
if("submit".equals(type)) {
record.setState(3);
} }
baseService.dao().update(record); score += p.getSchools() != null ? p.getSchools() : 0;
} }
List<Kh_record> list = khZbService.dao().query(Kh_record.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).desc("totalScore")); Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("union_id", "=", pf[0].getFlatid()));
for (int i = 0; i < list.size(); i++) { if (record != null && "submit".equals(type)) {
list.get(i).setSort(i + 1); record.setXgh_score(score);
baseService.dao().update(record);
} }
khZbService.dao().update(list);
return Result.success(); return Result.success();
} }
@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()));
Double score = 0D;
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);
} else {
record.setOnLineFinalScore(score);
}
BigDecimal bd = BigDecimal.valueOf(record.getOnLineFinalScore()).setScale(2, RoundingMode.HALF_UP);
record.setTotalScore(bd.doubleValue());
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);
}
khZbService.dao().update(list);
}
return Result.success();
}
} }
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller; package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -9,14 +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.KhBzService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhNrService; import com.budwk.app.zhgh.dayofficework.ghkh.service.KhNrService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService; 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.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST; import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.time.LocalDateTime;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
/** /**
@@ -64,6 +70,31 @@ public class GhkhXjkhzbController {
@At @At
public Result getZbList() { public Result getZbList() {
return Result.success(khZbService.query()); 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));
}
} }
@@ -1,9 +1,9 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model; package com.budwk.app.zhgh.dayofficework.ghkh.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data; import lombok.Data;
import org.nutz.dao.DB; import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
/** /**
@@ -96,6 +96,6 @@ public class Kh_bz extends BaseModel {
private Kh_zp zp; private Kh_zp zp;
private Kh_xghsh sh; private Kh_xghsh sh;
private Integer schools; private Double schools;
private String addition; private String addition;
} }
@@ -38,14 +38,14 @@ public class Kh_record {
@Column @Column
@Comment("自评得分") @Comment("自评得分")
@ColDefine(type = ColType.INT, width = 4) @ColDefine(type = ColType.DOUBLE, width = 4)
private Integer zp_score; private Double zp_score;
@Column @Column
@Comment("校工会评分") @Comment("校工会评分")
@ColDefine(type = ColType.INT, width = 4) @ColDefine(type = ColType.DOUBLE, width = 4)
@Default(value = "0") @Default(value = "0")
private Integer xgh_score; private Double xgh_score;
@Column @Column
@Comment("线上最终得分") @Comment("线上最终得分")
@@ -60,9 +60,9 @@ public class Kh_record {
@Column @Column
@Comment("线下得分") @Comment("线下得分")
@ColDefine(type = ColType.INT, width = 4) @ColDefine(type = ColType.DOUBLE, width = 4)
@Default(value = "0") @Default(value = "0")
private Integer offLineScore; private Double offLineScore;
@Column @Column
@Comment("线下最终得分") @Comment("线下最终得分")
@@ -1,8 +1,9 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model; package com.budwk.app.zhgh.dayofficework.ghkh.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.DB; import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
/** /**
@@ -12,6 +13,7 @@ import com.budwk.app.base.model.BaseModel;
* @Date: 2020/09/25/11:59 * @Date: 2020/09/25/11:59
* @Description:校工会审核 * @Description:校工会审核
*/ */
@Data
@Table("Kh_xghsh") @Table("Kh_xghsh")
public class Kh_xghsh extends BaseModel { public class Kh_xghsh extends BaseModel {
@@ -25,9 +27,9 @@ public class Kh_xghsh extends BaseModel {
@Column @Column
@Comment("校工会评分") @Comment("校工会评分")
@ColDefine(type = ColType.INT, width = 4) @ColDefine(type = ColType.DOUBLE, width = 4)
@Default("0") @Default("0")
private Integer schools; private Double schools;
@Column @Column
@Comment("加、减原因") @Comment("加、减原因")
@@ -61,78 +63,4 @@ public class Kh_xghsh extends BaseModel {
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_xghsh"), @SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_xghsh"),
}) })
private Integer location; private Integer location;
public String getZb_id() {
return zb_id;
}
public void setZb_id(String zb_id) {
this.zb_id = zb_id;
}
public String getNr_id() {
return nr_id;
}
public void setNr_id(String nr_id) {
this.nr_id = nr_id;
}
public Integer getLocation() {
return location;
}
public void setLocation(Integer location) {
this.location = location;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getSchools() {
return schools;
}
public void setSchools(Integer schools) {
this.schools = schools;
}
public String getAddition() {
return addition;
}
public void setAddition(String addition) {
this.addition = addition;
}
public String getFlatid() {
return flatid;
}
public void setFlatid(String flatid) {
this.flatid = flatid;
}
public String getBz_id() {
return bz_id;
}
public void setBz_id(String bz_id) {
this.bz_id = bz_id;
}
public Kh_bz getBz() {
return bz;
}
public void setBz(Kh_bz bz) {
this.bz = bz;
}
} }
@@ -1,10 +1,10 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model; package com.budwk.app.zhgh.dayofficework.ghkh.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.nutz.dao.DB; import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
@@ -1,10 +1,11 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model; package com.budwk.app.zhgh.dayofficework.ghkh.model;
import lombok.Data;
import org.nutz.dao.DB; import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.lang.util.NutMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created with IntelliJ IDEA. * Created with IntelliJ IDEA.
@@ -13,10 +14,10 @@ import java.util.Map;
* @Date: 2020/09/27/20:13 * @Date: 2020/09/27/20:13
* @Description: * @Description:
*/ */
@Data
@Table("Kh_zp") @Table("Kh_zp")
public class Kh_zp { public class Kh_zp {
@Column @Column
@Name @Name
@Comment("id") @Comment("id")
@@ -28,10 +29,12 @@ public class Kh_zp {
@Comment("标准id") @Comment("标准id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String bz_id; private String bz_id;
@Column @Column
@Comment("指标id") @Comment("指标id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String zb_id; private String zb_id;
@Column @Column
@Comment("内容id") @Comment("内容id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
@@ -52,92 +55,21 @@ public class Kh_zp {
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String flatid; private String flatid;
@Column @Column
@Comment("文件") @Comment("文件")
@ColDefine(type = ColType.MYSQL_JSON) @ColDefine(type = ColType.MYSQL_JSON)
private List<Map> files; private List<NutMap> files;
@Column @Column
@Comment("排序字段") @Comment("排序字段")
@Prev({ @Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_zp"), @SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_zp"),
}) })
private Integer location; private Integer location;
public String getId() { @Column
return id; @Comment("是否修改,默认为false")
} @ColDefine(type = ColType.BOOLEAN)
@Default("0")
public void setId(String id) { private Boolean updateStatus;
this.id = id;
}
public String getBz_id() {
return bz_id;
}
public void setBz_id(String bz_id) {
this.bz_id = bz_id;
}
public String getZb_id() {
return zb_id;
}
public void setZb_id(String zb_id) {
this.zb_id = zb_id;
}
public String getNr_id() {
return nr_id;
}
public void setNr_id(String nr_id) {
this.nr_id = nr_id;
}
public String getClnr() {
return clnr;
}
public void setClnr(String clnr) {
this.clnr = clnr;
}
public Integer getZpf() {
return zpf;
}
public void setZpf(Integer zpf) {
this.zpf = zpf;
}
public String getFlatid() {
return flatid;
}
public void setFlatid(String flatid) {
this.flatid = flatid;
}
public List<Map> getFiles() {
return files;
}
public void setFiles(List<Map> files) {
this.files = files;
}
public Integer getLocation() {
return location;
}
public void setLocation(Integer location) {
this.location = location;
}
} }
@@ -1,9 +1,9 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model; package com.budwk.app.zhgh.dayofficework.ghkh.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data; import lombok.Data;
import org.nutz.dao.DB; import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
import java.util.List; import java.util.List;
@@ -54,5 +54,8 @@ public class kh_nr extends BaseModel {
}) })
private Integer location; private Integer location;
@Column
@Comment("审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String auditUser;
} }
@@ -40,7 +40,7 @@ layout("/layouts/platform.html"){
<el-table-column label="年度" prop="annual" header-align="center" <el-table-column label="年度" prop="annual" header-align="center"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column label="分工会名称" prop="unionname" header-align="center" <el-table-column label="分工会名称" prop="unionName" header-align="center"
show-overflow-tooltip show-overflow-tooltip
align="center" sortable></el-table-column> align="center" sortable></el-table-column>
<el-table-column label="线上得分" prop="xgh_score" header-align="center" <el-table-column label="线上得分" prop="xgh_score" header-align="center"
@@ -53,7 +53,7 @@ layout("/layouts/platform.html"){
show-overflow-tooltip show-overflow-tooltip
align="center" sortable> align="center" sortable>
<template scope="scope"> <template scope="scope">
<div> <div v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')">
<div v-if="rowDataEdit && rowDataIndex==scope.$index"> <div v-if="rowDataEdit && rowDataIndex==scope.$index">
<el-input placeholder="请输入线下得分" <el-input placeholder="请输入线下得分"
autofocus autofocus
@@ -66,6 +66,9 @@ layout("/layouts/platform.html"){
<i class="el-icon-edit" style="color: #0a84ff"></i> <i class="el-icon-edit" style="color: #0a84ff"></i>
</div> </div>
</div> </div>
<div v-else>
{{scope.row.offLineScore}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="'线下最终得分' + (examConfig.offLine ? '' + examConfig.offLine + '%' : '')" prop="offLineFinalScore" header-align="center" <el-table-column :label="'线下最终得分' + (examConfig.offLine ? '' + examConfig.offLine + '%' : '')" prop="offLineFinalScore" header-align="center"
@@ -47,10 +47,10 @@ layout("/layouts/platform.html"){
:width="column.width" :width="column.width"
header-align="center" header-align="center"
show-overflow-tooltip> show-overflow-tooltip>
<template scope="{row}" v-if="column.prop==='startTime'"> <template scope="{row}" v-if="column.prop=='startTime'">
<span>{{row.startDateTime}} - {{row.endDateTime}}</span> <span>{{row.startDateTime}} - {{row.endDateTime}}</span>
</template> </template>
<template scope="{row}" v-else-if="column.prop==='disabled'"> <template scope="{row}" v-else-if="column.prop=='disabled'">
<el-switch <el-switch
v-model="row.disabled" v-model="row.disabled"
active-color="#13ce66" active-color="#13ce66"
@@ -2,6 +2,11 @@
layout("/layouts/platform.html"){ layout("/layouts/platform.html"){
#--> #-->
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<div id="app" v-cloak> <div id="app" v-cloak>
@@ -47,7 +52,7 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<el-table-column label="年度" prop="annual" header-align="center" <el-table-column label="年度" prop="annual" header-align="center"
width="300px" sortable sortable
align="center"> align="center">
<template scope="scope"> <template scope="scope">
{{scope.row.annual}} {{scope.row.annual}}
@@ -74,11 +79,15 @@ layout("/layouts/platform.html"){
show-overflow-tooltip v-if="examConfig.selfAssessment === true" show-overflow-tooltip v-if="examConfig.selfAssessment === true"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column label="校工会评分" sortable prop="xgh_score" <el-table-column label="您的评分" sortable prop="self_score"
header-align="center" header-align="center"
show-overflow-tooltip show-overflow-tooltip
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column label="校工会评分" sortable prop="xgh_score"
header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="状态" prop="name" header-align="center" <el-table-column label="状态" prop="name" header-align="center"
align="center"> align="center">
@@ -90,11 +99,14 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" <el-table-column align="center" header-align="center" label="操作"
fixed="right" width="120px"> fixed="right" width="160px">
<template scope="scope"> <template scope="scope">
<el-button size="mini" :disabled="scope.row.state==3" type="primary" <el-button size="mini" :disabled="scope.row.state==3" type="primary"
@click="openShGh(scope.row)">评分 @click="openShGh(scope.row)">评分
</el-button> </el-button>
<el-button size="mini" type="primary" :disabled="scope.row.state==3"
@click="doSubmit(scope.row)">提交
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -123,81 +135,83 @@ layout("/layouts/platform.html"){
</el-descriptions> </el-descriptions>
<table-tool label="考核内容" class="mt10"></table-tool> <table-tool label="考核内容" class="mt10"></table-tool>
<el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs"> <el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs" v-if="nr?.auditUser === $store.state.user.loginname">
<el-row type="flex" align="middle" justify="space-between"> <template>
<el-input v-model="nr.content" readonly maxlength="30" placeholder="请填写考核内容"> <el-row type="flex" align="middle" justify="space-between">
<template slot="prepend"><span>{{ idx + 1 }}</span></template> <el-input v-model="nr.content" readonly maxlength="30" placeholder="请填写考核内容">
</el-input> <template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-row> </el-input>
<el-row style="margin-top: 20px"> </el-row>
<el-table :data="nr.bzs" style="width: 100%" border show-summary size="small" :summary-method="getSummaries"> <el-row style="margin-top: 20px">
<el-table-column align="center" header-align="center" label="序号" <el-table :data="nr.bzs" style="width: 100%" border show-summary size="small" :summary-method="getSummaries"
type="index" width="60"> :row-class-name="tableRowClassName">
</el-table-column> <el-table-column align="center" header-align="center" label="序号"
type="index" width="60">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection" <el-table-column label="考核标准" disabled prop="inspection"
header-align="center" align="center"> header-align="center" align="center">
<template scope="{row}"> <template scope="{row}">
<el-input v-model="row.inspection" <el-input v-model="row.inspection"
readonly placeholder="请填写考核标准"></el-input> readonly placeholder="请填写考核标准"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标准分" prop="score" header-align="center" <el-table-column label="标准分" prop="score" header-align="center"
align="center"> align="center">
<template scope="{row}"> <template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4" <el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input> placeholder="请填写标准分"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center" <el-table-column label="自评得分" prop="zpf" header-align="center"
align="center" v-if="examConfig.selfAssessment === true"> align="center" v-if="examConfig.selfAssessment === true">
<template scope="{row}"> <template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf" <el-input v-if="row.zpf" v-model.number="row.zpf"
maxlength="4" maxlength="4"
readonly placeholder="请填写自评分"></el-input> readonly placeholder="请填写自评分"></el-input>
<el-input v-else value="暂无" maxlength="4" <el-input v-else value="暂无" maxlength="4"
readonly></el-input> readonly></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="校工会评分" prop="schools" header-align="center" <el-table-column label="校工会评分" prop="schools" header-align="center"
align="center"> align="center">
<template scope="{row}"> <template scope="{row}">
<el-input v-model.number="row.schools" maxlength="4" <el-input v-model="row.schools" maxlength="4"
placeholder="请填写评分"></el-input> placeholder="请填写评分" type="number"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="加、减原因" prop="addition" header-align="center" <el-table-column label="加、减原因" prop="addition" header-align="center"
align="center"> align="center">
<template scope="{row}"> <template scope="{row}">
<el-input v-model.number="row.addition" maxlength="50" <el-input v-model="row.addition" maxlength="50"
placeholder="请填写加、减原因"></el-input> placeholder="请填写加、减原因"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="佐证材料数量" header-align="center" align="center" width="100" prop="fileCount"> <el-table-column label="佐证材料数量" header-align="center" align="center" width="100" prop="fileCount">
<template scope="scope"> <template scope="scope">
<span v-if="scope.row.zp?.files?.length > 0" class="text-success" style="font-weight: bolder; font-size: 16px"> <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> {{ scope.row.zp?.files?.length || 0 }}</span>
<span v-else>0</span> <span v-else>0</span>
</template> </template>
</el-table-column> </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>
<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-item>
</el-form> </el-form>
</template> </template>
@@ -245,6 +259,7 @@ layout("/layouts/platform.html"){
window.vue = new Vue({ window.vue = new Vue({
el: '#app', el: '#app',
store,
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
@@ -290,6 +305,12 @@ layout("/layouts/platform.html"){
'upload-materials': httpVueLoader('/components/module/kh/UploadMaterials.vue') 'upload-materials': httpVueLoader('/components/module/kh/UploadMaterials.vue')
}, },
methods: { methods: {
tableRowClassName({row, rowIndex}) {
if(row.zp?.updateStatus === true) {
return 'warning-row';
}
return '';
},
addForm() { addForm() {
this.formData.nrs[this.idx].bzs[this.index].zp = this.data this.formData.nrs[this.idx].bzs[this.index].zp = this.data
this.dialog = false this.dialog = false
@@ -356,6 +377,24 @@ layout("/layouts/platform.html"){
loading.close() 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) { doView(nr, bz, row, index, idx) {
this.dialog = true this.dialog = true
this.viewRow = row this.viewRow = row
@@ -374,7 +413,7 @@ layout("/layouts/platform.html"){
sums[index] = ''; sums[index] = '';
return; return;
} else if (column.property === 'fileCount') { } else if (column.property === 'fileCount') {
const zpfs = data.map(v => v['zp']['files']?.length || 0) const zpfs = data.map(v => v.zp?.files?.length || 0)
sums[index] = zpfs.reduce((a, b) => { sums[index] = zpfs.reduce((a, b) => {
return a + b; return a + b;
}) + ' 个' }) + ' 个'
@@ -203,14 +203,14 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<el-table-column label="单项分" prop="single_score" header-align="center" align="center" <el-table-column label="单项分" prop="single_score" header-align="center" align="center"
v-if="examConfig.displaySingleItem === true" width="250px"> v-if="examConfig.displaySingleItem === true" width="120px">
<template scope="{row}"> <template scope="{row}">
<el-input v-model.number="row.single_score" readonly maxlength="4"></el-input> <el-input v-model.number="row.single_score" readonly maxlength="4"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标准分" prop="score" header-align="center" align="center" <el-table-column label="标准分" prop="score" header-align="center" align="center"
width="250px"> width="120px">
<template scope="{row}"> <template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4" <el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input> placeholder="请填写标准分"></el-input>
@@ -218,7 +218,7 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center" align="center" <el-table-column label="自评得分" prop="zpf" header-align="center" align="center"
width="250px" v-if="examConfig.selfAssessment === true"> width="120px" v-if="examConfig.selfAssessment === true">
<template scope="{row}"> <template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf" maxlength="4" <el-input v-if="row.zpf" v-model.number="row.zpf" maxlength="4"
readonly placeholder="请填写自评分"></el-input> readonly placeholder="请填写自评分"></el-input>
@@ -227,6 +227,20 @@ layout("/layouts/platform.html"){
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="校工会评分" prop="schools" header-align="center"
align="center" width="120px">
<template scope="{row}">
{{ row.schools || '暂无评分' }}
</template>
</el-table-column>
<el-table-column label="加、减原因" prop="addition" header-align="center"
align="center" show-overflow-tooltip width="200">
<template scope="{row}">
{{ row.addition || '暂无原因' }}
</template>
</el-table-column>
<el-table-column label="佐证材料数量" header-align="center" align="center" width="100" prop="fileCount"> <el-table-column label="佐证材料数量" header-align="center" align="center" width="100" prop="fileCount">
<template scope="scope"> <template scope="scope">
<span v-if="scope.row.zp?.files?.length > 0" class="text-success" style="font-weight: bolder; font-size: 16px"> <span v-if="scope.row.zp?.files?.length > 0" class="text-success" style="font-weight: bolder; font-size: 16px">
@@ -236,7 +250,7 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<el-table-column label="佐证材料" header-align="center" align="center" <el-table-column label="佐证材料" header-align="center" align="center"
width="250px" prop="files"> width="200px" prop="files">
<template scope="{row}"> <template scope="{row}">
<el-button v-if="!row.isEvidence" plain size="small" type="info">此项无需佐证材料</el-button> <el-button v-if="!row.isEvidence" plain size="small" type="info">此项无需佐证材料</el-button>
<el-button :type="row.zp?.files?.length > 0 ? 'success' : 'primary'" <el-button :type="row.zp?.files?.length > 0 ? 'success' : 'primary'"
@@ -543,17 +557,17 @@ layout("/layouts/platform.html"){
if (index === 0) { if (index === 0) {
sums[index] = '小计'; sums[index] = '小计';
return; return;
} else if (['inspection', 'files'].includes(column.property)) { } else if (['inspection', 'files', 'addition'].includes(column.property)) {
sums[index] = ''; sums[index] = '';
return; return;
} else if (column.property === 'zp.zpf' && this.examConfig.selfAssessment === true) { } else if (column.property === 'zp.zpf' && this.examConfig.selfAssessment === true) {
const zpfs = data.map(v => v['zp']['zpf'] || 0) const zpfs = data.map(v => v.zp?.zpf || 0)
sums[index] = zpfs.reduce((a, b) => { sums[index] = zpfs.reduce((a, b) => {
return a + b; return a + b;
}) + ' 分' }) + ' 分'
return; return;
} else if (column.property === 'fileCount') { } else if (column.property === 'fileCount') {
const zpfs = data.map(v => v['zp']['files']?.length || 0) const zpfs = data.map(v => v.zp?.files?.length || 0)
sums[index] = zpfs.reduce((a, b) => { sums[index] = zpfs.reduce((a, b) => {
return a + b; return a + b;
}) + ' 个' }) + ' 个'
@@ -628,12 +642,12 @@ layout("/layouts/platform.html"){
} }
// 考核还没结束 // 考核还没结束
if(this.$moment().isBefore(this.$moment(row.endDateTime))) { if(this.$moment().isBefore(this.$moment(row.endDateTime))) {
if(row.state === 3) { if(row.state === 2 || row.state === 3) {
this.$message.error("当前时间未在申诉期内,不能修改") this.$message.error("当前时间未在申诉期内,不能修改")
return return
} }
} else if(this.$moment().isAfter(this.$moment(row.endDateTime)) && this.$moment().isBefore(this.$moment(row.startApplyTime))) { } else if(this.$moment().isAfter(this.$moment(row.endDateTime)) && this.$moment().isBefore(this.$moment(row.startApplyTime))) {
if(row.state === 3) { if(row.state === 2 || row.state === 3) {
this.$message.error("当前时间未在申诉期内,不能修改") this.$message.error("当前时间未在申诉期内,不能修改")
return return
} }