Merge remote-tracking branch 'origin/main'

This commit is contained in:
zhaoxinyu
2024-09-20 16:57:02 +08:00
31 changed files with 991 additions and 231 deletions
+19 -20
View File
@@ -87,8 +87,8 @@ public class MsgApi {
log.info(Json.toJson(bodyMap)); log.info(Json.toJson(bodyMap));
String url = DOMAIN + SEND_URL + "?appid=%s&tokenid=%s&schoolcode=%s".formatted(APP_ID, getMsgToken(), SCHOOL_CODE); String url = DOMAIN + SEND_URL + "?appid=%s&tokenid=%s&schoolcode=%s".formatted(APP_ID, getMsgToken(), SCHOOL_CODE);
String content = ""; //String content = "";
// String content = Http.post(url, Map.of("message", Json.toJson(bodyMap)), Sender.Default_Read_Timeout); String content = Http.post(url, Map.of("message", Json.toJson(bodyMap)), Sender.Default_Read_Timeout);
NutMap contentMap = Json.fromJson(NutMap.class, content); NutMap contentMap = Json.fromJson(NutMap.class, content);
Sys_wechat_msg wechatMsg = new Sys_wechat_msg(); Sys_wechat_msg wechatMsg = new Sys_wechat_msg();
@@ -110,24 +110,23 @@ public class MsgApi {
* @return * @return
*/ */
public String getMsgToken() { public String getMsgToken() {
// String token = redisService.get(TOKEN_NAME); String token = redisService.get(TOKEN_NAME);
// if (StrUtil.isBlank(token)) { if (StrUtil.isBlank(token)) {
// Map<String, Object> params = new HashMap<String, Object>() {{ Map<String, Object> params = new HashMap<String, Object>() {{
// put("appid", APP_ID); put("appid", APP_ID);
// put("appsecret", APP_SECRET); put("appsecret", APP_SECRET);
// put("schoolcode", SCHOOL_CODE); put("schoolcode", SCHOOL_CODE);
// }}; }};
// String content = Http.get(DOMAIN + GET_TOKEN_URL, params, Sender.Default_Conn_Timeout).getContent(); String content = Http.get(DOMAIN + GET_TOKEN_URL, params, Sender.Default_Conn_Timeout).getContent();
// NutMap contentMap = Json.fromJson(NutMap.class, content); NutMap contentMap = Json.fromJson(NutMap.class, content);
// if (contentMap.getString("retcode").equals("0")) { if (contentMap.getString("retcode").equals("0")) {
// String access_token = contentMap.getString("access_token"); String access_token = contentMap.getString("access_token");
// redisService.setex(TOKEN_NAME, 3600, access_token); redisService.setex(TOKEN_NAME, 3600, access_token);
// } else { } else {
// throw new RuntimeException("获取短信接口token异常!!!"); throw new RuntimeException("获取短信接口token异常!!!");
// } }
// } }
// return redisService.get(TOKEN_NAME); return redisService.get(TOKEN_NAME);
return null;
} }
@@ -1,5 +1,7 @@
package io.v.nutz.lxy.controller; package io.v.nutz.lxy.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.service.BaseService; import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.annontation.ViReturn; import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.PageUtil;
@@ -11,21 +13,25 @@ import io.v.nutz.lxy.service.LxyMefpService;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record; import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
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.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.random.R; import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.*; import org.nutz.mvc.annotation.*;
import org.nutz.mvc.upload.TempFile; import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor; import org.nutz.mvc.upload.UploadAdaptor;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -91,19 +97,22 @@ public class LxyHdCon {
@At @At
@POST @POST
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
public Object doAdd(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files, Lxy_mefp[] mefp) throws IOException { @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doAdd(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files,@Param(value = "mefp") String jsonStr) throws IOException {
hd.setHdcjsj(new Date()); hd.setHdcjsj(new Date());
hd = lxyHdService.insert(hd); hd = lxyHdService.insert(hd);
for (Lxy_mefp lxyMefp : mefp) { lxyMefpService.setMefp(jsonStr, hd.getId());
lxyMefp.setHdid(hd.getId());
lxyMefp.setNumber(lxyMefp.getNumber() == null ? 0 : lxyMefp.getNumber()); // for (Lxy_mefp lxyMefp : mefp) {
lxyMefpService.insert(lxyMefp); // lxyMefp.setHdid(hd.getId());
} // lxyMefp.setNumber(lxyMefp.getNumber() == null ? 0 : lxyMefp.getNumber());
// lxyMefpService.insert(lxyMefp);
// }
for (TempFile file : files) { for (TempFile file : files) {
String rid = R.UU32(); String rid = R.UU32();
@@ -123,19 +132,23 @@ public class LxyHdCon {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
public Object doEditMefp(Lxy_mefp[] mefp) { public Object doEditMefp(@Param("mefp") String jsonStr, String hdId) {
for (Lxy_mefp lxyMefp : mefp) { lxyMefpService.dao().clear(Lxy_mefp.class, Cnd.where("hdid","=",hdId));
baseService.dao().update("lxy_mefp", Chain.make("number", lxyMefp.getNumber()), Cnd.where("ghid", "=", lxyMefp.getGhid()).and("hdid", "=", lxyMefp.getHdid())); lxyMefpService.setMefp(jsonStr, hdId);
} // for (Lxy_mefp lxyMefp : mefp) {
// baseService.dao().update("lxy_mefp", Chain.make("number", lxyMefp.getNumber()), Cnd.where("ghid", "=", lxyMefp.getGhid()).and("hdid", "=", lxyMefp.getHdid()));
// }
return null; return null;
} }
@At @At
@POST @POST
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doEdit(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files, String[] delFiles) throws IOException { public Object doEdit(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files, String[] delFiles) throws IOException {
lxyHdService.updateIgnoreNull(hd); lxyHdService.updateIgnoreNull(hd);
@@ -163,6 +176,7 @@ public class LxyHdCon {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
public Object delete(String id) { public Object delete(String id) {
List<Record> files = baseService.dao().query("sys_file", Cnd.where("reid", "=", id)); List<Record> files = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
@@ -235,6 +235,7 @@ public class LxyXghshController {
} }
@At @At
@Ok("void")
@RequiresPermissions("zgfw.lxy.xghsh") @RequiresPermissions("zgfw.lxy.xghsh")
public void downLoadAll(@Param(value = "year", required = false) Integer year, public void downLoadAll(@Param(value = "year", required = false) Integer year,
@Param(value = "hdid", required = false) String hdid, @Param(value = "hdid", required = false) String hdid,
@@ -5,4 +5,6 @@ import io.v.nutz.lxy.model.Lxy_mefp;
public interface LxyMefpService extends BaseService<Lxy_mefp> { public interface LxyMefpService extends BaseService<Lxy_mefp> {
void setMefp(String jsonStr, String hdId);
} }
@@ -1,10 +1,16 @@
package io.v.nutz.lxy.service.impl; package io.v.nutz.lxy.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.service.BaseServiceImpl; import cn.wizzer.framework.base.service.BaseServiceImpl;
import io.v.nutz.lxy.model.Lxy_mefp; import io.v.nutz.lxy.model.Lxy_mefp;
import io.v.nutz.lxy.service.LxyMefpService; import io.v.nutz.lxy.service.LxyMefpService;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import java.util.ArrayList;
import java.util.List;
/** /**
* @Author: 1V * @Author: 1V
@@ -16,4 +22,21 @@ public class LxyMefpServiceImpl extends BaseServiceImpl<Lxy_mefp> implements Lxy
public LxyMefpServiceImpl(Dao dao) { public LxyMefpServiceImpl(Dao dao) {
super(dao); super(dao);
} }
@Override
public void setMefp(String jsonStr, String hdId) {
if (StrUtil.isNotBlank(jsonStr)) {
List<NutMap> list = JSONUtil.parseArray(jsonStr).toList(NutMap.class);
List<Lxy_mefp> mefpList = new ArrayList<>();
for (NutMap map : list) {
Lxy_mefp mefp = new Lxy_mefp();
mefp.setGhid(map.getString("id"));
mefp.setHdid(hdId);
mefp.setNumber(map.getInt("limitNum"));
mefpList.add(mefp);
}
dao().insert(mefpList);
}
}
} }
@@ -13,10 +13,14 @@ import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
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.json.Json; import org.nutz.json.Json;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.*; import org.nutz.mvc.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@@ -99,11 +103,44 @@ public class MMeetingMineController {
@Ok("json:full") @Ok("json:full")
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object findMyMeetPeriod(@Param("meetingId") String meetingId) { public Object findMyMeetPeriod(@Param("meetingId") String meetingId,
@Param("userId") String userId,
@Param("helpLeave") Boolean helpLeave) {
if (StrUtil.isBlank(meetingId)) { if (StrUtil.isBlank(meetingId)) {
return Result.error("参数错误"); return Result.error("参数错误");
} }
return meetingMineService.findMyMeetPeriod(meetingId); return meetingMineService.findMyMeetPeriod(meetingId, helpLeave, userId);
}
@At("/searchUser")
@Ok("json:full")
@ViReturn
@RequiresAuthentication
public Object searchUser(@Param("query") String query, @Param("meetId") String meetId) {
Sql sql = Sqls.create("""
SELECT
u.id,
u.username,
u.loginname,
u.sex,
u.unionname,
u.unitname
FROM
`meeting_time_period_user` pu
LEFT JOIN USER u ON pu.userId = u.id
$condition
limit 50
""").setParam("meetId", meetId);
Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(query)) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("u.username", query);
group.orLike("u.loginname", query);
cnd.and(group);
}
cnd.and("meetingId", "=", meetId);
sql.setCondition(cnd);
return meetingMineService.listMap(sql);
} }
/** /**
@@ -27,7 +27,7 @@ public interface MeetingMineService extends ViService {
* *
* @return * @return
*/ */
List<Object> findMyMeetPeriod(String meetingId); List<Object> findMyMeetPeriod(String meetingId, Boolean helpLeave, String userId);
/** /**
* 请假 * 请假
@@ -75,7 +75,7 @@ public class MeetingMineServiceImpl extends ViServiceImpl implements MeetingMine
} }
@Override @Override
public List<Object> findMyMeetPeriod(String meetingId) { public List<Object> findMyMeetPeriod(String meetingId, Boolean helpLeave, String userId) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
tp.id AS tpid, tp.id AS tpid,
@@ -94,7 +94,7 @@ public class MeetingMineServiceImpl extends ViServiceImpl implements MeetingMine
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("tp.meetingId", "=", meetingId); cnd.and("tp.meetingId", "=", meetingId);
cnd.and("tpu.userId", "=", ShiroUtil.getPrincipalProperty("id")); cnd.and("tpu.userId", "=", helpLeave ? userId : ShiroUtil.getPrincipalProperty("id"));
sql.setCondition(cnd); sql.setCondition(cnd);
return listMap(sql); return listMap(sql);
} }
@@ -112,7 +112,7 @@ public class MeetingMineServiceImpl extends ViServiceImpl implements MeetingMine
dao().updateIgnoreNull(meetingTimePeriodUsers); dao().updateIgnoreNull(meetingTimePeriodUsers);
List<NutMap> userIdMap = meetingCommonService.getNextAuditUser(stateCode, moduleName); List<NutMap> userIdMap = meetingCommonService.getNextAuditUser(stateCode, moduleName);
String userInfoStr = msgNotifyService.userData(userIdMap); List<String> userInfoStr = msgNotifyService.userData(userIdMap);
String meetingId = meetingTimePeriodUsers.get(0).getMeetingId(); String meetingId = meetingTimePeriodUsers.get(0).getMeetingId();
MeetingInfo meetingInfo = dao().fetch(MeetingInfo.class, meetingId); MeetingInfo meetingInfo = dao().fetch(MeetingInfo.class, meetingId);
@@ -146,7 +146,7 @@ public class MsgNotifyController {
if (msgNotify.getType() != null && msgNotify.getType().equals("system")) { if (msgNotify.getType() != null && msgNotify.getType().equals("system")) {
List<NutMap> list = msgNotifyService.getUserByRoleIds(msgNotify.getModule(), msgNotify.getTeacherMeetingId(), msgNotify.getRoleIds()); List<NutMap> list = msgNotifyService.getUserByRoleIds(msgNotify.getModule(), msgNotify.getTeacherMeetingId(), msgNotify.getRoleIds());
String userData = msgNotifyService.userData(list); List<String> userData = msgNotifyService.userData(list);
if (flag) { if (flag) {
msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent()); msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent());
@@ -165,7 +165,7 @@ public class MsgNotifyController {
} else if (msgNotify.getType() != null && msgNotify.getType().equals("user")) { } else if (msgNotify.getType() != null && msgNotify.getType().equals("user")) {
if (flag) { if (flag) {
List<User> user = dao.query(User.class, Cnd.where("id", "in", users)); List<User> user = dao.query(User.class, Cnd.where("id", "in", users));
String objectUserData = msgNotifyService.ObjectUserData(user); List<String> objectUserData = msgNotifyService.ObjectUserData(user);
msgNotifyService.sendMsg(msgNotify.getSendTypes(), objectUserData, msgNotify.getContent()); msgNotifyService.sendMsg(msgNotify.getSendTypes(), objectUserData, msgNotify.getContent());
} }
for (String u : users) { for (String u : users) {
@@ -180,7 +180,7 @@ public class MsgNotifyController {
} }
} else { } else {
List<NutMap> userScopes = msgNotifyService.getUserScopes(msgNotify.getActivityGroupId()); List<NutMap> userScopes = msgNotifyService.getUserScopes(msgNotify.getActivityGroupId());
String userData = msgNotifyService.userData(userScopes); List<String> userData = msgNotifyService.userData(userScopes);
if (flag) { if (flag) {
msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent()); msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent());
@@ -220,7 +220,7 @@ public class MsgNotifyController {
msgNotify.setHold(flag ? true : false); msgNotify.setHold(flag ? true : false);
if (flag) { if (flag) {
String userData = msgNotifyService.userData(list); List<String> userData = msgNotifyService.userData(list);
msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent()); msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent());
} }
@@ -236,7 +236,7 @@ public class MsgNotifyController {
} else if (msgNotify.getType() != null && msgNotify.getType().equals("user")) { } else if (msgNotify.getType() != null && msgNotify.getType().equals("user")) {
if (flag) { if (flag) {
List<User> user = dao.query(User.class, Cnd.where("id", "in", users)); List<User> user = dao.query(User.class, Cnd.where("id", "in", users));
String objectUserData = msgNotifyService.ObjectUserData(user); List<String> objectUserData = msgNotifyService.ObjectUserData(user);
msgNotifyService.sendMsg(msgNotify.getSendTypes(), objectUserData, msgNotify.getContent()); msgNotifyService.sendMsg(msgNotify.getSendTypes(), objectUserData, msgNotify.getContent());
} }
@@ -268,7 +268,7 @@ public class MsgNotifyController {
""").setParam("groupId", msgNotify.getActivityGroupId()); """).setParam("groupId", msgNotify.getActivityGroupId());
List<NutMap> userScopes = activityBasicScopeService.listMap(sql); List<NutMap> userScopes = activityBasicScopeService.listMap(sql);
msgNotify.setHold(flag ? true : false); msgNotify.setHold(flag ? true : false);
String userData = msgNotifyService.userData(userScopes); List<String> userData = msgNotifyService.userData(userScopes);
if (flag) { if (flag) {
msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent()); msgNotifyService.sendMsg(msgNotify.getSendTypes(), userData, msgNotify.getContent());
@@ -105,7 +105,7 @@ public class MsgNotifyTitleController {
@RequiresAuthentication @RequiresAuthentication
public Object doSend(String id, String[] sendTypes, String content) { public Object doSend(String id, String[] sendTypes, String content) {
List<NutMap> msgNotifyUser = msgNotifyService.getMsgNotifyUser(id); List<NutMap> msgNotifyUser = msgNotifyService.getMsgNotifyUser(id);
String userData = msgNotifyService.userData(msgNotifyUser); List<String> userData = msgNotifyService.userData(msgNotifyUser);
msgNotifyService.sendMsg(Arrays.asList(sendTypes), userData, content); msgNotifyService.sendMsg(Arrays.asList(sendTypes), userData, content);
msgNotifyUser.forEach(v -> { msgNotifyUser.forEach(v -> {
baseService.dao().update(MsgNotify.class, Chain.make("hold", true).add("sendTime", DateUtil.getDateTime()), Cnd.where("id", "=", v.getString("titleId"))); baseService.dao().update(MsgNotify.class, Chain.make("hold", true).add("sendTime", DateUtil.getDateTime()), Cnd.where("id", "=", v.getString("titleId")));
@@ -36,9 +36,9 @@ public interface MsgNotifyService {
String userData(User user); String userData(User user);
String ObjectUserData(List<User> userList); List<String> ObjectUserData(List<User> userList);
String userData(List<NutMap> userListMap); List<String> userData(List<NutMap> userListMap);
/** /**
* 根据条件发送短信 * 根据条件发送短信
@@ -49,6 +49,7 @@ public interface MsgNotifyService {
*/ */
void sendMsg(List<String> sendTypes, String userData, String content); void sendMsg(List<String> sendTypes, String userData, String content);
void sendMsg(List<String> sendTypes, List<String> userData, String content);
/** /**
* 查询活动设置人员 * 查询活动设置人员
@@ -1,6 +1,7 @@
package io.v.nutz.msgNotify.service.impl; package io.v.nutz.msgNotify.service.impl;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.msgNotify.models.MsgNotify; import io.v.nutz.msgNotify.models.MsgNotify;
import io.v.nutz.msgNotify.models.MsgNotifyUser; import io.v.nutz.msgNotify.models.MsgNotifyUser;
import io.v.nutz.msgNotify.service.MsgNotifyService; import io.v.nutz.msgNotify.service.MsgNotifyService;
@@ -12,6 +13,7 @@ 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.dao.util.Daos; import org.nutz.dao.util.Daos;
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;
@@ -64,7 +66,7 @@ public class MsgNotifyServiceImpl extends ViServiceImpl<MsgNotify> implements Ms
*/ */
@Override @Override
public String userData(NutMap v) { public String userData(NutMap v) {
List<String> list = new ArrayList<>(); /*List<String> list = new ArrayList<>();
list.add(v.getString("userName")); list.add(v.getString("userName"));
list.add(v.getString("loginName")); list.add(v.getString("loginName"));
list.add(v.getString("unitId")); list.add(v.getString("unitId"));
@@ -72,13 +74,13 @@ public class MsgNotifyServiceImpl extends ViServiceImpl<MsgNotify> implements Ms
list.add(v.getString("mobile") != null ? v.getString("mobile") : ""); list.add(v.getString("mobile") != null ? v.getString("mobile") : "");
list.add(""); list.add("");
list.add(""); list.add("");
String collect = list.stream().collect(Collectors.joining("|")); String collect = list.stream().collect(Collectors.joining("|"));*/
return collect; return v.getString("loginName");
} }
@Override @Override
public String userData(User user) { public String userData(User user) {
List<String> list = new ArrayList<>(); /*List<String> list = new ArrayList<>();
list.add(user.getUsername()); list.add(user.getUsername());
list.add(user.getLoginname()); list.add(user.getLoginname());
list.add(user.getUnitid()); list.add(user.getUnitid());
@@ -87,25 +89,27 @@ public class MsgNotifyServiceImpl extends ViServiceImpl<MsgNotify> implements Ms
list.add(""); list.add("");
list.add(""); list.add("");
String collect = list.stream().collect(Collectors.joining("|")); String collect = list.stream().collect(Collectors.joining("|"));
return collect; return collect;*/
return user.getLoginname();
} }
@Override @Override
public String ObjectUserData(List<User> userList) { public List<String> ObjectUserData(List<User> userList) {
List<String> recievePersonInfo = new ArrayList<>(); List<String> recievePersonInfo = new ArrayList<>();
for (User user : userList) { for (User user : userList) {
recievePersonInfo.add(userData(user)); recievePersonInfo.add(userData(user));
} }
return String.join("^@^", recievePersonInfo); return recievePersonInfo;
} }
@Override @Override
public String userData(List<NutMap> userList) { public List<String> userData(List<NutMap> userList) {
List<String> recievePersonInfo = new ArrayList<>(); List<String> recievePersonInfo = new ArrayList<>();
for (NutMap map : userList) { for (NutMap map : userList) {
recievePersonInfo.add(userData(map)); recievePersonInfo.add(userData(map));
} }
return String.join("^@^", recievePersonInfo); //return String.join("^@^", recievePersonInfo);
return recievePersonInfo;
} }
/** /**
@@ -120,14 +124,33 @@ public class MsgNotifyServiceImpl extends ViServiceImpl<MsgNotify> implements Ms
@Override @Override
public void run() { public void run() {
if (sendTypes.contains("msg")) { if (sendTypes.contains("msg")) {
//msgApi.sendMsg(content, List.of(item.getString("loginname")));
} }
if (sendTypes.contains("WeChat")) { if (sendTypes.contains("WeChat")) {
//msgApi.sendMsg(content, List.of(item.getString("loginname")));
} }
} }
}.start(); }.start();
} }
public void sendMsg(List<String> sendTypes, List<String> receivers, String content) {
new Thread() {
@Override
public void run() {
if (sendTypes.contains("msg")) {
msgApi.sendMsg(content, receivers);
}
if (sendTypes.contains("WeChat")) {
msgApi.sendMsg(content, receivers);
}
}
}.start();
}
@Inject
private MsgApi msgApi;
/** /**
* 查询活动设置人员 * 查询活动设置人员
@@ -1,11 +1,16 @@
package io.v.nutz.trainEducation.controller.statistics; package io.v.nutz.trainEducation.controller.statistics;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.v.nutz.annontation.ViReturn; import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.modules.models.PageForm; import io.v.nutz.modules.models.PageForm;
import io.v.nutz.util.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -15,11 +20,14 @@ import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static; 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.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.Param; import org.nutz.mvc.annotation.Param;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -137,4 +145,63 @@ public class TrainEduStatisticsVideoController {
sql.setParam("albumId", albumId); sql.setParam("albumId", albumId);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
} }
@At
@Ok("void")
@RequiresPermissions("trainEdu.statistics.video")
public void exportXlsx(String albumId,HttpServletResponse response){
Sql sql = Sqls.create("""
SELECT
u.username,
u.loginname,
u.unitname,
u.unionname,
tev.qualifiedNum,
(
SELECT
SUM(IF( cnt > tev.everyDayMaxWatchNum, tev.everyDayMaxWatchNum, cnt )) AS count
FROM
( SELECT watchTime, COUNT( 1 ) AS cnt FROM train_edu_video_watch_record where userId = tevwr.userId and albumId = tevwr.albumId GROUP BY watchTime ) AS subquery
) as watchCount
FROM
`train_edu_video_watch_record` tevwr
LEFT JOIN train_edu_video tev ON tev.id = tevwr.videoId
LEFT JOIN train_edu_album tea on tea.id = tevwr.albumId
LEFT JOIN `user` u ON u.id = tevwr.userId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("tevwr.albumId", "=", albumId);
cnd.and(new Static("IF(tea.createType = 1, u.unionId = tea.unionId , 1=1)"));
cnd.groupBy("tevwr.userId");
sql.setCondition(cnd);
List<NutMap> list = baseService.listMap(sql);
List<ExcelExportEntity> excelExportEntities = new ArrayList<>();
excelExportEntities.add(new ExcelExportEntity("序号","no",10));
excelExportEntities.add(new ExcelExportEntity("姓名","username",20));
excelExportEntities.add(new ExcelExportEntity("工号","loginname",20));
excelExportEntities.add(new ExcelExportEntity("单位","unitname",20));
excelExportEntities.add(new ExcelExportEntity("分工会","unionname",20));
excelExportEntities.add(new ExcelExportEntity("学习总次数","watchCount",20));
excelExportEntities.add(new ExcelExportEntity("是否达标","qualifiedNum",20));
for (int i = 0; i < list.size(); i++) {
list.get(i).put("no",i+1);
list.get(i).put("qualifiedNum",list.get(i).getInt("qualifiedNum",0)==1?"是":"否");
}
try{
ViTool.excelResponse(response, "获奖人员名单.xls");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), excelExportEntities, list);
workbook.write(response.getOutputStream());
}catch (Exception e){
e.printStackTrace();
}
}
} }
@@ -1,18 +1,26 @@
package io.v.nutz.wakershome.controller.review; package io.v.nutz.wakershome.controller.review;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.annontation.ViReturn; import io.v.nutz.annontation.ViReturn;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.wakershome.model.review.CommentNr; import io.v.nutz.wakershome.model.review.CommentNr;
import io.v.nutz.wakershome.model.review.CommentUnionGrading;
import io.v.nutz.wakershome.model.review.CommentZb; import io.v.nutz.wakershome.model.review.CommentZb;
import io.v.nutz.wakershome.service.review.CommentZbService; import io.v.nutz.wakershome.service.review.CommentZbService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
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.random.R;
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.Param; import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans; import org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.List;
/** /**
* @ClassName addZbController * @ClassName addZbController
* @Description TODO * @Description TODO
@@ -44,6 +52,7 @@ public class AddZbController {
nr.getBzs().forEach(v->v.setZb_id(zb.getId())); nr.getBzs().forEach(v->v.setZb_id(zb.getId()));
commentZbService.insertWith(nr, "bzs"); commentZbService.insertWith(nr, "bzs");
} }
commentZbService.setGrading(zb);
}); });
return null; return null;
@@ -1,6 +1,7 @@
package io.v.nutz.wakershome.controller.review; package io.v.nutz.wakershome.controller.review;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
@@ -11,10 +12,7 @@ import io.v.nutz.base.utils.Vi;
import io.v.nutz.modules.models.PageForm; import io.v.nutz.modules.models.PageForm;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.util.ShiroUtil; import io.v.nutz.util.ShiroUtil;
import io.v.nutz.wakershome.model.review.CommentBz; import io.v.nutz.wakershome.model.review.*;
import io.v.nutz.wakershome.model.review.CommentNr;
import io.v.nutz.wakershome.model.review.CommentPeo;
import io.v.nutz.wakershome.model.review.CommentZb;
import io.v.nutz.wakershome.service.review.CommentPeoService; import io.v.nutz.wakershome.service.review.CommentPeoService;
import io.v.nutz.wakershome.service.review.CommentStatisticsService; import io.v.nutz.wakershome.service.review.CommentStatisticsService;
import io.v.nutz.wakershome.service.review.CommentZbService; import io.v.nutz.wakershome.service.review.CommentZbService;
@@ -24,6 +22,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.ddr.poi.html.HtmlRenderPolicy; import org.ddr.poi.html.HtmlRenderPolicy;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -91,11 +90,14 @@ public class StatisticsZpController {
SELECT SELECT
un.id, un.id,
un.unionname unionName, un.unionname unionName,
IFNULL(grading.gradingName,'未定级') AS gradingName,
grading.isGrading,
count( peo.id ) num count( peo.id ) num
FROM FROM
sys_union un sys_union un
LEFT JOIN `user` u ON u.unionId = un.id LEFT JOIN `user` u ON u.unionId = un.id
LEFT JOIN comment_peo peo ON peo.userId = u.id AND peo.zbId = @zbId LEFT JOIN comment_peo peo ON peo.userId = u.id AND peo.zbId = @zbId
LEFT JOIN comment_union_grading grading on un.id = grading.unionId AND grading.zbId = @zbId
$condition $condition
""").setParam("zbId", zbId); """).setParam("zbId", zbId);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
@@ -413,4 +415,17 @@ public class StatisticsZpController {
// Map<String, List<CommentPeo>> collect = peoList.stream().collect(Collectors.groupingBy(CommentPeo::getUnionId)); // Map<String, List<CommentPeo>> collect = peoList.stream().collect(Collectors.groupingBy(CommentPeo::getUnionId));
} }
@At
@RequiresPermissions("wakeshome.review.statistics")
public Object doGrading(CommentUnionGrading grading){
if (StrUtil.isAllBlank(grading.getZbId(),grading.getUnionId(),grading.getGradingName())) {
return Result.error("必要参数为空");
}
commentPeoService.dao().update(CommentUnionGrading.class,
Chain.make("isGrading",true).add("gradingName",grading.getGradingName()).add("gradingTime", DateUtil.now()),
Cnd.where("zbId","=",grading.getZbId()).and("unionId","=",grading.getUnionId()));
return Result.success();
}
} }
@@ -151,6 +151,7 @@ public class ViewZbController {
}); });
} }
commentZbService.setGrading(commentZb);
/* for (CommentNr nr : commentZb.getNrs()) { /* for (CommentNr nr : commentZb.getNrs()) {
nr.setZb_id(commentZb.getId()); nr.setZb_id(commentZb.getId());
commentNrService.insertWith(nr, "bzs"); commentNrService.insertWith(nr, "bzs");
@@ -2,6 +2,7 @@ package io.v.nutz.wakershome.model.review;
import cn.wizzer.framework.base.model.BaseModel; import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data; import lombok.Data;
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.*;
@@ -13,6 +14,7 @@ import org.nutz.dao.entity.annotation.*;
*/ */
@Data @Data
@Table @Table
@EqualsAndHashCode(callSuper = true)
public class CommentBz extends BaseModel { public class CommentBz extends BaseModel {
@Column @Column
@@ -2,6 +2,7 @@ package io.v.nutz.wakershome.model.review;
import cn.wizzer.framework.base.model.BaseModel; import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data; import lombok.Data;
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.*;
@@ -15,6 +16,7 @@ import java.util.List;
*/ */
@Data @Data
@Table @Table
@EqualsAndHashCode(callSuper = true)
public class CommentNr extends BaseModel { public class CommentNr extends BaseModel {
@@ -0,0 +1,66 @@
package io.v.nutz.wakershome.model.review;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import java.util.Date;
/**
* @version 1.0
* @Author zzr
* @name:CommentUnionGrading
* @Date 2024/9/19 8:48
* @注释 校工会给分工会定级
*/
@Data
@Table
@Comment("校工会给分工会定级表")
@EqualsAndHashCode(callSuper = true)
public class CommentUnionGrading extends BaseModel {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("考核指标id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zbId;
@Column
@Comment("定级的分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("分工会名称")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unionName;
@Column
@Comment("分工会编码")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionCode;
@Column
@Comment("定级的名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String gradingName;
@Column
@Default("0")
@Comment("是否定级")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isGrading;
@Column
@Comment("定级时间")
@ColDefine(type = ColType.DATETIME)
private Date gradingTime;
}
@@ -1,9 +1,12 @@
package io.v.nutz.wakershome.service.impl.review; package io.v.nutz.wakershome.service.impl.review;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.service.impl.ViServiceImpl; import io.v.nutz.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.wakershome.model.review.CommentBz; import io.v.nutz.wakershome.model.review.CommentBz;
import io.v.nutz.wakershome.model.review.CommentNr; import io.v.nutz.wakershome.model.review.CommentNr;
import io.v.nutz.wakershome.model.review.CommentUnionGrading;
import io.v.nutz.wakershome.model.review.CommentZb; import io.v.nutz.wakershome.model.review.CommentZb;
import io.v.nutz.wakershome.service.review.CommentNrService; import io.v.nutz.wakershome.service.review.CommentNrService;
import io.v.nutz.wakershome.service.review.CommentZbService; import io.v.nutz.wakershome.service.review.CommentZbService;
@@ -11,7 +14,9 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
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.random.R;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@@ -44,4 +49,34 @@ public class CommentZbServiceImpl extends ViServiceImpl<CommentZb> implements Co
return zb; return zb;
} }
@Override
public void setGrading(CommentZb commentZb) {
int count = dao().count(CommentUnionGrading.class, Cnd.where("zbId", "=", commentZb.getId()));
if (count > 0) {
dao().clear(CommentUnionGrading.class, Cnd.where("zbId", "=", commentZb.getId()));
}
if (ObjectUtil.isNotNull(commentZb.getCommentTarget()) && commentZb.getCommentTarget() != 1) {
List<Sys_union> query = new ArrayList<>();
if (commentZb.getCommentTarget() == 2) {
query = dao().query(Sys_union.class, Cnd.NEW());
} else if (commentZb.getCommentTarget() == 3) {
query = dao().query(Sys_union.class, Cnd.where("id", "in", commentZb.getUnionIds()));
}
List<CommentUnionGrading> commentUnionGradings = new ArrayList<>();
for (Sys_union union : query) {
CommentUnionGrading unionGrading = new CommentUnionGrading();
unionGrading.setId(R.UU32());
unionGrading.setUnionId(union.getId());
unionGrading.setZbId(commentZb.getId());
unionGrading.setUnionName(union.getUnionname());
unionGrading.setUnionCode(union.getUnioncode());
unionGrading.setIsGrading(false);
unionGrading.setGradingTime(null);
commentUnionGradings.add(unionGrading);
}
dao().insert(commentUnionGradings);
}
}
} }
@@ -8,4 +8,5 @@ public interface CommentZbService extends ViService<CommentZb> {
CommentZb khzb(String zbid); CommentZb khzb(String zbid);
void setGrading(CommentZb zb);
} }
Binary file not shown.
@@ -237,13 +237,20 @@ layout("/mobile/platform.html"){
<van-button v-if="o.isJoin === true" size="small" disabled color="grey">已签到</van-button>--> <van-button v-if="o.isJoin === true" size="small" disabled color="grey">已签到</van-button>-->
<van-button <van-button
:disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false" :disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false"
@click="needLeave(o, false)" @click="needLeave(o, true, true)"
color="#1867b0" size="small" style="margin-right: 8px"
v-if="${@shiro.hasRole('H04')}"
type="primary">替他人请假
</van-button>
<van-button
:disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false"
@click="needLeave(o, false, false)"
color="#1867b0" size="small" style="margin-right: 8px" color="#1867b0" size="small" style="margin-right: 8px"
type="primary">查看请假状态 type="primary">查看请假状态
</van-button> </van-button>
<van-button <van-button
:disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false" :disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false"
@click="needLeave(o, true)" @click="needLeave(o, true, false)"
color="#1867b0" size="small" style="margin-right: 8px" color="#1867b0" size="small" style="margin-right: 8px"
type="primary">我要请假 type="primary">我要请假
</van-button> </van-button>
@@ -275,16 +282,28 @@ layout("/mobile/platform.html"){
</div> </div>
<div class="content"> <div class="content">
<div class="van-doc-card" v-for="(item, index) in timeList"> <van-field
v-if="helpLeave"
v-model="needLeaveUser.userName"
label="请假人"
readonly=""
@click="helpUserShow = true"
placeholder="请点击选择请假人"
input-align="right"
></van-field>
<div v-if="timeList.length > 0" class="van-doc-card" v-for="(item, index) in timeList">
<div> <div>
<div><span style="color: grey">会议名称:</span>{{item.timePeriodName}}</div> <div>
<span style="color: grey">会议名称:</span>
<span>{{item.timePeriodName}}</span>
</div>
</div> </div>
<div @click="leaveClick(item, index)" <div @click="leaveClick(item, index)"
style="display: flex; justify-content: space-between"> style="display: flex; justify-content: space-between">
<div> <div>
<div> <div>
<span style="color: grey">会议时间:</span> <span style="color: grey">会议时间:</span>
{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}} <span>{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}}</span>
</div> </div>
<!--<div><span style="color: grey">结束时间:</span>{{moment(item.endTime).format('YYYY-MM-DD HH:mm')}}</div>--> <!--<div><span style="color: grey">结束时间:</span>{{moment(item.endTime).format('YYYY-MM-DD HH:mm')}}</div>-->
</div> </div>
@@ -297,12 +316,15 @@ layout("/mobile/platform.html"){
</div> </div>
</div> </div>
<div v-if="item.isJoin === false"> <div v-if="item.isJoin === false">
<div><span style="color: grey">审核状态:</span>{{item.stateName}}</div> <div>
<span style="color: grey">审核状态:</span>
<span>{{item.stateName}}</span>
</div>
</div> </div>
<div> <div>
<span style="float: left; color: grey">请假原因:</span> <span style="float: left; color: grey">请假原因:</span>
<van-field :disabled="item.isJoin === false" placeholder="请输入请假原因" rows="1" <van-field :disabled="item.isJoin === false" placeholder="请输入请假原因" rows="1"
style="font-size: 12px; padding: 0; width: 70%; line-height: 20px" style="font-size: 12px; padding: 0; width: 70%; line-height: 20px; margin-left: 69px"
type="textarea" autosize type="textarea" autosize
v-model="item.leaveReason"></van-field> v-model="item.leaveReason"></van-field>
</div> </div>
@@ -318,6 +340,7 @@ layout("/mobile/platform.html"){
</van-button> </van-button>
</div> </div>
</div> </div>
</div> </div>
<div v-if="flag === true"> <div v-if="flag === true">
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 20px; width: 100%"> <div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 20px; width: 100%">
@@ -330,6 +353,24 @@ layout("/mobile/platform.html"){
</div> </div>
</div> </div>
</van-action-sheet> </van-action-sheet>
<van-popup position="bottom" round v-model="helpUserShow" :style="{ height: '70%' }" closeable>
<van-search v-model="searchResult" show-action style="padding: 10px;margin-top: 45px" placeholder="请输入工号或姓名搜索"
@input="delaySearch">
</van-search>
<van-cell-group>
<div>
<van-checkbox-group style="text-align: center">
<van-cell-group>
<van-cell v-for="(item, index) in userList" :key="item.index" clickable
:title="item.name"
@click="toResult(item.loginname)">
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
</van-cell-group>
</van-popup>
</div> </div>
<script> <script>
@@ -340,6 +381,14 @@ layout("/mobile/platform.html"){
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
searchResult: '',
userList: [],
helpUserShow: false,
needLeaveUser: {
userName: '',
userId: '',
},
helpLeave: false,
timeList: [], timeList: [],
checked: [], checked: [],
checkboxRefs: [], checkboxRefs: [],
@@ -361,12 +410,34 @@ layout("/mobile/platform.html"){
} }
}, },
methods: { methods: {
async delaySearch(query) {
if (query) {
const data = await this.searchUser(query)
data.forEach(v => {
v.name = v.username + '(' + v.loginname + ')'
return v
})
this.userList = data
}
},
async searchUser(query) {
const res = await $.post('/mobile/meeting/mine/searchUser', {query: query, meetId: this.clickRow.id})
return res.data
},
toResult(loginname) {
this.timeList = []
const data = this.userList.find(o => o.loginname === loginname)
this.$set(this.needLeaveUser, 'userName', data.username)
this.$set(this.needLeaveUser, 'userId', data.id)
this.helpUserShow = false
this.findTimeList(this.clickRow)
},
refreshApply(o) { refreshApply(o) {
vant.Dialog.confirm({ vant.Dialog.confirm({
title: '温馨提示', title: '温馨提示',
message: '您确定要重新申请吗?', message: '您确定要重新申请吗?',
}).then(async () => { }).then(async () => {
await this.needLeave(this.clickRow, true) await this.needLeave(this.clickRow, true, false)
this.timeList.forEach((re, index) => { this.timeList.forEach((re, index) => {
if (re.stateAuditType === 1) { if (re.stateAuditType === 1) {
re.isJoin = null re.isJoin = null
@@ -437,23 +508,39 @@ layout("/mobile/platform.html"){
this.loading = false this.loading = false
}) })
}, },
async needLeave(o, flag) { async needLeave(o, flag, helpLeave) {
this.flag = flag this.flag = flag
this.clickRow = o this.clickRow = o
this.helpLeave = helpLeave
this.timeList = []
this.needLeaveUser = {
userName: '',
userId: '',
}
if (moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false) { if (moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false) {
vant.Toast('抱歉,已过请假截止时间'); vant.Toast('抱歉,已过请假截止时间');
return return
} }
this.leaveReason = '' this.leaveReason = ''
this.checked = [] this.checked = []
const res = await $.post('/mobile/meeting/mine/findMyMeetPeriod', {meetingId: o.id}) if(helpLeave) {
this.leaveShow = true
} else {
await this.findTimeList(o)
}
},
async findTimeList(o) {
const res = await $.post('/mobile/meeting/mine/findMyMeetPeriod', {
meetingId: o.id,
helpLeave: this.helpLeave,
userId: this.needLeaveUser.userId
})
if (res.code === 0) { if (res.code === 0) {
this.timeList = res.data this.timeList = res.data
if (this.timeList.length === 0) { if (this.timeList.length === 0) {
vant.Toast('您暂无可请假的假时间段'); vant.Toast('暂无可请假的假时间段');
return return
} }
this.leaveShow = true this.leaveShow = true
this.$nextTick(function () { this.$nextTick(function () {
this.timeList.forEach((re, index) => { this.timeList.forEach((re, index) => {
@@ -474,7 +561,7 @@ layout("/mobile/platform.html"){
} }
const array = this.timeList.find(o => o.stateCode === null || o.stateCode < this.clickRow.firstState) const array = this.timeList.find(o => o.stateCode === null || o.stateCode < this.clickRow.firstState)
if (array === undefined) { if (array === undefined) {
vant.Toast('您的所有请假均已处于审核阶段'); vant.Toast('所有请假均已处于审核阶段');
return return
} }
const paramArray = [] const paramArray = []
@@ -502,6 +589,15 @@ layout("/mobile/platform.html"){
if (valid) { if (valid) {
return return
} }
if(this.helpLeave) {
const confirm = await vant.Dialog.confirm({
title: '提示',
message: '您确定要替' + this.needLeaveUser.userName + '报名吗?',
})
if (confirm !== 'confirm') {
return
}
}
const resp = await $.post('/mobile/meeting/mine/askForLeave', { const resp = await $.post('/mobile/meeting/mine/askForLeave', {
meetingId: this.clickRow.id, meetingId: this.clickRow.id,
data: JSON.stringify(paramArray) data: JSON.stringify(paramArray)
@@ -146,7 +146,15 @@ layout("/mobile/platform.html"){
const now = new Date(); const now = new Date();
// 检查当前时间是否在 startTime 和 endTime 之间 // 检查当前时间是否在 startTime 和 endTime 之间
return now >= start && now <= end;
if (now < start && now > end){
vant.Dialog.alert({
title: '温馨提示',
message: '不在测评时间内,暂无法测评',
confirmButtonColor: '#1867b0'
})
return
}
//自评模式 //自评模式
if (o.reviewMode == 1 && !o.canJoin) { if (o.reviewMode == 1 && !o.canJoin) {
@@ -3,7 +3,7 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-doc-card { .van-doc-card {
margin: 14px; margin: 5px;
padding: 6px; padding: 6px;
background-color: #fff; background-color: #fff;
border-radius: 10px; border-radius: 10px;
@@ -78,7 +78,9 @@ layout("/mobile/platform.html"){
{{item.contentNumber}}、{{item.inspection}} {{item.contentNumber}}、{{item.inspection}}
</div> </div>
<van-row> <van-row>
<div style="font-size: 15px;text-align: right;margin-right: 30px;margin-bottom:-4px">标准分:{{item.score}}</div> <div style="font-size: 15px;text-align: right;margin-right: 30px;margin-bottom:-4px">
标准分:{{item.score}}
</div>
</van-row> </van-row>
<van-field <van-field
v-model="item.resultScore" v-model="item.resultScore"
@@ -107,7 +109,8 @@ layout("/mobile/platform.html"){
</van-collapse-item> </van-collapse-item>
</div> </div>
<div v-if="commentatorData.reviewMode == 1" class="content_div"> <div v-if="commentatorData.reviewMode == 1" class="content_div">
<van-field name="files" label="职工评家总结" required style="flex-flow: column" input-align="left"> <van-field name="files" label="职工评家总结" required style="flex-flow: column"
input-align="left">
<template #label> <template #label>
<div class="mb10">职工评家总结</div> <div class="mb10">职工评家总结</div>
</template> </template>
@@ -120,29 +123,36 @@ layout("/mobile/platform.html"){
<div v-if="commentatorData.scoringMode==2"> <div v-if="commentatorData.scoringMode==2">
<div class="search-fixed"> <div class="search-fixed" style="margin: 0px auto 60px auto" v-if="commentatorData.assessmentMode == 2">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="president" :options="presidentList" <van-dropdown-item v-model="president" :options="presidentList"
@change="presidentChange"></van-dropdown-item> @change="presidentChange"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div v-for="o in commentatorData.nrs" style="margin: 60px auto 0 auto"> <div>
<div v-for="o in commentatorData.nrs">
<van-collapse-item :title="o.content" :name="o.id" style="margin: 5px">
<div v-for="item in o.bzs"> <div v-for="item in o.bzs">
<div class="van-doc-card"> <div class="van-doc-card">
<div style="font-size: 15px;color: black">{{item.contentNumber}}、{{item.inspection}} <div style="font-size: 15px;color: black">
{{item.contentNumber}}、{{item.inspection}}
</div> </div>
<van-field name="radio" label="满意度" style="padding: 12px 2px;margin: 5px"> <van-field name="radio" style="padding: 12px 2px;margin: 5px">
<template #input> <template #input>
<van-radio-group style="margin-left: -20px" v-model="item.resultScore" :disabled="isReadOnly" direction="horizontal"> <van-radio-group v-model="item.resultScore" :disabled="isReadOnly"
direction="horizontal">
<van-radio name="非常满意">非常满意</van-radio>
<van-radio name="满意">满意</van-radio> <van-radio name="满意">满意</van-radio>
<van-radio name="基本满意">基本满意</van-radio> <van-radio name="良好">良好</van-radio>
<van-radio name="不满意">不满意</van-radio> <van-radio name="一般">一般</van-radio>
</van-radio-group> </van-radio-group>
</template> </template>
</van-field> </van-field>
</div> </div>
</div> </div>
</van-collapse-item>
</div>
</div> </div>
<div class="van-doc-card"> <div class="van-doc-card">
<van-field <van-field
@@ -163,8 +173,11 @@ layout("/mobile/platform.html"){
<div> <div>
<van-tabbar> <van-tabbar>
<van-button id="buttonAss" :disabled="isShowSubmit" round block type="info" @click="showAssess">查看测评结果</van-button> <van-button id="buttonAss" :disabled="isShowSubmit" round block type="info" @click="showAssess">
<van-button id="buttonSub" :disabled="isShowSubmit" round block type="info" @click="onSubmit">提交</van-button> 查看测评结果
</van-button>
<van-button id="buttonSub" :disabled="isShowSubmit" round block type="info" @click="onSubmit">提交
</van-button>
</van-tabbar> </van-tabbar>
</div> </div>
@@ -183,10 +196,10 @@ layout("/mobile/platform.html"){
bzList: [], bzList: [],
president: '', president: '',
presidentList: [], presidentList: [],
userList:[], userList: [],
isShowSubmit: false, isShowSubmit: false,
isReadOnly:false, isReadOnly: false,
formData:{ formData: {
id: '', id: '',
reviewResult: '', reviewResult: '',
presidentOpinions: '', presidentOpinions: '',
@@ -201,7 +214,7 @@ layout("/mobile/platform.html"){
assessmentFiles: [], assessmentFiles: [],
assessmentNrs: [], assessmentNrs: [],
assessmentReviewMode: '', assessmentReviewMode: '',
assessmentScoringMode:'', assessmentScoringMode: '',
} }
} }
}, },
@@ -226,7 +239,10 @@ layout("/mobile/platform.html"){
this.bzList = []; this.bzList = [];
this.commentatorData.nrs.forEach(v => { this.commentatorData.nrs.forEach(v => {
v.bzs.forEach(o => { v.bzs.forEach(o => {
if (self.commentatorData.assessmentMode === 1 && v.remark){ if (self.commentatorData.assessmentMode === 1 && v.remark) {
if (!o.resultScore) {
return
}
o.options = v.remark o.options = v.remark
} }
self.bzList.push(o) self.bzList.push(o)
@@ -241,15 +257,15 @@ layout("/mobile/platform.html"){
}) })
await this.assignment(); await this.assignment();
let evaluatedPersonName=null; let evaluatedPersonName = null;
let evaluatedPersonType=null; let evaluatedPersonType = null;
if (this.commentatorData.assessmentMode === 1) { if (this.commentatorData.assessmentMode === 1) {
let source = 0; // 标准分 let source = 0; // 标准分
let resultScore = 0; // 评议分 let resultScore = 0; // 评议分
this.bzList.forEach(v => { this.bzList.forEach(v => {
source += Number(v.source) source += Number(v.score)
resultScore += Number(v.resultScore) resultScore += Number(v.resultScore)
}) })
const result = (resultScore / source) * 100 const result = (resultScore / source) * 100
@@ -272,7 +288,7 @@ layout("/mobile/platform.html"){
this.reviewResult = '不满意' this.reviewResult = '不满意'
} }
const user = this.userList.find(v=> v.id === this.president) const user = this.userList.find(v => v.id === this.president)
evaluatedPersonName = user.username evaluatedPersonName = user.username
evaluatedPersonType = user.evaluatedPersonType evaluatedPersonType = user.evaluatedPersonType
} }
@@ -290,16 +306,36 @@ layout("/mobile/platform.html"){
const resp = await $.post('/mobile/wakeshome/review/appraisal/doSubmit', formData) const resp = await $.post('/mobile/wakeshome/review/appraisal/doSubmit', formData)
if (resp.code === 0) { if (resp.code === 0) {
await this.getCommentById(); await this.getCommentById();
vant.Toast.success('操作成功')
setTimeout(() => {
window.location.href = '/mobile/wakeshome/review/appraisal/mine' window.location.href = '/mobile/wakeshome/review/appraisal/mine'
}, 500)
} }
}) })
}, },
async showAssess() { async showAssess() {
this.$refs['addForm'].validate().then(async () => { this.$refs['addForm'].validate().then(async () => {
let score = 0; // let score = 0;
await this.assignment();
if (this.commentatorData.assessmentMode === 1) { if (this.commentatorData.assessmentMode === 1) {
await this.assignment();
let source = 0; // 标准分
let resultScore = 0; // 评议分
this.bzList.forEach(v => { this.bzList.forEach(v => {
source += Number(v.score)
resultScore += Number(v.resultScore)
})
const result = (resultScore / source) * 100
if (result >= 80) {
this.reviewResult = '满意'
} else if (result >= 60 && result <= 79) {
this.reviewResult = '基本满意'
} else {
this.reviewResult = '不满意'
}
/*this.bzList.forEach(v => {
score += Number(v.resultScore) score += Number(v.resultScore)
}) })
if (score >= Number(80)) { if (score >= Number(80)) {
@@ -308,12 +344,13 @@ layout("/mobile/platform.html"){
this.reviewResult = '基本满意' this.reviewResult = '基本满意'
} else { } else {
this.reviewResult = '不满意' this.reviewResult = '不满意'
} }*/
console.log(score) console.log(source)
console.log(resultScore)
console.log(this.reviewResult) console.log(this.reviewResult)
vant.Dialog.alert({ vant.Dialog.alert({
title: '测评结果', title: '测评结果',
message: '您的测评分数为【' + score + "】分,测评结果为【" + this.reviewResult + "】", message: '您的测评分数为【' + resultScore + "】分,测评结果为【" + this.reviewResult + "】",
confirmButtonColor: '#1867b0' confirmButtonColor: '#1867b0'
}) })
} else if (this.commentatorData.assessmentMode === 2) { } else if (this.commentatorData.assessmentMode === 2) {
@@ -34,7 +34,11 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool label="统计" :app="this"></table-tool> <table-tool label="统计" :app="this">
<template #func>
<el-button type="primary" size="small" @click="exportXlsx">导出</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" style="width: 100%"> <el-table :data="tableData" :size="tableSize" style="width: 100%">
<el-table-column type="index" label="序号" width="80px"></el-table-column> <el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column <el-table-column
@@ -46,9 +50,9 @@ layout("/layouts/platform.html"){
:prop="column.prop" :prop="column.prop"
:sortable="column.sortable" :sortable="column.sortable"
> >
<!-- <template v-if="column.prop==='sumDuration'" scope="{row}">--> <!-- <template v-if="column.prop==='sumDuration'" scope="{row}">-->
<!-- {{(row.sumDuration / 60 / 60).toFixed(2) + 'h'}}--> <!-- {{(row.sumDuration / 60 / 60).toFixed(2) + 'h'}}-->
<!-- </template>--> <!-- </template>-->
<template v-if="column.prop==='isQualified'" scope="{row}"> <template v-if="column.prop==='isQualified'" scope="{row}">
<span v-if="row.watchCount>=row.qualifiedNum" class="text-success"> <span v-if="row.watchCount>=row.qualifiedNum" class="text-success">
是 是
@@ -58,48 +62,48 @@ layout("/layouts/platform.html"){
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" header-align="center" label="操作" width="200">--> <!-- <el-table-column align="center" header-align="center" label="操作" width="200">-->
<!-- <template scope="{row}">--> <!-- <template scope="{row}">-->
<!-- <el-button size="mini" type="primary" @click="openView(row)">查看具体学习情况</el-button>--> <!-- <el-button size="mini" type="primary" @click="openView(row)">查看具体学习情况</el-button>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
</el-table> </el-table>
<!--#include("/layouts/pagination.html"){}#--> <!--#include("/layouts/pagination.html"){}#-->
</el-card> </el-card>
<!-- <template #view>--> <!-- <template #view>-->
<!-- <el-table :data="viewTableData" stripe border style="width: 100%">--> <!-- <el-table :data="viewTableData" stripe border style="width: 100%">-->
<!-- <el-table-column type="index" label="序号" width="80px">--> <!-- <el-table-column type="index" label="序号" width="80px">-->
<!-- <template scope="scope">--> <!-- <template scope="scope">-->
<!-- <span>{{ scope.$index + (viewPageForm.pageNumber - 1) * viewPageForm.pageSize + 1 }} </span>--> <!-- <span>{{ scope.$index + (viewPageForm.pageNumber - 1) * viewPageForm.pageSize + 1 }} </span>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- align="center"--> <!-- align="center"-->
<!-- header-align="center"--> <!-- header-align="center"-->
<!-- v-for="column in viewTableColumns"--> <!-- v-for="column in viewTableColumns"-->
<!-- show-overflow-tooltip--> <!-- show-overflow-tooltip-->
<!-- :label="column.label"--> <!-- :label="column.label"-->
<!-- :prop="column.prop"--> <!-- :prop="column.prop"-->
<!-- :sortable="column.sortable"--> <!-- :sortable="column.sortable"-->
<!-- >--> <!-- >-->
<!-- <template v-if="column.prop==='studyDuration'" scope="{row}">--> <!-- <template v-if="column.prop==='studyDuration'" scope="{row}">-->
<!-- {{(row.studyDuration / 60 / 60).toFixed(2) + 'h'}}--> <!-- {{(row.studyDuration / 60 / 60).toFixed(2) + 'h'}}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<!-- </el-table>--> <!-- </el-table>-->
<!-- <el-row class="el-pagination-container" style="margin-bottom: 0px">--> <!-- <el-row class="el-pagination-container" style="margin-bottom: 0px">-->
<!-- <el-pagination--> <!-- <el-pagination-->
<!-- @current-change="(val)=>{viewPageForm.pageNumber=val;viewPageData()}"--> <!-- @current-change="(val)=>{viewPageForm.pageNumber=val;viewPageData()}"-->
<!-- :current-page="viewPageForm.pageNumber"--> <!-- :current-page="viewPageForm.pageNumber"-->
<!-- :page-size="viewPageForm.pageSize"--> <!-- :page-size="viewPageForm.pageSize"-->
<!-- layout="total, sizes, prev, pager, next"--> <!-- layout="total, sizes, prev, pager, next"-->
<!-- :total="viewPageForm.totalCount">--> <!-- :total="viewPageForm.totalCount">-->
<!-- </el-pagination>--> <!-- </el-pagination>-->
<!-- </el-row>--> <!-- </el-row>-->
<!-- </template>--> <!-- </template>-->
</guava> </guava>
</div> </div>
@@ -155,6 +159,9 @@ layout("/layouts/platform.html"){
} }
}, },
viewPageNumberChange(val) { viewPageNumberChange(val) {
},
exportXlsx() {
window.open(loc() + '/exportXlsx?albumId=' + this.pageForm.albumId)
} }
}, },
async created() { async created() {
@@ -105,13 +105,40 @@ layout("/layouts/platform.html"){
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="350px"> <!-- <el-table-column label="操作" width="350px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="makeCode(row)" size="mini" type="primary">生成二维码</el-button> <el-button @click="makeCode(row)" size="mini" type="primary">生成二维码</el-button>
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button> <el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="deleteDo(row)" size="mini" type="primary">删除</el-button> <el-button @click="deleteDo(row)" size="mini" type="primary">删除</el-button>
</template> </template>
</el-table-column>-->
<el-table-column label="操作" width="150px">
<template scope="{row}">
<el-dropdown>
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="openCode(row.id)">
活动二维码
</el-dropdown-item>
<el-dropdown-item @click.native="makeCode(row)">
签到二维码
</el-dropdown-item>
<el-dropdown-item @click.native="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="openEdit(row)">
编辑
</el-dropdown-item>
<el-dropdown-item @click.native="deleteDo(row)">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--#include("/layouts/pagination.html"){}#--> <!--#include("/layouts/pagination.html"){}#-->
@@ -164,6 +191,8 @@ layout("/layouts/platform.html"){
</el-table> </el-table>
</el-dialog> </el-dialog>
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
</div> </div>
<script> <script>
@@ -197,9 +226,16 @@ layout("/layouts/platform.html"){
courseTimeList: [], courseTimeList: [],
viewMapDialog: false, viewMapDialog: false,
clickRow: {}, clickRow: {},
url: '',
} }
}, },
components: {
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
},
methods: { methods: {
openCode(id) {
this.$refs.openQRCode.openCode("/platform/mobile/trainSignUpActivity/trainList")
},
makeCode(row) { makeCode(row) {
this.clickRow = row this.clickRow = row
const type = this.trainTypeList.find(o => o.code === row.trainType) const type = this.trainTypeList.find(o => o.code === row.trainType)
@@ -96,7 +96,7 @@ layout("/layouts/platform.html"){
<template v-if="!scope.row.isReview"> <template v-if="!scope.row.isReview">
<el-tooltip content="评议页面的提交按钮在右上角哦" placement="top"> <el-tooltip content="评议页面的提交按钮在右上角哦" placement="top">
<el-button size="mini" type="primary" @click="doReview(scope.row)"> <el-button size="mini" type="primary" @click="doReview(scope.row)">
去评议 自评
</el-button> </el-button>
</el-tooltip> </el-tooltip>
</template> </template>
@@ -123,7 +123,7 @@ layout("/layouts/platform.html"){
<el-form :model="formData" ref="form" label-width="100px" <el-form :model="formData" ref="form" label-width="100px"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px"> style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<template v-if="formData.scoringMode==2"> <template v-if="formData.assessmentMode==2">
<vi-title title="评议对象选择"></vi-title> <vi-title title="评议对象选择"></vi-title>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@@ -189,9 +189,10 @@ layout("/layouts/platform.html"){
align="center" width="350px"> align="center" width="350px">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-radio-group v-model="row.resultScore" size="small"> <el-radio-group v-model="row.resultScore" size="small">
<el-radio label="非常满意">非常满意</el-radio>
<el-radio label="满意">满意</el-radio> <el-radio label="满意">满意</el-radio>
<el-radio label="基本满意">基本满意</el-radio> <el-radio label="良好">良好</el-radio>
<el-radio label="不满意">不满意</el-radio> <el-radio label="一般">一般</el-radio>
</el-radio-group> </el-radio-group>
</template> </template>
</el-table-column> </el-table-column>
@@ -414,7 +415,7 @@ layout("/layouts/platform.html"){
let source = 0; // 标准分 let source = 0; // 标准分
let resultScore = 0; // 评议分 let resultScore = 0; // 评议分
this.formData.bzList.forEach(v => { this.formData.bzList.forEach(v => {
source += Number(v.source) source += Number(v.score)
resultScore += Number(v.resultScore) resultScore += Number(v.resultScore)
}) })
const result = (resultScore / source) * 100 const result = (resultScore / source) * 100
@@ -76,11 +76,25 @@ layout("/layouts/platform.html"){
:sortable="column.sortable" :sortable="column.sortable"
:label="column.label" :label="column.label"
:prop="column.prop" :width="column.width" min-width="100px"> :prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop=='isGrading'" scope="{row}">
<el-tag v-if="row.isGrading" type="success">是</el-tag>
<el-tag v-else type="danger">否</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" <el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="240px" fixed="right"> width="380px" fixed="right">
<template scope="{row}"> <template scope="{row}">
<el-button size="mini" @click="openView(row)">查看</el-button> <el-button size="mini" @click="openView(row)">查看</el-button>
<el-button
v-if="!row.isGrading && row.num > 0 && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
size="mini" type="primary"
@click="openGrading(row)">定级
</el-button>
<el-button
v-if="row.isGrading && row.num > 0 && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
size="mini" type="primary"
@click="editGrading(row)">修改定级
</el-button>
<el-tooltip <el-tooltip
:content="canDownload ? ('导出【'+ row.unionName +'】管理员自我评议的评议结果') : ('导出【'+ row.unionName +'】下所有评议结果的压缩包') " :content="canDownload ? ('导出【'+ row.unionName +'】管理员自我评议的评议结果') : ('导出【'+ row.unionName +'】下所有评议结果的压缩包') "
placement="top"> placement="top">
@@ -185,6 +199,26 @@ layout("/layouts/platform.html"){
<el-dialog title="评议结果" :visible.sync="userDrawer" close-on-press-escape> <el-dialog title="评议结果" :visible.sync="userDrawer" close-on-press-escape>
<wakes-home-review ref="wakesHomeReview"></wakes-home-review> <wakes-home-review ref="wakesHomeReview"></wakes-home-review>
</el-dialog> </el-dialog>
<el-dialog :title="gradingTitle" :visible.sync="gradingDialog" width="40%" :close-on-press-escape="false">
<el-form :model="gradingData" ref="gradingForm" :rules="gradingRules" label-width="120px">
<el-form-item prop="zbName" label="评测名称">
<el-input readonly v-model="gradingData.zbName"></el-input>
</el-form-item>
<el-form-item prop="unionName" label="定级分工会">
<el-input readonly v-model="gradingData.unionName"></el-input>
</el-form-item>
<el-form-item prop="gradingName" label="定级结果">
<dict-select v-model="gradingData.gradingName" style="width: 100%" clearable
placeholder="请选择定级结果" code="GRADING_TYPE"></dict-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="gradingDialog = false">取 消</el-button>
<el-button type="primary" @click="doGrading">确 定</el-button>
</span>
</el-dialog>
</div> </div>
@@ -216,6 +250,8 @@ layout("/layouts/platform.html"){
tableColumns: [ tableColumns: [
{prop: 'unionName', label: '分工会名称'}, {prop: 'unionName', label: '分工会名称'},
{prop: 'num', label: '测评人数'}, {prop: 'num', label: '测评人数'},
{prop: 'isGrading', label: '是否定级'},
{prop: 'gradingName', label: '定级结果'},
], ],
tableData: [], tableData: [],
userTableData: [], userTableData: [],
@@ -235,13 +271,53 @@ layout("/layouts/platform.html"){
pageOrderName: "", pageOrderName: "",
pageOrderBy: "" pageOrderBy: ""
}, },
reviewResultData: {} reviewResultData: {},
gradingDialog: false,
gradingTitle: '',
gradingData: {
unionName: '',
unionId: '',
zbId: '',
zbName: '',
},
gradingRules: {
gradingName: [ {required: true, message: '请选择定级结果', trigger: 'blur'} ]
}
} }
}, },
components: { components: {
'wakes-home-review': httpVueLoader('/components/wakeshome/review/ReviewResult.vue?v=' + moment(new Date()).unix()), 'wakes-home-review': httpVueLoader('/components/wakeshome/review/ReviewResult.vue?v=' + moment(new Date()).unix()),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=' + moment(new Date()).unix()),
}, },
methods: { methods: {
editGrading(row) {
this.gradingData = {...row}
this.$set(this.gradingData, 'zbId', this.pageForm.zbId)
this.$set(this.gradingData, 'zbName', this.zbList.find(v => v.id === this.pageForm.zbId).assessment)
this.gradingDialog = true
},
doGrading() {
this.$refs['gradingForm'].validate(async (valid) => {
if (valid) {
const resp = await $.post(loc() + '/doGrading', this.gradingData)
if (resp.code === 0) {
this.gradingDialog = false
this.pageData()
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
}
})
},
openGrading(row) {
this.$set(this.gradingData, 'unionId', row.id)
this.$set(this.gradingData, 'unionName', row.unionName)
this.$set(this.gradingData, 'zbId', this.pageForm.zbId)
this.$set(this.gradingData, 'zbName', this.zbList.find(v => v.id === this.pageForm.zbId).assessment)
this.gradingDialog = true
},
doDownLoad(row, flag) { doDownLoad(row, flag) {
if (flag) { if (flag) {
// 为true,自我评议 // 为true,自我评议
@@ -271,9 +271,86 @@ layout("/layouts/platform.html"){
</div> </div>
</transition> </transition>
<transition name="el-zoom-in-bottom"> <transition name="el-zoom-in-bottom">
<div class="transition-box" style="margin-top: 20px;" <div class="transition-box" style="margin-top: 20px;" v-show="stepActive==1">
v-show="stepActive==1"> <vi-title2 title="分段设置">
<div class="pull-right offscreen-right mt5"> <template #func>
<el-button size="small" type="primary" @click="unionLimitQuickSetting">
应用分段设置
</el-button>
</template>
</vi-title2>
<el-row v-for="(item,index) in unionUserNumCalc" :gutter="20" class="mb5">
<el-col :span="7">
<el-input-number v-model="item.startNum" :precision="0" :step="1" :min="1"
placeholder="请输入最小人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="7">
<el-input-number v-model="item.endNum" :precision="0" :step="1" :min="1"
placeholder="请输入最大人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="6">
<el-input-number v-model="item.resultNum" :precision="0" :step="1" :min="1"
placeholder="请输入限制人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="4" class="text-right">
<el-button icon="el-icon-plus"
@click="unionUserNumCalc.push({})"></el-button>
<el-button icon="el-icon-minus" @click="unionUserNumCalc.splice(index,1)"
:disabled="unionUserNumCalc.length===1"></el-button>
</el-col>
</el-row>
<el-row class="mt10">
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
<span class="mr10">({{index+1}}).</span> {{item}}
</div>
</el-row>
<vi-title2 title="比例设置" class="mt20">
<template #func>
一键比例:
<el-input-number v-model="unionUserNumOneKeyRatio" :precision="0" :step="1"
:min="0"
placeholder="请输入一键比例"
size="small"
:max="100"></el-input-number>
<el-button size="small" type="primary" @click="applyScaleSettings"
class="ml5">应用比例设置
</el-button>
</template>
</vi-title2>
<el-table :data="unionUserNumberLimit" max-height="500px">
<el-table-column prop="unionname" label="分工会"></el-table-column>
<el-table-column prop="teacherCount" label="人数"></el-table-column>
<el-table-column prop="ratio" label="比例(%)">
<template scope="{row}">
<el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0"
:max="100"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="limitNum" label="限制人数">
<template scope="{row}">
<el-input-number v-model="row.limitNum" :precision="0" :step="1"
:min="0"
:max="row.teacherCount"
@change="calSummaryCount"></el-input-number>
</template>
</el-table-column>
</el-table>
<el-row class="mt20" justify="end" type="flex">
<div class="text-danger"
style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">
限制总人数:{{summaryCount}}人
</div>
<el-button @click="clearUnionLimit" type="danger">清空分工会人数限制</el-button>
<!--<el-button @click="setUpUnionLimitDialog=false">取消</el-button>-->
<!--<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>-->
</el-row>
<!--<div class="pull-right offscreen-right mt5">
<span style="color:#409EFF">沿用之前活动名额&nbsp;&nbsp;</span> <span style="color:#409EFF">沿用之前活动名额&nbsp;&nbsp;</span>
<el-select @change="mefpChange" class="d-select" clearable <el-select @change="mefpChange" class="d-select" clearable
filterable filterable
@@ -313,7 +390,7 @@ layout("/layouts/platform.html"){
v-model="scope.row.number"></el-input-number> v-model="scope.row.number"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>-->
<div style="float: right;margin: 20px 0"> <div style="float: right;margin: 20px 0">
<el-button @click="stepActive=0">上一步</el-button> <el-button @click="stepActive=0">上一步</el-button>
@@ -416,59 +493,93 @@ layout("/layouts/platform.html"){
</el-form> </el-form>
<div style="float: right;margin: 20px 0"> <div style="float: right;margin: 20px 0">
<el-button :disabled="subDis" @click="doEdit()" <el-button :disabled="subDis" @click="doEdit()"
type="primary">修 改 type="primary">修改基础数据
</el-button> </el-button>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="名额分配" name="2"> <el-tab-pane label="名额分配" name="2">
<el-form label-width="120px"> <vi-title2 title="分段设置">
<vi-title title="修改名额分配"></vi-title> <template #func>
<div class="pull-right offscreen-right mt5"> <el-button size="small" type="primary" @click="unionLimitQuickSetting">
<span style="color:#409EFF">沿用之前活动名额&nbsp;&nbsp;</span> 应用分段设置
<el-select @change="mefpChange" class="d-select" </el-button>
clearable filterable </template>
placeholder="请选择活动" </vi-title2>
v-model="pastQuota" width="300px"> <el-row v-for="(item,index) in unionUserNumCalc" :gutter="20" class="mb5">
<el-option <el-col :span="7">
:key="item.id" <el-input-number v-model="item.startNum" :precision="0" :step="1" :min="1"
:label="item.name" placeholder="请输入最小人数"
:value="item.id" style="width: 100%"></el-input-number>
v-for="item in lxyHd"> </el-col>
</el-option> <el-col :span="7">
</el-select> <el-input-number v-model="item.endNum" :precision="0" :step="1" :min="1"
placeholder="请输入最大人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="6">
<el-input-number v-model="item.resultNum" :precision="0" :step="1" :min="1"
placeholder="请输入限制人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="4" class="text-right">
<el-button icon="el-icon-plus"
@click="unionUserNumCalc.push({})"></el-button>
<el-button icon="el-icon-minus" @click="unionUserNumCalc.splice(index,1)"
:disabled="unionUserNumCalc.length===1"></el-button>
</el-col>
</el-row>
<el-row class="mt10">
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
<span class="mr10">({{index+1}}).</span> {{item}}
</div> </div>
</el-form> </el-row>
<el-table :data="unions_" height="70vh" size="medium">
<el-table-column align="center" header-align="center"
label="序号"
type="index"></el-table-column>
<el-table-column label="分工会" prop="unionname" sortable> <vi-title2 title="比例设置" class="mt20">
<template #func>
一键比例:
<el-input-number v-model="unionUserNumOneKeyRatio" :precision="0" :step="1"
:min="0"
placeholder="请输入一键比例"
size="small"
:max="100"></el-input-number>
<el-button size="small" type="primary" @click="applyScaleSettings"
class="ml5">应用比例设置
</el-button>
</template>
</vi-title2>
<el-table :data="unionUserNumberLimit" max-height="500px">
<el-table-column prop="unionname" label="分工会"></el-table-column>
<el-table-column prop="teacherCount" label="人数"></el-table-column>
<el-table-column prop="ratio" label="比例(%)">
<template scope="{row}"> <template scope="{row}">
{{isDisPlayCode?'('+row.unioncode+')':null}}{{row.unionname}} <el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0"
:max="100"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="limitNum" label="限制人数">
<el-table-column label="会员人数" prop="membercount" <template scope="{row}">
sortable></el-table-column> <el-input-number v-model="row.limitNum" :precision="0" :step="1"
<el-table-column align="center" header-align="center"
label="名额" prop="number"
width="200px">
<template scope="scope">
<el-input-number :max="1000"
:min="0" :min="0"
controls-position="right" :max="row.teacherCount"
placeholder="请填写名额数" @change="calSummaryCount"></el-input-number>
v-model="scope.row.number"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row class="mt20" justify="end" type="flex">
<div class="text-danger"
style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">
限制总人数:{{summaryCount}}人
</div>
<el-button @click="clearUnionLimit" type="danger">清空分工会人数限制</el-button>
<!--<el-button @click="setUpUnionLimitDialog=false">取消</el-button>-->
<!--<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>-->
</el-row>
<div style="float: right;margin: 20px 0"> <div style="float: right;margin: 20px 0">
<el-button :disabled="subDis" @click="doEditMefp" <el-button :disabled="subDis" @click="doEditMefp"
type="primary">提 交 type="primary">修改名额分配
</el-button> </el-button>
</div> </div>
</el-tab-pane> </el-tab-pane>
@@ -501,6 +612,10 @@ layout("/layouts/platform.html"){
} }
}; };
return { return {
summaryCount: 0,
unionUserNumCalc: [{}],
unionUserNumOneKeyRatio: null,
unionUserNumberLimit: [],
pastQuota: "", pastQuota: "",
tabs_active: '1', tabs_active: '1',
unions: [], unions: [],
@@ -541,7 +656,7 @@ layout("/layouts/platform.html"){
} }
}, },
methods: { methods: {
mefpChange() { /*mefpChange() {
if (this.pastQuota === '') { if (this.pastQuota === '') {
this.unions_ = this.unions.map(v => { this.unions_ = this.unions.map(v => {
const o = { const o = {
@@ -558,7 +673,7 @@ layout("/layouts/platform.html"){
$.post(base + "/platform/zgfw/lxy/hd/getPastQuota", {pastQuota: this.pastQuota}, res => { $.post(base + "/platform/zgfw/lxy/hd/getPastQuota", {pastQuota: this.pastQuota}, res => {
this.unions_ = res.data this.unions_ = res.data
}) })
}, },*/
doEditMefp() { doEditMefp() {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
@@ -567,7 +682,10 @@ layout("/layouts/platform.html"){
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
$.post(base + "/platform/zgfw/lxy/hd/doEditMefp", {mefp: JSON.stringify(this.unions_)}, (data) => { $.post(base + "/platform/zgfw/lxy/hd/doEditMefp", {
mefp: JSON.stringify(this.unionUserNumberLimit),
hdId: this.id
}, (data) => {
loading.close() loading.close()
if (data.code == 0) { if (data.code == 0) {
this.v = 'index' this.v = 'index'
@@ -703,7 +821,8 @@ layout("/layouts/platform.html"){
} }
}); });
}, },
openEdit(id) { async openEdit(id) {
this.id = id
this.pastQuota = "" this.pastQuota = ""
this.fileList = [] this.fileList = []
this.delFiles = [] this.delFiles = []
@@ -754,6 +873,20 @@ layout("/layouts/platform.html"){
this.loading = false this.loading = false
}, "json"); }, "json");
this.unionUserNumberLimit = []
this.unionUserNumOneKeyRatio = null
this.unionUserNumCalc = [{}]
// this.summaryCount = 0
await this.getLimitUnionData()
this.unionUserNumberLimit.forEach(v=>{
v.limitNum = this.unions_.find(item=>item.ghid===v.id).number
})
this.summaryCount = this.unionUserNumberLimit.reduce((accumulator, currentObject) => {
return accumulator + currentObject.limitNum;
}, 0);
}, },
doDelete(id) { doDelete(id) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
@@ -798,7 +931,7 @@ layout("/layouts/platform.html"){
formdata.append("files", val.raw, val.raw.name); formdata.append("files", val.raw, val.raw.name);
}); });
//const unions_ = this.unions_.filter(v => v.number) //const unions_ = this.unions_.filter(v => v.number)
formdata.append('mefp', JSON.stringify(this.unions_)) formdata.append('mefp', JSON.stringify(this.unionUserNumberLimit))
this.subDis = true this.subDis = true
const loading = this.$loading({ const loading = this.$loading({
@@ -872,6 +1005,11 @@ layout("/layouts/platform.html"){
if (this.$refs['form']) { if (this.$refs['form']) {
this.$refs['form'].resetFields() this.$refs['form'].resetFields()
} }
this.unionUserNumberLimit = []
this.unionUserNumOneKeyRatio = null
this.unionUserNumCalc = [{}]
this.summaryCount = 0
this.getLimitUnionData()
}, },
doSearch() { doSearch() {
this.tabKey = new Date().getTime() this.tabKey = new Date().getTime()
@@ -908,6 +1046,70 @@ layout("/layouts/platform.html"){
} }
}, "json"); }, "json");
}, },
applyScaleSettings() {
this.unionUserNumberLimit.forEach(v => {
v.limitNum = parseFloat((v.teacherCount * this.unionUserNumOneKeyRatio / 100).toFixed(0))
if (v.ratio) {
v.limitNum = parseFloat((v.teacherCount * v.ratio / 100).toFixed(0))
}
})
this.calSummaryCount()
},
calSummaryCount() {
const array = this.unionUserNumberLimit
if (array) {
this.summaryCount = array.reduce((prev, curr) => {
const value = Number(curr.limitNum);
if (!isNaN(value)) {
return prev + curr.limitNum;
} else {
return prev;
}
}, 0)
}
},
unionLimitQuickSetting() {
this.unionUserNumCalc.forEach((v, i) => {
const startNum = v.startNum
const endNum = v.endNum
const resultNum = v.resultNum
if (startNum > endNum) {
this.$message.warning('第' + (i + 1) + '行设置错误')
} else {
this.unionUserNumberLimit.forEach(x => {
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
x.limitNum = resultNum
}
})
this.calSummaryCount()
}
})
},
async clearUnionLimit(){
const confirm = await this.$confirm('确定要清空分工会人数限制吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' === confirm) {
this.unionUserNumberLimit = []
this.unionUserNumOneKeyRatio = null
this.unionUserNumCalc = [{}]
this.summaryCount = 0
await this.getLimitUnionData()
}
},
async getLimitUnionData() {
const resp = await $.get('/platform/trainSingUp/manage/activity/getUnionLimit')
this.unionUserNumberLimit = resp.data
}
},
computed: {
unionUserNumCalcTips() {
return this.unionUserNumCalc.map(v => {
return (v.startNum ? v.startNum : '?') + '-' + (v.endNum ? v.endNum : '?') + '人的分工会,限报' + (v.resultNum ? v.resultNum : '?') + '人'
})
},
}, },
async created() { async created() {
const unions_resp = await $.get(loc() + '/getUnions') const unions_resp = await $.get(loc() + '/getUnions')
@@ -470,19 +470,17 @@ display: -webkit-box;
async yjTg() { async yjTg() {
if (this.multipleSelectionGh.length == 0) { if (this.multipleSelectionGh.length == 0) {
this.$message({ this.$message({
message: '请选择工会!', message: '请勾选审核列表的分工会!',
type: 'warning' type: 'warning'
}); });
return return
} }
const confirm = await this.$confirm('确定要给报名人员发送消息吗', '提示', { const confirm = await this.$confirm('确定要一键审核勾选的分工会吗', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
if (confirm === "confirm") { if (confirm === "confirm") {
}
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: '数据提交中...', text: '数据提交中...',
@@ -495,7 +493,7 @@ display: -webkit-box;
}) })
const data = await $.post(base + "/platform/zgfw/lxy/xghsh/yjSh", {maps: JSON.stringify(arr)}) const data = await $.post(base + "/platform/zgfw/lxy/xghsh/yjSh", {maps: JSON.stringify(arr)})
if (data.code == 0) { if (data.code === 0) {
this.$message({ this.$message({
message: '提交成功', message: '提交成功',
type: 'success' type: 'success'
@@ -509,6 +507,7 @@ display: -webkit-box;
}); });
} }
loading.close() loading.close()
}
}, },
sh(zt) { sh(zt) {
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {