bug整改

This commit is contained in:
=
2025-03-28 15:28:07 +08:00
parent 74f24281e0
commit 58e48c5f75
98 changed files with 8099 additions and 1588 deletions
@@ -0,0 +1,68 @@
package io.v.nutz.base.utils;
import net.sourceforge.pinyin4j.PinyinHelper;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* Created by wizzer on 2017/5/24.
*/
@IocBean
public class PinyinUtil {
/**
* 将汉字转换为全拼
*/
public static String getPingYin(String name) {
char[] charArray = name.toCharArray();
StringBuilder pinyin = new StringBuilder();
for (int i = 0; i < charArray.length; i++) {
if (Character.toString(charArray[i]).matches("[\\u4E00-\\u9FA5]+")) {
pinyin.append(PinyinHelper.toHanyuPinyinStringArray(charArray[i])[0]);
} else {
pinyin.append(charArray[i]);
}
}
return pinyin.toString();
}
/**
* 返回中文的首字母
*
* @param str
* @return
*/
public static String getPinYinHeadChar(String str) {
String convert = "";
for (int j = 0; j < str.length(); j++) {
char word = str.charAt(j);
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word);
if (pinyinArray != null) {
convert += pinyinArray[0].charAt(0);
} else {
convert += word;
}
}
return convert;
}
/**
* 将字符串转移为ASCII码
*
* @param cnStr
* @return
*/
public static String getCnASCII(String cnStr) {
StringBuffer strBuf = new StringBuffer();
byte[] bGBK = cnStr.getBytes();
for (int i = 0; i < bGBK.length; i++) {
strBuf.append(Integer.toHexString(bGBK[i] & 0xff));
}
return strBuf.toString();
}
// public static void main(String[] args) {
// System.out.println(getPingYin("綦江qq县"));
// System.out.println(getPinYinHeadChar("綦江县"));
// System.out.println(getCnASCII("綦江县"));
// }
}
@@ -128,7 +128,7 @@ public class Sys_club_user extends BaseModel {
@Column @Column
@Comment("工作部门") @Comment("工作部门")
@ColDefine(type = ColType.VARCHAR, width = 100) @ColDefine(type = ColType.VARCHAR, width = 200)
private String unitName; private String unitName;
@Column @Column
@@ -661,6 +661,42 @@ public class Sys_user extends BaseModel implements Serializable {
@Comment("专业技术级别") @Comment("专业技术级别")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 50)
private String professionalTechnicalLevel; private String professionalTechnicalLevel;
@Column
@Comment("退休性质(针对退休人员)")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String retireNature;
@Column
@Comment("待遇")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String treatment;
@Column
@Comment("医疗证号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String medicalCertificateNumber;
@Column
@Comment("原部门")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String originalDepartment;
@Column
@Comment("家属姓名")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String familyName;
@Column
@Comment("备注(针对退休人员)")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String retireNotes;
@Column
@Comment("基础病信息")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String basicDiseaseInfo;
/** /**
* 前端菜单 * 前端菜单
*/ */
@@ -55,7 +55,7 @@ public class Globals {
//项目域名 (设置一个默认的 为优先级考虑) //项目域名 (设置一个默认的 为优先级考虑)
public static String AppDomain = "http://zhgh.zjitc.edu.cn"; public static String AppDomain = "http://zhgh.zjitc.edu.cn";
//cas地址 //cas地址
public static String CasAddress = "http://sso.zjitc.edu.cn/"; public static String CasAddress = "https://sso.zjitc.edu.cn";
//文件访问域名 //文件访问域名
public static String AppFileDomain = ""; public static String AppFileDomain = "";
//文件上传路径 //文件上传路径
@@ -76,7 +76,7 @@ public class DivisionCon {
act.*, act.*,
u.loginname bxr_loginname, u.loginname bxr_loginname,
u.unionname bxr_unionname, u.unionname bxr_unionname,
s.state_name, s.stateName,
s.state_color, s.state_color,
abs.`name` absName abs.`name` absName
FROM FROM
@@ -84,7 +84,7 @@ public class DivisionCon {
LEFT JOIN `user` u ON act.user_id = u.id LEFT JOIN `user` u ON act.user_id = u.id
LEFT JOIN sys_unit su ON su.id = u.unitid LEFT JOIN sys_unit su ON su.id = u.unitid
LEFT JOIN sys_union un ON su.unionid = un.id LEFT JOIN sys_union un ON su.unionid = un.id
LEFT JOIN state s ON act.state_id = s.state_id LEFT JOIN audit_state s ON act.stateId = s.state_id
LEFT JOIN activity_basic_settings abs ON abs.`code` = act.projectJfCode LEFT JOIN activity_basic_settings abs ON abs.`code` = act.projectJfCode
$condition $condition
"""); """);
@@ -64,4 +64,11 @@ public class MobileTheRapyRecuperationEnrollController {
public void myRecuperation() { public void myRecuperation() {
} }
@At("/userSignInfo")
@Ok("beetl:/mobile/therapyRecuperation/userSignInfo.html")
@RequiresAuthentication
public void userSignInfo() {
}
} }
@@ -4,12 +4,13 @@ import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup; import io.v.nutz.base.result.Result;
import io.v.nutz.zhgh.retired.group.model.RetiredGroupUnit;
import io.v.nutz.sys.models.Sys_unit; import io.v.nutz.sys.models.Sys_unit;
import io.v.nutz.sys.models.Sys_user_role; import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import io.v.nutz.zhgh.retired.group.model.RetiredGroupUnit;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
@@ -54,8 +55,8 @@ public class RetiredGroupManageController {
} }
@At @At
@RequiresPermissions("retired.group.manage")
@ViReturn @ViReturn
@RequiresPermissions("retired.group.manage")
public Object getTree() { public Object getTree() {
HashMap<String, Object> topMap = new HashMap<>(); HashMap<String, Object> topMap = new HashMap<>();
topMap.put("label", "离退办小组"); topMap.put("label", "离退办小组");
@@ -82,16 +83,16 @@ public class RetiredGroupManageController {
* @return {@link Object} * @return {@link Object}
*/ */
@At @At
@RequiresPermissions("retired.group.manage")
@ViReturn @ViReturn
@RequiresPermissions("retired.group.manage")
public Object doSetGroup(RetiredGroup retiredGroup) { public Object doSetGroup(RetiredGroup retiredGroup) {
dao.insertOrUpdate(retiredGroup); dao.insertOrUpdate(retiredGroup);
return null; return null;
} }
@At @At
@RequiresPermissions("retired.group.manage")
@ViReturn @ViReturn
@RequiresPermissions("retired.group.manage")
public Object groupPageData(PageForm pageForm) { public Object groupPageData(PageForm pageForm) {
Sql sql = Sqls.create("select * from retired_group $condition"); Sql sql = Sqls.create("select * from retired_group $condition");
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
@@ -121,8 +122,8 @@ public class RetiredGroupManageController {
* @return {@link Object} * @return {@link Object}
*/ */
@At @At
@RequiresPermissions("retired.group.manage")
@ViReturn @ViReturn
@RequiresPermissions("retired.group.manage")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Object deleteGroup(String id) { public Object deleteGroup(String id) {
dao.clear(RetiredGroup.class, Cnd.where("id", "=", id)); dao.clear(RetiredGroup.class, Cnd.where("id", "=", id));
@@ -131,8 +132,8 @@ public class RetiredGroupManageController {
} }
@At @At
@RequiresPermissions("retired.group.manage")
@ViReturn @ViReturn
@RequiresPermissions("retired.group.manage")
public Object componentUnitPageData(PageForm pageForm, String groupId) { public Object componentUnitPageData(PageForm pageForm, String groupId) {
Sql sql = Sqls.create("select * from sys_unit $condition"); Sql sql = Sqls.create("select * from sys_unit $condition");
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
@@ -150,8 +151,8 @@ public class RetiredGroupManageController {
* @return {@link Object} * @return {@link Object}
*/ */
@At @At
@RequiresPermissions("retired.group.manage")
@ViReturn @ViReturn
@RequiresPermissions("retired.group.manage")
public Object groupComponentUnit(String groupId) { public Object groupComponentUnit(String groupId) {
Sql sql = Sqls.create("select unitId from retired_group_unit where retiredGroupId = @groupId").setParam("groupId", groupId); Sql sql = Sqls.create("select unitId from retired_group_unit where retiredGroupId = @groupId").setParam("groupId", groupId);
return Daos.query(dao, sql.toString(), Sqls.callback.strs()); return Daos.query(dao, sql.toString(), Sqls.callback.strs());
@@ -184,8 +185,8 @@ public class RetiredGroupManageController {
*/ */
@At @At
@RequiresPermissions("retired.group.manage") @RequiresPermissions("retired.group.manage")
@ViReturn
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@ViReturn
public Object doSetComponentUnit(String groupId, @Param(value = "units", required = false) String[] units) { public Object doSetComponentUnit(String groupId, @Param(value = "units", required = false) String[] units) {
dao.clear(RetiredGroupUnit.class, Cnd.where("retiredGroupId", "=", groupId)); dao.clear(RetiredGroupUnit.class, Cnd.where("retiredGroupId", "=", groupId));
List<RetiredGroupUnit> insertGroupUnits = Arrays.stream(units).map(v -> { List<RetiredGroupUnit> insertGroupUnits = Arrays.stream(units).map(v -> {
@@ -231,8 +232,9 @@ public class RetiredGroupManageController {
"""); """);
sql.setParam("groupId", groupId); sql.setParam("groupId", groupId);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("u.userState", "=", "退休"); cnd.and("u.userState", "=", "不在职");
cnd.and("u.personType", "=", "退休人员"); // cnd.and("u.personType", "=", "退休人员");
cnd.and("u.unitid", "in", Sqls.create("select unitId from retired_group_unit where retiredGroupId = @retiredGroupId").setParam("retiredGroupId", groupId)); cnd.and("u.unitid", "in", Sqls.create("select unitId from retired_group_unit where retiredGroupId = @retiredGroupId").setParam("retiredGroupId", groupId));
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -256,8 +258,8 @@ public class RetiredGroupManageController {
*/ */
@At @At
@RequiresPermissions("retired.group.manage") @RequiresPermissions("retired.group.manage")
@ViReturn
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@ViReturn
public Object setGroupLeader(String userId, String groupId) { public Object setGroupLeader(String userId, String groupId) {
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", userId).and("roleId", "=", "32752cd07253419b98f32ca14b9915f1")); dao.clear(Sys_user_role.class, Cnd.where("userId", "=", userId).and("roleId", "=", "32752cd07253419b98f32ca14b9915f1"));
dao.insert(Sys_user_role.class, Chain.make("userId", userId).add("roleId", "32752cd07253419b98f32ca14b9915f1").add("ltbGroupId", groupId)); dao.insert(Sys_user_role.class, Chain.make("userId", userId).add("roleId", "32752cd07253419b98f32ca14b9915f1").add("ltbGroupId", groupId));
@@ -1,9 +1,10 @@
package io.v.nutz.zhgh.retired.group.controller; package io.v.nutz.zhgh.retired.group.controller;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -48,7 +49,7 @@ public class RetiredGroupStatisticsController {
LEFT JOIN retired_group_unit rgu ON rgu.retiredGroupId = g.id LEFT JOIN retired_group_unit rgu ON rgu.retiredGroupId = g.id
LEFT JOIN sys_unit n on n.id = rgu.unitId LEFT JOIN sys_unit n on n.id = rgu.unitId
LEFT JOIN sys_user u ON u.unitid = rgu.unitId LEFT JOIN sys_user u ON u.unitid = rgu.unitId
AND u.userState = '退休' AND u.userState = '不在职'
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
@@ -4,9 +4,9 @@ import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch; import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranchUser; import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranchUser;
import io.v.nutz.sys.services.SysUserService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -161,8 +161,8 @@ public class RetiredPartyBranchManageController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("u.userState", "=", "退休"); cnd.and("u.retired", "=", 1);
cnd.and("u.political", "=", "中共党员"); // cnd.and("u.political", "=", "中共党员");
cnd.and("u.id", "not in", Sqls.create("select userId from retired_party_branch_user")); cnd.and("u.id", "not in", Sqls.create("select userId from retired_party_branch_user"));
if (StrUtil.isNotBlank(val)) { if (StrUtil.isNotBlank(val)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -1,8 +1,9 @@
package io.v.nutz.zhgh.retired.partyBranch.controller; package io.v.nutz.zhgh.retired.partyBranch.controller;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -57,7 +58,7 @@ public class RetiredPartyBranchStatisticsController {
@At @At
@ViReturn @ViReturn
public Object retiredPartyBranch() { public Object retiredPartyBranch() {
return sysUserService.dao().query(RetiredPartyBranch.class, Cnd.NEW().asc("partyBranchCode")); return sysUserService.dao().query(RetiredPartyBranch.class,Cnd.NEW().asc("partyBranchCode"));
} }
} }
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.retired.user.contants; package io.v.nutz.zhgh.retired.user.contants;
import io.v.nutz.base.annontation.SelectEnum; import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -4,10 +4,10 @@ import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -105,7 +105,7 @@ public class RetiredUserHistoryController {
@At @At
@ViReturn @ViReturn
public Object retiredGroup() { public Object retiredGroup() {
return dao.query(RetiredGroup.class, Cnd.NEW().asc("groupCode")); return dao.query(RetiredGroup.class,Cnd.NEW().asc("groupCode"));
} }
@At @At
@@ -1,20 +1,33 @@
package io.v.nutz.zhgh.retired.user.controller; package io.v.nutz.zhgh.retired.user.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.result.Result;
import io.v.nutz.base.utils.PinyinUtil;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup; import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import io.v.nutz.zhgh.retired.group.model.RetiredUserHistory; import io.v.nutz.zhgh.retired.group.model.RetiredUserHistory;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch; import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import io.v.nutz.zhgh.retired.user.contants.RetiredUserChangeType; import io.v.nutz.zhgh.retired.user.contants.RetiredUserChangeType;
import io.v.nutz.zhgh.retired.user.mode.RetiredUserTemplate;
import io.v.nutz.zhgh.retired.user.model.RetiredUserChange; import io.v.nutz.zhgh.retired.user.model.RetiredUserChange;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.zhgh.staffmanage.member.UserMode;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -29,14 +42,21 @@ 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.Lang;
import org.nutz.lang.random.R; import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
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.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@IocBean @IocBean
@@ -69,12 +89,7 @@ public class RetiredUserListController {
@At @At
@RequiresPermissions("retired.user.list") @RequiresPermissions("retired.user.list")
@ViReturn @ViReturn
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm, @Param(value = "unitId", required = false) String unitId, @Param(value = "unionId", required = false) String unionId, @Param(value = "retiredGroupId", required = false) String retiredGroupId, @Param(value = "retiredPartyBranchId", required = false) String retiredPartyBranchId) {
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "retiredGroupId", required = false) String retiredGroupId,
@Param(value = "retiredPartyBranchId", required = false) String retiredPartyBranchId
) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
u.id, u.id,
@@ -96,10 +111,11 @@ public class RetiredUserListController {
LEFT JOIN retired_group rg ON rg.id = rgu.retiredGroupId LEFT JOIN retired_group rg ON rg.id = rgu.retiredGroupId
LEFT JOIN retired_party_branch_user rpbu ON rpbu.userId = u.id LEFT JOIN retired_party_branch_user rpbu ON rpbu.userId = u.id
LEFT JOIN retired_party_branch rpb ON rpb.id = rpbu.partyBranchId LEFT JOIN retired_party_branch rpb ON rpb.id = rpbu.partyBranchId
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("u.retired", "=", 1); cnd.and("u.retired", "=", 1);
// cnd.and("u.userState", "=", "不在岗");
cnd.andEX("u.unitId", "=", unitId); cnd.andEX("u.unitId", "=", unitId);
cnd.andEX("u.unionId", "=", unionId); cnd.andEX("u.unionId", "=", unionId);
cnd.andEX("rg.id", "=", retiredGroupId); cnd.andEX("rg.id", "=", retiredGroupId);
@@ -134,10 +150,7 @@ public class RetiredUserListController {
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Object changeToDie(String userId, Date deathDate) { public Object changeToDie(String userId, Date deathDate) {
sysUserService.update(Chain.make("userState", "死亡") sysUserService.update(Chain.make("userState", "死亡").add("personType", "去世人员").add("deathDate", deathDate), Cnd.where("id", "=", userId));
.add("personType", "去世人员")
.add("deathDate", deathDate),
Cnd.where("id", "=", userId));
RetiredUserChange retiredUserChange = new RetiredUserChange(); RetiredUserChange retiredUserChange = new RetiredUserChange();
retiredUserChange.setUserId(userId); retiredUserChange.setUserId(userId);
retiredUserChange.setChangeDate(new Date()); retiredUserChange.setChangeDate(new Date());
@@ -174,7 +187,6 @@ public class RetiredUserListController {
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("u.retired", "=", 0); cnd.and("u.retired", "=", 0);
cnd.and("u.userState", "=", "在职");
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup sqlExpressionGroup = new SqlExpressionGroup(); SqlExpressionGroup sqlExpressionGroup = new SqlExpressionGroup();
@@ -205,10 +217,7 @@ public class RetiredUserListController {
@RequiresPermissions("retired.user.list") @RequiresPermissions("retired.user.list")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Object doBatchJoinRetire(@Param("userIds") String[] userIds) { public Object doBatchJoinRetire(@Param("userIds") String[] userIds) {
sysUserService.update(Chain.make("userState", "退休") sysUserService.update(Chain.make("retired", 1), Cnd.where("id", "in", userIds));
.add("personType", "退休人员")
.add("retired", 1),
Cnd.where("id", "in", userIds));
List<RetiredUserChange> insertRetiredUserChanges = Arrays.stream(userIds).map(v -> { List<RetiredUserChange> insertRetiredUserChanges = Arrays.stream(userIds).map(v -> {
RetiredUserChange retiredUserChange = new RetiredUserChange(); RetiredUserChange retiredUserChange = new RetiredUserChange();
@@ -273,22 +282,7 @@ public class RetiredUserListController {
public Object userInfo(String userId) { public Object userInfo(String userId) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
u.username, u.*
u.loginname,
u.sex,
u.threeUnitName,
u.unitname,
u.unionname,
u.political,
u.birthday,
u.nation,
u.education,
u.userState,
u.personType,
u.mobile,
u.idcard,
rg.groupName as retiredGroupName,
rpb.partyBranchName as retiredPartyBranchName
FROM FROM
`user` u `user` u
LEFT JOIN retired_group_unit rgu ON rgu.unitId = u.unitid LEFT JOIN retired_group_unit rgu ON rgu.unitId = u.unitid
@@ -301,4 +295,210 @@ public class RetiredUserListController {
return Daos.query(sysUserService.dao(), sql.toString(), Sqls.callback.map()); return Daos.query(sysUserService.dao(), sql.toString(), Sqls.callback.map());
} }
/**
* 新增、编辑退休人员
*
* @param user
* @param userId
* @return {@link Object}
*/
@At
@ViReturn
@RequiresPermissions("retired.user.list")
@Aop(TransAop.READ_COMMITTED)
public Object doSubmit(@Param("user") Sys_user user, @Param(required = false, value = "userId") String userId) {
if (StrUtil.isBlank(userId)) {
UserMode.initUser(user);
dao.insert(user);
UserMode.addPublicRole(user.getId());
} else {
dao.updateIgnoreNull(user);
}
return null;
}
@At
@ViReturn
@RequiresPermissions("retired.user.list")
@Aop(TransAop.READ_COMMITTED)
public Object getInfo(String id) {
Sys_user user = dao.fetch(Sys_user.class, id);
return user;
}
@At
@ViReturn
@RequiresPermissions("retired.user.list")
@Aop(TransAop.READ_COMMITTED)
public Object doDelete(String id) {
dao.clear(Sys_user.class, Cnd.where("id", "=", id));
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", id));
return null;
}
/**
* 离退休人员,导入下载模版
*
* @param response
*/
@At
@Ok("void")
@RequiresPermissions("retired.user.list")
public void downloadImport(HttpServletResponse response) {
try {
ViTool.excelResponse(response, "离退休人员导入模版.xlsx");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook sheets = ExcelExportUtil.exportExcel(exportParams, RetiredUserTemplate.class, new ArrayList<>());
ServletOutputStream outputStream = response.getOutputStream();
sheets.write(outputStream);
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("retired.user.list")
public Object doImport(TempFile file) {
try {
List<RetiredUserTemplate> retiredUserImportList = ExcelImportUtil.importExcel(file.getFile(), RetiredUserTemplate.class, new ImportParams());
List<Sys_user> users = sysUserService.query(Cnd.where("idcard", "is not", null).and("idcard", "!=", ""));
Map<String, Sys_user> userMap = users.stream().collect(Collectors.toMap(Sys_user::getIdcard, Function.identity(), (o1, o2) -> o1));
List<RetiredUserTemplate> errorInfos = new ArrayList<>();
//需要新增的离退休人员
List<Sys_user> needInsertUserList = new ArrayList<>();
//需要修改的离退休人员
List<Sys_user> needUpdateUserList = new ArrayList<>();
List<ActivityUserScope> userScopeList = new ArrayList<>();
Sql sql = Sqls.create("SELECT MAX(DISTINCT groupId) AS groupId FROM activity_user_scope");
NutMap query = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
Integer groupId = query.getInt("groupId") + 1;
String groupName = DateUtil.thisYear() + "" + (DateUtil.thisMonth() + 1) + "月离退休教职工";
for (RetiredUserTemplate template : retiredUserImportList) {
if (StrUtil.isBlank(template.getUsername())) {
template.setErrorMsg("获取不到该用户的姓名!");
errorInfos.add(template);
continue;
} else if (StrUtil.isBlank(template.getIdCard())) {
template.setErrorMsg("获取不到该用户的身份证号!");
errorInfos.add(template);
continue;
}
Sys_user user = new Sys_user();
user.setRetired(true);
user.setRetireNature(template.getRetireNature());
user.setUsername(template.getUsername().trim());
user.setSex(template.getSex());
user.setNation(template.getNation());
// user.setBirthday(template.getBirthday());
// user.setPartyJoiningTime(DateUtil.parse(template.getPartyJoiningTime(),"yyyy-MM"));
// user.setWorkStartDate(DateUtil.parse(template.getWorkStartDate(),"yyyy-MM"));
// user.setSchoolTime(template.getSchoolTime());
user.setEducation(template.getEducation());
user.setHometown(template.getHometown());
user.setJobTitle(template.getJobTitle());
user.setTreatment(template.getTreatment());
// user.setRetirementTime(DateUtil.parse(template.getRetirementTime(),"yyyy-MM"));
user.setIdcard(template.getIdCard());
user.setMedicalCertificateNumber(template.getMedicalCertificateNumber());
user.setOriginalDepartment(template.getOriginalDepartment());
user.setFamilyName(template.getFamilyName());
user.setHomeAddress(template.getHomeAddress());
user.setMobile(template.getRetirePhone());
user.setRetireNotes(template.getRetireNotes());
user.setBasicDiseaseInfo(template.getBasicDiseaseInfo());
Sys_user sysUser = userMap.get(template.getIdCard());
ActivityUserScope userScope = new ActivityUserScope();
userScope.setGroupName(groupName);
userScope.setGroupId(groupId);
if (Lang.isNotEmpty(sysUser)) {
user.setId(sysUser.getId());
userScope.setUserId(sysUser.getId());
needUpdateUserList.add(user);
} else {
String pinYinHeadChar = PinyinUtil.getPinYinHeadChar(template.getUsername().trim());
String idCardLastSix = template.getIdCard().substring(template.getIdCard().length() - 6);
user.setLoginname(pinYinHeadChar + idCardLastSix);
Sys_user initUser = UserMode.initUser(user);
initUser.setRetired(true);
userScope.setUserId(initUser.getId());
needInsertUserList.add(initUser);
}
userScopeList.add(userScope);
}
if (Lang.isNotEmpty(needInsertUserList)) {
sysUserService.dao().fastInsert(needInsertUserList);
}
if (Lang.isNotEmpty(needInsertUserList)) {
sysUserService.dao().updateIgnoreNull(needUpdateUserList);
}
if (Lang.isNotEmpty(userScopeList)) {
sysUserService.dao().insert(userScopeList);
}
if (Lang.isNotEmpty(errorInfos)) {
NutMap nutMap = NutMap.NEW();
nutMap.setv("totalCount", retiredUserImportList.size());
nutMap.setv("successCount", (needUpdateUserList.size() + needUpdateUserList.size()));
nutMap.setv("errorCount", errorInfos.size());
nutMap.setv("errorList", errorInfos.stream().map(v -> {
return NutMap.NEW().addv("姓名", v.getUsername()).addv("错误原因", v.getErrorMsg());
}).collect(Collectors.toList()));
return Result.success(nutMap);
}
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("retired.user.list")
public Object doImport1(TempFile file) {
List<RetiredUserTemplate> retiredUserImportList = ExcelImportUtil.importExcel(file.getFile(), RetiredUserTemplate.class, new ImportParams());
List<Sys_user> retiredUserList = dao.query(Sys_user.class,
Cnd.where("retired", "=", 1).and("username","not in",List.of("雍炳华","凤孟贤","王伟")));
Map<String, Sys_user> map = retiredUserList.stream().collect(Collectors.toMap(Sys_user::getUsername, v -> v));
List<Sys_user> needUpdateList = new ArrayList<>();
retiredUserImportList.forEach(v->{
Sys_user sysUser = map.get(v.getUsername());
if (Lang.isNotEmpty(sysUser)){
if (!v.getRetirePhone().equals(sysUser.getMobile())){
sysUser.setMobile(v.getRetirePhone());
needUpdateList.add(sysUser);
}
}
});
dao.updateIgnoreNull(needUpdateList);
return null;
}
} }
@@ -4,10 +4,10 @@ import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.retired.group.model.RetiredGroup;
import io.v.nutz.zhgh.retired.partyBranch.model.RetiredPartyBranch;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -0,0 +1,86 @@
package io.v.nutz.zhgh.retired.user.mode;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @version 1.0
* @Author zzr
* @nameRetiredUserTemplate
* @Date 2024/4/29 17:32
* @注释 离退休人员导入模版
*/
@Data
public class RetiredUserTemplate {
// @Excel(name = "工号")
private String loginName;
@Excel(name = "性质")
private String retireNature;
@Excel(name = "姓名")
private String username;
@Excel(name = "性别")
private String sex;
@Excel(name = "民族")
private String nation;
@Excel(name = "出生年月",importFormat = "yyyy-MM")
private String birthday;
@Excel(name = "入党时间",importFormat = "yyyy-MM")
private String partyJoiningTime;
@Excel(name = "所属支部")
private String belongBranch;
@Excel(name = "工作时间",importFormat = "yyyy-MM")
private String workStartDate;
@Excel(name = "进校时间",importFormat = "yyyy-MM")
private String schoolTime;
@Excel(name = "文化程度")
private String education;
@Excel(name = "籍贯")
private String hometown;
@Excel(name = "职称")
private String jobTitle;
@Excel(name = "待遇")
private String treatment;
@Excel(name = "退休时间",importFormat = "yyyy-MM")
private String retirementTime;
@Excel(name = "身份证号码")
private String idCard;
@Excel(name = "医疗证号")
private String medicalCertificateNumber;
@Excel(name = "基础病信息")
private String basicDiseaseInfo;
@Excel(name = "原部门")
private String originalDepartment;
@Excel(name = "家属姓名")
private String familyName;
@Excel(name = "家庭住址")
private String homeAddress;
@Excel(name = "联系方式")
private String retirePhone;
@Excel(name = "备注")
private String retireNotes;
private String errorMsg;
}
@@ -1,7 +1,6 @@
package io.v.nutz.zhgh.retired.user.model; package io.v.nutz.zhgh.retired.user.model;
import io.v.nutz.base.model.BaseModel; import io.v.nutz.base.model.BaseModel;
import io.v.nutz.zhgh.retired.user.contants.RetiredUserChangeType;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
@@ -302,7 +302,7 @@ public class MemberCommonController {
COLUMN_COMMENT COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'sys_user' WHERE TABLE_NAME = 'sys_user'
AND TABLE_SCHEMA = 'zhgh_hmc' AND TABLE_SCHEMA = 'zhgh_zjitc'
"""); """);
List<NutMap> userTableColumnInfos = sysUserService.listMap(userColumnSql); List<NutMap> userTableColumnInfos = sysUserService.listMap(userColumnSql);
@@ -5,6 +5,7 @@ import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.services.SysLocalProcessService; import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
@@ -73,6 +74,9 @@ public class MemberChangeBranchUnionAuditController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin, A06, SchoolUnionMemberAdmin")) {
cnd.and("record.allocationUnionId", "=", Vi.getUnionId());
}
pageForm.buildSearch(cnd, "record."); pageForm.buildSearch(cnd, "record.");
if (pageForm.getAudit()) { if (pageForm.getAudit()) {
cnd.and("record.applyStateId", ">", 10020); cnd.and("record.applyStateId", ">", 10020);
@@ -133,7 +133,7 @@ public class SpecialStaffManageController {
@At @At
@RequiresPermissions("staff.special.manage") @RequiresPermissions("staff.special.manage")
public Result queryUser(String keyWord) { public Result queryUser(String keyWord,Boolean con) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select select
id, id,
@@ -148,7 +148,10 @@ public class SpecialStaffManageController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("id", "not in", "(select userId from special_staff)"); if (con==null||!con){
cnd.and("id", "not in", "(select userId from special_staff)");
}
if (StrUtil.isNotBlank(keyWord)) { if (StrUtil.isNotBlank(keyWord)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("username", keyWord); seg.orLike("username", keyWord);
@@ -0,0 +1,20 @@
package io.v.nutz.zhgh.therapyRecuperation.common;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
public class TherapyRecuperationCommon {
public static String getRemarkBySchoolTime(String schoolTime) {
if(StrUtil.isNotBlank(schoolTime)) {
DateTime schoolDate = DateUtil.parse(schoolTime);
DateTime time = DateUtil.parse(DateUtil.thisYear() + "-07-01");
int compareResult = DateUtil.compare(schoolDate, time);
return compareResult >= 0 ? ("入校时间为:" + schoolTime + ",疗休养额度为1500。") : "";
} else {
return "";
}
}
}
@@ -6,7 +6,7 @@ import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationJoinUserImportExcelMode * @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationJoinUserImportExcelMode
* @Description: 参加人员导入excel mode * @Description: 参加人员导入excel mode
* @Author zxc * @Author zxc
* @Date 2022/6/14:11:10 * @Date 2022/6/14:11:10
@@ -1,11 +1,12 @@
package io.v.nutz.zhgh.therapyRecuperation.constant; package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum; import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
/** /**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationSignUpMode * @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @Description: 线路创建模式 * @Description: 线路创建模式
* @Author zxc * @Author zxc
* @Date 2022/6/2:15:22 * @Date 2022/6/2:15:22
@@ -1,11 +1,12 @@
package io.v.nutz.zhgh.therapyRecuperation.constant; package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum; import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
/** /**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationProvinceType * @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationProvinceType
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/6/2:14:08 * @Date 2022/6/2:14:08
@@ -1,11 +1,12 @@
package io.v.nutz.zhgh.therapyRecuperation.constant; package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum; import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
/** /**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationSignUpMode * @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode
* @Description: 报名模式 * @Description: 报名模式
* @Author zxc * @Author zxc
* @Date 2022/6/2:15:22 * @Date 2022/6/2:15:22
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.constant; package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum; import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -8,7 +9,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* @FileName io.v.nutz.therapyRecuperation.constant.TheRapyRecuperationType * @FileName io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType
* @Description: 疗休养分类 * @Description: 疗休养分类
* @Author zxc * @Author zxc
* @Date 2022/6/2:14:02 * @Date 2022/6/2:14:02
@@ -31,7 +32,7 @@ public enum TheRapyRecuperationType {
/** /**
* 省内旅行社 * 省内旅行社
*/ */
provinceInTravelAgency("旅行社", 2, TheRapyRecuperationProvinceType.provinceIn.getValue(), "/assets/mobile/img/therapyRecuperation/lxs.png"), provinceInTravelAgency("自由组团", 2, TheRapyRecuperationProvinceType.provinceIn.getValue(), "/assets/mobile/img/therapyRecuperation/lxs.png"),
/** /**
* 酒店 * 酒店
@@ -2,33 +2,40 @@ package io.v.nutz.zhgh.therapyRecuperation.controller.audit;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.RCSCloudAPI;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.model.AuditState; import io.v.nutz.base.model.AuditState;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
import io.v.nutz.web.commons.utils.ShiroUtil; 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.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;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.dao.util.cri.Static; import org.nutz.dao.util.cri.Static;
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.util.NutMap; 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.trans.Trans; import org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -54,16 +61,15 @@ public class TheRapyRecuperationAuditController {
@Inject @Inject
private Dao dao; private Dao dao;
@Inject
private MsgApi msgApi;
@At @At
@ViReturn @ViReturn
public Object getXlByUnion(@Param(value = "state", required = false) Integer state, @RequiresAuthentication
@Param(value = "unionId", required = false) String unionId, public Object getXlByUnion(Integer state, String unionId, String regionalNature, String year, String endYear, Integer signUpMode) {
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "year", required = false) String year,
@Param(value = "signUpMode", required = false) Integer signUpMode) {
List<NutMap> xlByUnion = auditService.getXlByUnion(state, unionId, regionalNature, year, signUpMode); List<NutMap> xlByUnion = auditService.getXlByUnion(state, unionId, regionalNature, year, endYear, signUpMode);
return xlByUnion; return xlByUnion;
} }
@@ -71,15 +77,44 @@ public class TheRapyRecuperationAuditController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
public Object getXlByUnionAudit(String unionId, String regionalNature, String year, Integer signUpMode) {
Sql sql = Sqls.create("""
SELECT
line.id,
line.lineName,
line.regionalNature,
ts.id as selectId,
ts.playStartTime,
ts.playEndTime
FROM
the_rapy_recuperation_line_union_select ts
LEFT JOIN the_rapy_recuperation_line line ON line.id = ts.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("ts.unionId", "=", unionId);
} else {
cnd.and("ts.unionId", "=", vi.getUnionId());
}
cnd.andEX("YEAR(ts.selectTime)", "=", year);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("line.signUpMode", "=", signUpMode);
cnd.groupBy("line.id");
sql.setCondition(cnd);
return auditService.listMap(sql);
}
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyAudit") @RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object pageData(PageForm pageForm, @Param(value = "year", required = false) String year, public Object pageData(PageForm pageForm, String year, String unionId,
@Param(value = "unionId", required = false) String unionId, String unitId, String state, String takePartInLineId,
@Param(value = "unitId", required = false) String unitId, String isAudit, String regionalNature, String lotId,
@Param(value = "state", required = false) String state, String selectId) {
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "isAudit", required = false) String isAudit,
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "lotId", required = false) String lotId) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
enroll.*, enroll.*,
@@ -89,6 +124,7 @@ public class TheRapyRecuperationAuditController {
'教职工' userNature, '教职工' userNature,
state.stateColor, state.stateColor,
state.stateName, state.stateName,
CONCAT(DATE_FORMAT(lineu.playStartTime,'%m月%d日'),'-',DATE_FORMAT(lineu.playEndTime,'%m月%d日')) AS linePlayTime,
IF IF
( enroll.takePartInUnionId != enroll.selfUnionId, TRUE, FALSE ) isTransferIn, ( enroll.takePartInUnionId != enroll.selfUnionId, TRUE, FALSE ) isTransferIn,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily, ( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily,
@@ -107,9 +143,10 @@ public class TheRapyRecuperationAuditController {
cnd.andEX("enroll.selfUnionId", "=", unionId); cnd.andEX("enroll.selfUnionId", "=", unionId);
cnd.and("enroll.takePartInLineId", "is not", null); cnd.and("enroll.takePartInLineId", "is not", null);
cnd.andEX("enroll.selfUnitId", "=", unitId); cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("enroll.takePartInLineId", "=", takePartInLineId); cnd.andEX("lineu.lineId", "=", takePartInLineId);
cnd.andEX("enroll.isNormal", "=", true); cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("lineu.signUpMode", "=", 1); cnd.andEX("lineu.signUpMode", "=", 1);
cnd.andEX("lineu.id", "=", selectId);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) { if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword()); cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
} }
@@ -120,7 +157,7 @@ public class TheRapyRecuperationAuditController {
} else if (state.equals("2")) { } else if (state.equals("2")) {
cnd.andEX("enroll.takePartInUnionId", "!=", Vi.getUnionId()); cnd.andEX("enroll.takePartInUnionId", "!=", Vi.getUnionId());
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId()); cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
} else { } else if (state.equals("3")) {
cnd.andEX("enroll.selfUnionId", "!=", Vi.getUnionId()); cnd.andEX("enroll.selfUnionId", "!=", Vi.getUnionId());
cnd.andEX("enroll.takePartInUnionId", "=", Vi.getUnionId()); cnd.andEX("enroll.takePartInUnionId", "=", Vi.getUnionId());
} }
@@ -136,11 +173,14 @@ public class TheRapyRecuperationAuditController {
((enroll.stateId = %s OR enroll.stateId=%s )AND enroll.takePartInUnionId='%s') ((enroll.stateId = %s OR enroll.stateId=%s )AND enroll.takePartInUnionId='%s')
""".formatted(TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId()))); """.formatted(TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId())));
} else { } else {
cnd.and(new Static(""" /*cnd.and(new Static("""
((( enroll.stateId = %s OR enroll.stateId = %s OR enroll.stateId = %s ) AND enroll.selfUnionId = '%s' ) ((( enroll.stateId = %s OR enroll.stateId = %s OR enroll.stateId = %s ) AND enroll.selfUnionId = '%s' )
OR OR
((enroll.stateId = %s OR enroll.stateId=%s )AND enroll.takePartInUnionId='%s')) ((enroll.stateId = %s OR enroll.stateId=%s )AND enroll.takePartInUnionId='%s'))
""".formatted(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNIT, TheRapyRecuperationState.PASS, vi.getUnionId(), TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId()))); """.formatted(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNIT, TheRapyRecuperationState.PASS, vi.getUnionId(), TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId())));*/
cnd.and(new Static("""
((enroll.stateId = %s OR enroll.stateId=%s )AND enroll.takePartInUnionId='%s')
""".formatted(TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId())));
} }
} else { } else {
cnd.and(new Static(""" cnd.and(new Static("""
@@ -148,12 +188,16 @@ public class TheRapyRecuperationAuditController {
""".formatted(TheRapyRecuperationState.UNIT, vi.getUnionId(), TheRapyRecuperationState.LINEUNIT, vi.getUnionId()))); """.formatted(TheRapyRecuperationState.UNIT, vi.getUnionId(), TheRapyRecuperationState.LINEUNIT, vi.getUnionId())));
} }
} else { } else {
cnd.and(Cnd.exps("enroll.selfUnionId", "=", vi.getUnionId()).or("enroll.takePartInUnionId", "=", vi.getUnionId())); //屏蔽了本工会选择其他工会线路的人员
// cnd.and(Cnd.exps("enroll.selfUnionId", "=", vi.getUnionId()).or("enroll.takePartInUnionId", "=", vi.getUnionId()));
cnd.and("enroll.takePartInUnionId", "=", vi.getUnionId());
} }
cnd.desc("enroll.signingUptime"); cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName"); cnd.desc("enroll.unitName");
// cnd.having(Cnd.where("isTransferIn","=",0));
sql.setCondition(cnd); sql.setCondition(cnd);
return auditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); return auditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -163,6 +207,7 @@ public class TheRapyRecuperationAuditController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
public Object findOne(String id) { public Object findOne(String id) {
NutMap one = auditService.findOne(id); NutMap one = auditService.findOne(id);
return one; return one;
@@ -179,11 +224,9 @@ public class TheRapyRecuperationAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyAudit") @RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doAudit(@Param(value = "id", required = false) String id, public Object doAudit(String id, boolean flag, Boolean adjustment, boolean isTransferIn, String auditOpinion) {
@Param(value = "flag", required = false) boolean flag,
@Param(value = "isTransferIn", required = false) boolean isTransferIn,
@Param(value = "auditOpinion", required = false) String auditOpinion) {
Trans.exec(() -> { Trans.exec(() -> {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id); TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
Audit audit = new Audit(); Audit audit = new Audit();
@@ -219,8 +262,13 @@ public class TheRapyRecuperationAuditController {
enroll.setStateId(TheRapyRecuperationState.LINEUNITFAIL); enroll.setStateId(TheRapyRecuperationState.LINEUNITFAIL);
} }
} }
auditService.updateIgnoreNull(enroll); auditService.updateIgnoreNull(enroll);
//auditMsg(enroll.getStateId(), enroll.getLoginName(), enroll.getTakePartInLineId()); auditMsg(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
if (adjustment) {
// enroll.setNormal(false);
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enroll.getId()));
}
}); });
return null; return null;
} }
@@ -233,9 +281,11 @@ public class TheRapyRecuperationAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyAudit") @RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doRecall(String id) { public Object doRecall(String id) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id); TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
TheRapyRecuperationLineUnionSelect unionSelect = auditService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", enroll.getTakePartInLineId()));
if (enroll.getStateId().equals(TheRapyRecuperationState.UNITFAIL)) { if (enroll.getStateId().equals(TheRapyRecuperationState.UNITFAIL)) {
enroll.setStateId(TheRapyRecuperationState.UNIT); enroll.setStateId(TheRapyRecuperationState.UNIT);
enroll.setSelfUnionAuditId(null); enroll.setSelfUnionAuditId(null);
@@ -245,10 +295,12 @@ public class TheRapyRecuperationAuditController {
} else if (enroll.getStateId().equals(TheRapyRecuperationState.LINEUNITFAIL)) { } else if (enroll.getStateId().equals(TheRapyRecuperationState.LINEUNITFAIL)) {
enroll.setStateId(TheRapyRecuperationState.LINEUNIT); enroll.setStateId(TheRapyRecuperationState.LINEUNIT);
enroll.setSelfUnionAuditId(null); enroll.setSelfUnionAuditId(null);
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getSelfUnionId().equals(vi.getUnionId())) { // } else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getSelfUnionId().equals(vi.getUnionId())) {
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getSelfUnionId().equals(unionSelect.getUnionId())) {
enroll.setStateId(TheRapyRecuperationState.UNIT); enroll.setStateId(TheRapyRecuperationState.UNIT);
enroll.setSelfUnionAuditId(null); enroll.setSelfUnionAuditId(null);
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getTakePartInUnionId().equals(vi.getUnionId())) { // } else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getTakePartInUnionId().equals(vi.getUnionId())) {
} else if (enroll.getStateId().equals(TheRapyRecuperationState.PASS) && enroll.getTakePartInUnionId().equals(unionSelect.getUnionId())) {
enroll.setStateId(TheRapyRecuperationState.LINEUNIT); enroll.setStateId(TheRapyRecuperationState.LINEUNIT);
enroll.setJoinLineUnionAuditId(null); enroll.setJoinLineUnionAuditId(null);
} }
@@ -267,9 +319,10 @@ public class TheRapyRecuperationAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.TheRapyAudit") @RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doOnekeyAudit(@Param(value = "ids", required = false) String[] ids, public Object doOnekeyAudit(String[] ids, String auditOpinion, boolean flag, Boolean adjustment) {
@Param(value = "auditOpinion", required = false) String auditOpinion, boolean flag) {
Audit audit = new Audit(); Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion); audit.setAuditOpinion(auditOpinion);
audit.setAuditor(ShiroUtil.getUserId()); audit.setAuditor(ShiroUtil.getUserId());
@@ -278,6 +331,7 @@ public class TheRapyRecuperationAuditController {
audit.setAuditTime(new Date()); audit.setAuditTime(new Date());
audit.setAuditPass(flag); audit.setAuditPass(flag);
Audit insert = auditService.insert(audit); Audit insert = auditService.insert(audit);
List<String> enrollIdList = new ArrayList<>();
for (String id : ids) { for (String id : ids) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id); TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
//如果状态等于分工会审核,并且参加的线路分工会也是自己的工会,就代表自己参加自己的工会线路 //如果状态等于分工会审核,并且参加的线路分工会也是自己的工会,就代表自己参加自己的工会线路
@@ -292,9 +346,14 @@ public class TheRapyRecuperationAuditController {
enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.LINEUNITFAIL); enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.LINEUNITFAIL);
enroll.setJoinLineUnionAuditId(insert.getId()); enroll.setJoinLineUnionAuditId(insert.getId());
} }
if (adjustment) {
// enroll.setNormal(false);
enrollIdList.add(id);
}
auditService.updateIgnoreNull(enroll); auditService.updateIgnoreNull(enroll);
// auditMsg(enroll.getStateId(), enroll.getLoginName(), enroll.getTakePartInLineId()); auditMsg(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
} }
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", enrollIdList));
return null; return null;
} }
@@ -305,19 +364,22 @@ public class TheRapyRecuperationAuditController {
* @param loginName * @param loginName
* @param takePartInLineId * @param takePartInLineId
*/ */
private void auditMsg(Integer stateId, private void auditMsg(Integer stateId, String loginName, Boolean adjustment, String takePartInLineId) {
String loginName,
String takePartInLineId) {
Sys_user user = auditService.dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName)); Sys_user user = auditService.dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
TheRapyRecuperationLine theRapyRecuperationLine = auditService.dao().fetch(TheRapyRecuperationLine.class, Cnd.where("id", "=", takePartInLineId)); TheRapyRecuperationLineUnionSelect unionSelect = auditService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", takePartInLineId));
TheRapyRecuperationLine theRapyRecuperationLine = auditService.dao().fetch(TheRapyRecuperationLine.class, Cnd.where("id", "=", unionSelect.getLineId()));
AuditState auditState = auditService.dao().fetch(AuditState.class, Cnd.where("stateId", "=", stateId)); AuditState auditState = auditService.dao().fetch(AuditState.class, Cnd.where("stateId", "=", stateId));
if (stateId.equals(TheRapyRecuperationState.UNITFAIL)) {
RCSCloudAPI.sendTplSms("3a96eeb38ca7406aaf39dcf305507816", user.getMobile(), "@1@=" + user.getUsername() + "||@2@=" + theRapyRecuperationLine.getLineName() + "||@3@=" + auditState.getStateName() + "", ""); String content = "【智慧工会】%s老师您好,您报名的%s线路因报名人数不足已取消,请尽快进入智慧工会重新选择线路。"
} else if (stateId.equals(TheRapyRecuperationState.LINEUNITFAIL)) { .formatted(user.getUsername(), theRapyRecuperationLine.getLineName());
RCSCloudAPI.sendTplSms("3a96eeb38ca7406aaf39dcf305507816", user.getMobile(), "@1@=" + user.getUsername() + "||@2@=" + theRapyRecuperationLine.getLineName() + "||@3@=" + auditState.getStateName() + "", "");
} else if (stateId.equals(TheRapyRecuperationState.PASS)) { List list = List.of(Map.of("type", "User", "userId", user.getLoginname(), "name", user.getUsername()));
RCSCloudAPI.sendTplSms("3a96eeb38ca7406aaf39dcf305507816", user.getMobile(), "@1@=" + user.getUsername() + "||@2@=" + theRapyRecuperationLine.getLineName() + "||@3@=" + auditState.getStateName() + "", ""); if (stateId.equals(TheRapyRecuperationState.PASS)) {
content = "【智慧工会】%s老师您好,您报名的%s线路已组团成功,请按约定出行。"
.formatted(user.getUsername(), theRapyRecuperationLine.getLineName());
} }
//msgApi.sendMsg(content, list, "疗休养", " IntelligenceMode", MsgApi.sendMode.normal.name());
} }
@@ -328,6 +390,7 @@ public class TheRapyRecuperationAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
public Object getBmUserUnion() { public Object getBmUserUnion() {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -340,7 +403,9 @@ public class TheRapyRecuperationAuditController {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
cnd.and("takePartInLineId", "IS NOT", null); cnd.and("takePartInLineId", "IS NOT", null);
cnd.and("takePartInLineId", "!=", "");
cnd.and(Cnd.exps("takePartInUnionId", "=", vi.getUnionId()).or("selfUnionId", "=", vi.getUnionId())); cnd.and(Cnd.exps("takePartInUnionId", "=", vi.getUnionId()).or("selfUnionId", "=", vi.getUnionId()));
//cnd.and("selfUnionId", "=", vi.getUnionId());
} }
cnd.groupBy("selfUnionId"); cnd.groupBy("selfUnionId");
sql.setCondition(cnd); sql.setCondition(cnd);
@@ -357,18 +422,26 @@ public class TheRapyRecuperationAuditController {
*/ */
@At @At
@ViReturn @ViReturn
public Object getApplyNumAudit(@Param(value = "mode", required = false) String mode, @RequiresAuthentication
@Param(value = "isAudit", required = false) String isAudit, public Object getApplyNumAudit(String takePartInLineId, String mode, String isAudit, Integer year, String selectId) {
@Param(value = "year", required = false) Integer year) { TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
String unionId = Vi.getUnionId(); String unionId = Vi.getUnionId();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
COUNT( 1 ) COUNT(1) as signUpNum,
$val as familyNumber
FROM FROM
`the_rapy_recuperation_enroll` enroll `the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
$condition $condition
"""); """);
String val = "";
if (config.getFamilyInfo() == 1) {
val = "IFNULL(sum(familyNumber),0)";
} else {
val = "IFNULL((select count(1) from the_rapy_recuperation_enroll_companion where trreId = enroll.id),0)";
}
sql.setVar("val", val);
Sql sql2 = sql; Sql sql2 = sql;
Sql sql3 = sql; Sql sql3 = sql;
Sql sql4 = sql; Sql sql4 = sql;
@@ -380,13 +453,16 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId) .and("selfUnionId", "=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1); .andEX("signUpMode", "=", 1)
.andEX("lineu.id", "=", selectId);
if (StrUtil.isNotBlank(mode)) { if (StrUtil.isNotBlank(mode)) {
cnd1.and("stateId", "=", TheRapyRecuperationState.PASS); cnd1.and("stateId", "=", TheRapyRecuperationState.PASS);
} }
sql.setCondition(cnd1); sql.setCondition(cnd1);
int count1 = auditService.count(sql); NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber", 0)));
//本工会人员(其他路线) //本工会人员(其他路线)
Cnd cnd2 = Cnd.NEW(); Cnd cnd2 = Cnd.NEW();
@@ -394,13 +470,16 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId) .and("selfUnionId", "=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1); .andEX("signUpMode", "=", 1)
.andEX("lineu.id", "=", selectId);
if (StrUtil.isNotBlank(mode)) { if (StrUtil.isNotBlank(mode)) {
cnd2.and("stateId", "=", TheRapyRecuperationState.PASS); cnd2.and("stateId", "=", TheRapyRecuperationState.PASS);
} }
sql2.setCondition(cnd2); sql2.setCondition(cnd2);
int count2 = auditService.count(sql2); NutMap map2 = (NutMap) Daos.query(dao, sql2.toString(), Sqls.callback.map());
int count2 = Integer.parseInt(String.valueOf(map2.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map2.getOrDefault("familyNumber", 0)));
//其他工会人员(选我线路) //其他工会人员(选我线路)
Cnd cnd3 = Cnd.NEW(); Cnd cnd3 = Cnd.NEW();
@@ -408,26 +487,32 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId) .and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1); .andEX("signUpMode", "=", 1)
.andEX("lineu.id", "=", selectId);
if (StrUtil.isNotBlank(mode)) { if (StrUtil.isNotBlank(mode)) {
cnd3.and("stateId", "=", TheRapyRecuperationState.PASS); cnd3.and("stateId", "=", TheRapyRecuperationState.PASS);
} }
sql3.setCondition(cnd3); sql3.setCondition(cnd3);
int count3 = auditService.count(sql3); NutMap map3 = (NutMap) Daos.query(dao, sql3.toString(), Sqls.callback.map());
int count3 = Integer.parseInt(String.valueOf(map3.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map3.getOrDefault("familyNumber", 0)));
//选择校工会线路人员 //选择校工会线路人员
Cnd cnd4 = Cnd.NEW(); Cnd cnd4 = Cnd.NEW();
cnd4.and("selfUnionId", "=", unionId) cnd4.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 2); .andEX("signUpMode", "=", 2)
.andEX("lineu.id", "=", selectId);
if (StrUtil.isNotBlank(mode)) { if (StrUtil.isNotBlank(mode)) {
cnd4.and("stateId", "=", TheRapyRecuperationState.PASS); cnd4.and("stateId", "=", TheRapyRecuperationState.PASS);
} }
sql4.setCondition(cnd4); sql4.setCondition(cnd4);
int count4 = auditService.count(sql4); NutMap map4 = (NutMap) Daos.query(dao, sql4.toString(), Sqls.callback.map());
int count4 = Integer.parseInt(String.valueOf(map4.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map4.getOrDefault("familyNumber", 0)));
return Map.of("count1", count1, "count2", count2, "count3", count3, "count4", count4); return Map.of("count1", count1, "count2", count2, "count3", count3, "count4", count4);
} }
@@ -436,26 +521,29 @@ public class TheRapyRecuperationAuditController {
//本公会人员(自己线路) //本公会人员(自己线路)
Cnd cnd1 = Cnd.NEW(); Cnd cnd1 = Cnd.NEW();
cnd1.and("takePartInUnionId", "=", unionId) cnd1.and("takePartInUnionId", "=", unionId)
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null).
andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1);
sql.setCondition(cnd1);
int count1 = auditService.count(sql);
//本工会人员(其他路线)
Cnd cnd2 = Cnd.NEW();
cnd2.and("takePartInUnionId", "!=", unionId)
.and("selfUnionId", "=", unionId) .and("selfUnionId", "=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.UNIT) .and("stateId", ">", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1); .andEX("signUpMode", "=", 1);
sql2.setCondition(cnd2); sql.setCondition(cnd1);
int count2 = auditService.count(sql2); NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber", 0)));
//本工会人员(其他路线)
// Cnd cnd2 = Cnd.NEW();
// cnd2.and("takePartInUnionId", "!=", unionId)
// .and("selfUnionId", "=", unionId)
// .and("isNormal", "=", true)
// .and("takePartInLineId", "is not", null)
// .andEX("YEAR(signingUptime)", "=", year)
// .and("stateId", ">", TheRapyRecuperationState.UNIT)
// .andEX("signUpMode", "=", 1);
// sql2.setCondition(cnd2);
// int count2 = auditService.count(sql2);
//其他工会人员(选我线路) //其他工会人员(选我线路)
Cnd cnd3 = Cnd.NEW(); Cnd cnd3 = Cnd.NEW();
@@ -463,13 +551,17 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId) .and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.LINEUNIT) .and("stateId", ">", TheRapyRecuperationState.LINEUNIT)
.andEX("signUpMode", "=", 1); .andEX("signUpMode", "=", 1);
sql3.setCondition(cnd3); sql3.setCondition(cnd3);
int count3 = auditService.count(sql3); NutMap map3 = (NutMap) Daos.query(dao, sql3.toString(), Sqls.callback.map());
int count3 = Integer.parseInt(String.valueOf(map3.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map3.getOrDefault("familyNumber", 0)));
return Map.of("count1", count1, "count2", count2, "count3", count3);
// return Map.of("count1", count1, "count2", count2, "count3", count3);
return Map.of("count1", count1, "count3", count3);
} }
if ("false".equals(isAudit)) { if ("false".equals(isAudit)) {
@@ -479,23 +571,26 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId) .and("selfUnionId", "=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.UNIT) .and("stateId", "=", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1); .andEX("signUpMode", "=", 1);
sql.setCondition(cnd1); sql.setCondition(cnd1);
int count1 = auditService.count(sql); NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber", 0)));
//本工会人员(其他路线) //本工会人员(其他路线)
Cnd cnd2 = Cnd.NEW(); // Cnd cnd2 = Cnd.NEW();
cnd2.and("takePartInUnionId", "!=", unionId) // cnd2.and("takePartInUnionId", "!=", unionId)
.and("selfUnionId", "=", unionId) // .and("selfUnionId", "=", unionId)
.and("isNormal", "=", true) // .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) // .and("takePartInLineId", "is not", null)
.andEX("YEAR(signingUptime)", "=", year) // .andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.UNIT) // .and("stateId", "=", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1); // .andEX("signUpMode", "=", 1);
sql2.setCondition(cnd2); // sql2.setCondition(cnd2);
int count2 = auditService.count(sql2); // int count2 = auditService.count(sql2);
//其他工会人员(选我线路) //其他工会人员(选我线路)
Cnd cnd3 = Cnd.NEW(); Cnd cnd3 = Cnd.NEW();
@@ -503,12 +598,16 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId) .and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("takePartInLineId", "is not", null) .and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year) .andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.LINEUNIT) .and("stateId", "=", TheRapyRecuperationState.LINEUNIT)
.andEX("signUpMode", "=", 1); .andEX("signUpMode", "=", 1);
sql3.setCondition(cnd3); sql3.setCondition(cnd3);
int count3 = auditService.count(sql3); NutMap map3 = (NutMap) Daos.query(dao, sql3.toString(), Sqls.callback.map());
return Map.of("count1", count1, "count2", count2, "count3", count3); int count3 = Integer.parseInt(String.valueOf(map3.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map3.getOrDefault("familyNumber", 0)));
// return Map.of("count1", count1, "count2", count2, "count3", count3);
return Map.of("count1", count1, "count3", count3);
} }
@@ -0,0 +1,238 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.audit;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* @Author zzr
* @nameTheRapyRecuperationTranlAuditController
* @Date 2024/5/22 9:59
* @注释
*/
@IocBean
@At("/platform/theRapyRecuperation/TheRapyTravelAudit")
@Ok("json:full")
public class TheRapyRecuperationTravelAuditController {
@Inject
private TheRapyRecuperationAuditService theRapyRecuperationAuditService;
@Inject
private Vi vi;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/audit/TheRapyTravelAudit.html")
@RequiresPermissions("theRapyRecuperation.TheRapyTravelAudit")
public void index() {
}
@At
@ViReturn
public Object pageData(PageForm pageForm,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "year", required = false) String year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "isAudit", required = false) String isAudit){
Sql sql = Sqls.create("""
SELECT
enroll.*,
state.stateColor,
state.stateName,
ta.travelAgencyName,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
left join the_rapy_recuperation_travel_agency ta on ta.id = enroll.takePartInTravelAgencyId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
cnd.and("enroll.selfUnionId", "=", StrUtil.isBlank(unionId) ? Vi.getUnionId() : unionId);
cnd.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd.and("enroll.takePartInTravelAgencyId", "!=", "");
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
if (isAudit.equals("true")) {
cnd.and("enroll.stateId", ">", TheRapyRecuperationState.UNIT);
} else if (isAudit.equals("false")){
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.UNIT);
}
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName");
sql.setCondition(cnd);
return theRapyRecuperationAuditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresAuthentication
public Object getBmUserUnion() {
Sql sql = Sqls.create("""
SELECT
unionName unionname,
selfUnionId id
FROM
`the_rapy_recuperation_enroll`
$condition
""");
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
cnd.and("takePartInTravelAgencyId", "IS NOT", null);
cnd.and("takePartInTravelAgencyId", "!=", "");
cnd.and("selfUnionId", "=", vi.getUnionId());
}
cnd.groupBy("selfUnionId");
sql.setCondition(cnd);
List<NutMap> unionList = theRapyRecuperationAuditService.listMap(sql);
return unionList;
}
@At
@ViReturn
@RequiresAuthentication
public Object getApplyNumAudit(String agencyId, String isAudit, Integer year) {
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
String unionId = Vi.getUnionId();
Sql sql = Sqls.create("""
SELECT
count(1) as signUpNum,
$val as familyNumber
FROM
`the_rapy_recuperation_enroll` enroll
$condition
""");
String val = "";
if(config.getFamilyInfo() == 1) {
val = "IFNULL(sum(familyNumber),0)";
} else {
val = "IFNULL((select count(1) from the_rapy_recuperation_enroll_companion where trreId = enroll.id),0)";
}
sql.setVar("val", val);
Cnd cnd = Cnd.NEW();
if (isAudit.equals("true")) {
cnd.and("enroll.stateId", ">", TheRapyRecuperationState.UNIT);
} else if (isAudit.equals("false")){
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.UNIT);
}
cnd.andEX("takePartInTravelAgencyId", "=", agencyId);
cnd.andEX("year(signingUptime)", "=", year);
cnd.and("takePartInTravelAgencyId", "is not", null);
cnd.and("takePartInTravelAgencyId", "!=", "");
cnd.and("selfUnionId", "=", unionId);
cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
sql.setCondition(cnd);
NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum",0)))
+ Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber",0)));
return Map.of("count1", count1);
}
@At
@ViReturn
@RequiresAuthentication
public Object doAudit(String id, boolean flag,Boolean adjustment, String auditOpinion) {
Trans.exec(() -> {
TheRapyRecuperationEnroll enroll = dao.fetch(TheRapyRecuperationEnroll.class, id);
Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion);
audit.setAuditor(ShiroUtil.getUserId());
audit.setLoginname((String) ShiroUtil.getPrincipalProperty("loginname"));
audit.setUsername((String) ShiroUtil.getPrincipalProperty("username"));
audit.setAuditTime(new Date());
audit.setAuditPass(flag);
Audit insert = dao.insert(audit);
enroll.setSelfUnionAuditId(insert.getId());
enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.UNITFAIL);
dao.updateIgnoreNull(enroll);
// auditMsg(enroll.getStateId(), enroll.getLoginName(),adjustment, enroll.getTakePartInLineId());
if (adjustment){
// enroll.setNormal(false);
dao.clear(TheRapyRecuperationEnroll.class,Cnd.where("id","=",enroll.getId()));
}
});
return null;
}
@At
@ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
public Object doOnekeyAudit(String[] ids, String auditOpinion, boolean flag, Boolean adjustment) {
Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion);
audit.setAuditor(ShiroUtil.getUserId());
audit.setLoginname((String) ShiroUtil.getPrincipalProperty("loginname"));
audit.setUsername((String) ShiroUtil.getPrincipalProperty("username"));
audit.setAuditTime(new Date());
audit.setAuditPass(flag);
Audit insert = dao.insert(audit);
List<String> enrollIdList = new ArrayList<>();
for (String id : ids) {
TheRapyRecuperationEnroll enroll = dao.fetch(TheRapyRecuperationEnroll.class, id);
enroll.setSelfUnionAuditId(insert.getId());
enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.UNITFAIL);
dao.updateIgnoreNull(enroll);
//auditMsg(enroll.getStateId(), enroll.getLoginName(),adjustment, enroll.getTakePartInLineId());
}
dao.clear(TheRapyRecuperationEnroll.class,Cnd.where("id","in",enrollIdList));
return null;
}
@At
@ViReturn
@RequiresAuthentication
public Object doRecall(String id) {
TheRapyRecuperationEnroll enroll = dao.fetch(TheRapyRecuperationEnroll.class, id);
enroll.setStateId(TheRapyRecuperationState.UNIT);
enroll.setSelfUnionAuditId(null);
dao.update(enroll);
return null;
}
}
@@ -1,30 +1,45 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.audit; package io.v.nutz.zhgh.therapyRecuperation.controller.audit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
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.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;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static; import org.nutz.dao.util.cri.Static;
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.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.nutz.trans.Trans; import org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@IocBean @IocBean
@At("/platform/theRapyRecuperation/TheRapyXghAudit") @At("/platform/theRapyRecuperation/TheRapyXghAudit")
@@ -53,16 +68,70 @@ public class TheRapyRecuperationXghAuditController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit") @RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm, String year, String unionId,
@Param(value = "year", required = false) String year, String unitId, String state, String takePartInLineId,
@Param(value = "unionId", required = false) String unionId, String isAudit, String regionalNature, String lotId,
@Param(value = "unitId", required = false) String unitId, String selectId) {
@Param(value = "state", required = false) String state, Sql sql = Sqls.create("""
@Param(value = "takePartInLineId", required = false) String takePartInLineId, SELECT
@Param(value = "isAudit", required = false) String isAudit, enroll.*,
@Param(value = "regionalNature", required = false) String regionalNature, line.lineName,
@Param(value = "lotId", required = false) String lotId) { line.id as lineId,
line.regionalNature,
'教职工' userNature,
state.stateColor,
state.stateName,
CONCAT(DATE_FORMAT(rs.playStartTime,'%m月%d日'),'-',DATE_FORMAT(rs.playEndTime,'%m月%d日')) AS linePlayTime,
IF
( enroll.takePartInUnionId != enroll.selfUnionId, TRUE, FALSE ) isTransferIn,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) num
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `the_rapy_recuperation_line_union_select` rs ON rs.id = enroll.takePartInLineId
LEFT JOIN `the_rapy_recuperation_line` line on line.id=rs.lineId
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
cnd.andEX("enroll.selfUnionId", "=", unionId);
cnd.and("enroll.takePartInLineId", "is not", null);
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("rs.signUpMode", "=", "2");
cnd.andEX("rs.id", "=", selectId);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
if (Strings.isNotBlank(isAudit)) {
if (isAudit.equals("true")) {
cnd.and(new Static("enroll.stateId = %s".formatted(TheRapyRecuperationState.PASS)));
} else {
cnd.and(new Static("enroll.stateId = %s".formatted(TheRapyRecuperationState.SCHOOL)));
}
} else {
cnd.and(new Static("( enroll.stateId = %s OR enroll.stateId = %s OR enroll.stateId = %s)".
formatted(TheRapyRecuperationState.SCHOOL, TheRapyRecuperationState.SCHOOLFAIL, TheRapyRecuperationState.PASS)));
}
cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName");
sql.setCondition(cnd);
return auditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object getLineNumber(PageForm pageForm, String year, String unionId,
String unitId, String state, String takePartInLineId,
String isAudit, String regionalNature, String lotId, String selectId) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
enroll.*, enroll.*,
@@ -93,6 +162,7 @@ public class TheRapyRecuperationXghAuditController {
cnd.andEX("line.id", "=", takePartInLineId); cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("enroll.isNormal", "=", true); cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("rs.signUpMode", "=", "2"); cnd.andEX("rs.signUpMode", "=", "2");
cnd.andEX("rs.id", "=", selectId);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) { if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword()); cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
} }
@@ -109,7 +179,9 @@ public class TheRapyRecuperationXghAuditController {
cnd.desc("enroll.signingUptime"); cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName"); cnd.desc("enroll.unitName");
sql.setCondition(cnd); sql.setCondition(cnd);
return auditService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); List<NutMap> nutMaps = auditService.listMap(sql);
int familyNumber = nutMaps.stream().filter(o -> StrUtil.isNotBlank(o.getString("familyNumber"))).mapToInt(o -> o.getInt("familyNumber")).sum();
return familyNumber + nutMaps.size();
} }
@@ -124,11 +196,9 @@ public class TheRapyRecuperationXghAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit") @RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object doAudit(@Param(value = "id", required = false) String id, public Object doAudit(String id, boolean flag, boolean isTransferIn, String auditOpinion, Boolean adjustment) {
@Param(value = "flag", required = false) boolean flag,
@Param(value = "isTransferIn", required = false) boolean isTransferIn,
@Param(value = "auditOpinion", required = false) String auditOpinion) {
Trans.exec(() -> { Trans.exec(() -> {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id); TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
Audit audit = new Audit(); Audit audit = new Audit();
@@ -147,6 +217,11 @@ public class TheRapyRecuperationXghAuditController {
enroll.setStateId(TheRapyRecuperationState.SCHOOLFAIL); enroll.setStateId(TheRapyRecuperationState.SCHOOLFAIL);
} }
auditService.updateIgnoreNull(enroll); auditService.updateIgnoreNull(enroll);
auditService.schoolAudit(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
if (adjustment) {
// enroll.setNormal(false);
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enroll.getId()));
}
}); });
return null; return null;
} }
@@ -159,6 +234,7 @@ public class TheRapyRecuperationXghAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit") @RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object doRecall(String id) { public Object doRecall(String id) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id); TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
@@ -178,10 +254,10 @@ public class TheRapyRecuperationXghAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit") @RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object doOnekeyAudit(@Param(value = "ids", required = false) String[] ids, public Object doOnekeyAudit(String[] ids, String auditOpinion, boolean flag, Boolean adjustment) {
@Param(value = "auditOpinion", required = false) String auditOpinion,
@Param(value = "flag", required = false) boolean flag) {
Audit audit = new Audit(); Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion); audit.setAuditOpinion(auditOpinion);
audit.setAuditor(ShiroUtil.getUserId()); audit.setAuditor(ShiroUtil.getUserId());
@@ -191,12 +267,19 @@ public class TheRapyRecuperationXghAuditController {
audit.setAuditPass(flag); audit.setAuditPass(flag);
Audit insert = auditService.insert(audit); Audit insert = auditService.insert(audit);
//List<TheRapyRecuperationEnroll> enrollList = auditService.dao().query(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", ids)); //List<TheRapyRecuperationEnroll> enrollList = auditService.dao().query(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", ids));
List<String> enrollIdList = new ArrayList<>();
for (String id : ids) { for (String id : ids) {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id); TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
enroll.setStateId(TheRapyRecuperationState.PASS); enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.SCHOOLFAIL);
enroll.setSchoolUnionAuditId(insert.getId()); enroll.setSchoolUnionAuditId(insert.getId());
auditService.updateIgnoreNull(enroll); auditService.updateIgnoreNull(enroll);
auditService.schoolAudit(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
if (adjustment) {
// enroll.setNormal(false);
enrollIdList.add(id);
}
} }
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", enrollIdList));
return null; return null;
} }
@@ -208,6 +291,7 @@ public class TheRapyRecuperationXghAuditController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit") @RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object getXghLine() { public Object getXghLine() {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
@@ -220,7 +304,57 @@ public class TheRapyRecuperationXghAuditController {
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId
where line.signUpMode='2' and line.createMode='2' where line.signUpMode='2' and line.createMode='2'
group by line.id
"""); """);
return baseService.listMap(sql); return baseService.listMap(sql);
} }
@At
@ViReturn
@RequiresAuthentication
public Object getLinePlayTimeByLineId(String lineId,
@Param(value = "signUpMode",required = false) Integer signUpMode,
@Param(value = "year",required = false) Integer year,
@Param(value = "startYear",required = false)Integer startYear,
@Param(value = "endYear",required = false)Integer endYear,
@Param(value = "flag",required = false) Boolean flag) {
Cnd cnd = Cnd.NEW();
cnd.and("lineId", "=", lineId);
if (flag == null || !flag){
cnd.andEX("signUpMode", "=", signUpMode);
cnd.and("YEAR(selectTime)", "=", year);
} else {
cnd.and("YEAR(selectTime)", ">=", startYear);
cnd.and("YEAR(selectTime)", "<=", endYear);
}
List<TheRapyRecuperationLineUnionSelect> query = dao.query(TheRapyRecuperationLineUnionSelect.class, cnd);
//.and("selectUserId", "=", ShiroUtil.getUserId()).and("unionId", "=", Vi.getUnionId()));
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
List<NutMap> nutMaps = new ArrayList<>();
query.forEach(v -> {
String startTime = DateUtil.formatChineseDate(v.getPlayStartTime(), false, false).substring(5);
String endTime = DateUtil.formatChineseDate(v.getPlayEndTime(), false, false).substring(5);
NutMap map = new NutMap();
List<TheRapyRecuperationEnroll> enrollList = dao.query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "=", v.getId())
.and("isNormal", "=", true)
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
int hasSignNumber;
if (config.getFamilyInfo() == 1) {
int sum = enrollList.stream().mapToInt(TheRapyRecuperationEnroll::getFamilyNumber).sum();
hasSignNumber = enrollList.size() + sum;
} else {
List<String> list = enrollList.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
List<TheRapyRecuperationEnrollCompanion> companions = dao.query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "in", list));
hasSignNumber = enrollList.size() + companions.size();
}
map.setv("times", startTime + "-" + endTime + "(报名人数:" + hasSignNumber + ",其中家属:" + (hasSignNumber - enrollList.size()) + "人)");
map.setv("selectId", v.getId());
nutMaps.add(map);
});
return nutMaps;
}
} }
@@ -11,20 +11,19 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.mobile.selfApplyUser.models.SelfApplyUser;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.baseManage.TheRapyRecuperationBaseManagerService; import io.v.nutz.zhgh.therapyRecuperation.service.baseManage.TheRapyRecuperationBaseManagerService;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
@@ -50,7 +49,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @FileName io.v.nutz.therapyRecuperation.controller.baseManage.TheBaseManagerController * @FileName io.v.nutz.zhgh.therapyRecuperation.controller.baseManage.TheBaseManagerController
* @Description: 疗休养基地管理 * @Description: 疗休养基地管理
* @Author zzr * @Author zzr
* @Date 2023/6/5 * @Date 2023/6/5
@@ -93,14 +92,8 @@ public class TheRapyRecuperationBaseManagerController {
@POST @POST
@Ok("json:full") @Ok("json:full")
@ViReturn @ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR) @RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm, Integer year, String lotId, String baseName, String unionId, String travelAgencyId, String regionalNature) {
@Param(value = "year", required = false) Integer year,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "baseName", required = false) String baseName,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "travelAgencyId", required = false) String travelAgencyId,
@Param(value = "regionalNature", required = false) String regionalNature) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -121,7 +114,7 @@ public class TheRapyRecuperationBaseManagerController {
tb.files, tb.files,
tb.baseContactPerson, tb.baseContactPerson,
tb.baseContactNumber, tb.baseContactNumber,
cast( tb.files ->> '$[0].id' AS CHAR ) AS fileId, tb.files AS fileId,
gh.unionname createUnionName, gh.unionname createUnionName,
u.username createUserName, u.username createUserName,
ta.travelAgencyName, ta.travelAgencyName,
@@ -146,9 +139,6 @@ public class TheRapyRecuperationBaseManagerController {
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) { if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("tb.createUnionId", "=", Vi.getUnionId()); cnd.and("tb.createUnionId", "=", Vi.getUnionId());
} else {
SelfApplyUser selfApplyUser = baseService.dao().fetch(SelfApplyUser.class, Cnd.where("mobile", "=", ShiroUtil.getPrincipalProperty("loginname")));
cnd.and("tb.id", "in", selfApplyUser.getBaseManagementIds());
} }
} else { } else {
cnd.andEX("tb.createUnionId", "=", unionId); cnd.andEX("tb.createUnionId", "=", unionId);
@@ -167,6 +157,7 @@ public class TheRapyRecuperationBaseManagerController {
@At("/openClosedBase/?") @At("/openClosedBase/?")
@POST @POST
@ViReturn @ViReturn
@RequiresAuthentication
public Object openClosedBase(String id) { public Object openClosedBase(String id) {
if (StrUtil.isBlank(id)) { if (StrUtil.isBlank(id)) {
return Result.error("参数错误"); return Result.error("参数错误");
@@ -184,6 +175,7 @@ public class TheRapyRecuperationBaseManagerController {
*/ */
@At("/selectBaseManageById/?") @At("/selectBaseManageById/?")
@ViReturn @ViReturn
@RequiresAuthentication
public Object selectBaseManageById(String id) { public Object selectBaseManageById(String id) {
Assert.notBlank(id); Assert.notBlank(id);
return dao.fetchLinks(dao.fetch(TheRapyRecuperationBaseManagement.class, id), "travelAgency"); return dao.fetchLinks(dao.fetch(TheRapyRecuperationBaseManagement.class, id), "travelAgency");
@@ -199,8 +191,8 @@ public class TheRapyRecuperationBaseManagerController {
@At @At
@POST @POST
@ViReturn @ViReturn
@SLog(type = "theRapyRecuperation", tag = "疗休养目的地管理", msg = "添加目的地") @RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR) @RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object doSubmit(@Param("base") TheRapyRecuperationBaseManagement baseManagement) { public Object doSubmit(@Param("base") TheRapyRecuperationBaseManagement baseManagement) {
baseManagement.setOpBy((String) ShiroUtil.getPrincipalProperty("id")); baseManagement.setOpBy((String) ShiroUtil.getPrincipalProperty("id"));
baseManagement.setCreateUnionId((String) ShiroUtil.getPrincipalProperty("unionid")); baseManagement.setCreateUnionId((String) ShiroUtil.getPrincipalProperty("unionid"));
@@ -218,7 +210,7 @@ public class TheRapyRecuperationBaseManagerController {
@At("/deleteBase/?") @At("/deleteBase/?")
@POST @POST
@ViReturn @ViReturn
@SLog(type = "theRapyRecuperation", tag = "疗休养目的地管理", msg = "删除目的地") @RequiresAuthentication
public Object deleteBase(String id) { public Object deleteBase(String id) {
if (StrUtil.isBlank(id)) { if (StrUtil.isBlank(id)) {
return Result.error("参数错误"); return Result.error("参数错误");
@@ -235,10 +227,9 @@ public class TheRapyRecuperationBaseManagerController {
@At("/listAllBase") @At("/listAllBase")
@POST @POST
@ViReturn @ViReturn
public Object listAllBase(@Param(value = "startYear", required = false) String startYear, @RequiresAuthentication
@Param(value = "endYear", required = false) String endYear, public Object listAllBase(String startYear, String endYear, String year) {
@Param(value = "year", required = false) String year) { Sql sql = Sqls.create("select * from `the_rapy_recuperation_base_management` tb left join `the_rapy_recuperation_lot` lot on lot.id=tb.lotId $condition");
Sql sql = Sqls.create("select * from `the_rapy_recuperation_base_management` tb $condition");
CndPlus cnd = new CndPlus(); CndPlus cnd = new CndPlus();
cnd.andEX("tb.`year`", ">=", startYear); cnd.andEX("tb.`year`", ">=", startYear);
@@ -257,6 +248,7 @@ public class TheRapyRecuperationBaseManagerController {
@At("/selectBaseAllInfo") @At("/selectBaseAllInfo")
@GET @GET
@ViReturn @ViReturn
@RequiresAuthentication
public Object selectBaseAllInfo(@Param("id") String id) { public Object selectBaseAllInfo(@Param("id") String id) {
Assert.notBlank(id); Assert.notBlank(id);
return theRapyRecuperationBaseManagerService.selectBaseAllInfo(id); return theRapyRecuperationBaseManagerService.selectBaseAllInfo(id);
@@ -329,6 +321,7 @@ public class TheRapyRecuperationBaseManagerController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Object importBaseManager(TempFile file) { public Object importBaseManager(TempFile file) {
@@ -9,12 +9,14 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.mobile.selfApplyUser.models.SelfApplyUser;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationLineCreateMode; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationLineCreateMode;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyTravelLineExcelMode; import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyTravelLineExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
@@ -24,6 +26,7 @@ import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
@@ -42,14 +45,11 @@ import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @FileName io.v.nutz.therapyRecuperation.controller.basicManage.TheRapyRecuperationLineController * @FileName io.v.nutz.zhgh.therapyRecuperation.controller.basicManage.TheRapyRecuperationLineController
* @Description: 疗休养线路管理 * @Description: 疗休养线路管理
* @Author zxc * @Author zxc
* @Date 2022/5/31:09:34 * @Date 2022/5/31:09:34
@@ -76,23 +76,17 @@ public class TheRapyRecuperationLineController {
* 页面数据 * 页面数据
* *
* @param pageForm 分页参数 * @param pageForm 分页参数
* @param year 年度
* @return {@link Object} * @return {@link Object}
*/ */
@At @At
@POST @POST
@Ok("json:full") @Ok("json:full")
@ViReturn @ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR) @RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm, Integer startYear , Integer endYear, String keywords, String travelAgencyId, String lineName, String unionId, String lotId) {
@Param(value = "year", required = false) Integer year,
@Param(value = "keywords", required = false) String keywords,
@Param(value = "travelAgencyId", required = false) String travelAgencyId,
@Param(value = "lineName", required = false) String lineName,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "lotId", required = false) String lotId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("line.`year`", "=", year); cnd.andEX("line.`year`", ">=", startYear);
cnd.andEX("line.`year`", "<=", endYear);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId); cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
cnd.andEX("line.lotId", "=", lotId); cnd.andEX("line.lotId", "=", lotId);
cnd.and(Cnd.likeEX("line.lineName", lineName)); cnd.and(Cnd.likeEX("line.lineName", lineName));
@@ -107,17 +101,25 @@ public class TheRapyRecuperationLineController {
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) { if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("line.createUnionId", "=", Vi.getUnionId()); cnd.and("line.createUnionId", "=", Vi.getUnionId());
} else {
SelfApplyUser selfApplyUser = lineService.dao().fetch(SelfApplyUser.class, Cnd.where("mobile", "=", ShiroUtil.getPrincipalProperty("loginname")));
cnd.and("line.id", "in", selfApplyUser.getLineIds());
} }
} else { } else {
cnd.andEX("line.createUnionId", "=", unionId); cnd.andEX("line.createUnionId", "=", unionId);
} }
cnd.asc("serialNumber"); cnd.desc("regionalNature").asc("serialNumber").asc("line.opBy");
return lineService.pageData(pageForm, cnd); return lineService.pageData(pageForm, cnd);
} }
@At
@POST
@ViReturn
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object getNo() {
Object serialNumber = dao.func2(TheRapyRecuperationLine.class, "max", "serialNumber");
serialNumber = Objects.requireNonNullElse(serialNumber, 0);
return Integer.parseInt(serialNumber.toString()) + 1;
}
/** /**
* 提交 * 提交
* *
@@ -127,8 +129,9 @@ public class TheRapyRecuperationLineController {
@At @At
@POST @POST
@ViReturn @ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04", "lxygys"}, logical = Logical.OR) @RequiresAuthentication
public Object doSubmit(@Param("line") TheRapyRecuperationLine line) { @RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object doSubmit(TheRapyRecuperationLine line) {
if (StrUtil.isBlank(line.getId())) { if (StrUtil.isBlank(line.getId())) {
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber())) > 0) { if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber())) > 0) {
return Result.error("编号已存在"); return Result.error("编号已存在");
@@ -152,6 +155,7 @@ public class TheRapyRecuperationLineController {
@At("/openClosedLine/?") @At("/openClosedLine/?")
@POST @POST
@ViReturn @ViReturn
@RequiresAuthentication
public Object openClosedLine(String id) { public Object openClosedLine(String id) {
if (StrUtil.isBlank(id)) { if (StrUtil.isBlank(id)) {
return Result.error("参数错误"); return Result.error("参数错误");
@@ -169,6 +173,7 @@ public class TheRapyRecuperationLineController {
@At("/deleteLine/?") @At("/deleteLine/?")
@POST @POST
@ViReturn @ViReturn
@RequiresAuthentication
public Object deleteLine(String id) { public Object deleteLine(String id) {
if (StrUtil.isBlank(id)) { if (StrUtil.isBlank(id)) {
return Result.error("参数错误"); return Result.error("参数错误");
@@ -186,6 +191,7 @@ public class TheRapyRecuperationLineController {
*/ */
@At("/selectLineInfoById/?") @At("/selectLineInfoById/?")
@ViReturn @ViReturn
@RequiresAuthentication
public Object selectLineInfoById(String id) { public Object selectLineInfoById(String id) {
Assert.notBlank(id); Assert.notBlank(id);
return lineService.selectLineInfoById(id); return lineService.selectLineInfoById(id);
@@ -201,9 +207,8 @@ public class TheRapyRecuperationLineController {
*/ */
@At("/selectLineUser") @At("/selectLineUser")
@ViReturn @ViReturn
public Object selectLineUser(PageForm pageForm, @RequiresAuthentication
@Param(value = "id", required = false) String id, public Object selectLineUser(PageForm pageForm, String id, String unionId) {
@Param(value = "unionId", required = false) String unionId) {
if (StrUtil.isBlank(id)) { if (StrUtil.isBlank(id)) {
return Result.error("参数错误"); return Result.error("参数错误");
} }
@@ -212,6 +217,7 @@ public class TheRapyRecuperationLineController {
@At("/getCreateMode") @At("/getCreateMode")
@ViReturn @ViReturn
@RequiresAuthentication
public Object getCreateMode() { public Object getCreateMode() {
boolean hasSchoolAdminRole = ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06")); boolean hasSchoolAdminRole = ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"));
if (hasSchoolAdminRole) { if (hasSchoolAdminRole) {
@@ -228,6 +234,7 @@ public class TheRapyRecuperationLineController {
*/ */
@At("/viewUnionSelectTimeInfo/?") @At("/viewUnionSelectTimeInfo/?")
@ViReturn @ViReturn
@RequiresAuthentication
public Object viewUnionSelectTimeInfo(String id) { public Object viewUnionSelectTimeInfo(String id) {
Assert.notBlank(id); Assert.notBlank(id);
return lineService.viewUnionSelectTimeInfo(id); return lineService.viewUnionSelectTimeInfo(id);
@@ -240,6 +247,7 @@ public class TheRapyRecuperationLineController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
public Object hasAnyRoles(@Param("roles") String[] roles) { public Object hasAnyRoles(@Param("roles") String[] roles) {
boolean b = ShiroUtil.hasAnyRoles(roles); boolean b = ShiroUtil.hasAnyRoles(roles);
return b; return b;
@@ -267,6 +275,7 @@ public class TheRapyRecuperationLineController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Object travelLineImport(TempFile file) { public Object travelLineImport(TempFile file) {
@@ -5,9 +5,11 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyTravelAgencyExcelMode; import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyTravelAgencyExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
@@ -69,8 +71,7 @@ public class TheRapyRecuperationTravelAgencyController {
@POST @POST
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object pageData(PageForm pageForm, @Param(value = "year", required = false) Integer year, public Object pageData(PageForm pageForm, Integer year, String keywords) {
@Param(value = "keywords", required = false) String keywords) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year); cnd.andEX("year", "=", year);
if (StrUtil.isNotBlank(keywords)) { if (StrUtil.isNotBlank(keywords)) {
@@ -83,7 +84,7 @@ public class TheRapyRecuperationTravelAgencyController {
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else { } else {
cnd.asc("serialNumber"); cnd.asc("serialNumber * 1");
} }
return travelAgencyService.pageData(pageForm, cnd); return travelAgencyService.pageData(pageForm, cnd);
} }
@@ -158,7 +159,7 @@ public class TheRapyRecuperationTravelAgencyController {
@At("/selectTravelAgency") @At("/selectTravelAgency")
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object selectTravelAgency(@Param(value = "year", required = false) Integer year) { public Object selectTravelAgency(Integer year) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year); cnd.andEX("year", "=", year);
return travelAgencyService.selectAllTravelAgencyByYear(cnd); return travelAgencyService.selectAllTravelAgencyByYear(cnd);
@@ -175,11 +176,14 @@ public class TheRapyRecuperationTravelAgencyController {
@At("/selectTravelAgencyByYears") @At("/selectTravelAgencyByYears")
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object selectTravelAgencyByYears(@Param(value = "startYear", required = false) Integer startYear, public Object selectTravelAgencyByYears(Integer startYear, Integer endYear, Integer year) {
@Param(value = "endYear", required = false) Integer endYear) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("year", ">=", startYear); if(startYear != null && endYear != null) {
cnd.andEX("year", "<=", endYear); cnd.andEX("year", ">=", startYear);
cnd.andEX("year", "<=", endYear);
}else {
cnd.andEX("year", "=", year);
}
return travelAgencyService.selectAllTravelAgencyByYear(cnd); return travelAgencyService.selectAllTravelAgencyByYear(cnd);
} }
@@ -246,7 +250,7 @@ public class TheRapyRecuperationTravelAgencyController {
List<TheRapyRecuperationTravelAgency> list = new ArrayList<>(); List<TheRapyRecuperationTravelAgency> list = new ArrayList<>();
for (TheRapyTravelAgencyExcelMode travel : travelAgency) { for (TheRapyTravelAgencyExcelMode travel : travelAgency) {
TheRapyRecuperationTravelAgency agency = new TheRapyRecuperationTravelAgency(); TheRapyRecuperationTravelAgency agency = new TheRapyRecuperationTravelAgency();
if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))) { if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))){
agency.setId(map.get(travel.getTravelAgencyName())); agency.setId(map.get(travel.getTravelAgencyName()));
} }
if (travel.getIsDisabled().equals("")) { if (travel.getIsDisabled().equals("")) {
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process; package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@@ -7,6 +8,8 @@ import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_config; import io.v.nutz.sys.models.Sys_config;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
@@ -17,8 +20,6 @@ import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationCommonServi
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.web.commons.base.Globals;
import org.apache.shiro.authz.annotation.RequiresAuthentication; 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;
@@ -88,20 +89,32 @@ public class TheRapyRecuperationEnrollController {
@POST @POST
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm, Integer year, String unionId, int theRapyRecuperationType, Integer lineUnionType) {
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "theRapyRecuperationType", required = false) int theRapyRecuperationType,
@Param(value = "lineUnionType", required = false) Integer lineUnionType) {
return enrollService.enrollPageData(pageForm, year, unionId, theRapyRecuperationType, lineUnionType); return enrollService.enrollPageData(pageForm, year, unionId, theRapyRecuperationType, lineUnionType);
} }
@At
@POST
@ViReturn
@RequiresAuthentication
public Object getSelectLineById(String lineId, String unionId, int theRapyRecuperationType, Integer lineUnionType) {
return enrollService.getSelectLineById(lineId, unionId, theRapyRecuperationType, lineUnionType);
}
@At
@POST
@ViReturn
@RequiresAuthentication
public Object openSignUser(String usId, String travelId, String searchKeyWord) {
return enrollService.openSignUser(usId, travelId, searchKeyWord);
}
//获取设置了公开线路的分工会 //获取设置了公开线路的分工会
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getTheRapyUnions(@Param(value = "year", required = false) Integer year) { public Object getTheRapyUnions(Integer year, int theRapyRecuperationType) {
return enrollService.getTheRapyUnions(year); return enrollService.getTheRapyUnions(year, theRapyRecuperationType);
} }
@@ -118,13 +131,14 @@ public class TheRapyRecuperationEnrollController {
public Object doSignUpForLine(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) { public Object doSignUpForLine(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
//省外的线路报名需要判断 //省外的线路报名需要判断
// if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceOut.getValue())) { // if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceOut.getValue())) {
String schoolCode = Globals.schoolCode; Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode"));
Map<Boolean, String> validResult = new HashMap<>(); Map<Boolean, String> validResult = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) { if("zjxu".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); validResult = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else { } else if("zjiet".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); validResult = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfoForZJNU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} }
if (validResult.containsKey(false)) { if (validResult.containsKey(false)) {
return Result.error(validResult.get(false)); return Result.error(validResult.get(false));
@@ -149,13 +163,14 @@ public class TheRapyRecuperationEnrollController {
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object doSignUpForTravelAgency(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) { public Object doSignUpForTravelAgency(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
String schoolCode = Globals.schoolCode; Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode"));
Map<Boolean, String> resultMap = new HashMap<>(); Map<Boolean, String> resultMap = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) { if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else { } else if("zjiet".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJNU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} }
if (resultMap.containsKey(false)) { if (resultMap.containsKey(false)) {
return Result.error(resultMap.get(false)); return Result.error(resultMap.get(false));
@@ -179,10 +194,9 @@ public class TheRapyRecuperationEnrollController {
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object doSignUpForBaseManagement(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) { public Object doSignUpForBaseManagement(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
String schoolCode = Globals.schoolCode; Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode"));
Map<Boolean, String> resultMap = new HashMap<>(); Map<Boolean, String> resultMap = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) { if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else { } else {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
@@ -221,11 +235,7 @@ public class TheRapyRecuperationEnrollController {
@POST @POST
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object mySignUpPageData(PageForm pageForm, public Object mySignUpPageData(PageForm pageForm, Integer year, int theRapyRecuperationType, Integer auditStateId, int signUpStateId) {
@Param(value = "year", required = false) Integer year,
@Param(value = "theRapyRecuperationType", required = false) int theRapyRecuperationType,
@Param(value = "auditStateId", required = false) Integer auditStateId,
@Param(value = "signUpStateId", required = false) int signUpStateId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("e.loginName", "=", ShiroUtil.getPrincipalProperty("loginname")); cnd.and("e.loginName", "=", ShiroUtil.getPrincipalProperty("loginname"));
switch (signUpStateId) { switch (signUpStateId) {
@@ -291,13 +301,18 @@ public class TheRapyRecuperationEnrollController {
return Result.error("线路信息不能为空"); return Result.error("线路信息不能为空");
} }
String schoolCode = Globals.schoolCode; if (StrUtil.isBlank(enrollInfo.getLoginName())){
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "schoolCode")); enrollInfo.setLoginName(ShiroUtil.getPrincipalProperty("loginname").toString());
}
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> resultMap = new HashMap<>(); Map<Boolean, String> resultMap = new HashMap<>();
if ("zjxu".equals(schoolCode) || "zjxu".equals(config.getConfigValue())) { if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); resultMap = enrollService.validSignUpInfoForZJXU(enrollInfo.getLoginName(), enrollInfo);
} else { } else if("zjiet".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo); resultMap = enrollService.validSignUpInfo(enrollInfo.getLoginName(), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJNU(enrollInfo.getLoginName(), enrollInfo);
} }
if (resultMap.containsKey(false)) { if (resultMap.containsKey(false)) {
return Result.error(resultMap.get(false)); return Result.error(resultMap.get(false));
@@ -320,6 +335,22 @@ public class TheRapyRecuperationEnrollController {
return null; return null;
} }
/**
* 删除我的报名信息
*
* @param id id
* @return {@link Object}
*/
@At("/doModify/?")
@POST
@ViReturn
@RequiresAuthentication
public Object doModify(String id) {
enrollService.update(Chain.make("isNormal",false),Cnd.where("id","=",id));
return null;
}
/** /**
* 能取消吗 * 能取消吗
* *
@@ -367,11 +398,8 @@ public class TheRapyRecuperationEnrollController {
@POST @POST
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object doFeedBack(@Param(value = "id", required = false) String id, public Object doFeedBack(String id, String evaluationForTravelAgency, String evaluationForLine,
@Param(value = "evaluationForTravelAgency", required = false) String evaluationForTravelAgency, String evaluationForJourney, String feedbackContent) {
@Param(value = "evaluationForLine", required = false) String evaluationForLine,
@Param(value = "evaluationForJourney", required = false) String evaluationForJourney,
@Param(value = "feedbackContent", required = false) String feedbackContent) {
Chain chain = Chain.make("evaluationForTravelAgency", evaluationForTravelAgency); Chain chain = Chain.make("evaluationForTravelAgency", evaluationForTravelAgency);
chain.add("evaluationForLine", evaluationForLine); chain.add("evaluationForLine", evaluationForLine);
chain.add("evaluationForJourney", evaluationForJourney); chain.add("evaluationForJourney", evaluationForJourney);
@@ -398,8 +426,8 @@ public class TheRapyRecuperationEnrollController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select select
(select count(1) from the_rapy_recuperation_enroll where takePartInUnionId = @unionId AND takePartInLineId = @lineId AND stateId = @signUpSuccessCode) as signUpUserNum, (select count(1) from the_rapy_recuperation_enroll where isNormal=true and takePartInUnionId = @unionId AND takePartInLineId = @lineId AND stateId = @signUpSuccessCode) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInUnionId = @unionId AND takePartInLineId = @lineId AND stateId = @signUpSuccessCode)) as signUpUserFamilyNum (select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where isNormal=true and takePartInUnionId = @unionId AND takePartInLineId = @lineId AND stateId = @signUpSuccessCode)) as signUpUserFamilyNum
"""); """);
sql.setParam("signUpSuccessCode", TheRapyRecuperationState.PASS); sql.setParam("signUpSuccessCode", TheRapyRecuperationState.PASS);
sql.setParam("lineId", lineId); sql.setParam("lineId", lineId);
@@ -411,7 +439,7 @@ public class TheRapyRecuperationEnrollController {
/** /**
* 手机端线路介绍所有信息 * 手机端线路介绍所有信息
* *
* @param usId 行id * @param usId 行id
* @param usUnionId 我们工会id * @param usUnionId 我们工会id
* @return {@link Object} * @return {@link Object}
*/ */
@@ -419,9 +447,25 @@ public class TheRapyRecuperationEnrollController {
@GET @GET
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object selectLineAllInfo(@Param(value = "usId", required = false) String usId, public Object selectLineAllInfo(@Param("usId") String usId,
@Param(value = "usUnionId", required = false) String usUnionId) { @Param("usUnionId") String usUnionId,
@Param("year") String year) {
Assert.notBlank(usId); Assert.notBlank(usId);
return enrollService.selectLineAllInfo(usId, usUnionId); return enrollService.selectLineAllInfo(usId, usUnionId, year);
}
@At
@ViReturn
@RequiresAuthentication
public Object getSchoolTime() {
Sys_user sysUser = dao.fetch(Sys_user.class, ShiroUtil.getUserId());
if(StrUtil.isNotBlank(sysUser.getSchoolTime())) {
DateTime schoolDate = DateUtil.parse(sysUser.getSchoolTime());
DateTime time = DateUtil.parse(DateUtil.thisYear() + "-07-01");
int compareResult = DateUtil.compare(schoolDate, time);
return compareResult >= 0 ? sysUser.getSchoolTime() : null;
} else {
return null;
}
} }
} }
@@ -10,9 +10,9 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.result.Result; import io.v.nutz.base.result.Result;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollJoinUserImportService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollJoinUserImportService;
import io.v.nutz.base.utils.ViTool;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -38,7 +38,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationEnrollJoinUserImport * @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationEnrollJoinUserImport
* @Description: 导入参加人员 * @Description: 导入参加人员
* @Author zxc * @Author zxc
* @Date 2022/6/14:09:16 * @Date 2022/6/14:09:16
@@ -65,17 +65,14 @@ public class TheRapyRecuperationEnrollJoinUserImportController {
@At @At
@RequiresPermissions("theRapyRecuperation.joinUser.import") @RequiresPermissions("theRapyRecuperation.joinUser.import")
@ViReturn @ViReturn
public Object selectLineAndTravelAgencyList(@Param(value = "year", required = false) Integer year, public Object selectLineAndTravelAgencyList(Integer year, String keyword) {
@Param(value = "keyword", required = false) String keyword) {
return joinUserImportService.selectLineAndTravelAgencyList(year, keyword); return joinUserImportService.selectLineAndTravelAgencyList(year, keyword);
} }
@At @At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@RequiresPermissions("theRapyRecuperation.joinUser.import") @RequiresPermissions("theRapyRecuperation.joinUser.import")
public Object readExcel(@Param(value = "file", required = false) TempFile tempFile, public Object readExcel(@Param("file") TempFile tempFile, @Param("lineId") String lineId, @Param("travelAgencyId") String travelAgencyId) {
@Param(value = "lineId", required = false) String lineId,
@Param(value = "travelAgencyId", required = false) String travelAgencyId) {
try { try {
Assert.notNull(tempFile); Assert.notNull(tempFile);
File file = tempFile.getFile(); File file = tempFile.getFile();
@@ -121,7 +118,7 @@ public class TheRapyRecuperationEnrollJoinUserImportController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("theRapyRecuperation.joinUser.import") @RequiresPermissions("theRapyRecuperation.joinUser.import")
public Object selectLineOrTravelAgency(@Param(value = "year", required = false) Integer year) { public Object selectLineOrTravelAgency(Integer year) {
return joinUserImportService.selectLineOrTravelAgency(year); return joinUserImportService.selectLineOrTravelAgency(year);
} }
@@ -5,7 +5,7 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
/** /**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationExamineController * @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationExamineController
* @Description: 疗休养报名审核 * @Description: 疗休养报名审核
* @Author zxc * @Author zxc
* @Date 2022/6/1:18:16 * @Date 2022/6/1:18:16
@@ -4,6 +4,8 @@ import cn.hutool.core.lang.Assert;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineAdjustmentService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineAdjustmentService;
@@ -17,15 +19,23 @@ 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;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
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.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.POST; import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationLineAdjustment * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineAdjustment
* @Description: 线路及人员调整 * @Description: 线路及人员调整
* @Author zxc * @Author zxc
* @Date 2022/6/10:10:00 * @Date 2022/6/10:10:00
@@ -40,6 +50,9 @@ public class TheRapyRecuperationLineAdjustmentController {
@Inject @Inject
private Dao dao; private Dao dao;
@Inject
private MsgApi msgApi;
@Inject @Inject
private TheRapyRecuperationLineAdjustmentService adjustmentService; private TheRapyRecuperationLineAdjustmentService adjustmentService;
@@ -62,11 +75,13 @@ public class TheRapyRecuperationLineAdjustmentController {
@ViReturn @ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR) @RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm,
@Param(value = "year", required = false) Integer year, Integer year,
@Param(value = "lineId", required = false) String lineId, String lineId,
@Param(value = "unionId", required = false) String unionId, String unionId,
@Param(value = "keywords", required = false) String keywords) { String keywords,
return adjustmentService.pageData(pageForm, year, lineId, unionId, keywords); String regionalNature,
String lotId) {
return adjustmentService.pageData(pageForm, year, lineId, unionId, keywords, regionalNature, lotId);
} }
@@ -81,7 +96,7 @@ public class TheRapyRecuperationLineAdjustmentController {
@Ok("json:full") @Ok("json:full")
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object findUnionSignUpModeLineList(@Param(value = "year", required = false) Integer year) { public Object findUnionSignUpModeLineList(Integer year) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select id,lineName from the_rapy_recuperation_line select id,lineName from the_rapy_recuperation_line
$condition $condition
@@ -104,8 +119,7 @@ public class TheRapyRecuperationLineAdjustmentController {
@POST @POST
@Ok("json:full") @Ok("json:full")
@RequiresAuthentication @RequiresAuthentication
public Object findUnionSignUpModeUserList(@Param(value = "lineId", required = false) String lineId, public Object findUnionSignUpModeUserList(@Param("lineId") String lineId, @Param("unionId") String unionId) {
@Param(value = "unionId", required = false) String unionId) {
try { try {
Assert.notBlank(lineId); Assert.notBlank(lineId);
return Result.success().addData(adjustmentService.findUnionSignUpModeUserList(lineId, unionId)); return Result.success().addData(adjustmentService.findUnionSignUpModeUserList(lineId, unionId));
@@ -126,8 +140,7 @@ public class TheRapyRecuperationLineAdjustmentController {
@POST @POST
@Ok("json:full") @Ok("json:full")
@RequiresAuthentication @RequiresAuthentication
public Object adjustmentUser(@Param(value = "lineId", required = false) String lineId, public Object adjustmentUser(String lineId, @Param("loginNames") String[] loginName) {
@Param(value = "loginNames", required = false) String[] loginName) {
try { try {
Assert.notBlank(lineId); Assert.notBlank(lineId);
Assert.notNull(loginName); Assert.notNull(loginName);
@@ -142,4 +155,53 @@ public class TheRapyRecuperationLineAdjustmentController {
} }
} }
@At
@POST
@Ok("json:full")
@RequiresAuthentication
public Object smsAlerts(String lineId,@Param("loginNames") String[] loginName){
try {
Sql sql = Sqls.create("""
SELECT
rlus.id,
rlus.unionId,
rlus.lineId,
rlus.selectUserId,
DATE_FORMAT( rlus.playStartTime, '%Y-%m-%d' ) AS playStartTime,
DATE_FORMAT( rlus.playEndTime, '%Y-%m-%d' ) AS playEndTime,
rl.lineName,
rl.regionalNature,
lot.lotName
FROM
`the_rapy_recuperation_line_union_select` rlus
LEFT JOIN `the_rapy_recuperation_line` rl ON rlus.lineId = rl.id
LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id
WHERE
rlus.id = @id
""").setParam("id",lineId);
NutMap map = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
String lineName = map.getString("lineName");
String lotName = map.getString("lotName");
String regionalNature = map.getString("regionalNature");
String playStartTime = map.getString("playStartTime");
String playEndTime = map.getString("playEndTime");
List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where("loginname", "in", loginName));
Map<String, String> usernameMap = userList.stream().collect(Collectors.toMap(Sys_user::getLoginname, Sys_user::getUsername));
if (Lang.isNotEmpty(loginName)){
Arrays.stream(loginName).forEach(v->{
String username = usernameMap.get(v);
String content = "%s老师您好,您报名的%s【%s-%s】(%s至%s)线路未达到成团标准,现已解散,请您选择其他线路进行报名!"
.formatted(username,lineName,lotName,regionalNature,playStartTime,playEndTime);
//msgApi.sendWxMsg(content,v);
});
}
return Result.success();
} catch (Exception e){
e.printStackTrace();
return Result.error();
}
}
} }
@@ -4,10 +4,10 @@ import cn.hutool.core.lang.Assert;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationClusterMember; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationClusterMember;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineClusterService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineClusterService;
import io.v.nutz.web.commons.slog.annotation.SLog;
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;
@@ -26,7 +26,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationLineClusterController * @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationLineClusterController
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/6/17:08:52 * @Date 2022/6/17:08:52
@@ -59,10 +59,7 @@ public class TheRapyRecuperationLineClusterController {
@POST @POST
@RequiresAuthentication @RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.lineCluster") @RequiresPermissions("theRapyRecuperation.lineCluster")
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm, Integer year, String keywords, String unionId) {
@Param(value = "year", required = false) Integer year,
@Param(value = "keywords", required = false) String keywords,
@Param(value = "unionId", required = false) String unionId) {
Pagination pagination = clusterService.pageData(pageForm, year, unionId, keywords); Pagination pagination = clusterService.pageData(pageForm, year, unionId, keywords);
return pagination; return pagination;
} }
@@ -79,8 +76,7 @@ public class TheRapyRecuperationLineClusterController {
@ViReturn @ViReturn
@POST @POST
@RequiresAuthentication @RequiresAuthentication
public Object findClusterInfo(@Param(value = "lineId", required = false) String lineId, public Object findClusterInfo(@Param("lineId") String lineId, @Param("usUnionId") String usUnionId) {
@Param(value = "usUnionId", required = false) String usUnionId) {
Assert.notBlank(lineId); Assert.notBlank(lineId);
Assert.notBlank(usUnionId); Assert.notBlank(usUnionId);
return clusterService.findClusterInfo(lineId, usUnionId); return clusterService.findClusterInfo(lineId, usUnionId);
@@ -97,8 +93,7 @@ public class TheRapyRecuperationLineClusterController {
@POST @POST
@RequiresAuthentication @RequiresAuthentication
@SLog(tag = "疗休养", msg = "设置组团人员", param = true, result = true) @SLog(tag = "疗休养", msg = "设置组团人员", param = true, result = true)
public Object setClusterMembers(@Param(value = "clusters", required = false) String clusters, public Object setClusterMembers(@Param("clusters") String clusters, @Param("lineId") String lineId) {
@Param(value = "lineId", required = false) String lineId) {
NutMap nutMap = Json.fromJson(NutMap.class, clusters); NutMap nutMap = Json.fromJson(NutMap.class, clusters);
List<TheRapyRecuperationCluster> clusterList = new ArrayList<>(); List<TheRapyRecuperationCluster> clusterList = new ArrayList<>();
nutMap.forEach((k, v) -> { nutMap.forEach((k, v) -> {
@@ -1,18 +1,16 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process; package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineUnionSelectService;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineUnionSelectService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -78,24 +76,30 @@ public class TheRapyRecuperationLineUnionSelectController {
@POST @POST
@ViReturn @ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR) @RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, public Object pageData(PageForm pageForm, Integer year, String keywords, int selectStatus, String unionId,
@Param(value = "year", required = false) Integer year, String lotId, String travelAgencyId, Integer mode, String regionalNature) {
@Param(value = "keywords", required = false) String keywords,
@Param(value = "selectStatus", required = false) int selectStatus, TheRapyRecuperationConfig config = unionSelectService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
@Param(value = "unionId", required = false) String unionId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "travelAgencyId", required = false) String travelAgencyId,
@Param(value = "mode", required = false) Integer mode) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("line.year", "=", year);
cnd.andEX("line.lotId", "=", lotId); cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId); cnd.andEX("us.travelAgencyId", "=", travelAgencyId);
if (!"全部".equals(regionalNature)) {
cnd.andEX("line.regionalNature", "=", regionalNature);
}
//当前登录用户已选择的线路id //当前登录用户已选择的线路id
Sql hasSelectLineSql = Sqls.createf(""" Sql hasSelectLineSql;
select lineId from the_rapy_recuperation_line_union_select where selectUserId = '%s' AND unionId = '%s' if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
""", ShiroUtil.getPrincipalProperty("id"), Vi.getUnionId()); cnd.and(Cnd.exps("line.createUnionId", "=", Vi.getUnionId()).or("createMode", "=", 2));
hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where selectUserId = '%s' AND unionId = '%s' AND year(selectTime) = %s
""", ShiroUtil.getPrincipalProperty("id"), Vi.getUnionId(), year == null ? DateUtil.thisYear() : year);
} else {
hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where year(selectTime) = %s
""", year == null ? DateUtil.thisYear() : year);
}
/*hasSelectLineSql = Sqls.createf(""" /*hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where unionId = '%s' select lineId from the_rapy_recuperation_line_union_select where unionId = '%s'
@@ -103,7 +107,10 @@ public class TheRapyRecuperationLineUnionSelectController {
switch (selectStatus) { switch (selectStatus) {
//查询未选择的线路 //查询未选择的线路
case -1 -> cnd.and("line.id", "not in", hasSelectLineSql); case -1 -> {
cnd.and("line.id", "not in", hasSelectLineSql);
cnd.and("line.year", "in", year == null ? Lang.array(config.getProvinceStartYear(), config.getProvinceStartYear() + 1) : year);
}
case 0 -> { case 0 -> {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -123,6 +130,7 @@ public class TheRapyRecuperationLineUnionSelectController {
case 1 -> { case 1 -> {
cnd.and("line.id", "in", hasSelectLineSql); cnd.and("line.id", "in", hasSelectLineSql);
cnd.and("us.signUpMode", "=", mode); cnd.and("us.signUpMode", "=", mode);
cnd.and("year(us.selectTime)", "=", year == null ? DateUtil.thisYear() : year);
} }
} }
@@ -137,9 +145,9 @@ public class TheRapyRecuperationLineUnionSelectController {
if (StrUtil.isAllNotEmpty(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { if (StrUtil.isAllNotEmpty(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().replace("ending", "")); cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().replace("ending", ""));
} else { } else {
cnd.desc("year").asc("serialNumber"); cnd.asc("createUnionId").desc("year").asc("serialNumber");
} }
return unionSelectService.pageData(pageForm, cnd); return unionSelectService.pageData(pageForm, cnd, year);
} }
/** /**
@@ -176,12 +184,14 @@ public class TheRapyRecuperationLineUnionSelectController {
//组织形式 //组织形式
int signUpMode = ShiroUtil.hasRole("H04") ? 1 : 2; int signUpMode = ShiroUtil.hasRole("H04") ? 1 : 2;
TheRapyRecuperationLineUnionSelect theRapyRecuperationLineUnionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", lineUnionSelect.getId()));
for (TheRapyRecuperationLineUnionSelect unionSelect : lineUnionSelects) { for (TheRapyRecuperationLineUnionSelect unionSelect : lineUnionSelects) {
unionSelect.setSelectTime(new Date()); unionSelect.setSelectTime(new Date());
unionSelect.setSelectUserId(ShiroUtil.getPlatformUid()); unionSelect.setSelectUserId(ShiroUtil.getPlatformUid());
unionSelect.setUnionId(Vi.getUnionId()); unionSelect.setUnionId(Vi.getUnionId());
unionSelect.setOpen(true); unionSelect.setIsOpen(Lang.isNotEmpty(theRapyRecuperationLineUnionSelect) ? theRapyRecuperationLineUnionSelect.getIsOpen() : true);
unionSelect.setDelFlag(false); //unionSelect.setDelFlag(signUpMode == 2);
unionSelect.setSignUpMode(signUpMode); unionSelect.setSignUpMode(signUpMode);
} }
@@ -199,20 +209,18 @@ public class TheRapyRecuperationLineUnionSelectController {
@At @At
@POST @POST
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR) @RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
public Object selectLineInfo(@Param(value = "lineId", required = false) String lineId, public Object selectLineInfo(@Param("lineId") String lineId, @Param("unionId") String unionId, @Param("mode") Integer mode, @Param("year") Integer year) {
@Param(value = "unionId", required = false) String unionId,
@Param(value = "mode", required = false) Integer mode) {
try { try {
Assert.notBlank(lineId); Assert.notBlank(lineId);
Assert.notNull(mode); Assert.notNull(mode);
unionId = StrUtil.emptyToNull(Vi.getUnionId()); unionId = StrUtil.emptyToNull(Vi.getUnionId());
if (mode == 1 && !ShiroUtil.hasRole("H04")) { if (mode == 1 && !ShiroUtil.hasRole("H04")&&!ShiroUtil.hasRole("sysadmin")) {
return Result.error("您没有分工会角色权限!"); return Result.error("您没有分工会角色权限!");
} else if (mode == 2 && !ShiroUtil.hasRole("A06")) { } else if (mode == 2 && !ShiroUtil.hasRole("SchoolUnionAdmin")&&!ShiroUtil.hasRole("sysadmin")) {
return Result.error("您没有校工会角色权限!"); return Result.error("您没有校工会角色权限!");
} }
return Result.success(unionSelectService.selectLineInfo(lineId, unionId, mode)); return Result.success(unionSelectService.selectLineInfo(lineId, unionId, mode, year));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
return Result.error(e.getMessage()); return Result.error(e.getMessage());
@@ -248,8 +256,29 @@ public class TheRapyRecuperationLineUnionSelectController {
// enrollCnd.and("takePartInLineId", "=", lineId); // enrollCnd.and("takePartInLineId", "=", lineId);
Cnd enrollCnd = Cnd.where("unionId", "=", unionId); Cnd enrollCnd = Cnd.where("unionId", "=", unionId);
enrollCnd.and("lineId", "=", lineId); enrollCnd.and("lineId", "=", lineId);
unionSelectService.clear(enrollCnd);
List<TheRapyRecuperationLineUnionSelect> unionSelects = unionSelectService.query(enrollCnd);
List<String> list = unionSelects.stream().map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList());
List<TheRapyRecuperationEnroll> enrolls = unionSelectService.dao().query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "in", list));
List<String> enrollIdList = enrolls.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
List<String> bedIdList = enrolls.stream().map(TheRapyRecuperationEnroll::getBedInfoId).collect(Collectors.toList());
//同伴信息
List<TheRapyRecuperationEnrollCompanion> companions = unionSelectService.dao().query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "in", enrollIdList));
List<String> comBedIdList = companions.stream().map(TheRapyRecuperationEnrollCompanion::getBedInfoId).collect(Collectors.toList());
//删除报名记录
unionSelectService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", enrollIdList));
//删除床位记录
unionSelectService.dao().clear(TheRapyRecuperationEnrollBed.class, Cnd.where("id", "in", bedIdList));
//删除同伴信息
unionSelectService.dao().clear(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "in", enrollIdList));
//删除变更记录
unionSelectService.dao().clear(TheRapyRecuperationEnrollChangeRecord.class, Cnd.where("enrollId", "in", enrollIdList));
//删除同伴床位信息
unionSelectService.dao().clear(TheRapyRecuperationEnrollBed.class, Cnd.where("id", "in", comBedIdList));
unionSelectService.clear(enrollCnd);
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
return Result.error(e.getMessage()); return Result.error(e.getMessage());
@@ -301,8 +330,52 @@ public class TheRapyRecuperationLineUnionSelectController {
Integer cost = Optional.ofNullable(lotInfo).map(v -> v.getActivityCost()).orElse(0); Integer cost = Optional.ofNullable(lotInfo).map(v -> v.getActivityCost()).orElse(0);
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW()); TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
Integer groupNumber = Optional.ofNullable(config).map(TheRapyRecuperationConfig::getGroupNumber).orElse(0); Integer groupNumber = Optional.ofNullable(config).map(TheRapyRecuperationConfig::getGroupNumber).orElse(0);
return Result.success(Map.of("cost", cost, "groupNumber", groupNumber)); Integer outsideQuota = Optional.ofNullable(config).map(TheRapyRecuperationConfig::getOutsideQuota).orElse(0);
return Result.success(Map.of("cost", cost, "groupNumber", groupNumber, "outsideQuota", outsideQuota));
} }
/**
* 一键统赋时间,针对于已选择的线路
*
* @param lineIds 线路Id数组
* @param lineUnionSelects 出行时段
* @return {@link Object}
*/
@At("/setGiveLineTimes")
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@Aop(TransAop.READ_COMMITTED)
@SLog(type = "普惠疗休养", tag = "分工会/校工会选择线路", msg = "一键统赋时间,针对于已选择的线路", param = true, result = true)
public Object setGiveLineTimes(@Param("lineIds") String[] lineIds, @Param("lineUnionSelects") TheRapyRecuperationLineUnionSelect[] lineUnionSelects) {
if (Lang.isNotEmpty(lineUnionSelects) && Lang.isNotEmpty(lineIds)) {
TheRapyRecuperationLineUnionSelect lineUnionSelect = lineUnionSelects[0];
Chain chain = Chain.make("enable", 1);
if (lineUnionSelect.getSignUpStartTime() != null)
chain.add("signUpStartTime", lineUnionSelect.getSignUpStartTime());
if (lineUnionSelect.getSignUpEndTime() != null)
chain.add("signUpEndTime", lineUnionSelect.getSignUpEndTime());
if (lineUnionSelect.getChangeEndTime() != null)
chain.add("changeEndTime", lineUnionSelect.getChangeEndTime());
if (lineUnionSelect.getPlayStartTime() != null)
chain.add("playStartTime", lineUnionSelect.getPlayStartTime());
if (lineUnionSelect.getPlayEndTime() != null) chain.add("playEndTime", lineUnionSelect.getPlayEndTime());
dao.update(TheRapyRecuperationLineUnionSelect.class, chain, Cnd.where("id", "in", lineIds));
}
return null;
}
@At
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@SLog(type = "普惠疗休养", tag = "分工会/校工会选择线路", msg = "是否开放对外报名", param = true, result = true)
public Object doEditOpen(String id) {
dao.update(TheRapyRecuperationLineUnionSelect.class, Chain.makeSpecial("isOpen", "isOpen ^ 1"), Cnd.where("id", "=", id));
return null;
}
} }
@@ -1,5 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process; package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -13,7 +15,6 @@ import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap; 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 java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -42,12 +43,11 @@ public class TheRapyRecuperationStatisticsController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getLineBar(@Param(value = "regionalNature", required = false) String regionalNature, public Object getLineBar(String regionalNature, Integer year) {
@Param(value = "year", required = false) Integer year) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
line.lineName, line.lineName,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE line.id = takePartInLineId ) AS enrollNum, ( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE isNormal=true and line.id = takePartInLineId ) AS enrollNum,
( (
SELECT SELECT
COUNT( 1 ) COUNT( 1 )
@@ -123,7 +123,7 @@ public class TheRapyRecuperationStatisticsController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
agency.travelAgencyName, agency.travelAgencyName,
( SELECT AVG( evaluationForTravelAgency ) FROM the_rapy_recuperation_enroll where agency.id=takePartInTravelAgencyId) AS avg ( SELECT AVG( evaluationForTravelAgency ) FROM the_rapy_recuperation_enroll where isNormal=true and agency.id=takePartInTravelAgencyId) AS avg
FROM FROM
`the_rapy_recuperation_travel_agency` agency `the_rapy_recuperation_travel_agency` agency
WHERE WHERE
@@ -140,7 +140,7 @@ public class TheRapyRecuperationStatisticsController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
line.lineName, line.lineName,
( SELECT AVG( evaluationForLine ) FROM the_rapy_recuperation_enroll where line.id=takePartInLineId) AS avg ( SELECT AVG( evaluationForLine ) FROM the_rapy_recuperation_enroll where isNormal=true and line.id=takePartInLineId) AS avg
FROM FROM
`the_rapy_recuperation_line` line `the_rapy_recuperation_line` line
WHERE WHERE
@@ -7,23 +7,26 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.EmailUtil; import io.v.nutz.base.utils.EmailUtil;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.common.TherapyRecuperationCommon;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
import org.apache.poi.ss.usermodel.Workbook; 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;
@@ -79,18 +82,24 @@ public class TheRapyRecuperationUnionQueryController {
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getXlData(PageForm pageForm, public Object getXlData(PageForm pageForm,
@Param(value = "year", required = false) String year, String year,
@Param(value = "unionId", required = false) String unionId, String unionId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId, String takePartInLineId,
@Param(value = "regionalNature", required = false) String regionalNature, String regionalNature,
@Param(value = "lotId", required = false) String lotId) { String lotId,
String state,
String selectId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
lot.lotName, enroll.id as enrollId,
lot.lotValue, lineu.id,
line.*, line.lineName,
line.regionalNature,
lineu.lineId, lineu.lineId,
lineu.signUpMode,
YEAR(lineu.selectTime) as `year`,
CONCAT(DATE_FORMAT(lineu.playStartTime,'%m月%d日'),'-',DATE_FORMAT(lineu.playEndTime,'%m月%d日')) AS linePlayTime,
lineu.playStartTime as playStartTime1, lineu.playStartTime as playStartTime1,
lineu.playEndTime as playEndTime2, lineu.playEndTime as playEndTime2,
lxs.travelAgencyName, lxs.travelAgencyName,
@@ -98,14 +107,17 @@ public class TheRapyRecuperationUnionQueryController {
lxs.contactMobileNumber, lxs.contactMobileNumber,
enroll.takePartInUnionId AS usUnionId, enroll.takePartInUnionId AS usUnionId,
un.unionname, un.unionname,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE takePartInLineId = lineu.id and stateId=@stateId $unionCnd) lineNum, lot.lotName,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = lineu.id $unionCnd)) as signUpUserFamilyNum lot.lotValue,
enroll.familyNumber,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE isNormal=true and takePartInLineId = lineu.id and stateId=@stateId $unionCnd) lineNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where isNormal=true and stateId=2750 and takePartInLineId = lineu.id $unionCnd)) as signUpUserFamilyNum
FROM FROM
`the_rapy_recuperation_enroll` enroll `the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON line.travelAgencyId = lxs.id LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lineu.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId
$condition $condition
""").setParam("stateId", TheRapyRecuperationState.PASS); """).setParam("stateId", TheRapyRecuperationState.PASS);
@@ -115,8 +127,11 @@ public class TheRapyRecuperationUnionQueryController {
cnd.andEX("YEAR(enroll.signingUptime)", "=", year); cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
sql.setVar("unionCnd", "and (takePartInUnionId='%s' or selfUnionId='%s')".formatted(Vi.getUnionId(), Vi.getUnionId())); // sql.setVar("unionCnd", "and (takePartInUnionId='%s' or selfUnionId='%s')".formatted(Vi.getUnionId(), Vi.getUnionId()));
String unionCndSql = StrUtil.isBlank(year) ? "and (takePartInUnionId='%s' or selfUnionId='%s')".formatted(Vi.getUnionId(), Vi.getUnionId()) : "and (takePartInUnionId='%s' or selfUnionId='%s') and YEAR(signingUptime)='%s'".formatted(Vi.getUnionId(), Vi.getUnionId(), year);
sql.setVar("unionCnd", unionCndSql);
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId())); cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
//cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
/* if (Strings.isNotBlank(unionId)) { /* if (Strings.isNotBlank(unionId)) {
cnd.andEX("enroll.selfUnionId", "=", unionId); cnd.andEX("enroll.selfUnionId", "=", unionId);
//cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId)); //cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
@@ -127,36 +142,47 @@ public class TheRapyRecuperationUnionQueryController {
} else { } else {
if (Strings.isNotBlank(unionId)) { if (Strings.isNotBlank(unionId)) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId)); cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
//cnd.and("enroll.selfUnionId", "=", unionId);
} }
} }
if (Strings.isNotBlank(regionalNature)) { if (Strings.isNotBlank(regionalNature)) {
sql.setVar("regionalNature", "AND line.regionalNature='%s'".formatted(regionalNature)); sql.setVar("regionalNature", "AND line.regionalNature='%s'".formatted(regionalNature));
} }
if(state.equals("2")) {
cnd.and("enroll.takePartInTravelAgencyId", "is not", null)
.and("enroll.takePartInTravelAgencyId", "!=", "");
} else {
cnd.and("enroll.takePartInLineId", "is not", null)
.and("enroll.takePartInLineId", "!=", "");
}
cnd.andEX("line.lotId", "=", lotId); cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.id", "=", takePartInLineId); cnd.andEX("lineu.lineId", "=", takePartInLineId);
cnd.andEX("lineu.id", "=", selectId);
cnd.andEX("line.regionalNature", "=", regionalNature); cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.groupBy("enroll.takePartInLineId"); cnd.groupBy("enroll.takePartInLineId");
cnd.desc("un.unioncode"); cnd.desc("un.unioncode");
sql.setCondition(cnd); sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> list = pagination.getList();
list.forEach(v -> {
List<TheRapyRecuperationEnrollCompanion> companionList = baseService.dao().query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", v.getString("enrollId")));
for (TheRapyRecuperationEnrollCompanion enrollCompanion : companionList) {
baseService.dao().fetchLinks(enrollCompanion, "bedInfo");
}
v.setv("companionList", companionList);
});
return pagination;
} }
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getRyData(PageForm pageForm, public Object getRyData(PageForm pageForm, String year, String unionId, String unitId,
@Param(value = "year", required = false) String year, String takePartInLineId, String regionalNature, String state,
@Param(value = "unionId", required = false) String unionId, String state2, String agencyId, String takePartInBaseManagementId,
@Param(value = "unitId", required = false) String unitId, String lotId, String selectId) {
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "state", required = false) String state,
@Param(value = "state2", required = false) String state2,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId,
@Param(value = "lotId", required = false) String lotId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -167,6 +193,7 @@ public class TheRapyRecuperationUnionQueryController {
agency.travelAgencyName, agency.travelAgencyName,
ma.baseName, ma.baseName,
enroll.*, enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lineu.lineId, lineu.lineId,
lineu.playStartTime, lineu.playStartTime,
lineu.playEndTime, lineu.playEndTime,
@@ -202,6 +229,7 @@ public class TheRapyRecuperationUnionQueryController {
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (Strings.isNotBlank(unionId) && state.equals("1")) { if (Strings.isNotBlank(unionId) && state.equals("1")) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId)); cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
//cnd.and("enroll.selfUnionId", "=", unionId);
} }
cnd.andEX("enroll.selfUnionId", "=", unionId); cnd.andEX("enroll.selfUnionId", "=", unionId);
} else { } else {
@@ -222,16 +250,20 @@ public class TheRapyRecuperationUnionQueryController {
} }
} else { } else {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId())); cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
//cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
} }
} }
cnd.andEX("enroll.selfUnitId", "=", unitId); cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("line.id", "=", takePartInLineId); cnd.andEX("lineu.lineId", "=", takePartInLineId);
cnd.andEX("lineu.id", "=", selectId);
if (state.equals("1")) { if (state.equals("1")) {
cnd.andEX("line.regionalNature", "=", regionalNature); cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.and("enroll.takePartInLineId", "is not", null); cnd.and("enroll.takePartInLineId", "is not", null);
cnd.and("enroll.takePartInLineId", "!=", "");
sql.setVar("lotSql", ",(select lotName from the_rapy_recuperation_lot where id = line.lotId) as lotName"); sql.setVar("lotSql", ",(select lotName from the_rapy_recuperation_lot where id = line.lotId) as lotName");
} else if (state.equals("2")) { } else if (state.equals("2")) {
cnd.and("enroll.takePartInTravelAgencyId", "is not", null); cnd.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd.and("enroll.takePartInTravelAgencyId", "!=", "");
cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId); cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
} else if ("3".equals(state)) { } else if ("3".equals(state)) {
cnd.and("enroll.takePartInBaseManagementId", "is not", null); cnd.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -255,13 +287,12 @@ public class TheRapyRecuperationUnionQueryController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getLxsData(PageForm pageForm, @Param(value = "year", required = false) String year, public Object getLxsData(PageForm pageForm, String year, String agencyId) {
@Param(value = "agencyId", required = false) String agencyId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
*, *,
cast( files ->> '$[0].id' AS CHAR ) AS fileId, files AS fileId,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE agency.id = takePartInTravelAgencyId and isNormal=true and stateId=@stateId $unionCnd $yearCnd) agencyNum ( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE agency.id = takePartInTravelAgencyId and isNormal=true and stateId=@stateId $unionCnd $yearCnd) agencyNum
FROM FROM
the_rapy_recuperation_travel_agency agency the_rapy_recuperation_travel_agency agency
@@ -286,9 +317,7 @@ public class TheRapyRecuperationUnionQueryController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getJdData(PageForm pageForm, public Object getJdData(PageForm pageForm, String year, String takePartInBaseManagementId) {
@Param(value = "year", required = false) String year,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -321,18 +350,14 @@ public class TheRapyRecuperationUnionQueryController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getSelfUnionUser(PageForm pageForm, public Object getSelfUnionUser(PageForm pageForm, String year, String unitId, String unionId, String state, String state2) {
@Param(value = "year", required = false) String year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "state", required = false) String state,
@Param(value = "state2", required = false) String state2) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
state.stateName, state.stateName,
state.stateColor, state.stateColor,
enroll.*, enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lineu.lineId, lineu.lineId,
lineu.playStartTime, lineu.playStartTime,
lineu.playEndTime, lineu.playEndTime,
@@ -365,10 +390,12 @@ public class TheRapyRecuperationUnionQueryController {
cnd.and("enroll.selfUnionId", "=", unionId); cnd.and("enroll.selfUnionId", "=", unionId);
} else { } else {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId())); cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
//cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
} }
} else { } else {
if (StrUtil.isNotBlank(unionId)) { if (StrUtil.isNotBlank(unionId)) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId)); cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
//cnd.and("enroll.selfUnionId", "=", unionId);
} }
} }
cnd.desc("enroll.stateId"); cnd.desc("enroll.stateId");
@@ -396,15 +423,8 @@ public class TheRapyRecuperationUnionQueryController {
@Ok("void") @Ok("void")
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public void doExport(@Param(value = "state", required = false) String state, public void doExport(String state, Integer year, String searchName, String searchKeyword, String unionId,
@Param(value = "year", required = false) Integer year, String unitId, String agencyId, String takePartInLineId, String lotId,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "lotId", required = false) String lotId,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(state)) { if (StrUtil.isNotBlank(state)) {
@@ -418,12 +438,7 @@ public class TheRapyRecuperationUnionQueryController {
cnd.andEX("YEAR(signingUptime)", "=", year); cnd.andEX("YEAR(signingUptime)", "=", year);
cnd.andEX("takePartInTravelAgencyId", "=", agencyId); cnd.andEX("takePartInTravelAgencyId", "=", agencyId);
cnd.and("takePartInTravelAgencyId", "is not", null); cnd.and("takePartInTravelAgencyId", "is not", null);
} }
} else {
} }
if (Strings.isNotBlank(searchKeyword) && Strings.isNotBlank(searchName)) { if (Strings.isNotBlank(searchKeyword) && Strings.isNotBlank(searchName)) {
@@ -437,6 +452,9 @@ public class TheRapyRecuperationUnionQueryController {
baseService.dao().fetchLinks(v, "companionList"); baseService.dao().fetchLinks(v, "companionList");
baseService.dao().fetchLinks(v, "bedInfo"); baseService.dao().fetchLinks(v, "bedInfo");
}); });
TheRapyRecuperationConfig config = baseService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
List<NutMap> arrayList = new ArrayList<>(); List<NutMap> arrayList = new ArrayList<>();
enrollList.forEach(v -> { enrollList.forEach(v -> {
arrayList.add(new NutMap() {{ arrayList.add(new NutMap() {{
@@ -447,6 +465,7 @@ public class TheRapyRecuperationUnionQueryController {
addv("unionName", v.getUnionName()); addv("unionName", v.getUnionName());
addv("idCard", v.getIdCard()); addv("idCard", v.getIdCard());
addv("mobile", v.getMobile()); addv("mobile", v.getMobile());
addv("familyNumber", v.getFamilyNumber());
addv("relation", "本人"); addv("relation", "本人");
addv("bedType", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedType() : null); addv("bedType", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedType() : null);
addv("bedNum", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedNum() : null); addv("bedNum", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedNum() : null);
@@ -476,14 +495,19 @@ public class TheRapyRecuperationUnionQueryController {
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20)); exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20)); exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
exportEntities.add(new ExcelExportEntity("性别", "sex", 20)); exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
exportEntities.add(new ExcelExportEntity("单位", "unitName", 40)); exportEntities.add(new ExcelExportEntity("单位", "unitName", 20));
exportEntities.add(new ExcelExportEntity("工会", "unionName", 40)); exportEntities.add(new ExcelExportEntity("工会", "unionName", 20));
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 60)); exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
exportEntities.add(new ExcelExportEntity("手机号", "mobile", 60)); exportEntities.add(new ExcelExportEntity("手机号", "mobile", 10));
exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 60)); if (config.getFamilyInfo() == 2) {
exportEntities.add(new ExcelExportEntity("床型", "bedType", 20)); exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 10));
exportEntities.add(new ExcelExportEntity("位数", "bedNum", 20)); exportEntities.add(new ExcelExportEntity("", "bedType", 10));
exportEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 20)); exportEntities.add(new ExcelExportEntity("床位数", "bedNum", 10));
exportEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 10));
} else {
exportEntities.add(new ExcelExportEntity("携带家属数", "familyNumber", 10));
}
exportEntities.add(new ExcelExportEntity("备注", "bz", 20)); exportEntities.add(new ExcelExportEntity("备注", "bz", 20));
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
@@ -512,12 +536,7 @@ public class TheRapyRecuperationUnionQueryController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getApplyNum(@Param(value = "state", required = false)String state, public Object getApplyNum(String state, String state2, String unionId, Integer year, String regionalNature, String takePartInLineId, String selectId) {
@Param(value = "state2", required = false)String state2,
@Param(value = "unionId", required = false)String unionId,
@Param(value = "year", required = false)Integer year,
@Param(value = "regionalNature", required = false)String regionalNature,
@Param(value = "takePartInLineId", required = false)String takePartInLineId) {
Cnd cnd1 = Cnd.NEW(); Cnd cnd1 = Cnd.NEW();
Sql sql1 = Sqls.create(""" Sql sql1 = Sqls.create("""
SELECT SELECT
@@ -533,12 +552,16 @@ public class TheRapyRecuperationUnionQueryController {
if (Strings.isNotBlank(state)) { if (Strings.isNotBlank(state)) {
if (state.equals("1")) { if (state.equals("1")) {
cnd1.andEX("line.regionalNature", "=", regionalNature); cnd1.andEX("line.regionalNature", "=", regionalNature);
cnd1.and("enroll.takePartInTravelAgencyId", "is", null); cnd1.and("enroll.takePartInLineId", "is not", null);
cnd1.and("enroll.takePartInLineId", "!=", "");
if (StrUtil.isBlank(state2)) { if (StrUtil.isBlank(state2)) {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId())); cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
//cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
} }
} else if (state.equals("2")) { } else if (state.equals("2")) {
cnd1.and("enroll.takePartInTravelAgencyId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId()); cnd1.and("enroll.takePartInTravelAgencyId", "is not", null)
.and("enroll.takePartInTravelAgencyId", "!=", "")
.and("enroll.selfUnionId", "=", Vi.getUnionId());
} else { } else {
cnd1.and("enroll.takePartInBaseManagementId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId()); cnd1.and("enroll.takePartInBaseManagementId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
} }
@@ -560,6 +583,7 @@ public class TheRapyRecuperationUnionQueryController {
} }
} else { } else {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId())); cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
//cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
} }
} else { } else {
if (Strings.isNotBlank(state)) { if (Strings.isNotBlank(state)) {
@@ -569,8 +593,10 @@ public class TheRapyRecuperationUnionQueryController {
} }
cnd1.andEX("line.regionalNature", "=", regionalNature); cnd1.andEX("line.regionalNature", "=", regionalNature);
cnd1.and("enroll.takePartInLineId", "is not", null); cnd1.and("enroll.takePartInLineId", "is not", null);
cnd1.and("enroll.takePartInLineId", "!=", "");
} else if (state.equals("2")) { } else if (state.equals("2")) {
cnd1.and("enroll.takePartInTravelAgencyId", "is not", null); cnd1.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd1.and("enroll.takePartInTravelAgencyId", "!=", "");
cnd1.andEX("enroll.selfUnionId", "=", unionId); cnd1.andEX("enroll.selfUnionId", "=", unionId);
} else if (state.equals("3")) { } else if (state.equals("3")) {
cnd1.and("enroll.takePartInBaseManagementId", "is not", null); cnd1.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -580,37 +606,52 @@ public class TheRapyRecuperationUnionQueryController {
} else { } else {
if (Strings.isNotBlank(unionId)) { if (Strings.isNotBlank(unionId)) {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId)); cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
//cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId));
} }
} }
} }
cnd1.andEX("line.id", "=", takePartInLineId); cnd1.andEX("lineu.lineId", "=", takePartInLineId);
cnd1.andEX("lineu.id", "=", selectId);
cnd1.andEX("YEAR(enroll.signingUptime)", "= ", year); cnd1.andEX("YEAR(enroll.signingUptime)", "= ", year);
cnd1.andEX("enroll.isNormal", "= ", true); cnd1.andEX("enroll.isNormal", "= ", true);
cnd1.andEX("enroll.stateId", "= ", TheRapyRecuperationState.PASS); cnd1.andEX("enroll.stateId", "= ", TheRapyRecuperationState.PASS);
TheRapyRecuperationConfig config = baseService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
Sql sql2 = null;
if (config.getFamilyInfo() == 2) {
sql2 = Sqls.create("""
SELECT
count( 1 )
FROM
the_rapy_recuperation_enroll_companion
WHERE
trreId IN ( SELECT enroll.id FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId $condition )
""");
} else {
sql2 = Sqls.create("""
SELECT sum(familyNumber) FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId $condition
""");
}
Cnd cnd2 = Cnd.NEW(); Cnd cnd2 = Cnd.NEW();
Sql sql2 = Sqls.create("""
SELECT
count( 1 )
FROM
the_rapy_recuperation_enroll_companion
WHERE
trreId IN ( SELECT enroll.id FROM the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId $condition )
""");
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
if (Strings.isNotBlank(state)) { if (Strings.isNotBlank(state)) {
if (state.equals("1")) { if (state.equals("1")) {
cnd2.andEX("line.regionalNature", "=", regionalNature); cnd2.andEX("line.regionalNature", "=", regionalNature);
cnd2.and("enroll.takePartInLineId", "is not", null); cnd2.and("enroll.takePartInLineId", "is not", null);
cnd2.and("enroll.takePartInLineId", "!=", "");
if (StrUtil.isBlank(state2)) { if (StrUtil.isBlank(state2)) {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId())); cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
//cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
} }
} else if (state.equals("2")) { } else if (state.equals("2")) {
cnd2.and("enroll.takePartInTravelAgencyId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId()); cnd2.and("enroll.takePartInTravelAgencyId", "is not", null)
.and("enroll.takePartInTravelAgencyId", "!=", "")
.and("enroll.selfUnionId", "=", Vi.getUnionId());
} else { } else {
cnd2.and("enroll.takePartInBaseManagementId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId()); cnd2.and("enroll.takePartInBaseManagementId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
} }
@@ -631,17 +672,21 @@ public class TheRapyRecuperationUnionQueryController {
} }
} else { } else {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId())); cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
//cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()));
} }
} else { } else {
if (Strings.isNotBlank(state)) { if (Strings.isNotBlank(state)) {
if (state.equals("1")) { if (state.equals("1")) {
if (Strings.isNotBlank(unionId)) { if (Strings.isNotBlank(unionId)) {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId)); cnd2.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
//cnd2.and(Cnd.exps("enroll.selfUnionId", "=", unionId));
} }
cnd2.andEX("line.regionalNature", "=", regionalNature); cnd2.andEX("line.regionalNature", "=", regionalNature);
cnd2.and("enroll.takePartInLineId", "is not", null); cnd2.and("enroll.takePartInLineId", "is not", null);
cnd2.and("enroll.takePartInLineId", "!=", "");
} else if (state.equals("2")) { } else if (state.equals("2")) {
cnd2.and("enroll.takePartInTravelAgencyId", "is not", null); cnd2.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd2.and("enroll.takePartInTravelAgencyId", "!=", "");
cnd2.andEX("enroll.selfUnionId", "=", unionId); cnd2.andEX("enroll.selfUnionId", "=", unionId);
} else { } else {
cnd2.and("enroll.takePartInBaseManagementId", "is not", null); cnd2.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -650,7 +695,8 @@ public class TheRapyRecuperationUnionQueryController {
cnd2.andEX("enroll.selfUnionId", "=", unionId); cnd2.andEX("enroll.selfUnionId", "=", unionId);
} }
} }
cnd2.andEX("line.id", "=", takePartInLineId); cnd2.andEX("lineu.lineId", "=", takePartInLineId);
cnd2.andEX("lineu.id", "=", selectId);
cnd2.andEX("YEAR(enroll.signingUptime)", "=", year); cnd2.andEX("YEAR(enroll.signingUptime)", "=", year);
cnd2.andEX("enroll.isNormal", "=", true); cnd2.andEX("enroll.isNormal", "=", true);
cnd2.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS); cnd2.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS);
@@ -659,7 +705,14 @@ public class TheRapyRecuperationUnionQueryController {
sql1.setCondition(cnd1); sql1.setCondition(cnd1);
int count1 = baseService.count(sql1); int count1 = baseService.count(sql1);
sql2.setCondition(cnd2); sql2.setCondition(cnd2);
int count2 = baseService.count(sql2); int count2 = 0;
if (config.getFamilyInfo() == 2) {
count2 = baseService.count(sql2);
} else {
Sql sql = Sqls.fetchInt(sql2.toString());
baseService.dao().execute(sql);
count2 = sql.getInt();
}
return Map.of("count1", count1, "count2", count2); return Map.of("count1", count1, "count2", count2);
} }
@@ -678,12 +731,19 @@ public class TheRapyRecuperationUnionQueryController {
.and("YEAR(signingUptime)", "=", year) .and("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.PASS)); .and("stateId", "=", TheRapyRecuperationState.PASS));
TheRapyRecuperationTravelAgency travelAgency = baseService.dao().fetch(TheRapyRecuperationTravelAgency.class, Cnd.where("id", "=", id)); TheRapyRecuperationTravelAgency travelAgency = baseService.dao().fetch(TheRapyRecuperationTravelAgency.class, Cnd.where("id", "=", id));
List<Sys_user> sysUsers = baseService.dao().query(Sys_user.class, Cnd.NEW());
Map<String, String> userMap = sysUsers.stream().collect(Collectors.toMap(Sys_user::getLoginname, Sys_user::getSchoolTime));
if (travelAgency != null) { if (travelAgency != null) {
enrollList.forEach(v -> { enrollList.forEach(v -> {
baseService.dao().fetchLinks(v, "companionList"); baseService.dao().fetchLinks(v, "companionList");
}); });
List<NutMap> arrayList = new ArrayList<>(); List<NutMap> arrayList = new ArrayList<>();
enrollList.forEach(v -> { enrollList.forEach(v -> {
String schoolTime = userMap.getOrDefault(v.getLoginName(), "");
String sTime = TherapyRecuperationCommon.getRemarkBySchoolTime(schoolTime);
arrayList.add(new NutMap() {{ arrayList.add(new NutMap() {{
addv("userName", v.getUserName()); addv("userName", v.getUserName());
addv("loginName", v.getLoginName()); addv("loginName", v.getLoginName());
@@ -693,6 +753,7 @@ public class TheRapyRecuperationUnionQueryController {
addv("idCard", v.getIdCard()); addv("idCard", v.getIdCard());
addv("relation", "本人"); addv("relation", "本人");
addv("bz", v.getUserName()); addv("bz", v.getUserName());
addv("remark", sTime);
}}); }});
v.getCompanionList().forEach(c -> { v.getCompanionList().forEach(c -> {
arrayList.add(new NutMap() {{ arrayList.add(new NutMap() {{
@@ -717,7 +778,7 @@ public class TheRapyRecuperationUnionQueryController {
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 60)); exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 60));
exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 60)); exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 60));
exportEntities.add(new ExcelExportEntity("备注", "bz", 20)); exportEntities.add(new ExcelExportEntity("备注", "bz", 20));
exportEntities.add(new ExcelExportEntity("备注2", "remark", 30));
File xls = new File("C:\\疗休养报名信息表.xls"); File xls = new File("C:\\疗休养报名信息表.xls");
FileOutputStream fileOutputStream = null; FileOutputStream fileOutputStream = null;
@@ -737,7 +798,6 @@ public class TheRapyRecuperationUnionQueryController {
return null; return null;
} }
@At @At
@ViReturn @ViReturn
public Object doAttend(@Param("data") String multipleSelection) { public Object doAttend(@Param("data") String multipleSelection) {
@@ -789,7 +849,7 @@ public class TheRapyRecuperationUnionQueryController {
left join `the_rapy_recuperation_line` rl on rs.lineId=rl.id left join `the_rapy_recuperation_line` rl on rs.lineId=rl.id
LEFT JOIN `the_rapy_recuperation_travel_agency` ta ON rl.travelAgencyId = ta.id LEFT JOIN `the_rapy_recuperation_travel_agency` ta ON rl.travelAgencyId = ta.id
LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id
where rs.signUpMode='1' and rl.year=@year where rs.signUpMode='1' and YEAR(rs.selectTime)=@year
"""); """);
sql.setParam("year", DateUtil.thisYear()); sql.setParam("year", DateUtil.thisYear());
List<NutMap> lineAllList = baseService.listMap(sql); List<NutMap> lineAllList = baseService.listMap(sql);
@@ -855,7 +915,7 @@ public class TheRapyRecuperationUnionQueryController {
WHERE WHERE
rl.lineName IS NOT NULL and rs.signUpMode='1' and re.isNormal='1' rl.lineName IS NOT NULL and rs.signUpMode='1' and re.isNormal='1'
and re.takePartInUnionId=@unionid and re.takePartInUnionId=@unionid
and rl.year=@year and YEAR(re.signingUptime)=@year
and re.stateId=@stateId and re.stateId=@stateId
"""); """);
String unionid = ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId(); String unionid = ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId();
@@ -874,6 +934,8 @@ public class TheRapyRecuperationUnionQueryController {
} }
}); });
map.put("unionName", ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getUnionname()); map.put("unionName", ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getUnionname());
map.put("year", DateUtil.thisYear());
map.put("schoolName", Globals.MyConfig.getString("GxName"));
map.put("maplist", list); map.put("maplist", list);
Sys_user user = baseService.dao().fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getPrincipalProperty("id"))); Sys_user user = baseService.dao().fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getPrincipalProperty("id")));
map.put("filler", user.getUsername()); map.put("filler", user.getUsername());
@@ -1,24 +1,34 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process; package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
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.base.query.PageForm; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.common.TherapyRecuperationCommon;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyRecuperationEnrollExcelMode; import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyRecuperationEnrollExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
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.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -28,6 +38,7 @@ 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.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy; import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
@@ -36,10 +47,18 @@ import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor; import org.nutz.mvc.upload.UploadAdaptor;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@IocBean @IocBean
@At("/platform/theRapyRecuperation/user/query") @At("/platform/theRapyRecuperation/user/query")
@@ -62,16 +81,10 @@ public class TheRapyRecuperationUserQueryController {
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object pageData(@Param(value = "regionalNature", required = false) String regionalNature, public Object pageData(String regionalNature, Integer state, PageForm pageForm,
@Param(value = "state", required = false) Integer state, PageForm pageForm, Integer startYear, Integer endYear, String unionId,
@Param(value = "startYear", required = false) Integer startYear, String unitId, String takePartInLineId, String agencyId, String lotId,
@Param(value = "endYear", required = false) Integer endYear, String takePartInBaseManagementId, String signUpMode) {
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) { if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
@@ -83,14 +96,17 @@ public class TheRapyRecuperationUserQueryController {
sql = Sqls.create(""" sql = Sqls.create("""
SELECT SELECT
enroll.*, enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lxs.travelAgencyName, lxs.travelAgencyName,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily ( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
FROM FROM
`the_rapy_recuperation_enroll` enroll `the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = enroll.takePartInTravelAgencyId LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = enroll.takePartInTravelAgencyId
$condition $condition
"""); """);
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId()); if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
}
cnd.andEX("lxs.`year`", ">=", startYear); cnd.andEX("lxs.`year`", ">=", startYear);
cnd.andEX("lxs.`year`", "<=", endYear); cnd.andEX("lxs.`year`", "<=", endYear);
cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId); cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
@@ -103,10 +119,11 @@ public class TheRapyRecuperationUserQueryController {
line.lineName, line.lineName,
ma.baseName, ma.baseName,
enroll.*, enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lineu.lineId, lineu.lineId,
lineu.playStartTime, lineu.playStartTime,
lineu.playEndTime, lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily ( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
FROM FROM
`the_rapy_recuperation_enroll` enroll `the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
@@ -121,6 +138,7 @@ public class TheRapyRecuperationUserQueryController {
cnd.andEX("enroll.selfUnitId", "=", unitId); cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("line.id", "=", takePartInLineId); cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("line.regionalNature", "=", regionalNature); cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("lineu.signUpMode", "=", signUpMode);
if (state == 3) { if (state == 3) {
sql.setVar("lotSql", "(select lotName from the_rapy_recuperation_lot where id = ma.lotId) as lotName"); sql.setVar("lotSql", "(select lotName from the_rapy_recuperation_lot where id = ma.lotId) as lotName");
cnd.and("enroll.takePartInBaseManagementId", "is not", null); cnd.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -128,6 +146,7 @@ public class TheRapyRecuperationUserQueryController {
} else { } else {
sql.setVar("lotSql", "(select lotName from the_rapy_recuperation_lot where id = line.lotId) as lotName"); sql.setVar("lotSql", "(select lotName from the_rapy_recuperation_lot where id = line.lotId) as lotName");
cnd.and("enroll.takePartInLineId", "is not", null); cnd.and("enroll.takePartInLineId", "is not", null);
cnd.and("enroll.takePartInLineId", "!=", "");
} }
if (StrUtil.isNotBlank(lotId)) { if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -139,9 +158,9 @@ public class TheRapyRecuperationUserQueryController {
if (StrUtil.isNotBlank(unionId)) { if (StrUtil.isNotBlank(unionId)) {
cnd.and("enroll.selfUnionId", "=", unionId); cnd.and("enroll.selfUnionId", "=", unionId);
} }
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
} }
cnd.and("enroll.isNormal", "=", true); cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.desc("enroll.unionName"); cnd.desc("enroll.unionName");
sql.setCondition(cnd); sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -149,9 +168,7 @@ public class TheRapyRecuperationUserQueryController {
@At @At
@ViReturn @ViReturn
public Object getXlLxsUserCount(@Param(value = "unionId", required = false) String unionId, public Object getXlLxsUserCount(String unionId, Integer startYear, Integer endYear, Integer signUpMode) {
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(signingUptime)", ">=", startYear); cnd.andEX("YEAR(signingUptime)", ">=", startYear);
cnd.andEX("YEAR(signingUptime)", "<=", endYear); cnd.andEX("YEAR(signingUptime)", "<=", endYear);
@@ -160,18 +177,25 @@ public class TheRapyRecuperationUserQueryController {
} }
cnd.and("isNormal", "=", true); cnd.and("isNormal", "=", true);
cnd.and("takePartInLineId", "is not", null); cnd.and("takePartInLineId", "is not", null);
cnd.and("takePartInLineId", "!=", "");
cnd.and("stateId", "=", TheRapyRecuperationState.PASS); cnd.and("stateId", "=", TheRapyRecuperationState.PASS);
cnd.andEX("(select signUpMode from the_rapy_recuperation_line_union_select where id = takePartInLineId)", "=", signUpMode);
int count = baseService.dao().count(TheRapyRecuperationEnroll.class, cnd); int count = baseService.dao().count(TheRapyRecuperationEnroll.class, cnd);
int count1 = baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInTravelAgencyId", "is not", null) int count1 = baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInTravelAgencyId", "is not", null)
.and("takePartInTravelAgencyId", "!=", "")
.andEX("selfUnionId", "=", unionId) .andEX("selfUnionId", "=", unionId)
.andEX("YEAR(signingUptime)", ">=", startYear) .andEX("YEAR(signingUptime)", ">=", startYear)
.andEX("YEAR(signingUptime)", "<=", endYear) .andEX("YEAR(signingUptime)", "<=", endYear)
.andEX("isNormal", "=", true)); .andEX("stateId", "=", TheRapyRecuperationState.PASS)
.andEX("isNormal", "=", true)
.andEX("(select signUpMode from the_rapy_recuperation_line_union_select where id = takePartInLineId)", "=", signUpMode));
int count2 = baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInBaseManagementId", "is not", null) int count2 = baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInBaseManagementId", "is not", null)
.andEX("selfUnionId", "=", unionId) .andEX("selfUnionId", "=", unionId)
.andEX("YEAR(signingUptime)", ">=", startYear) .andEX("YEAR(signingUptime)", ">=", startYear)
.andEX("YEAR(signingUptime)", "<=", endYear) .andEX("YEAR(signingUptime)", "<=", endYear)
.andEX("isNormal", "=", true)); .andEX("stateId", "=", TheRapyRecuperationState.PASS)
.andEX("isNormal", "=", true)
.andEX("(select signUpMode from the_rapy_recuperation_line_union_select where id = takePartInLineId)", "=", signUpMode));
return Map.of("xlCount", count, "lxsCount", count1, "jdCount", count2); return Map.of("xlCount", count, "lxsCount", count1, "jdCount", count2);
} }
@@ -259,4 +283,616 @@ public class TheRapyRecuperationUserQueryController {
return null; return null;
} }
@At
@ViReturn
public Object doEdit(TheRapyRecuperationEnroll enroll) {
enroll.setNormal(true);
baseService.dao().updateIgnoreNull(enroll);
return null;
}
@At
@ViReturn
public Object getUnionSelectLine(Integer startYear, Integer endYear, Integer signUpMode, String regionalNature, Boolean flag, String disPlayUnionSelectId) {
Sql sql = Sqls.create("""
SELECT
rlus.id,
rlus.unionId,
rlus.lineId,
rlus.selectUserId,
DATE_FORMAT( rlus.playStartTime, '%Y-%m-%d' ) AS playStartTime,
DATE_FORMAT( rlus.playEndTime, '%Y-%m-%d' ) AS playEndTime,
rl.lineName,
rl.regionalNature,
if(rlus.signUpMode=2,'校工会','分工会') AS signUpMode,
lot.lotName
FROM
`the_rapy_recuperation_line_union_select` rlus
LEFT JOIN `the_rapy_recuperation_line` rl ON rlus.lineId = rl.id
LEFT JOIN `the_rapy_recuperation_lot` lot ON rl.lotId = lot.id
$condition
""");
Cnd cnd = Cnd.NEW();
if (flag == null || !flag) {
SqlExpressionGroup group = new SqlExpressionGroup();
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
group.and("rlus.isOpen", "=", 1);
//cnd.and(Cnd.exps("rlus.isOpen", "=", 1));
} else {
group.or("rlus.isOpen", "=", 1).or("rlus.unionId", "=", Vi.getUnionId());
//cnd.and(Cnd.exps("rlus.isOpen", "=", 1).or();
}
if(StrUtil.isNotBlank(disPlayUnionSelectId)) {
group.or("rlus.id", "=", disPlayUnionSelectId);
}
cnd.and(group);
} else {
cnd.andEX("YEAR(rlus.selectTime)", ">=", startYear);
cnd.andEX("YEAR(rlus.selectTime)", "<=", endYear);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and(Cnd.exps("rlus.selectUserId", "=", ShiroUtil.getUserId()).or("rlus.unionId", "=", Vi.getUnionId()));
}
cnd.andEX("rl.regionalNature", "=", regionalNature);
cnd.groupBy("rlus.lineId");
}
cnd.and("YEAR(rlus.selectTime)", "in", startYear != null ? Lang.array(startYear) : Lang.array(DateUtil.thisYear()));
cnd.andEX("rlus.signUpMode", "=", signUpMode);
cnd.desc("lot.lotValue");
cnd.desc("rl.lineName");
sql.setCondition(cnd);
return baseService.listMap(sql);
}
@At
@Ok("void")
@ViReturn
@RequiresAuthentication
public void doExportExcel(@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "state", required = false) Integer state,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId,
@Param(value = "signUpMode", required = false) String signUpMode,
@Param(value = "types", required = false) String[] types,
@Param(value = "satisfyPeople", required = false) Boolean satisfyPeople,
HttpServletResponse response) throws IOException {
Cnd commonCnd = Cnd.NEW();
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
commonCnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
commonCnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
}
commonCnd.and("enroll.isNormal", "=", true);
commonCnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
//线路的查询
Sql lineSql = Sqls.create("""
SELECT
line.regionalNature,
lxs.travelAgencyName,
line.lineName,
enroll.*,
date_format( enroll.signingUptime, '%Y-%m-%d %H:%i:%s' ) signingUptimeFormat,
date_format( lineu.playStartTime, '%Y-%m-%d' ) playStartTime,
lineu.lineId,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id) familyCount,
u.schoolTime
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `user` u on enroll.loginName = u.loginname
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = lineu.travelAgencyId
$condition
""");
Cnd lineCnd = commonCnd.clone();
lineCnd.andEX("YEAR(enroll.signingUptime)", ">=", startYear);
lineCnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
lineCnd.andEX("enroll.selfUnitId", "=", unitId);
lineCnd.andEX("line.id", "=", takePartInLineId);
lineCnd.andEX("line.regionalNature", "=", regionalNature);
lineCnd.andEX("lineu.signUpMode", "=", signUpMode);
lineCnd.andEX("enroll.selfUnionId", "=", unionId);
lineCnd.and("enroll.takePartInLineId", "is not", null);
lineCnd.and("enroll.takePartInLineId", "!=", "");
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
lineCnd.and(seg);
}
lineCnd.asc("lineName").asc("playStartTime").asc("unionName");
lineSql.setCondition(lineCnd);
List<NutMap> lineEnroll = baseService.listMap(lineSql);
lineEnroll.forEach(item -> {
String remark = TherapyRecuperationCommon.getRemarkBySchoolTime(item.getString("schoolTime"));
item.put("remark", remark);
});
//自由组团的查询
Sql travelSql = Sqls.create("""
SELECT
enroll.*,
lxs.travelAgencyName,
u.schoolTime
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `user` u on enroll.loginName = u.loginname
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = enroll.takePartInTravelAgencyId
$condition
""");
Cnd travelCnd = commonCnd.clone();
travelCnd.andEX("enroll.selfUnionId", "=", unionId);
travelCnd.andEX("lxs.`year`", ">=", startYear);
travelCnd.andEX("lxs.`year`", "<=", endYear);
travelCnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
travelCnd.and("enroll.takePartInTravelAgencyId", "is not", null);
travelCnd.and("enroll.takePartInTravelAgencyId", "!=", "");
travelCnd.asc("travelAgencyName").desc("enroll.unionName");
travelSql.setCondition(travelCnd);
List<NutMap> travelEnroll = baseService.listMap(travelSql);
travelEnroll.forEach(item -> {
String remark = TherapyRecuperationCommon.getRemarkBySchoolTime(item.getString("schoolTime"));
item.put("remark", remark);
});
//公共的导出表头
ArrayList<ExcelExportEntity> commonEntities = new ArrayList<>();
commonEntities.add(new ExcelExportEntity("姓名", "userName", 20));
commonEntities.add(new ExcelExportEntity("工号", "loginName", 20));
commonEntities.add(new ExcelExportEntity("性别", "sex", 10));
commonEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
commonEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
commonEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
commonEntities.add(new ExcelExportEntity("手机号", "mobile", 15));
ExcelExportEntity entity = new ExcelExportEntity("报名时间", "signingUptime", 15);
entity.setFormat("yyyy-MM-dd HH:mm:ss");
commonEntities.add(entity);
//线路表头
ArrayList<ExcelExportEntity> lineEntities = new ArrayList<>(commonEntities);
lineEntities.add(new ExcelExportEntity("出行时间", "playStartTime", 20));
lineEntities.add(new ExcelExportEntity("线路名称", "lineName", 20));
lineEntities.add(new ExcelExportEntity("旅行社", "travelAgencyName", 20));
lineEntities.add(new ExcelExportEntity("家属人数", "familyCount", 20));
//自由组团表头
ArrayList<ExcelExportEntity> travelEntities = new ArrayList<>(commonEntities);
travelEntities.add(new ExcelExportEntity("旅行社", "travelAgencyName", 20));
commonEntities.add(new ExcelExportEntity("备注", "remark", 30));
try {
ViTool.excelResponse(response, "人员名单.xlsx");
if(Arrays.asList(types).contains("line")) {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, lineEntities, lineEnroll);
workbook.write(response.getOutputStream());
}
if(Arrays.asList(types).contains("travel")) {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, travelEntities, travelEnroll);
workbook.write(response.getOutputStream());
}
} catch (Exception e) {
log.error(e.getMessage());
}
}
@At
@Ok("void")
@ViReturn
@RequiresAuthentication
public void doExport(@Param(value = "regionalNature", required = false) String regionalNature,
@Param(value = "state", required = false) Integer state,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "takePartInLineId", required = false) String takePartInLineId,
@Param(value = "agencyId", required = false) String agencyId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId,
@Param(value = "signUpMode", required = false) String signUpMode,
@Param(value = "types", required = false) String[] types,
@Param(value = "satisfyPeople", required = false) Boolean satisfyPeople,
HttpServletResponse response) throws IOException {
response.setContentType("application/octet-stream");
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode("疗休养报名人员名单.zip", StandardCharsets.UTF_8));
Cnd commonCnd = Cnd.NEW();
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
commonCnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
commonCnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
}
commonCnd.and("enroll.isNormal", "=", true);
commonCnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
//线路的查询
Sql lineSql = Sqls.create("""
SELECT
line.regionalNature,
lxs.travelAgencyName,
line.lineName,
enroll.*,
date_format( enroll.signingUptime, '%Y-%m-%d %H:%i:%s' ) signingUptimeFormat,
date_format( lineu.playStartTime, '%Y-%m-%d' ) playStartTime,
lineu.lineId,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id) familyCount,
u.schoolTime
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `user` u on enroll.loginName = u.loginname
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = lineu.travelAgencyId
$condition
""");
Cnd lineCnd = commonCnd.clone();
lineCnd.andEX("YEAR(enroll.signingUptime)", ">=", startYear);
lineCnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
lineCnd.andEX("enroll.selfUnitId", "=", unitId);
lineCnd.andEX("line.id", "=", takePartInLineId);
lineCnd.andEX("line.regionalNature", "=", regionalNature);
lineCnd.andEX("lineu.signUpMode", "=", signUpMode);
lineCnd.andEX("enroll.selfUnionId", "=", unionId);
lineCnd.and("enroll.takePartInLineId", "is not", null);
lineCnd.and("enroll.takePartInLineId", "!=", "");
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
lineCnd.and(seg);
}
lineCnd.asc("playStartTime").asc("unionName");
lineSql.setCondition(lineCnd);
List<NutMap> lineEnroll = baseService.listMap(lineSql);
if (satisfyPeople) {
//按照选择线路id分组,便于判断是否成团
Map<String, List<NutMap>> enrollGroup = lineEnroll.stream().collect(Collectors.groupingBy(o -> o.getString("takePartInLineId")));
List<TheRapyRecuperationLineUnionSelect> unionSelects =
baseService.dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("enable", "=", true));
Map<String, TheRapyRecuperationLineUnionSelect> selectMap = unionSelects.stream().collect(Collectors.toMap(TheRapyRecuperationLineUnionSelect::getId, o -> o));
lineEnroll = enrollGroup.entrySet().stream()
.filter(entry -> selectMap.containsKey(entry.getKey()) && (entry.getValue().size() + entry.getValue().stream().mapToInt(o -> o.getInt("familyCount")).sum()) >= selectMap.get(entry.getKey()).getEstimatedFamilyNumbers())
.flatMap(entry -> entry.getValue().stream())
.collect(Collectors.toList());
}
Map<String, List<NutMap>> lineGroupMap = lineEnroll.stream().collect(Collectors.groupingBy(o -> o.getString("lineId")));
//查询所有的线路
List<TheRapyRecuperationLine> lineList = baseService.dao().query(TheRapyRecuperationLine.class, Cnd.NEW());
Map<String, String> lineMap = lineList.stream().collect(Collectors.toMap(TheRapyRecuperationLine::getId, TheRapyRecuperationLine::getLineName));
//自由组团的查询
Sql travelSql = Sqls.create("""
SELECT
enroll.*,
lxs.travelAgencyName,
u.schoolTime
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `user` u on enroll.loginName = u.loginname
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = enroll.takePartInTravelAgencyId
$condition
""");
Cnd travelCnd = commonCnd.clone();
travelCnd.andEX("enroll.selfUnionId", "=", unionId);
travelCnd.andEX("lxs.`year`", ">=", startYear);
travelCnd.andEX("lxs.`year`", "<=", endYear);
travelCnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
travelCnd.and("enroll.takePartInTravelAgencyId", "is not", null);
travelCnd.and("enroll.takePartInTravelAgencyId", "!=", "");
travelCnd.desc("enroll.unionName");
travelSql.setCondition(travelCnd);
List<NutMap> travelEnroll = baseService.listMap(travelSql);
Map<String, List<NutMap>> travelGroupMap = travelEnroll.stream().collect(Collectors.groupingBy(o -> o.getString("takePartInTravelAgencyId")));
//查询所有的旅行社
List<TheRapyRecuperationTravelAgency> travelList = baseService.dao().query(TheRapyRecuperationTravelAgency.class, Cnd.NEW());
Map<String, String> travelMap = travelList.stream().collect(Collectors.toMap(TheRapyRecuperationTravelAgency::getId, TheRapyRecuperationTravelAgency::getTravelAgencyName));
//公共的导出表头
ArrayList<ExcelExportEntity> commonEntities = new ArrayList<>();
commonEntities.add(new ExcelExportEntity("姓名", "userName", 20));
commonEntities.add(new ExcelExportEntity("工号", "loginName", 20));
commonEntities.add(new ExcelExportEntity("性别", "sex", 10));
commonEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
commonEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
commonEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
commonEntities.add(new ExcelExportEntity("手机号", "mobile", 15));
ExcelExportEntity entity = new ExcelExportEntity("报名时间", "signingUptime", 15);
entity.setFormat("yyyy-MM-dd HH:mm:ss");
commonEntities.add(entity);
//线路表头
ArrayList<ExcelExportEntity> lineEntities = new ArrayList<>(commonEntities);
lineEntities.add(new ExcelExportEntity("出行时间", "playStartTime", 20));
lineEntities.add(new ExcelExportEntity("线路名称", "lineName", 20));
lineEntities.add(new ExcelExportEntity("旅行社", "travelAgencyName", 20));
lineEntities.add(new ExcelExportEntity("家属人数", "familyCount", 20));
//自由组团表头
ArrayList<ExcelExportEntity> travelEntities = new ArrayList<>(commonEntities);
travelEntities.add(new ExcelExportEntity("旅行社", "travelAgencyName", 20));
commonEntities.add(new ExcelExportEntity("备注", "remark", 30));
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
try {
if(Arrays.asList(types).contains("line")) {
for (String key : lineGroupMap.keySet()) {
List<NutMap> enrollList = lineGroupMap.get(key);
enrollList.forEach(item -> {
String remark = TherapyRecuperationCommon.getRemarkBySchoolTime(item.getString("schoolTime"));
item.put("remark", remark);
});
String fileName = "线路报名人员/" + lineMap.get(key) + ".xlsx";
zipOutputStream.putNextEntry(new ZipEntry(fileName));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, lineEntities, enrollList);
workbook.write(zipOutputStream);
zipOutputStream.closeEntry();
response.flushBuffer();
}
}
if(Arrays.asList(types).contains("travel")) {
for (String key : travelGroupMap.keySet()) {
List<NutMap> enrollList = travelGroupMap.get(key);
enrollList.forEach(item -> {
String remark = TherapyRecuperationCommon.getRemarkBySchoolTime(item.getString("schoolTime"));
item.put("remark", remark);
});
String fileName = "自由组团报名人员/" + travelMap.get(key) + ".xlsx";
zipOutputStream.putNextEntry(new ZipEntry(fileName));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, travelEntities, enrollList);
workbook.write(zipOutputStream);
zipOutputStream.closeEntry();
response.flushBuffer();
}
}
zipOutputStream.flush();
zipOutputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@Ok("void")
@ViReturn
@RequiresAuthentication
public void doExport1(String regionalNature, Integer state, String searchName, String searchKeyword,
Integer startYear, Integer endYear, String unionId,
String unitId, String takePartInLineId, String agencyId, String lotId,
String takePartInBaseManagementId, String signUpMode,
HttpServletResponse response) throws IOException {
Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
Sql sql;
if (state != null && state == 2) {
sql = Sqls.create("""
SELECT
enroll.*,
lxs.travelAgencyName,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = enroll.takePartInTravelAgencyId
$condition
""");
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
cnd.andEX("lxs.`year`", ">=", startYear);
cnd.andEX("lxs.`year`", "<=", endYear);
cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
cnd.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd.and("enroll.takePartInTravelAgencyId", "!=", "");
} else {
sql = Sqls.create("""
SELECT
$lotSql,
line.regionalNature,
lxs.travelAgencyName,
line.lineName,
ma.baseName,
enroll.*,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
$condition
""");
cnd.andEX("YEAR(enroll.signingUptime)", ">=", startYear);
cnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.and("enroll.takePartInLineId", "is not", null);
cnd.and("enroll.takePartInLineId", "!=", "");
if (state == 3) {
sql.setVar("lotSql", "(select lotName from the_rapy_recuperation_lot where id = ma.lotId) as lotName");
cnd.and("enroll.takePartInBaseManagementId", "is not", null);
cnd.andEX("enroll.takePartInBaseManagementId", "=", takePartInBaseManagementId);
} else {
sql.setVar("lotSql", "(select lotName from the_rapy_recuperation_lot where id = line.lotId) as lotName");
cnd.and("enroll.takePartInLineId", "is not", null);
}
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
// seg.or("agency.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
cnd.and(seg);
}
if (StrUtil.isNotBlank(unionId)) {
cnd.and("enroll.selfUnionId", "=", unionId);
}
}
cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.desc("enroll.unionName");
sql.setCondition(cnd);
List<NutMap> list = baseService.listMap(sql);
List<TheRapyRecuperationEnroll> enrollList = Lang.collection2list(list, TheRapyRecuperationEnroll.class);
TheRapyRecuperationConfig config = baseService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
enrollList.forEach(v -> {
baseService.dao().fetchLinks(v, "companionList");
baseService.dao().fetchLinks(v, "bedInfo");
baseService.dao().fetchLinks(v, "managementInfo");
if (StrUtil.isNotBlank(v.getLineId())) {
TheRapyRecuperationLine line = baseService.dao().fetch(TheRapyRecuperationLine.class, v.getLineId());
v.setLineInfo(line);
}
});
List<NutMap> arrayList = new ArrayList<>();
String takePartInLineId2 = "";
String takePartInBaseManagementId2 = "";
String agencyName = "";
String lotName = "";
for (TheRapyRecuperationEnroll v : enrollList) {
if (StrUtil.isNotBlank(v.getTakePartInLineId()) && !v.getTakePartInLineId().equals(takePartInLineId2)) {
TheRapyRecuperationLine line = baseService.dao().fetch(TheRapyRecuperationLine.class, v.getLineId());
TheRapyRecuperationLineUnionSelect unionSelect = baseService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, v.getTakePartInLineId());
TheRapyRecuperationLot lot = baseService.dao().fetch(TheRapyRecuperationLot.class, line.getLotId());
TheRapyRecuperationTravelAgency agency = baseService.dao().fetch(TheRapyRecuperationTravelAgency.class, unionSelect.getTravelAgencyId());
agencyName = agency.getTravelAgencyName();
lotName = lot.getLotName();
} else {
if (StrUtil.isNotBlank(v.getTakePartInBaseManagementId()) && !v.getTakePartInBaseManagementId().equals(takePartInBaseManagementId2)) {
TheRapyRecuperationBaseManagement management = baseService.dao().fetch(TheRapyRecuperationBaseManagement.class, v.getTakePartInBaseManagementId());
TheRapyRecuperationLot lot = baseService.dao().fetch(TheRapyRecuperationLot.class, management.getLotId());
TheRapyRecuperationTravelAgency agency = baseService.dao().fetch(TheRapyRecuperationTravelAgency.class, management.getTravelAgencyId());
agencyName = agency.getTravelAgencyName();
lotName = lot.getLotName();
}
}
String finalAgencyName = agencyName;
String finalLotName = lotName;
arrayList.add(new NutMap() {{
addv("userName", v.getUserName());
addv("loginName", v.getLoginName());
addv("sex", v.getSex());
addv("unitName", v.getUnitName());
addv("unionName", v.getUnionName());
addv("idCard", v.getIdCard());
addv("mobile", v.getMobile());
addv("relation", "本人");
addv("familyNumber", v.getFamilyNumber());
addv("bedType", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedType() : null);
addv("bedNum", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getBedNum() : null);
addv("otherSleepUser", Lang.isNotEmpty(v.getBedInfo()) ? v.getBedInfo().getOtherSleepUser() : null);
addv("baseName", Lang.isNotEmpty(v.getManagementInfo()) ? v.getManagementInfo().getBaseName() : v.getLineInfo().getLineName());
addv("signingUptime", DateUtil.formatDateTime(v.getSigningUptime()));
addv("agencyName", finalAgencyName);
addv("lotName", finalLotName);
addv("bz", v.getUserName());
}});
v.getCompanionList().forEach(c -> {
baseService.dao().fetchLinks(c, "bedInfo");
arrayList.add(new NutMap() {{
addv("userName", c.getUserName());
addv("loginName", c.getLoginName());
addv("sex", c.getSex());
addv("unitName", null);
addv("unionName", null);
addv("idCard", c.getIdCard());
addv("mobile", c.getMobile());
addv("relation", c.getRelation());
addv("bedType", Lang.isNotEmpty(c.getBedInfo()) ? c.getBedInfo().getBedType() : null);
addv("bedNum", Lang.isNotEmpty(c.getBedInfo()) ? c.getBedInfo().getBedNum() : null);
addv("otherSleepUser", Lang.isNotEmpty(c.getBedInfo()) ? c.getBedInfo().getOtherSleepUser() : null);
addv("baseName", Lang.isNotEmpty(v.getManagementInfo()) ? v.getManagementInfo().getBaseName() : v.getLineInfo().getLineName());
addv("signingUptime", DateUtil.formatDateTime(v.getSigningUptime()));
addv("agencyName", finalAgencyName);
addv("lotName", finalLotName);
addv("bz", v.getUserName());
}});
});
}
ArrayList<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
exportEntities.add(new ExcelExportEntity("性别", "sex", 10));
exportEntities.add(new ExcelExportEntity("单位", "unitName", 20));
exportEntities.add(new ExcelExportEntity("工会", "unionName", 20));
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
exportEntities.add(new ExcelExportEntity("手机号", "mobile", 15));
if (config.getFamilyInfo() == 2) {
exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 10));
exportEntities.add(new ExcelExportEntity("床型", "bedType", 20));
exportEntities.add(new ExcelExportEntity("床位数", "bedNum", 20));
exportEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 20));
} else {
exportEntities.add(new ExcelExportEntity("携带家属数", "familyNumber", 20));
}
exportEntities.add(new ExcelExportEntity("疗休养时长", "lotName", 20));
exportEntities.add(new ExcelExportEntity("集中/目的地", "baseName", 20));
exportEntities.add(new ExcelExportEntity("旅行社", "agencyName", 20));
exportEntities.add(new ExcelExportEntity("报名时间", "signingUptime", 20));
exportEntities.add(new ExcelExportEntity("备注", "bz", 20));
try {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + new String(("报名人员.xls").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, arrayList);
workbook.write(response.getOutputStream());
workbook.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@ViReturn
@RequiresAuthentication
public Object doReimbursement(@Param("data") String data) {
JSONArray objects = JSONUtil.parseArray(data);
List<String> enrollIds = objects.toList(String.class);
if (Lang.isNotEmpty(enrollIds)) {
baseService.dao().update(TheRapyRecuperationEnroll.class, Chain.make("isReimbursement", 1), Cnd.where("id", "in", enrollIds));
}
return null;
}
} }
@@ -0,0 +1,254 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.statistics;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
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.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @version 1.0
* @Author zzr
* @nameTheRapyRecuperationStatisticsController
* @Date 2024/6/3 17:32
* @注释 查看报名情况
*/
@IocBean
@At("/platform/theRapyRecuperation/statistics")
@Ok("json:full")
@Slf4j
public class TheRapyRecuperationLineStatisticsController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private MsgApi msgApi;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/statistics/lineStatistics.html")
@RequiresPermissions("theRapyRecuperation.statistics")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.statistics")
public Object pageData(PageForm pageForm,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param(value = "unionId", required = false) String unionId,
@Param("takePartInLineId") String takePartInLineId,
@Param(value = "lotId", required = false) String lotId,
@Param(value = "signUpMode", required = false) String signUpMode,
@Param(value = "selectId",required = false) String selectId,
@Param(value = "regionalNature", required = false) String regionalNature) {
Sql sql = Sqls.create("""
SELECT
line.id,
line.lineName,
line.regionalNature,
lineu.lineId,
lineu.id as lineUId,
lineu.signUpMode,
lineu.minimumGroupSize,
lineu.estimatedFamilyNumbers,
YEAR(lineu.selectTime) as `year`,
CONCAT(DATE_FORMAT(lineu.playStartTime,'%m月%d日'),'-',DATE_FORMAT(lineu.playEndTime,'%m月%d日')) AS linePlayTime,
lineu.playStartTime as playStartTime1,
lineu.playEndTime as playEndTime2,
lxs.travelAgencyName,
lxs.contact,
lxs.contactMobileNumber,
enroll.takePartInUnionId AS usUnionId,
if(lineu.signUpMode = 2, '校工会', un.unionname) as unionname,
lot.lotName,
lot.lotValue,
enroll.familyNumber,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE takePartInLineId = lineu.id and stateId=2750 and isNormal = true $unionCnd) lineNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where stateId=2750 and takePartInLineId = lineu.id and isNormal = true $unionCnd)) as signUpUserFamilyNum
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lineu.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = lineu.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(lineu.selectTime)", ">=", startYear);
cnd.andEX("YEAR(lineu.selectTime)", "<=", endYear);
cnd.andEX("lineu.signUpMode","=",signUpMode);
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")){
String unionCndSql = "and (selfUnionId='%s' or takePartInUnionId = '%s')".formatted(Vi.getUnionId(), Vi.getUnionId());
sql.setVar("unionCnd", unionCndSql);
cnd.and("lineu.unionId", "=", Vi.getUnionId());
} else {
if (Strings.isNotBlank(unionId)) {
cnd.and("lineu.unionId", "=", unionId);
}
}
cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("lineu.id", "=", selectId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.groupBy("enroll.takePartInLineId");
cnd.asc("line.serialNumber").asc("lineu.playStartTime");
sql.setCondition(cnd);
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
/**
* 根据线路查询报名详情
* @param searchKeyword
* @param unionId
* @param unitId
* @return
*/
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.statistics")
public Object getUserDateByLine(PageForm pageForm,
@Param(value = "takePartLineId",required = false) String takePartLineId,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId) {
Sql sql = Sqls.create("""
SELECT
enroll.*,
line.lineName,
line.id as lineId,
line.regionalNature,
'教职工' userNature,
state.stateColor,
state.stateName,
CONCAT(DATE_FORMAT(rs.playStartTime,'%m月%d日'),'-',DATE_FORMAT(rs.playEndTime,'%m月%d日')) AS linePlayTime,
IF
( enroll.takePartInUnionId != enroll.selfUnionId, TRUE, FALSE ) isTransferIn,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) num
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN `the_rapy_recuperation_line_union_select` rs ON rs.id = enroll.takePartInLineId
LEFT JOIN `the_rapy_recuperation_line` line on line.id=rs.lineId
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("enroll.takePartInLineId","=",takePartLineId);
cnd.and("enroll.stateId","=",2750);
cnd.andEX("enroll.selfUnionId", "=", unionId);
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.and("enroll.takePartInLineId", "is not", null);
cnd.andEX("enroll.isNormal", "=", true);
if (StrUtil.isNotBlank(searchKeyword)){
cnd.and(Cnd.exps("enroll.loginName","like","%"+searchKeyword+"%").or("enroll.userName","like","%"+searchKeyword+"%"));
}
cnd.desc("enroll.signingUptime");
cnd.desc("enroll.unitName");
sql.setCondition(cnd);
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresAuthentication
public Object sendSuccess(String id) {
TheRapyRecuperationLineUnionSelect unionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, id);
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
if (DateUtil.compare(new Date(), unionSelect.getSignUpEndTime()) < 0) {
return Result.error("报名还未结束,不能发送");
}
//找出报名人员
List<TheRapyRecuperationEnroll> enrolls = dao.query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "=", id)
.and("isNormal", "=", true).and("year(signingUptime)", "=", DateUtil.thisYear())
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
//发短信
enrolls.forEach(item -> {
String content = "%s老师,您好!您报名的%s线路,出行时间为%s,达到成团条件,请准时参加疗休养活动。".formatted(
item.getUserName(),
line.getLineName(),
DateUtil.format(unionSelect.getPlayStartTime(), "yyyy-MM-dd")
);
List list = List.of(Map.of("type", "User", "userId", item.getLoginName(), "name", item.getUserName()));
//msgApi.sendMsg(content, list, "疗休养", " IntelligenceMode", MsgApi.sendMode.normal.name());
});
return null;
}
@At
@ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
public Object sendFail(String id, Boolean type) {
TheRapyRecuperationLineUnionSelect unionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, id);
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
if (DateUtil.compare(new Date(), unionSelect.getSignUpEndTime()) < 0) {
return Result.error("报名还未结束,不能发送");
}
//找出报名人员
List<TheRapyRecuperationEnroll> enrolls = dao.query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "=", id)
.and("isNormal", "=", true).and("year(signingUptime)", "=", DateUtil.thisYear())
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
//发短信
enrolls.forEach(item -> {
String content = "%s老师,您好!您报名的%s线路,出行时间为%s,因报名人数不足未达到成团条件,请尽快进入疗休养管理系统重新选择线路。".formatted(
item.getUserName(),
line.getLineName(),
DateUtil.format(unionSelect.getPlayStartTime(), "yyyy-MM-dd")
);
List list = List.of(Map.of("type", "User", "userId", item.getLoginName(), "name", item.getUserName()));
//msgApi.sendMsg(content, list, "疗休养", " IntelligenceMode", MsgApi.sendMode.normal.name());
});
if(!type) {
List<String> enrollIds = enrolls.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
List<TheRapyRecuperationEnrollBed> bedIds = enrolls.stream().map(TheRapyRecuperationEnroll::getBedInfo).collect(Collectors.toList());
dao.clear(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "=", id));
dao.clear(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "in", enrollIds));
dao.clear(TheRapyRecuperationEnrollBed.class, Cnd.where("id", "in", bedIds));
} else {
List<String> idList = enrolls.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
dao.update(TheRapyRecuperationEnroll.class, Chain.make("isNormal", false), Cnd.where("id", "in", idList));
}
return null;
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.theRapyConfig; package io.v.nutz.zhgh.therapyRecuperation.controller.theRapyConfig;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
@@ -17,7 +18,6 @@ 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.Param;
import org.nutz.trans.Trans; import org.nutz.trans.Trans;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@@ -53,8 +53,7 @@ public class TheRapyRecuperationConfigController {
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Object operation(TheRapyRecuperationConfig config, public Object operation(TheRapyRecuperationConfig config, String[] lotDeleteList) {
@Param(value = "lotDeleteList", required = false) String[] lotDeleteList) {
if (Strings.isNotBlank(config.getId())) { if (Strings.isNotBlank(config.getId())) {
if (Lang.isNotEmpty(lotDeleteList)) { if (Lang.isNotEmpty(lotDeleteList)) {
dao.clear(TheRapyRecuperationLot.class, Cnd.where("id", "in", lotDeleteList)); dao.clear(TheRapyRecuperationLot.class, Cnd.where("id", "in", lotDeleteList));
@@ -75,32 +74,31 @@ public class TheRapyRecuperationConfigController {
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object findOne() { public Object findOne() {
return dao.fetchLinks(dao.fetch(TheRapyRecuperationConfig.class), "lots", Cnd.NEW().desc("lotValue")); return dao.fetchLinks(dao.fetch(TheRapyRecuperationConfig.class), "lots",Cnd.NEW().desc("lotValue"));
} }
/** /**
* 查使用该标段的线路和目的地 * 查使用该标段的线路和目的地
*
* @param lotId * @param lotId
* @return * @return
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object getLotsById(String lotId) { public Object getLotsById(String lotId){
List<String> lineNames = new ArrayList<>(); List<String> lineNames = new ArrayList<>();
List<String> baseNames = new ArrayList<>(); List<String> baseNames = new ArrayList<>();
Map<String, List<String>> map = new HashMap<>(); Map<String, List<String>> map = new HashMap<>();
List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("lotId", "=", lotId)); List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(lineList)) { if (!CollectionUtils.isEmpty(lineList)){
lineList.forEach(v -> lineNames.add(v.getLineName())); lineList.forEach(v-> lineNames.add(v.getLineName()));
map.put("line", lineNames); map.put("line",lineNames);
} }
List<TheRapyRecuperationBaseManagement> managementList = dao.query(TheRapyRecuperationBaseManagement.class, Cnd.where("lotId", "=", lotId)); List<TheRapyRecuperationBaseManagement> managementList = dao.query(TheRapyRecuperationBaseManagement.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(managementList)) { if (!CollectionUtils.isEmpty(managementList)){
managementList.forEach(v -> baseNames.add(v.getBaseName())); managementList.forEach(v-> baseNames.add(v.getBaseName()));
map.put("base", baseNames); map.put("base",baseNames);
} }
return map; return map;
} }
@@ -108,16 +106,15 @@ public class TheRapyRecuperationConfigController {
/** /**
* 强制删除标段时长,会删除已绑定的线路和目的地 * 强制删除标段时长,会删除已绑定的线路和目的地
*
* @param lotId * @param lotId
* @return * @return
*/ */
@At @At
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object deleteLotById(String lotId) { public Object deleteLotById(String lotId){
Trans.exec(() -> { Trans.exec(()->{
dao.clear(TheRapyRecuperationLot.class, Cnd.where("id", "=", lotId)); dao.clear(TheRapyRecuperationLot.class, Cnd.where("id","=",lotId));
List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("lotId", "=", lotId)); List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("lotId", "=", lotId));
if (!CollectionUtils.isEmpty(lineList)) { if (!CollectionUtils.isEmpty(lineList)) {
lineList.forEach(v -> v.setLotId(null)); lineList.forEach(v -> v.setLotId(null));
@@ -10,7 +10,7 @@ public class TheRapyTravelLineExcelMode {
private Integer year; private Integer year;
@Excel(name = "排序编号") @Excel(name = "排序编号")
private String serialNumber; private Integer serialNumber;
@Excel(name = "线路名称") @Excel(name = "线路名称")
private String lineName; private String lineName;
@@ -21,7 +21,7 @@ public class TheRapyTravelLineExcelMode {
@Excel(name = "活动范围") @Excel(name = "活动范围")
private String regionalNature; private String regionalNature;
@Excel(name = "最少成团人数") @Excel(name = "最少参与教工")
private Integer minimumGroupSize; private Integer minimumGroupSize;
// @Excel(name = "创建模式(分工会/校工会)") // @Excel(name = "创建模式(分工会/校工会)")
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.model; package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@@ -11,7 +12,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationBaseManagement * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement
* @Description: TODO * @Description: TODO
* @Author zzr * @Author zzr
* @Date 2023/6/5 * @Date 2023/6/5
@@ -128,6 +129,14 @@ public class TheRapyRecuperationBaseManagement {
@Excel(name = "组织形式(分工会/校工会)") @Excel(name = "组织形式(分工会/校工会)")
private int createMode; private int createMode;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人")
@Excel(name = "目的地联系人")
private String baseContactPerson;
@Column @Column
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("基地联系人电话") @Comment("基地联系人电话")
@@ -8,7 +8,7 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List; import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationCluster * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/6/17:09:30 * @Date 2022/6/17:09:30
@@ -6,7 +6,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationClusterMember * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationClusterMember
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/6/17:09:30 * @Date 2022/6/17:09:30
@@ -67,13 +67,21 @@ public class TheRapyRecuperationConfig {
@Column @Column
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
@Comment("省内线路是否审核") @Comment("省内线路是否审核")
@Default(value = "0")
private Boolean isSnLine; private Boolean isSnLine;
@Column @Column
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
@Comment("省外线路是否审核") @Comment("省外线路是否审核")
@Default(value = "0")
private Boolean isSwLine; private Boolean isSwLine;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("旅行社是否审核")
@Default(value = "0")
private Boolean travelAudit;
@Column @Column
@ColDefine(type = ColType.MYSQL_JSON) @ColDefine(type = ColType.MYSQL_JSON)
@Comment("标段") @Comment("标段")
@@ -93,11 +101,20 @@ public class TheRapyRecuperationConfig {
@Comment("疗休养服务须知") @Comment("疗休养服务须知")
private String notice; private String notice;
@Column @Column
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
@Comment("省内起始年份") @Comment("省内起始年份")
private Integer provinceStartYear; private Integer provinceStartYear;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("床位信息")
@Default(value = "0")
private Boolean bedInfo;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属信息")
@Default(value = "0")
private Integer familyInfo;
} }
@@ -12,7 +12,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnroll * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll
* @Description: 疗休养报名登记表 * @Description: 疗休养报名登记表
* @Author zxc * @Author zxc
* @Date 2022/5/31:16:58 * @Date 2022/5/31:16:58
@@ -143,6 +143,20 @@ public class TheRapyRecuperationEnroll extends BaseModel {
@Many(field = "trreId") @Many(field = "trreId")
private List<TheRapyRecuperationEnrollCompanion> companionList; private List<TheRapyRecuperationEnrollCompanion> companionList;
/**
* 酒店信息
*/
@One(field = "takePartInBaseManagementId")
private TheRapyRecuperationBaseManagement managementInfo;
/**
* 线路信息
*/
// @One(field = "takePartInLineId")
private TheRapyRecuperationLine lineInfo;
private String lineId;
/** /**
* 床位信息 * 床位信息
*/ */
@@ -179,4 +193,15 @@ public class TheRapyRecuperationEnroll extends BaseModel {
@Comment("校工会审核Id") @Comment("校工会审核Id")
private String schoolUnionAuditId; private String schoolUnionAuditId;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属数量")
private Integer familyNumber;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否报销")
private Boolean isReimbursement;
private String firstLetter;
} }
@@ -8,7 +8,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollBed * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollBed
* @Description: 报名拼床信息 * @Description: 报名拼床信息
* @Author zxc * @Author zxc
* @Date 2022/6/2:14:44 * @Date 2022/6/2:14:44
@@ -8,7 +8,7 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date; import java.util.Date;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollChangeRecord * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollChangeRecord
* @Description: 疗休养登记变更记录表 * @Description: 疗休养登记变更记录表
* @Author zxc * @Author zxc
* @Date 2022/5/31:17:10 * @Date 2022/5/31:17:10
@@ -8,7 +8,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationEnrollFamily * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollFamily
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/5/31:17:07 * @Date 2022/5/31:17:07
@@ -1,7 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.model; package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.wizzer.framework.base.model.BaseModel; import cn.wizzer.framework.base.model.BaseModel;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@@ -9,10 +8,9 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationLine * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine
* @Description: 疗休养线路管理 * @Description: 疗休养线路管理
* @Author zxc * @Author zxc
* @Date 2022/5/31:09:13 * @Date 2022/5/31:09:13
@@ -30,9 +28,9 @@ public class TheRapyRecuperationLine extends BaseModel {
private String id; private String id;
@Column @Column
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.INT)
@Comment("编号") @Comment("编号")
private String serialNumber; private Integer serialNumber;
@Column @Column
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 50)
@@ -61,7 +59,7 @@ public class TheRapyRecuperationLine extends BaseModel {
@Column @Column
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
@Comment("最少成团人数") @Comment("最少参与教工")
private Integer minimumGroupSize; private Integer minimumGroupSize;
@Column @Column
@@ -116,13 +114,13 @@ public class TheRapyRecuperationLine extends BaseModel {
@Column @Column
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
@Comment("预计人数(含家属") @Comment("成团人数包括家属")
private Integer estimatedFamilyNumbers; private Integer estimatedFamilyNumbers;
@Column @Column
@ColDefine(type = ColType.MYSQL_JSON) @ColDefine(type = ColType.VARCHAR, width = 30)
@Comment("缩略图") @Comment("缩略图")
private List<Sys_file> files; private String files;
@Column @Column
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
@@ -92,11 +92,11 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
@Column @Column
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
@Comment("是否公开") @Comment("是否公开")
private boolean isOpen; private Boolean isOpen;
@Column @Column
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
@Comment("最少成团人数") @Comment("最少参与教工")
private Integer minimumGroupSize; private Integer minimumGroupSize;
@@ -112,7 +112,7 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
@Column @Column
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
@Comment("预计人数(含家属") @Comment("成团人数包括家属")
private Integer estimatedFamilyNumbers; private Integer estimatedFamilyNumbers;
@Column @Column
@@ -125,5 +125,8 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
@Comment("是否启用") @Comment("是否启用")
private Boolean enable; private Boolean enable;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("旅行社id")
private String travelAgencyId;
} }
@@ -6,7 +6,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationLot * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot
* @Description: TODO * @Description: TODO
* @Author zzr * @Author zzr
* @Date 2023/6/6 * @Date 2023/6/6
@@ -1,17 +1,14 @@
package io.v.nutz.zhgh.therapyRecuperation.model; package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.wizzer.framework.base.model.BaseModel; import cn.wizzer.framework.base.model.BaseModel;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationTravelAgency * @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency
* @Description: 疗休养旅行社管理 * @Description: 疗休养旅行社管理
* @Author zxc * @Author zxc
* @Date 2022/5/31:14:39 * @Date 2022/5/31:14:39
@@ -75,7 +72,12 @@ public class TheRapyRecuperationTravelAgency extends BaseModel {
private boolean isDisabled; private boolean isDisabled;
@Column @Column
@ColDefine(type = ColType.MYSQL_JSON) @ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图") @Comment("缩略图")
private List<Sys_file> files; private String files;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否自由组团")
private Boolean signUpTravelAgency;
} }
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -18,7 +19,7 @@ public interface TheRapyRecuperationAuditService extends ViService<Audit> {
* @param year 可为空 * @param year 可为空
* @return * @return
*/ */
List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year, Integer signUpMode); List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode);
/** /**
@@ -29,5 +30,12 @@ public interface TheRapyRecuperationAuditService extends ViService<Audit> {
NutMap findOne(String id); NutMap findOne(String id);
/**
* 校工会审核
* @param stateId
* @param loginName
* @param adjustment
* @param takePartInLineId
*/
void schoolAudit(Integer stateId, String loginName,Boolean adjustment, String takePartInLineId);
} }
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType;
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -1,8 +1,10 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -29,6 +31,10 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
*/ */
Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType); Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType);
List<NutMap> getSelectLineById(String lineId, String unionId, int trrt, Integer lineUnionType);
Object openSignUser(String usId, String travelId, String searchKeyWord);
/** /**
* 线路报名 * 线路报名
* *
@@ -78,6 +84,7 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
Map<Boolean, String> validSignUpInfoForZJXU(String loginName, TheRapyRecuperationEnroll enrollInfo); Map<Boolean, String> validSignUpInfoForZJXU(String loginName, TheRapyRecuperationEnroll enrollInfo);
Map<Boolean, String> validSignUpInfoForZJNU(String loginName, TheRapyRecuperationEnroll enrollInfo);
/** /**
* 我报名的页面数据 * 我报名的页面数据
@@ -113,7 +120,7 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
* @param usUnionId usUnionId * @param usUnionId usUnionId
* @return {@link NutMap} * @return {@link NutMap}
*/ */
NutMap selectLineAllInfo(String usId, String usUnionId); NutMap selectLineAllInfo(String usId, String usUnionId, String year);
List<Sys_union> getTheRapyUnions(Integer year); List<Sys_union> getTheRapyUnions(Integer year, int theRapyRecuperationType);
} }
@@ -1,15 +1,17 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import java.util.List; import java.util.List;
public interface TheRapyRecuperationLineAdjustmentService extends ViService { public interface TheRapyRecuperationLineAdjustmentService extends ViService {
Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords); Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords, String regionalNature, String lotId);
List findUnionSignUpModeUserList(String lineId, String unionId); List findUnionSignUpModeUserList(String lineId, String unionId);
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster;
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
@@ -10,7 +11,7 @@ import org.nutz.lang.util.NutMap;
import java.util.List; import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.TheRapyRecuperationLineService * @FileName io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService
* @Description: 疗休养线路管理service * @Description: 疗休养线路管理service
* @Author zxc * @Author zxc
* @Date 2022/5/31:09:45 * @Date 2022/5/31:09:45
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
@@ -24,7 +25,7 @@ public interface TheRapyRecuperationLineUnionSelectService extends ViService<The
* @param cnd cnd * @param cnd cnd
* @return {@link Pagination} * @return {@link Pagination}
*/ */
Pagination pageData(PageForm pageForm, Cnd cnd); Pagination pageData(PageForm pageForm, Cnd cnd, Integer year);
/** /**
@@ -49,7 +50,7 @@ public interface TheRapyRecuperationLineUnionSelectService extends ViService<The
* @param lineId 行id * @param lineId 行id
* @return {@link Object} * @return {@link Object}
*/ */
Object selectLineInfo(String lineId, String unionId,Integer mode); Object selectLineInfo(String lineId, String unionId,Integer mode, Integer year);
/** /**
* 设置线路时间信息 * 设置线路时间信息
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.service; package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
@@ -1,21 +1,28 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl; package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import io.v.nutz.base.utils.Vi; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollBed; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollBed;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationAuditService;
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;
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.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import java.util.List; import java.util.List;
import java.util.Map;
@IocBean(args = {"refer:dao"}) @IocBean(args = {"refer:dao"})
public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> implements TheRapyRecuperationAuditService { public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> implements TheRapyRecuperationAuditService {
@@ -23,12 +30,16 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
super(dao); super(dao);
} }
@Inject
private MsgApi msgApi;
@Override @Override
public List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year, Integer signUpMode) { public List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
line.*, line.*,
lineu.id as selectId,
un.unionname, un.unionname,
DATE_FORMAT(lineu.playStartTime,'%Y-%m-%d') as playStartTime1 DATE_FORMAT(lineu.playStartTime,'%Y-%m-%d') as playStartTime1
FROM FROM
@@ -51,11 +62,18 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
} }
cnd.andEX("lineu.signUpMode", "=", signUpMode); cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.andEX("line.regionalNature", "=", regionalNature); cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("YEAR(enroll.signingUptime)", "=", year); if (StrUtil.isNotBlank(endYear)){
cnd.andEX("YEAR(enroll.signingUptime)", ">=", year);
cnd.andEX("YEAR(enroll.signingUptime)", "<=", endYear);
} else {
cnd.andEX("YEAR(enroll.signingUptime)", "=", year);
}
cnd.and("enroll.takePartInLineId", "is not", null); cnd.and("enroll.takePartInLineId", "is not", null);
cnd.and("enroll.takePartInLineId", "!=", "");
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS); cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.groupBy("enroll.takePartInLineId"); cnd.groupBy("line.id");
cnd.asc("un.unionname"); cnd.having(Cnd.where("playStartTime1", "is not", null));
cnd.asc("un.unionname").asc("lineu.lineId").asc("lineu.playStartTime");
sql.setCondition(cnd); sql.setCondition(cnd);
return listMap(sql); return listMap(sql);
} }
@@ -65,6 +83,7 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
lxs.travelAgencyName, lxs.travelAgencyName,
ta.travelAgencyName as joinTravelAgencyName,
enroll.*, enroll.*,
line.lineName, line.lineName,
if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn, if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn,
@@ -73,7 +92,8 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
`the_rapy_recuperation_enroll` enroll `the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = lineu.travelAgencyId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = enroll.takePartInTravelAgencyId
where enroll.id=@id where enroll.id=@id
""").setParam("id", id); """).setParam("id", id);
@@ -104,4 +124,22 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
return map; return map;
} }
@Override
public void schoolAudit(Integer stateId, String loginName, Boolean adjustment, String takePartInLineId) {
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
TheRapyRecuperationLineUnionSelect unionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", takePartInLineId));
TheRapyRecuperationLine theRapyRecuperationLine = dao().fetch(TheRapyRecuperationLine.class, Cnd.where("id", "=", unionSelect.getLineId()));
String content = "【智慧工会】%s老师您好,您报名的%s线路因报名人数不足已取消,请尽快进入智慧工会重新选择线路。"
.formatted(user.getUsername(),theRapyRecuperationLine.getLineName());
List list = List.of(Map.of("type", "User", "userId", user.getLoginname(), "name", user.getUsername()));
if (stateId.equals(TheRapyRecuperationState.PASS)) {
content = "【智慧工会】%s老师您好,您报名的%s线路已组团成功,请按约定出行。"
.formatted(user.getUsername(), theRapyRecuperationLine.getLineName());
}
//msgApi.sendMsg(content, list, "疗休养", " IntelligenceMode", MsgApi.sendMode.normal.name());
}
} }
@@ -1,7 +1,8 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl; package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
@@ -12,7 +13,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationCommonServiceImpl * @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationCommonServiceImpl
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/6/6:10:46 * @Date 2022/6/6:10:46
@@ -1,7 +1,8 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl; package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollJoinUserImportService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollJoinUserImportService;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -13,7 +14,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationEnrollJoinUserImportServiceImpl * @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationEnrollJoinUserImportServiceImpl
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/6/14:09:57 * @Date 2022/6/14:09:57
@@ -1,19 +1,29 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl; package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.EmailUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.zhgh.therapyRecuperation.constant.*; import io.v.nutz.zhgh.therapyRecuperation.constant.*;
import io.v.nutz.zhgh.therapyRecuperation.model.*; import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import io.v.nutz.web.commons.utils.ShiroUtil; import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -26,6 +36,8 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import java.io.File;
import java.io.FileOutputStream;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.Period; import java.time.Period;
import java.util.*; import java.util.*;
@@ -44,6 +56,12 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
@Inject @Inject
private BaseService baseService; private BaseService baseService;
@Inject
private MsgApi msgApi;
@Inject
private EmailUtil emailUtil;
public TheRapyRecuperationEnrollServiceImpl(Dao dao) { public TheRapyRecuperationEnrollServiceImpl(Dao dao) {
super(dao); super(dao);
} }
@@ -76,8 +94,8 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
us.playStartTime, us.playStartTime,
us.playEndTime, us.playEndTime,
us.signUpMode, us.signUpMode,
line.files, us.estimatedFamilyNumbers,
cast( line.files ->> '$[0].id' AS CHAR ) AS fileId, line.files AS fileId,
usgh.unionname AS usUnionName, usgh.unionname AS usUnionName,
usgh.id AS takePartInUnionId, usgh.id AS takePartInUnionId,
u.username AS createUserName, u.username AS createUserName,
@@ -88,25 +106,34 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
lot.lotValue, lot.lotValue,
lot.activityCost as lotActivityCost, lot.activityCost as lotActivityCost,
(select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum, (select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum (select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
FROM FROM
`the_rapy_recuperation_line_union_select` us `the_rapy_recuperation_line_union_select` us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
LEFT JOIN sys_union usgh ON usgh.id = us.unionId LEFT JOIN sys_union usgh ON usgh.id = us.unionId
LEFT JOIN sys_user u ON u.id = line.opBy LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = us.travelAgencyId
$lineCnd $lineCnd
group by lineId
ORDER BY serialNumber ASC ORDER BY serialNumber ASC
""").setParam("year", DateUtil.thisYear()); """).setParam("year", DateUtil.thisYear());
Cnd lineCnd = Cnd.NEW(); Cnd lineCnd = Cnd.NEW();
lineCnd.and("line.isDisabled", "=", false);
lineCnd.and("us.enable", "=", true);
lineCnd.and("line.regionalNature", "=", TheRapyRecuperationType.typeMap.get(trrt)); lineCnd.and("line.regionalNature", "=", TheRapyRecuperationType.typeMap.get(trrt));
lineCnd.andEX("line.year", "=", year); lineCnd.andEX("year(us.selectTime)", "=", year != null ? year : DateUtil.thisYear());
//本公会 //本公会
if(lineUnionType == 1 || lineUnionType == 2) { if (lineUnionType == 1) {
lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue());
// lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId);
} else if (lineUnionType == 2) {
lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue()); lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue());
lineCnd.and("us.isOpen", "=", true); lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId); lineCnd.and("us.unionId", "=", unionId);
//lineCnd.and("us.unionId", "!=", Vi.getUnionId());
} else if (lineUnionType == 3) { } else if (lineUnionType == 3) {
//校工会 //校工会
lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.FREE.getValue()); lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.FREE.getValue());
@@ -114,24 +141,28 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
lineSql.setVar("lineCnd", lineCnd); lineSql.setVar("lineCnd", lineCnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), lineSql); return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), lineSql);
} else if (TheRapyRecuperationType.provinceInTravelAgency.getValue() == trrt) { } else if (TheRapyRecuperationType.provinceInTravelAgency.getValue() == trrt) {
cnd.andEX("year", "=", year); cnd.andEX("year", "=", year != null ? year : DateUtil.thisYear());
cnd.and("isDisabled", "=", false); cnd.and("isDisabled", "=", false);
cnd.and("ta.signUpTravelAgency", "=", true);
Sql taSql = Sqls.create(""" Sql taSql = Sqls.create("""
select select
*, *,
cast(files ->> '$[0].id' as char) as fileId files as fileId,
(select count(1) from the_rapy_recuperation_enroll where takePartInTravelAgencyId=ta.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInTravelAgencyId = ta.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInTravelAgencyId=ta.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
from from
the_rapy_recuperation_travel_agency $condition the_rapy_recuperation_travel_agency ta $condition
"""); """).setParam("year", DateUtil.thisYear());
taSql.setCondition(cnd); taSql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql); return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql);
} else if (TheRapyRecuperationType.provinceInHotel.getValue() == trrt) { } else if (TheRapyRecuperationType.provinceInHotel.getValue() == trrt) {
cnd.andEX("b.year", "=", year); cnd.andEX("b.year", "=", year != null ? year : DateUtil.thisYear());
cnd.and("b.isDisabled", "=", false); cnd.and("b.isDisabled", "=", false);
Sql taSql = Sqls.create(""" Sql taSql = Sqls.create("""
select select
b.*, b.*,
cast(b.files ->> '$[0].id' as char) as fileId, b.files as fileId,
l.lotName, l.lotName,
t.travelAgencyName t.travelAgencyName
from from
@@ -147,6 +178,101 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
return new Pagination(); return new Pagination();
} }
@Override
public List<NutMap> getSelectLineById(String lineId, String unionId, int trrt, Integer lineUnionType) {
Sql lineSql = Sqls.create("""
SELECT
us.id as usId,
line.id as lineId,
line.serialNumber,
line.lineName,
line.regionalNature,
us.minimumGroupSize,
line.`year`,
us.enable,
us.signUpStartTime,
us.signUpEndTime,
us.changeEndTime,
us.playStartTime,
us.playEndTime,
us.signUpMode,
us.estimatedFamilyNumbers,
line.files AS fileId,
usgh.unionname AS usUnionName,
usgh.id AS takePartInUnionId,
u.username AS createUserName,
ta.travelAgencyName,
us.contact,
us.contactPhone,
lot.lotName,
lot.lotValue,
lot.activityCost as lotActivityCost,
(select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
FROM
`the_rapy_recuperation_line_union_select` us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
LEFT JOIN sys_union usgh ON usgh.id = us.unionId
LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
$lineCnd
ORDER BY us.lineId, playStartTime ASC
""").setParam("lineId", lineId).setParam("year", DateUtil.thisYear());
Cnd lineCnd = Cnd.NEW();
lineCnd.and("lineId", "=", lineId);
lineCnd.and("us.enable", "=", true);
lineCnd.and("year(us.selectTime)", "=", DateUtil.thisYear());
lineCnd.and("line.regionalNature", "=", TheRapyRecuperationType.typeMap.get(trrt));
//本公会
if (lineUnionType == 1) {
lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue());
// lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId);
} else if (lineUnionType == 2) {
lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue());
lineCnd.and("us.isOpen", "=", true);
lineCnd.and("us.unionId", "=", unionId);
} else if (lineUnionType == 3) {
//校工会
lineCnd.and("us.signUpMode", "=", TheRapyRecuperationSignUpMode.FREE.getValue());
}
lineSql.setVar("lineCnd", lineCnd);
return (List<NutMap>) Daos.query(dao(), lineSql.toString(), Sqls.callback.maps());
}
@Override
public Object openSignUser(String usId, String travelId, String searchKeyWord) {
List<TheRapyRecuperationEnroll> enrolls = new ArrayList<>();
if(StrUtil.isNotBlank(usId)) {
enrolls = dao().query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "=", usId)
.and("isNormal", "=", true)
.and("stateId", "=", 2750)
.and(Cnd.likeEX("userName", searchKeyWord))
.asc("unionName"));
}
if(StrUtil.isNotBlank(travelId)) {
enrolls = dao().query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInTravelAgencyId", "=", travelId)
.and("isNormal", "=", true)
.and("stateId", "=", 2750)
.and(Cnd.likeEX("userName", searchKeyWord))
.asc("unionName"));
}
enrolls.forEach(item -> {
String firstLetter = PinyinUtil.getFirstLetter(StrUtil.sub(item.getUserName(), 0, 1), "");
item.setFirstLetter(firstLetter.toUpperCase());
});
Map<String, List<TheRapyRecuperationEnroll>> listMap = enrolls.stream().collect(Collectors.groupingBy(TheRapyRecuperationEnroll::getFirstLetter));
// 对分组结果的键进行排序
return listMap.entrySet().stream()
.sorted(Comparator.comparing(Map.Entry::getKey))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
}
/** /**
* 线路报名 * 线路报名
* *
@@ -180,24 +306,34 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
Boolean isSnLine = recuperationConfig.getIsSnLine(); Boolean isSnLine = recuperationConfig.getIsSnLine();
Boolean isSwLine = recuperationConfig.getIsSwLine(); Boolean isSwLine = recuperationConfig.getIsSwLine();
Boolean flag = null;
if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceOut.getValue())) { if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceOut.getValue())) {
if(isSwLine) { flag = isSwLine;
enrollInfo.setStateId(lineUnionSelect.getSignUpMode() == 1 ? TheRapyRecuperationState.UNIT : TheRapyRecuperationState.SCHOOL);
} else {
enrollInfo.setStateId(TheRapyRecuperationState.PASS);
}
} else if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceIn.getValue())) { } else if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceIn.getValue())) {
if(isSnLine) { flag = isSnLine;
enrollInfo.setStateId(lineUnionSelect.getSignUpMode() == 1 ? TheRapyRecuperationState.UNIT : TheRapyRecuperationState.SCHOOL); }
if (Boolean.TRUE.equals(flag)) {
if (lineUnionSelect.getSignUpMode() == 1) {
if (StrUtil.isNotBlank(enrollInfo.getTakePartInUnionId()) && !enrollInfo.getTakePartInUnionId().equals(enrollInfo.getSelfUnionId())) {
enrollInfo.setStateId(TheRapyRecuperationState.LINEUNIT);
} else {
enrollInfo.setStateId(TheRapyRecuperationState.UNIT);
}
} else { } else {
enrollInfo.setStateId(TheRapyRecuperationState.PASS); enrollInfo.setStateId(TheRapyRecuperationState.SCHOOL);
} }
} else {
enrollInfo.setStateId(TheRapyRecuperationState.PASS);
} }
for (TheRapyRecuperationEnrollCompanion theRapyRecuperationEnrollCompanion : enrollInfo.getCompanionList()) { if (recuperationConfig.getBedInfo() || recuperationConfig.getFamilyInfo() == 2) {
insertLinks(theRapyRecuperationEnrollCompanion, "bedInfo"); for (TheRapyRecuperationEnrollCompanion theRapyRecuperationEnrollCompanion : enrollInfo.getCompanionList()) {
insertLinks(theRapyRecuperationEnrollCompanion, "bedInfo");
}
insertWith(enrollInfo, "companionList|bedInfo");
} else {
insert(enrollInfo);
} }
insertWith(enrollInfo, "companionList|bedInfo");
} }
/** /**
@@ -211,14 +347,18 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
TheRapyRecuperationLineUnionSelect lineUnionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, enrollInfo.getTakePartInLineId()); TheRapyRecuperationLineUnionSelect lineUnionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, enrollInfo.getTakePartInLineId());
TheRapyRecuperationLine lineInfo = dao().fetch(TheRapyRecuperationLine.class, lineUnionSelect.getLineId()); TheRapyRecuperationLine lineInfo = dao().fetch(TheRapyRecuperationLine.class, lineUnionSelect.getLineId());
TheRapyRecuperationConfig recuperationConfig = dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
if (lineUnionSelect.getSignUpMode() == TheRapyRecuperationSignUpMode.FREE.getValue()) { if (lineUnionSelect.getSignUpMode() == TheRapyRecuperationSignUpMode.FREE.getValue()) {
enrollInfo.setTakePartInUnionId(null); enrollInfo.setTakePartInUnionId(null);
} }
dao().clearLinks(enrollInfo, "companionList"); if (recuperationConfig.getBedInfo() || recuperationConfig.getFamilyInfo() == 2) {
dao().delete(TheRapyRecuperationEnrollBed.class, enrollInfo.getBedInfoId()); dao().clearLinks(enrollInfo, "companionList");
dao().delete(TheRapyRecuperationEnrollBed.class, enrollInfo.getBedInfoId());
dao().insertLinks(enrollInfo, "companionList|bedInfo"); dao().insertLinks(enrollInfo, "companionList|bedInfo");
}
update(enrollInfo); update(enrollInfo);
//插入变更记录 //插入变更记录
@@ -235,6 +375,11 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
*/ */
@Override @Override
public void doSignUpForTravelAgency(TheRapyRecuperationEnroll enrollInfo) { public void doSignUpForTravelAgency(TheRapyRecuperationEnroll enrollInfo) {
TheRapyRecuperationConfig recuperationConfig = dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
Boolean travelAudit = recuperationConfig.getTravelAudit();
enrollInfo.setStateId(travelAudit ? TheRapyRecuperationState.UNIT : TheRapyRecuperationState.PASS);
Sys_user user = (Sys_user) ShiroUtil.getPrincipal(); Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
enrollInfo.setLoginName(user.getLoginname()); enrollInfo.setLoginName(user.getLoginname());
enrollInfo.setUserName(user.getUsername()); enrollInfo.setUserName(user.getUsername());
@@ -246,7 +391,11 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
enrollInfo.setSigningUptime(new Date()); enrollInfo.setSigningUptime(new Date());
enrollInfo.setTakePartIn(false); enrollInfo.setTakePartIn(false);
enrollInfo.setNormal(true); enrollInfo.setNormal(true);
insert(enrollInfo);
for (TheRapyRecuperationEnrollCompanion theRapyRecuperationEnrollCompanion : enrollInfo.getCompanionList()) {
insertLinks(theRapyRecuperationEnrollCompanion, "bedInfo");
}
insertWith(enrollInfo, "companionList|bedInfo");
} }
/** /**
@@ -320,16 +469,16 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
//配置信息 //配置信息
TheRapyRecuperationConfig config = dao().fetch(TheRapyRecuperationConfig.class); TheRapyRecuperationConfig config = dao().fetch(TheRapyRecuperationConfig.class);
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
//判断是否在报名范围内 //判断是否在报名范围内
int count = dao().count("activity_user_scope", Cnd.NEW().and("groupId", "=", config.getActivityGroupId()) int count = dao().count("activity_user_scope", Cnd.NEW().and("groupId", "=", config.getActivityGroupId())
.and("userId", "=", ShiroUtil.getPrincipalProperty("id"))); .and("userId", "=", user.getId() ));
if (count == 0) { if (count == 0) {
return Map.of(false, "抱歉,您不在报名范围内!"); return Map.of(false, "抱歉,您不在报名范围内!");
} }
//是否入职满一年 //是否入职满一年
Sql schoolTimeSql = Sqls.create("select schoolTime from sys_user where loginName = @loginName").setParam("loginName", loginName); Sql schoolTimeSql = Sqls.create("select date_format(schoolTime,'%Y-%m-%d') schoolTime from sys_user where loginName = @loginName").setParam("loginName", loginName);
String schoolTime = (String) Daos.query(dao(), schoolTimeSql.toString(), Sqls.callback.str()); String schoolTime = (String) Daos.query(dao(), schoolTimeSql.toString(), Sqls.callback.str());
if (StrUtil.isBlank(schoolTime)) { if (StrUtil.isBlank(schoolTime)) {
return Map.of(false, "请先联系校工会完善您的入校时间后再报名!"); return Map.of(false, "请先联系校工会完善您的入校时间后再报名!");
@@ -392,7 +541,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
if (DateUtil.compare(new Date(), signUpStartTime) < 0) { if (DateUtil.compare(new Date(), signUpStartTime) < 0) {
return Map.of(false, "报名未开始,请耐心等待"); return Map.of(false, "报名未开始,请耐心等待");
} }
if (DateUtil.compare(new Date(), signUpEndTime) > 0) { if (DateUtil.compare(new Date(), changeEndTime) > 0) {
return Map.of(false, "报名时间已过,抱歉不能报名"); return Map.of(false, "报名时间已过,抱歉不能报名");
} }
TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature()); TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature());
@@ -457,9 +606,10 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
//配置信息 //配置信息
TheRapyRecuperationConfig config = dao().fetch(TheRapyRecuperationConfig.class); TheRapyRecuperationConfig config = dao().fetch(TheRapyRecuperationConfig.class);
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
//判断是否在报名范围内 //判断是否在报名范围内
int count = dao().count("activity_user_scope", Cnd.NEW().and("groupId", "=", config.getActivityGroupId()) int count = dao().count("activity_user_scope", Cnd.NEW().and("groupId", "=", config.getActivityGroupId())
.and("userId", "=", ShiroUtil.getPrincipalProperty("id"))); .and("userId", "=", user.getId() ));
if (count == 0) { if (count == 0) {
return Map.of(false, "抱歉,您不在报名范围内!"); return Map.of(false, "抱歉,您不在报名范围内!");
} }
@@ -484,14 +634,17 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
Date signUpStartTime = lineUnionSelect.getSignUpStartTime(); Date signUpStartTime = lineUnionSelect.getSignUpStartTime();
Date signUpEndTime = lineUnionSelect.getSignUpEndTime(); Date signUpEndTime = lineUnionSelect.getSignUpEndTime();
Date changeEndTime = lineUnionSelect.getChangeEndTime(); Date changeEndTime = lineUnionSelect.getChangeEndTime();
//Integer estimatedFamilyNumbers = config.getOutsideQuota();
if (DateUtil.compare(new Date(), signUpStartTime) < 0) { if (DateUtil.compare(new Date(), signUpStartTime) < 0) {
return Map.of(false, "报名未开始,请耐心等待"); return Map.of(false, "报名未开始,请耐心等待");
} }
if (DateUtil.compare(new Date(), signUpEndTime) > 0 && enrollInfo.isNormal()) { if (DateUtil.compare(new Date(), changeEndTime) > 0 && enrollInfo.isNormal()) {
return Map.of(false, "报名时间已过,抱歉不能报名"); return Map.of(false, "报名时间已过,抱歉不能报名");
} }
TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature());
if (StrUtil.isBlank(enrollInfo.getId()) && StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) { if (StrUtil.isBlank(enrollInfo.getId()) && StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
//获取标段中的最大费用 //获取标段中的最大费用
List<TheRapyRecuperationLot> lotList = dao().query(TheRapyRecuperationLot.class, Cnd.NEW()); List<TheRapyRecuperationLot> lotList = dao().query(TheRapyRecuperationLot.class, Cnd.NEW());
//最大费用 //最大费用
@@ -500,7 +653,13 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
//获取当前报名线路对应的标段的费用 //获取当前报名线路对应的标段的费用
Integer currentLineCost = dao().fetch(TheRapyRecuperationLot.class, lineInfo.getLotId()).getActivityCost(); Integer currentLineCost = dao().fetch(TheRapyRecuperationLot.class, lineInfo.getLotId()).getActivityCost();
TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature()); //省外线路判断报名人数
/*if (trrt.getValue() == TheRapyRecuperationType.provinceOutLine.getValue() && estimatedFamilyNumbers != null) {
Map<Boolean, String> map = validSignCount(enrollInfo, config, estimatedFamilyNumbers, "add");
if(map != null) {
return map;
}
}*/
//获取起始年份到当前时间,是否报名 //获取起始年份到当前时间,是否报名
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
@@ -557,16 +716,16 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
List<NutMap> threeYearOutMapList = listMap(threeYearOutSql); List<NutMap> threeYearOutMapList = listMap(threeYearOutSql);
//今年是否报名,不管报省内还是省外 //今年是否报名,不管报省内还是省外
if(nowYearMapList.size() > 0) { if (nowYearMapList.size() > 0) {
NutMap nowYearMap = nowYearMapList.get(0); NutMap nowYearMap = nowYearMapList.get(0);
//判断当前报名的线路是否和今年第一次报名的线路重复 //判断当前报名的线路是否和今年第一次报名的线路重复
if(nowYearMap.getString("takePartInLineId").equals(lineUnionSelect.getId())) { if (nowYearMap.getString("takePartInLineId").equals(lineUnionSelect.getId())) {
return Map.of(false, "您已报名过当前线路,请选择其他线路"); return Map.of(false, "您已报名过当前线路,请选择其他线路");
} }
//获取第一次报名线路对应的标段的费用 //获取第一次报名线路对应的标段的费用
int lastLineCost = nowYearMap.getInt("activityCost"); int lastLineCost = nowYearMap.getInt("activityCost");
if ((lastLineCost + currentLineCost) > maxCost) { if ((lastLineCost + currentLineCost) > maxCost) {
return Map.of(false, "您已报名过省内线路,预算超过" + maxCost + ""); return Map.of(false, "您已报名过省内或省外线路");
} }
} }
//省内线路判断 //省内线路判断
@@ -581,7 +740,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
if (twoYearInMapList.size() > 0) { if (twoYearInMapList.size() > 0) {
int hasCost = twoYearInMapList.get(0).getInt("activityCost"); int hasCost = twoYearInMapList.get(0).getInt("activityCost");
if ((hasCost + currentLineCost) > maxCost) { if ((hasCost + currentLineCost) > maxCost) {
return Map.of(false, "您已参加过省内线路,预算超过" + maxCost + ""); return Map.of(false, "您已参加过省内线路");
} }
} }
} }
@@ -605,7 +764,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
//获取这些省外线路的总报名人数 //获取这些省外线路的总报名人数
List<TheRapyRecuperationEnroll> enrollList = dao().query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "in", selectIds) List<TheRapyRecuperationEnroll> enrollList = dao().query(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "in", selectIds)
.and("isNormal", "=", true).and("signingUptime", "=", DateUtil.thisYear()) .and("isNormal", "=", true).and("signingUptime", "=", DateUtil.thisYear())
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL,TheRapyRecuperationState.LINEUNITFAIL,TheRapyRecuperationState.SCHOOLFAIL))); .and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
//活动范围总人数 //活动范围总人数
List<ActivityUserScope> userScopes = dao().query(ActivityUserScope.class, Cnd.where("groupId", "=", activityGroupId)); List<ActivityUserScope> userScopes = dao().query(ActivityUserScope.class, Cnd.where("groupId", "=", activityGroupId));
int result = (int) Math.floor((double) userScopes.size() / 3); int result = (int) Math.floor((double) userScopes.size() / 3);
@@ -617,6 +776,14 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
//变更操作 //变更操作
if (StrUtil.isNotBlank(enrollInfo.getId())) { if (StrUtil.isNotBlank(enrollInfo.getId())) {
/*if (trrt.getValue() == TheRapyRecuperationType.provinceOutLine.getValue() && estimatedFamilyNumbers != null) {
Map<Boolean, String> map = validSignCount(enrollInfo, config, estimatedFamilyNumbers, "edit");
if(map != null) {
return map;
}
}*/
int changeCount = dao().count(TheRapyRecuperationEnrollChangeRecord.class, Cnd.where("enrollId", "=", enrollInfo.getId())); int changeCount = dao().count(TheRapyRecuperationEnrollChangeRecord.class, Cnd.where("enrollId", "=", enrollInfo.getId()));
if (changeCount >= modifyNumber) { if (changeCount >= modifyNumber) {
@@ -633,29 +800,245 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
return Map.of(true, "验证成功"); return Map.of(true, "验证成功");
} }
@Override
public Map<Boolean, String> validSignUpInfoForZJNU(String loginName, TheRapyRecuperationEnroll enrollInfo) {
//配置信息
TheRapyRecuperationConfig config = dao().fetch(TheRapyRecuperationConfig.class);
Sys_user user = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
//判断是否在报名范围内
int count = dao().count("activity_user_scope", Cnd.NEW().and("groupId", "=", config.getActivityGroupId())
.and("userId", "=", user.getId() ));
if (count == 0) {
return Map.of(false, "抱歉,您不在报名范围内!");
}
//每年旅行频率
Integer travelFrequency = config.getTravelFrequency();
//省外几年去一次
Integer outsideNumber = config.getOutsideNumber();
//可以修改几次
Integer modifyNumber = config.getModifyNumber();
//活动范围
Integer activityGroupId = config.getActivityGroupId();
//如果报旅行社
if (StrUtil.isNotBlank(enrollInfo.getTakePartInTravelAgencyId())) {
if(StrUtil.isNotBlank(enrollInfo.getId())) {
return Map.of(true, "成功");
}
Map<Boolean, String> oneYear = this.validCountOneYear(loginName, travelFrequency);
if (oneYear != null) {
return oneYear;
}
}
//如果报酒店
if (StrUtil.isNotBlank(enrollInfo.getTakePartInBaseManagementId()) && StrUtil.isBlank(enrollInfo.getId())) {
Map<Boolean, String> oneYear = this.validCountOneYear(loginName, travelFrequency);
if (oneYear != null) {
return oneYear;
}
}
//线路信息
TheRapyRecuperationLineUnionSelect lineUnionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, enrollInfo.getTakePartInLineId());
TheRapyRecuperationLine lineInfo = dao().fetch(TheRapyRecuperationLine.class, lineUnionSelect.getLineId());
Date signUpStartTime = lineUnionSelect.getSignUpStartTime();
Date signUpEndTime = lineUnionSelect.getSignUpEndTime();
Date changeEndTime = lineUnionSelect.getChangeEndTime();
//线路人数,省外线路最多报名数
//Integer estimatedFamilyNumbers = config.getOutsideQuota();
if (DateUtil.compare(new Date(), signUpStartTime) < 0) {
return Map.of(false, "报名未开始,请耐心等待");
}
if (DateUtil.compare(new Date(), signUpEndTime) > 0) {
return Map.of(false, "报名时间已过,抱歉不能报名");
}
TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature());
if (StrUtil.isBlank(enrollInfo.getId()) && StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
Map<Boolean, String> oneYear = this.validCountOneYear(loginName, travelFrequency);
if (oneYear != null) {
return oneYear;
}
//省外线路判断报名人数
/*if (trrt.getValue() == TheRapyRecuperationType.provinceOutLine.getValue() && estimatedFamilyNumbers != null) {
Map<Boolean, String> map = validSignCount(enrollInfo, config, estimatedFamilyNumbers, "add");
if(map != null) {
return map;
}
}*/
//获取起始年份到当前时间,是否报名
Sql sql = Sqls.create("""
SELECT
r.*,
l.regionalNature,
(select activityCost from the_rapy_recuperation_lot where id = l.lotId) as activityCost
FROM
the_rapy_recuperation_enroll r
LEFT JOIN the_rapy_recuperation_line_union_select us on us.id = r.takePartInLineId
LEFT JOIN the_rapy_recuperation_line l ON l.id = us.lineId
$condition
""");
Sql threeYearOutSql = sql;
Sql nowYearSql = sql;
Cnd commonCnd = Cnd.NEW();
commonCnd.and("r.takePartInLineId", "is not", null);
commonCnd.and("r.takePartInLineId", "!=", "");
commonCnd.and("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"));
commonCnd.and("r.isNormal", "=", true);
commonCnd.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL));
commonCnd.and("signingUptime", "<=", DateUtil.now());
//今年是否报名,不管省内省外
Cnd nowYearCnd = commonCnd.clone();
nowYearCnd.and("signingUptime", ">=", DateUtil.thisYear() + "-01-01");
nowYearSql.setCondition(nowYearCnd);
List<NutMap> nowYearMapList = listMap(nowYearSql);
//三年参加省外
Cnd threeYearOutCnd = commonCnd.clone();
threeYearOutCnd.and("signingUptime", ">=", (DateUtil.thisYear() - outsideNumber) + "-01-01");
threeYearOutCnd.and("regionalNature", "=", "省外");
threeYearOutCnd.and("isTakePartIn", "=", true);
threeYearOutSql.setCondition(threeYearOutCnd);
List<NutMap> threeYearOutMapList = listMap(threeYearOutSql);
//今年是否报名,不管报省内还是省外,还是旅行社
if (nowYearMapList.size() >= travelFrequency) {
return Map.of(false, "您已经选择%s条线路,并审核通过,不能再次选择。".formatted(travelFrequency));
}
//省外线路判断
if (trrt.getValue() == TheRapyRecuperationType.provinceOutLine.getValue()) {
//三年内有没有参加过省外
if (threeYearOutMapList.size() > 0) {
return Map.of(false, "近%s年内您已参加过省外线路,不能再次报名".formatted(outsideNumber));
}
//zzr2024-04-25修改,删除下面的,取消注释上面的
List<TheRapyRecuperationLine> lineList = dao().query(TheRapyRecuperationLine.class, Cnd.NEW().and("isDisabled", "=", false));
List<String> lineIds = lineList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList());
//获取这些线路在选择表中的选择id,因为报名表存的是选择id
List<TheRapyRecuperationLineUnionSelect> selectList = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", lineIds));
List<ActivityUserScope> userScopes = dao().query(ActivityUserScope.class, Cnd.where("groupId", "=", activityGroupId));
List<String> userIdList = userScopes.stream().map(ActivityUserScope::getUserId).collect(Collectors.toList());
List<User> userList = dao().query(User.class, Cnd.where("unionid", "=", Vi.getUnionId()));
//分工会所有人数
List<User> unionUserList = userList.stream().filter(v -> userIdList.contains(v.getId())).collect(Collectors.toList());
List<String> outLineIdLIst = selectList.stream().filter(v -> v.getSignUpMode() == 2).map(v -> v.getId()).collect(Collectors.toList());
//分工会参加省外线路人数
List<TheRapyRecuperationEnroll> selfUnionIdTakePartInUserList = dao().query(TheRapyRecuperationEnroll.class,
Cnd.where("selfUnionId", "=", Vi.getUnionId()).and("takePartInLineId", "in", outLineIdLIst)
.and("YEAR(signingUptime)", "=", DateUtil.thisYear()));
int selfUnionTakePartNum = selfUnionIdTakePartInUserList.size();
int selfUnionNum = unionUserList.size();
double bili = (double) selfUnionTakePartNum / selfUnionNum;
/*if (bili >= 0.33) {
return Map.of(false, "本分工会已报省外线路的人数超过三分之一,不能报名");
}*/
}
}
//变更操作
if (StrUtil.isNotBlank(enrollInfo.getId())) {
//省外线路判断报名人数
/*if (trrt.getValue() == TheRapyRecuperationType.provinceOutLine.getValue() && estimatedFamilyNumbers != null) {
Map<Boolean, String> map = validSignCount(enrollInfo, config, estimatedFamilyNumbers, "add");
if(map != null) {
return map;
}
}*/
int changeCount = dao().count(TheRapyRecuperationEnrollChangeRecord.class, Cnd.where("enrollId", "=", enrollInfo.getId()));
if (changeCount >= modifyNumber) {
return Map.of(false, "只能变更" + changeCount + "次!");
}
if (DateUtil.compare(new Date(), changeEndTime) > 0) {
return Map.of(false, "超过变更截至时间,无法变更!");
} else {
return Map.of(true, "验证成功");
}
}
return Map.of(true, "验证成功");
}
public Map<Boolean, String> validSignCount(TheRapyRecuperationEnroll enrollInfo, TheRapyRecuperationConfig config, int estimatedFamilyNumbers, String type) {
int hasSignNumber = 0;//已经报名的人数
int currentSignNumber = 1;//当前报名人数,1表示自己,下面的if是加家属人数
Cnd cnd = Cnd.where("takePartInLineId", "=", enrollInfo.getTakePartInLineId())
.and("stateId", "in", Lang.array(TheRapyRecuperationState.UNIT, TheRapyRecuperationState.LINEUNIT, TheRapyRecuperationState.SCHOOL, TheRapyRecuperationState.PASS))
.and("isNormal", "=", true);
//如果是修改,排除自己的报名记录
if("edit".equals(type)) {
cnd.and("loginName", "!=", ShiroUtil.getPlatformLoginname());
}
List<TheRapyRecuperationEnroll> enrolls = dao().query(TheRapyRecuperationEnroll.class, cnd);
//1表示在配置页面的家属配置的是数量,2是家属的List
/*if (config.getFamilyInfo() == 1) {
currentSignNumber += enrollInfo.getFamilyNumber() != null ? enrollInfo.getFamilyNumber() : 0;
int sum = enrolls.stream().mapToInt(TheRapyRecuperationEnroll::getFamilyNumber).sum();
hasSignNumber = enrolls.size() + sum;
} else {
currentSignNumber += enrollInfo.getCompanionList() != null ? enrollInfo.getCompanionList().size() : 0;
List<String> list = enrolls.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
List<TheRapyRecuperationEnrollCompanion> companions = dao().query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", list));
hasSignNumber = enrolls.size() + companions.size();
}*/
//省外报名限制,不包含家属
// hasSignNumber += currentSignNumber + enrolls.size();
if ((currentSignNumber + enrolls.size()) > estimatedFamilyNumbers) {
return Map.of(false, "报名人数已满");
} else {
return null;
}
}
//判断一年报几次 //判断一年报几次
public Map<Boolean, String> validCountOneYear(String loginName, int travelFrequency) { public Map<Boolean, String> validCountOneYear(String loginName, int travelFrequency) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("loginName", "=", loginName); cnd.and("loginName", "=", loginName);
cnd.and("isNormal", "=", true);
cnd.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()); cnd.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear());
int joinCount = dao().count(TheRapyRecuperationEnroll.class, cnd); int joinCount = dao().count(TheRapyRecuperationEnroll.class, cnd);
if (joinCount >= travelFrequency) { if (joinCount >= travelFrequency) {
List<TheRapyRecuperationLine> inList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省内")); List<TheRapyRecuperationLine> inList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省内"));
List<TheRapyRecuperationLineUnionSelect> unionInSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", inList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList())));
List<TheRapyRecuperationLine> outList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省外")); List<TheRapyRecuperationLine> outList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省外"));
List<TheRapyRecuperationLineUnionSelect> unionOutSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", outList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList())));
//是否选择省外 //是否选择省外
int inCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) int inCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "in", inList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList())) .and("takePartInLineId", "in", unionInSelects.stream().map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList()))
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()));
//是否报省外 //是否报省外
int outCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) int outCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "in", outList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList())) .and("takePartInLineId", "in", unionOutSelects.stream().map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList()))
.and("isNormal", "=", true) .and("isNormal", "=", true)
.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()));
//是否报旅行社 //是否报旅行社
int travelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname")) int travelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "is", null).and("isNormal", "=", true) .and(Cnd.exps("takePartInLineId", "is", null).or("takePartInLineId", "=", ""))
.and("isNormal", "=", true)
.and("takePartInTravelAgencyId", "is not", null) .and("takePartInTravelAgencyId", "is not", null)
.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear())); .and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()));
//是否报酒店 //是否报酒店
@@ -742,7 +1125,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
us.playStartTime, us.playStartTime,
us.playEndTime, us.playEndTime,
us.signUpMode, us.signUpMode,
cast( line.files ->> '$[0].id' AS CHAR ) AS fileId, line.files AS fileId,
gh.unionname AS signUpUnionName, gh.unionname AS signUpUnionName,
ta.travelAgencyName, ta.travelAgencyName,
ta.contact, ta.contact,
@@ -780,15 +1163,18 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
ta.contact, ta.contact,
ta.contactMobileNumber, ta.contactMobileNumber,
ta.officialWebsite, ta.officialWebsite,
cast( ta.files ->> '$[0].id' AS CHAR ) AS fileId ta.files AS fileId,
(select count(1) from the_rapy_recuperation_enroll where takePartInTravelAgencyId=ta.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInTravelAgencyId = ta.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInTravelAgencyId=ta.id and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as totalFamilyNumber
FROM FROM
the_rapy_recuperation_enroll e the_rapy_recuperation_enroll e
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = e.takePartInTravelAgencyId LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = e.takePartInTravelAgencyId
$condition $condition
"""); """).setParam("year", year == null ? DateUtil.thisYear() : year);
cnd.and("e.takePartInTravelAgencyId", "is not", null); cnd.and("e.takePartInTravelAgencyId", "is not", null);
cnd.and("e.isNormal", "=", true); cnd.and("e.isNormal", "=", true);
cnd.andEX("ta.year", "=", year); cnd.and("YEAR(e.signingUptime)", "=", year == null ? DateUtil.thisYear() : year);
taSql.setCondition(cnd); taSql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql); return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql);
} }
@@ -800,7 +1186,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
ta.baseName, ta.baseName,
ta.baseContactPerson, ta.baseContactPerson,
ta.baseContactNumber, ta.baseContactNumber,
cast( ta.files ->> '$[0].id' AS CHAR ) AS fileId, ta.files AS fileId,
l.lotName, l.lotName,
ta.regionalNature, ta.regionalNature,
t.travelAgencyName, t.travelAgencyName,
@@ -828,7 +1214,11 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
@Override @Override
public TheRapyRecuperationEnroll findSignUpInfoById(String id) { public TheRapyRecuperationEnroll findSignUpInfoById(String id) {
TheRapyRecuperationEnroll enroll = fetch(id); TheRapyRecuperationEnroll enroll = fetch(id);
return fetchLinks(enroll, "companionList|bedInfo"); TheRapyRecuperationEnroll recuperationEnroll = fetchLinks(enroll, "companionList|bedInfo");
recuperationEnroll.getCompanionList().forEach(item -> {
fetchLinks(item, "bedInfo");
});
return recuperationEnroll;
} }
/** /**
@@ -841,48 +1231,60 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
public void deleteMyEnrollInfoById(String id) { public void deleteMyEnrollInfoById(String id) {
TheRapyRecuperationEnroll enrollInfo = fetch(id); TheRapyRecuperationEnroll enrollInfo = fetch(id);
dao().clearLinks(enrollInfo, "companionList|bedInfo"); dao().clearLinks(enrollInfo, "companionList|bedInfo");
if (StrUtil.isNotBlank(enrollInfo.getTakePartInTravelAgencyId())){
cancelTravelSendEmail(enrollInfo);
}
delete(id); delete(id);
dao().clear(TheRapyRecuperationEnrollChangeRecord.class, Cnd.where("enrollId", "=", id)); dao().clear(TheRapyRecuperationEnrollChangeRecord.class, Cnd.where("enrollId", "=", id));
if(StrUtil.isBlank(enrollInfo.getTakePartInTravelAgencyId())) {
TheRapyRecuperationLineUnionSelect lineUnionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, enrollInfo.getTakePartInLineId());
//TheRapyRecuperationLine lineInfo = dao().fetch(TheRapyRecuperationLine.class, lineUnionSelect.getLineId());
}
} }
/** /**
* 手机端线路介绍所有信息 * 手机端线路介绍所有信息
* *
* @param usId usId * @param usId usId
* @param usUnionId usUnionId * @param usUnionId usUnionId
* @return {@link NutMap} * @return {@link NutMap}
*/ */
@Override @Override
public NutMap selectLineAllInfo(String usId, String usUnionId) { public NutMap selectLineAllInfo(String usId, String usUnionId, String year) {
Sql usLineSql = Sqls.create(""" Sql usLineSql = Sqls.create("""
SELECT SELECT
us.id as usId, us.id as usId,
line.id as lineId, line.id as lineId,
line.lineName, line.lineName,
us.playStartTime, us.playStartTime,
us.playEndTime, us.playEndTime,
us.signUpStartTime, us.signUpStartTime,
us.signUpEndTime, us.signUpEndTime,
us.changeEndTime, us.changeEndTime,
us.minimumGroupSize, us.minimumGroupSize,
line.content, us.estimatedFamilyNumbers,
l.lotName, us.estimatedCost,
(select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=true AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormal, line.content,
(select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=false AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormalFalse, l.lotName,
(select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year) as signUpUserNum, (select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=true AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormal,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year)) as signUpUserFamilyNum, (select COUNT(1) FROM the_rapy_recuperation_enroll en WHERE isNormal=false AND en.loginName=@loginname and YEAR(en.signingUptime)=@year) isNormalFalse,
ta.travelAgencyName, (select count(1) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year) as signUpUserNum,
ta.contactMobileNumber (select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and YEAR(signingUptime)=@year)) as signUpUserFamilyNum,
FROM (select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber,
`the_rapy_recuperation_line_union_select` us ta.travelAgencyName,
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId us.contactPhone as contactMobileNumber
LEFT JOIN the_rapy_recuperation_travel_agency ta on ta.id = line.travelAgencyId FROM
LEFT JOIN the_rapy_recuperation_lot l on l.id = line.lotId `the_rapy_recuperation_line_union_select` us
WHERE if(us.signUpMode = 1, us.unionId = @usUnionId, 1=1) AND us.id = @id LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
"""); LEFT JOIN the_rapy_recuperation_travel_agency ta on ta.id = us.travelAgencyId
LEFT JOIN the_rapy_recuperation_lot l on l.id = line.lotId
WHERE if(us.signUpMode = 1, us.unionId = @usUnionId, 1=1) AND us.id = @id
""");
usLineSql.setParam("loginname", ShiroUtil.getPrincipalProperty("loginname")); usLineSql.setParam("loginname", ShiroUtil.getPrincipalProperty("loginname"));
usLineSql.setParam("year", DateUtil.thisYear()); usLineSql.setParam("year", StrUtil.isNotBlank(year) ? year : DateUtil.thisYear());
usLineSql.setParam("usUnionId", usUnionId); usLineSql.setParam("usUnionId", usUnionId);
usLineSql.setParam("id", usId); usLineSql.setParam("id", usId);
@@ -890,14 +1292,71 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
} }
@Override @Override
public List<Sys_union> getTheRapyUnions(Integer year) { public List<Sys_union> getTheRapyUnions(Integer year, int theRapyRecuperationType) {
//查询某个年份公开线路了的工会 //查询某个年份公开线路了的工会
List<TheRapyRecuperationLineUnionSelect> openList = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("isOpen", "=", true) Sql sql = Sqls.create("""
.and("signUpMode", "=", 1).and("year(selectTime)", "=", DateUtil.thisYear())); SELECT
if (Lang.isNotEmpty(openList)) { rr.unionId
List<String> unionIds = openList.stream().map(TheRapyRecuperationLineUnionSelect::getUnionId).distinct().collect(Collectors.toList()); FROM
the_rapy_recuperation_line_union_select rr left join the_rapy_recuperation_line l on rr.lineId = l.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("rr.isOpen", "=", true);
cnd.and("year(rr.selectTime)", "=", DateUtil.thisYear());
cnd.and("rr.unionId", "!=", Vi.getUnionId());
cnd.and("rr.signUpMode", "=", 1);
cnd.and("l.regionalNature", "=", TheRapyRecuperationType.typeMap.get(theRapyRecuperationType));
sql.setCondition(cnd);
List<NutMap> listMap = baseService.listMap(sql);
/*List<TheRapyRecuperationLineUnionSelect> openList = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("isOpen", "=", true)
.and("signUpMode", "=", 1).and("year(selectTime)", "=", DateUtil.thisYear()).and("unionId", "!=", Vi.getUnionId()));*/
// List<TheRapyRecuperationLineUnionSelect> openList = dao().query(TheRapyRecuperationLineUnionSelect.class,
// Cnd.where("signUpMode", "=", 1).and("year(selectTime)", "=", DateUtil.thisYear()));
if (Lang.isNotEmpty(listMap)) {
List<String> unionIds = listMap.stream().map(o -> o.getString("unionId")).distinct().collect(Collectors.toList());
return dao().query(Sys_union.class, Cnd.where("id", "in", unionIds)); return dao().query(Sys_union.class, Cnd.where("id", "in", unionIds));
} }
return new ArrayList<>(); return new ArrayList<>();
} }
/**
* 自由组团取消报名,发送给旅行社
* @param enroll
*/
private void cancelTravelSendEmail(TheRapyRecuperationEnroll enroll){
TheRapyRecuperationTravelAgency travelAgency = dao().fetch(TheRapyRecuperationTravelAgency.class, Cnd.where("id", "=", enroll.getTakePartInTravelAgencyId()));
NutMap enrollMap = Lang.obj2nutmap(enroll);
enrollMap.setv("travelAgencyName",travelAgency.getTravelAgencyName());
enrollMap.setv("remark","该教师自由出行取消报名本旅行社,请从出行名单中移除此教师");
List<NutMap> nutMaps = new ArrayList<>();
nutMaps.add(enrollMap);
if (StrUtil.isNotBlank(travelAgency.getEmail())){
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
entityList.add(new ExcelExportEntity("身份证号", "idCard", 20));
entityList.add(new ExcelExportEntity("联系电话", "mobile", 20));
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
entityList.add(new ExcelExportEntity("旅行社名称", "travelAgencyName", 20));
entityList.add(new ExcelExportEntity("备注", "remark", 50));
File xls = new File("C:/temp/"+travelAgency.getTravelAgencyName()+"疗休养自由组团出行人员名单.xlsx");
FileOutputStream fileOutputStream = null;
try {
fileOutputStream = new FileOutputStream(xls);
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, nutMaps);
workbook.write(fileOutputStream);
fileOutputStream.close();
emailUtil.send(travelAgency.getEmail(), travelAgency.getTravelAgencyName() + "疗休养自由组团出行人员名单", false, xls);
if (xls.exists()) {
xls.delete();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
} }
@@ -2,12 +2,13 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineAdjustmentService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineAdjustmentService;
import io.v.nutz.web.commons.utils.ShiroUtil;
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;
@@ -20,7 +21,7 @@ import org.nutz.lang.util.NutMap;
import java.util.List; import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineAdjustmentServiceImpl * @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineAdjustmentServiceImpl
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/6/10:10:04 * @Date 2022/6/10:10:04
@@ -34,14 +35,14 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
} }
@Override @Override
public Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords) { public Pagination pageData(PageForm pageForm, Integer year, String lineId, String unionId, String keywords, String regionalNature, String lotId) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
line.id, line.id,
line.serialNumber, line.serialNumber,
line.lineName, line.lineName,
line.regionalNature, line.regionalNature,
line.minimumGroupSize, us.minimumGroupSize,
line.`year`, line.`year`,
line.isDisabled, line.isDisabled,
line.playNumberOfDays, line.playNumberOfDays,
@@ -51,16 +52,17 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
line.changeEndTime, line.changeEndTime,
line.signUpMode, line.signUpMode,
line.createMode, line.createMode,
us.id as usId,
us.playStartTime, us.playStartTime,
us.playEndTime, us.playEndTime,
line.files, line.files AS fileId,
cast( line.files ->> '$[0].id' AS CHAR ) AS fileId,
create_gh.unionname AS createUnionName, create_gh.unionname AS createUnionName,
ta.travelAgencyName, ta.travelAgencyName,
us.unionId, us.unionId,
select_gh.unionname AS selectUnionName, select_gh.unionname AS selectUnionName,
(select count(1) from the_rapy_recuperation_enroll where takePartInUnionId = us.unionId AND takePartInLineId = line.id and isNormal=true) as signUpUserNum, (select count(1) from the_rapy_recuperation_enroll where if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) AND takePartInLineId = us.id and isNormal=true) as signUpUserNum,
(select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInUnionId = us.unionId AND takePartInLineId = line.id and isNormal=true)) as signUpUserFamilyNum (select count(1) from the_rapy_recuperation_enroll_companion where trreId in (select id from the_rapy_recuperation_enroll where if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) AND takePartInLineId = us.id and isNormal=true)) as signUpUserFamilyNum,
(select ifnull(sum(familyNumber),0) from the_rapy_recuperation_enroll where takePartInLineId = us.id and if(us.signUpMode = 1, takePartInUnionId = us.unionId, 1=1) and isNormal = true and stateId not in (2715,2725,2735) and YEAR(signingUptime)=@year) as familyNumber
FROM FROM
the_rapy_recuperation_line_union_select us the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
@@ -70,11 +72,14 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
$condition $condition
"""); """);
sql.setParam("signUpSuccessCode", TheRapyRecuperationState.PASS); sql.setParam("signUpSuccessCode", TheRapyRecuperationState.PASS);
sql.setParam("year", year);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("line.regionalNature","=",regionalNature);
cnd.andEX("line.lotId", "=", lotId);
//cnd.and("line.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue()); //cnd.and("line.signUpMode", "=", TheRapyRecuperationSignUpMode.UNION.getValue());
cnd.and("us.playStartTime", "is not", null); cnd.and("us.playStartTime", "is not", null);
cnd.andEX("line.year", "=", year); //cnd.andEX("line.year", "=", year);
cnd.andEX("line.id", "=", lineId); cnd.andEX("line.id", "=", lineId);
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("us.unionId", "=", unionId); cnd.andEX("us.unionId", "=", unionId);
@@ -92,6 +97,7 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
if (Vi.isNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { if (Vi.isNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy()); cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy());
} }
cnd.and("year(selectTime)", "=", year);
sql.setCondition(cnd); sql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
} }
@@ -108,13 +114,15 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
e.unionName, e.unionName,
e.signingUptime, e.signingUptime,
e.isNormal, e.isNormal,
count(c.id) as companionCount count(c.id) as companionCount,
e.familyNumber
FROM FROM
the_rapy_recuperation_enroll e the_rapy_recuperation_enroll e
LEFT JOIN the_rapy_recuperation_enroll_companion c ON c.trreId = e.id LEFT JOIN the_rapy_recuperation_enroll_companion c ON c.trreId = e.id
left join the_rapy_recuperation_line_union_select us on e.takePartInLineId = us.id
WHERE WHERE
e.takePartInLineId = @lineId e.takePartInLineId = @lineId
AND e.takePartInUnionId = @unionId and if(us.signUpMode = 1, e.takePartInUnionId = @unionId, 1=1)
GROUP BY e.id GROUP BY e.id
"""); """);
// AND (e.stateId = @passStateCode or e.stateId is null) // AND (e.stateId = @passStateCode or e.stateId is null)
@@ -1,14 +1,15 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl; package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationClusterMember; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationClusterMember;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineClusterService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineClusterService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -25,7 +26,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineClusterServiceImpl * @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineClusterServiceImpl
* @Description: 组团 * @Description: 组团
* @Author zxc * @Author zxc
* @Date 2022/6/17:09:04 * @Date 2022/6/17:09:04
@@ -180,6 +181,7 @@ public class TheRapyRecuperationLineClusterServiceImpl extends ViServiceImpl<The
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Cnd summaryCnd = Cnd.NEW(); Cnd summaryCnd = Cnd.NEW();
summaryCnd.and("isNormal", "=", true);
summaryCnd.and("takePartInLineId", "=", "us.id"); summaryCnd.and("takePartInLineId", "=", "us.id");
summaryCnd.and("stateId", "=", TheRapyRecuperationState.PASS); summaryCnd.and("stateId", "=", TheRapyRecuperationState.PASS);
//如果是超级管理和校工会管理员,查看校工会线路 //如果是超级管理和校工会管理员,查看校工会线路
@@ -2,17 +2,16 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationLineCreateMode; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationLineCreateMode;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState; import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -24,11 +23,10 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.plugins.wkcache.annotation.CacheRemove; import org.nutz.plugins.wkcache.annotation.CacheRemove;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineServiceImpl * @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineServiceImpl
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/5/31:09:47 * @Date 2022/5/31:09:47
@@ -73,12 +71,12 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
line.setCreateMode(TheRapyRecuperationLineCreateMode.UNION.getValue()); line.setCreateMode(TheRapyRecuperationLineCreateMode.UNION.getValue());
insert(line); insert(line);
if (line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) { /*if (line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) {
TheRapyRecuperationLineUnionSelect unionSelect = new TheRapyRecuperationLineUnionSelect(); TheRapyRecuperationLineUnionSelect unionSelect = new TheRapyRecuperationLineUnionSelect();
unionSelect.setUnionId(line.getCreateUnionId()); unionSelect.setUnionId(line.getCreateUnionId());
unionSelect.setLineId(line.getId()); unionSelect.setLineId(line.getId());
unionSelect.setSelectTime(new Date()); unionSelect.setSelectTime(new Date());
unionSelect.setSelectUserId((String) ShiroUtil.getPrincipalProperty("id")); unionSelect.setSelectUserId((String) io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id"));
unionSelect.setSignUpStartTime(line.getSignUpStartTime()); unionSelect.setSignUpStartTime(line.getSignUpStartTime());
unionSelect.setSignUpEndTime(line.getSignUpEndTime()); unionSelect.setSignUpEndTime(line.getSignUpEndTime());
@@ -87,7 +85,7 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
unionSelect.setPlayEndTime(line.getPlayEndTime()); unionSelect.setPlayEndTime(line.getPlayEndTime());
insert(unionSelect); insert(unionSelect);
} }*/
} }
} }
@@ -100,7 +98,7 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public void editLine(TheRapyRecuperationLine line) { public void editLine(TheRapyRecuperationLine line) {
update(line); update(line);
if (line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) { /*if (line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) {
TheRapyRecuperationLineUnionSelect unionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "=", line.getId())); TheRapyRecuperationLineUnionSelect unionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "=", line.getId()));
if (unionSelect != null) { if (unionSelect != null) {
@@ -115,7 +113,7 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
insertUnionSelect.setUnionId(line.getCreateUnionId()); insertUnionSelect.setUnionId(line.getCreateUnionId());
insertUnionSelect.setLineId(line.getId()); insertUnionSelect.setLineId(line.getId());
insertUnionSelect.setSelectTime(new Date()); insertUnionSelect.setSelectTime(new Date());
insertUnionSelect.setSelectUserId((String) ShiroUtil.getPrincipalProperty("id")); insertUnionSelect.setSelectUserId((String) io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id"));
insertUnionSelect.setSignUpStartTime(line.getSignUpStartTime()); insertUnionSelect.setSignUpStartTime(line.getSignUpStartTime());
insertUnionSelect.setSignUpEndTime(line.getSignUpEndTime()); insertUnionSelect.setSignUpEndTime(line.getSignUpEndTime());
@@ -127,7 +125,7 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
} }
} }
deleteLineInfoCache(line.getId()); deleteLineInfoCache(line.getId());*/
} }
/** /**
@@ -163,9 +161,8 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
line.createUnionId, line.createUnionId,
line.signUpMode, line.signUpMode,
line.createMode, line.createMode,
line.files, line.files AS fileId,
cast( line.files ->> '$[0].id' AS CHAR ) AS fileId, ifnull(gh.unionname, '校工会') AS createUnionName,
gh.unionname AS createUnionName,
u.username AS createUserName, u.username AS createUserName,
ta.travelAgencyName, ta.travelAgencyName,
ta.contact, ta.contact,
@@ -218,12 +215,13 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
WHERE WHERE
lineu.lineId = @takePartInLineId enroll.takePartInLineId = @takePartInLineId
and enroll.stateId=@stateId and enroll.stateId=@stateId
$unionCnd $unionCnd
""").setParam("takePartInLineId", lineId).setParam("stateId", TheRapyRecuperationState.PASS); """).setParam("takePartInLineId", lineId).setParam("stateId", TheRapyRecuperationState.PASS);
if (StrUtil.isNotBlank(unionId) && !ShiroUtil.hasAnyRoles("sysadmin")) { if (StrUtil.isNotBlank(unionId) && !ShiroUtil.hasAnyRoles("sysadmin")) {
sql.setVar("unionCnd", "and (enroll.takePartInUnionId='%s' or enroll.selfUnionId='%s')".formatted(unionId, unionId)); sql.setVar("unionCnd", "and (enroll.takePartInUnionId='%s' or enroll.selfUnionId='%s')".formatted(unionId, unionId));
//sql.setVar("unionCnd", "and enroll.selfUnionId='%s'".formatted(unionId));
} }
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> list = pagination.getList(); List<NutMap> list = pagination.getList();
@@ -1,14 +1,16 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl; package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineUnionSelectService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineUnionSelectService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -24,7 +26,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationLineUnionSelectServiceImpl * @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineUnionSelectServiceImpl
* @Description: 分工会选择线路 * @Description: 分工会选择线路
* @Author zxc * @Author zxc
* @Date 2022/6/1:10:18 * @Date 2022/6/1:10:18
@@ -46,7 +48,7 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
* @return {@link Pagination} * @return {@link Pagination}
*/ */
@Override @Override
public Pagination pageData(PageForm pageForm, Cnd cnd) { public Pagination pageData(PageForm pageForm, Cnd cnd, Integer year) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select select
line.id, line.id,
@@ -58,7 +60,7 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
line.isDisabled, line.isDisabled,
line.playNumberOfDays, line.playNumberOfDays,
line.createUnionId, line.createUnionId,
GROUP_CONCAT(us.playStartTime,'至',us.playEndTime) as playTimes, GROUP_CONCAT(us.playStartTime,'至',us.playEndTime,ifnull(concat('', ta.travelAgencyName, ''), '') order by us.playStartTime) as playTimes,
us.signUpStartTime, us.signUpStartTime,
us.signUpEndTime, us.signUpEndTime,
us.playStartTime, us.playStartTime,
@@ -77,19 +79,23 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
us.unionId as usUnionId, us.unionId as usUnionId,
us.id as usId, us.id as usId,
usUnion.unionname as belongUnionName, usUnion.unionname as belongUnionName,
(SELECT COUNT(*) FROM the_rapy_recuperation_enroll WHERE takePartInLineId=line.id AND takePartInUnionId=@unionId) applyCount (SELECT COUNT(*) FROM the_rapy_recuperation_enroll WHERE takePartInLineId=us.id and isNormal=true) applyCount
from from
the_rapy_recuperation_line line the_rapy_recuperation_line line
LEFT JOIN the_rapy_recuperation_travel_agency ta on ta.id = line.travelAgencyId
LEFT JOIN sys_union gh ON gh.id = line.createUnionid LEFT JOIN sys_union gh ON gh.id = line.createUnionid
LEFT JOIN sys_user u ON u.id = line.opBy LEFT JOIN sys_user u ON u.id = line.opBy
LEFT JOIN the_rapy_recuperation_line_union_select us on us.lineId = line.id AND us.unionId = @unionId AND us.selectUserId = @userId LEFT JOIN the_rapy_recuperation_line_union_select us on us.lineId = line.id AND year(selectTime) = @year $us
LEFT JOIN the_rapy_recuperation_travel_agency ta on ta.id = us.travelAgencyId
LEFT JOIN sys_union usUnion on usUnion.id = us.unionId LEFT JOIN sys_union usUnion on usUnion.id = us.unionId
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
$condition $condition
"""); """);
sql.setParam("unionId", Vi.getUnionId()); if(!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
sql.setParam("userId", ShiroUtil.getPrincipalProperty("id")); sql.setVar("us", "AND us.unionId = '%s' AND us.selectUserId = '%s'".formatted(Vi.getUnionId(), ShiroUtil.getPlatformUid()));
}
//sql.setParam("unionId", Vi.getUnionId());
//sql.setParam("userId", io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id"));
sql.setParam("year", year == null ? DateUtil.thisYear() : year);
/*SqlExpressionGroup seg = new SqlExpressionGroup(); /*SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.createUnionId", "=", Vi.getUnionId()); seg.or("line.createUnionId", "=", Vi.getUnionId());
@@ -151,36 +157,41 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
* @return {@link Object} * @return {@link Object}
*/ */
@Override @Override
public Object selectLineInfo(String lineId, String unionId, Integer mode) { public Object selectLineInfo(String lineId, String unionId, Integer mode, Integer year) {
Sql sql; Sql sql;
sql = Sqls.create(""" sql = Sqls.create("""
select select
id, us.id,
lineId, lineId,
signUpStartTime, signUpStartTime,
signUpEndTime, signUpEndTime,
changeEndTime, changeEndTime,
playStartTime, playStartTime,
playEndTime, playEndTime,
contact, us.contact,
contactPhone, us.contactPhone,
minimumGroupSize, minimumGroupSize,
trafficTools, trafficTools,
estimatedCost, estimatedCost,
estimatedFamilyNumbers, estimatedFamilyNumbers,
us.travelAgencyId,
signUpMode, signUpMode,
enable enable,
ta.travelAgencyName
from from
the_rapy_recuperation_line_union_select the_rapy_recuperation_line_union_select us
left join the_rapy_recuperation_travel_agency ta on ta.id = us.travelAgencyId
where unionId = @unionId where unionId = @unionId
and lineId = @lineId and lineId = @lineId
and signUpMode = @mode and signUpMode = @mode
ORDER BY signUpStartTime ASC and year(selectTime) = @year
ORDER BY signUpStartTime,playStartTime ASC
"""); """);
sql.setParam("unionId", unionId); sql.setParam("unionId", unionId);
sql.setParam("lineId", lineId); sql.setParam("lineId", lineId);
sql.setParam("mode", mode); sql.setParam("mode", mode);
sql.setParam("year", year == null ? DateUtil.thisYear() : year);
return listMap(sql); return listMap(sql);
@@ -3,6 +3,9 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency; import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService; import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -15,7 +18,7 @@ import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List; import java.util.List;
/** /**
* @FileName io.v.nutz.therapyRecuperation.service.impl.TheRapyRecuperationTravelAgencyServiceImpl * @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationTravelAgencyServiceImpl
* @Description: 疗休养旅行社 * @Description: 疗休养旅行社
* @Author zxc * @Author zxc
* @Date 2022/5/31:14:46 * @Date 2022/5/31:14:46
@@ -81,7 +84,7 @@ public class TheRapyRecuperationTravelAgencyServiceImpl extends ViServiceImpl<Th
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select select
*, *,
cast(files ->> '$[0].id' as char) as fileId files as fileId
from from
the_rapy_recuperation_travel_agency $condition the_rapy_recuperation_travel_agency $condition
"""); """);
@@ -116,7 +119,8 @@ public class TheRapyRecuperationTravelAgencyServiceImpl extends ViServiceImpl<Th
LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
WHERE WHERE
enroll.takePartInTravelAgencyId = @takePartInTravelAgencyId enroll.takePartInTravelAgencyId = @takePartInTravelAgencyId
""").setParam("takePartInTravelAgencyId", id); and enroll.selfUnionId = @unionId
""").setParam("takePartInTravelAgencyId", id).setParam("unionId", Vi.getUnionId());
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
} }
} }
@@ -2,8 +2,8 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl.baseManage;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import io.v.nutz.base.service.impl.BaseServiceImpl; import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.zhgh.therapyRecuperation.service.baseManage.TheRapyRecuperationBaseManagerService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.service.baseManage.TheRapyRecuperationBaseManagerService;
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;
@@ -0,0 +1,219 @@
<template>
<div style="padding: 20px 50px">
<el-timeline>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-button size="medium" style="width: 200px"
@click="location.href=temp_url"
icon="el-icon-download">下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-form>
<el-form-item label="请选择更新模式" v-if="is_show_radio">
<el-radio-group v-model="importData.isFlag">
<el-radio-button label="true">清空更新</el-radio-button>
<el-radio-button label="false">追加</el-radio-button>
</el-radio-group>
</el-form-item>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList);
importResult={
errorCount:0,
successCount:0,
totalCount:0,
errorList:[]
}
}"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload"
style="width: 200px">选择文件
</el-button>
<div class="el-upload__tip" slot="tip" style="color: #F56C6C">
只能上传 xls/xlsx 文件
</div>
</el-upload>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="导入结果">
<el-card shadow="never">
<p>总记录数{{ errorInfoData.totalCount }}</p>
<p>成功数<span class="text-success">{{ errorInfoData.successCount }}</span></p>
<p>错误数<span class="text-danger">{{ errorInfoData.errorCount }}</span></p>
<el-link @click="exportErrors" type="primary" v-if="errorInfoData.errorCount>0">下载错误记录
</el-link>
</el-card>
</el-timeline-item>
</el-timeline>
<div style="text-align: right">
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="importVisible = false" :disabled="importLoading"> </el-button>-->
<el-button type="primary" @click="doImport" :loading="importLoading"> </el-button>
</span>
</div>
</div>
</template>
<script>
module.exports = {
props: {
temp_url: {type: String},
post_url: {type: String},
project_id: {type: String, default: ''},
is_show_radio: {type: Boolean, default: false}
},
mounted() {
const s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'https://cdn.staticfile.org/xlsx/0.18.5/xlsx.full.min.js';
document.body.appendChild(s);
},
data() {
return {
// importVisible: false,
importLoading: false,
importData: {
fileList: [],
isFlag: false
},
errorInfoData: {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0,
},
}
},
methods: {
resetImportData() {
this.importData = {
fileList: [],
isFlag: false
}
this.errorInfoData = {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0,
}
this.importLoading = false
},
doImport() {
if (this.importData.fileList.length === 0) {
this.$notify.error({
title: '错误',
message: '请选择文件!'
});
// this.notifyWarning("")
return
}
const data = new FormData();
data.append("isFlag", this.importData.isFlag)
data.append("projectId", this.project_id)
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
// this.importLoading = true
$.ajax({
url: this.post_url,
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
this.importLoading = false
if (data.code === 0 && data.data === null) {
this.$notify.success("导入成功")
this.importVisible = false
this.$emit("flush")
} else {
this.$notify.warning("导入失败")
this.errorInfoData = data.data
}
},
error: (data) => {
this.$notify.warning("导入失败")
// this.importLoading = false
}
});
},
exportErrors() {
const data = this.errorInfoData.errorList
// 簿
const workbook = XLSX.utils.book_new();
//
const worksheet = XLSX.utils.json_to_sheet(data);
// 簿
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
// 簿
const excelBuffer = XLSX.write(workbook, {bookType: 'xlsx', type: 'array'});
// Blob
const blob = new Blob([excelBuffer], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
//
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = '错误记录.xlsx';
//
document.body.appendChild(link);
link.click();
//
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
},
fileHandleRemove(file, fileList) {
return fileList;
},
fileHandleChange(file, fileList, {type, size}) {
const removeFile = () => {
fileList.splice(fileList.findIndex(v => v === file))
}
if (!file.size) {
this.$notify.warning('您选择的是空文件!')
removeFile()
}
if (type && type.length && !type.includes(file.name.split('.').pop().toLowerCase())) {
this.$notify.warning(`文件只能是 ${type.map(v => v.toUpperCase()).join('/')} 格式!`)
removeFile()
}
if (size && !file.size < size) {
this.$notify.warning(`文件大小不能超过 ${size / 1024 / 1024}MB`)
removeFile()
}
return fileList;
},
}
}
</script>
<style>
.el-card__body {
padding: 25px;
}
</style>
@@ -0,0 +1,240 @@
/**
*Desc:
*Create by: jug
*Create time:2023/11/20/16:49
*/
<template>
<div>
<el-form :model="formData" label-width="0" ref="form" class="applyForm">
<border-table>
<table>
<tr>
<th>姓名</th>
<td>
<el-form-item prop="username" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="formData.username"></el-input>
</el-form-item>
</td>
<th>工号</th>
<td>
<el-form-item prop="loginname" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="formData.loginname"></el-input>
</el-form-item>
</td>
<th>性别</th>
<td>
<el-form-item prop="sex"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.sex" size="mini">
<el-radio label="男" border></el-radio>
<el-radio label="女" border></el-radio>
</el-radio-group>
</el-form-item>
</td>
<th>民族</th>
<td>
<el-form-item prop="nation">
<el-select v-model="formData.nation">
<el-option v-for="item in nation" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-form-item>
</td>
</tr>
<tr>
<th>出生年月</th>
<td>
<el-form-item prop="birthday">
<el-date-picker v-model="formData.birthday" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</td>
<th>入党时间</th>
<td>
<el-form-item prop="partyJoiningTime">
<el-date-picker v-model="formData.partyJoiningTime" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</td>
<th>工作时间</th>
<td>
<el-form-item prop="workStartDate">
<el-date-picker v-model="formData.workStartDate" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</td>
<th>进校时间</th>
<td>
<el-form-item prop="schoolTime">
<el-date-picker v-model="formData.schoolTime" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</td>
</tr>
<tr>
<th>文化程度</th>
<td>
<el-form-item prop="schoolTime">
<dict-select v-model="formData.personType" clearable placeholder="文化程度"
code="Education"></dict-select>
</el-form-item>
</td>
<th>籍贯</th>
<td>
<el-form-item prop="hometown">
<el-input v-model="formData.hometown" maxlength="20" clearable></el-input>
</el-form-item>
</td>
<th>职称</th>
<td>
<el-form-item prop="jobTitle">
<el-input v-model="formData.jobTitle" maxlength="20" clearable></el-input>
</el-form-item>
</td>
<th>待遇</th>
<td>
<el-form-item prop="treatment">
<el-input v-model="formData.treatment" maxlength="20" clearable></el-input>
</el-form-item>
</td>
</tr>
<tr>
<th>退休时间</th>
<td>
<el-form-item prop="retirementTime">
<el-date-picker v-model="formData.retirementTime" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</td>
<th>身份证号码</th>
<td>
<el-form-item prop="idcard">
<el-input v-model="formData.idcard" clearable></el-input>
</el-form-item>
</td>
<th>医疗证号</th>
<td>
<el-form-item prop="medicalCertificateNumber">
<el-input v-model="formData.medicalCertificateNumber" clearable></el-input>
</el-form-item>
</td>
<th>/基础病</th>
<td>
<el-form-item prop="basicDiseaseInfo">
<el-input v-model="formData.basicDiseaseInfo" clearable></el-input>
</el-form-item>
</td>
</tr>
<tr>
<th>原部门</th>
<td>
<el-form-item prop="originalDepartment">
<el-input v-model="formData.originalDepartment" clearable></el-input>
</el-form-item>
</td>
<th>家属姓名</th>
<td>
<el-form-item prop="familyName">
<el-input v-model="formData.familyName" clearable></el-input>
</el-form-item>
</td>
<th>家庭住址</th>
<td :colspan="3">
<el-form-item prop="homeAddress">
<el-input v-model="formData.homeAddress" clearable></el-input>
</el-form-item>
</td>
</tr>
<tr>
<th>联系方式</th>
<td>
<el-form-item prop="mobile">
<el-input v-model="formData.mobile" clearable></el-input>
</el-form-item>
</td>
<th>退休性质</th>
<td >
<el-form-item prop="retireNature">
<el-select v-model="formData.retireNature" clearable>
<el-option label="离休" value="离休"></el-option>
<el-option label="退休" value="退休"></el-option>
</el-select>
</el-form-item>
</td>
<th>是否去世</th>
<td :colspan="3">
<!-- :rules="[{required:true,message:'必填',trigger:['change','blur']}]" -->
<el-form-item prop="isDead">
<el-radio-group v-model="formData.isDead" size="mini">
<el-radio label="true" border></el-radio>
<el-radio label="false" border></el-radio>
</el-radio-group>
</el-form-item>
</td>
</tr>
<tr>
<th>备注</th>
<td :colspan="7">
<el-form-item prop="retireNotes">
<el-input type="textarea" :rows="3" v-model="formData.retireNotes" clearable></el-input>
</el-form-item>
</td>
</tr>
</table>
</border-table>
</el-form>
<el-row :gutter="10" class="mt10" type="flex" justify="end">
<el-button @click="doSubmit" type="primary">确定</el-button>
</el-row>
</div>
</template>
<script>
module.exports = {
name: "userEdit",
data() {
return {
userId: null
}
},
components: {
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
},
data() {
return {
formData: {},
nation: nation
}
},
methods: {
doSubmit() {
this.$refs.form.validate(async valid => {
if (valid) {
const {data, code, msg} = await $.post(loc() + '/doSubmit', {
user: JSON.stringify(this.formData),
userId: this.userId
})
if (code === 0) {
this.$message.success(msg)
this.$emit('finish')
} else {
this.$message.warning(msg)
}
}
})
},
reset() {
this.userId = null
this.formData = {}
},
async getInfo(id) {
this.userId = id
const {data} = await $.get(loc() + '/getInfo', {id: this.userId})
this.formData = data
}
},
created() {
}
}
</script>
<style scoped>
</style>
@@ -4,26 +4,112 @@
*Create time:2023/7/25/9:14 *Create time:2023/7/25/9:14
*/ */
<template> <template>
<div> <border-table>
<el-descriptions :column="3" border> <table>
<el-descriptions-item label="姓名">{{ userData.username }}</el-descriptions-item> <tr>
<el-descriptions-item label="工号">{{ userData.loginname }}</el-descriptions-item> <th>姓名</th>
<el-descriptions-item label="性别">{{ userData.sex }}</el-descriptions-item> <td>
<el-descriptions-item label="退休小组">{{ userData.retiredGroupName }}</el-descriptions-item> {{ formData.username }}
<el-descriptions-item label="政治面貌">{{ userData.political }}</el-descriptions-item> </td>
<el-descriptions-item label="退休党支部">{{ userData.retiredPartyBranchName }}</el-descriptions-item> <th>工号</th>
<el-descriptions-item label="所在科室">{{ userData.threeUnitName }}</el-descriptions-item> <td>
<el-descriptions-item label="所在单位">{{ userData.unitname }}</el-descriptions-item> {{ formData.loginname }}
<el-descriptions-item label="所在工会">{{ userData.unionname }}</el-descriptions-item> </td>
<el-descriptions-item label="出生日期">{{ userData.birthday }}</el-descriptions-item> <th>性别</th>
<el-descriptions-item label="民族">{{ userData.nation }}</el-descriptions-item> <td>
<el-descriptions-item label="学历">{{ userData.education }}</el-descriptions-item> {{ formData.sex }}
<el-descriptions-item label="在职状态">{{ userData.userState }}</el-descriptions-item> </td>
<el-descriptions-item label="人员类型">{{ userData.personType }}</el-descriptions-item> <th>民族</th>
<el-descriptions-item label="联系方式">{{ userData.mobile }}</el-descriptions-item> <td>
<el-descriptions-item label="身份证号码">{{ userData.idcard }}</el-descriptions-item> {{ formData.nation }}
</el-descriptions> </td>
</div> </tr>
<tr>
<th>出生年月</th>
<td>
{{ formData.birthday }}
</td>
<th>入党时间</th>
<td>
{{ formData.partyJoiningTime | formatterDate }}
</td>
<th>工作时间</th>
<td>
{{ formData.workStartDate | formatterDate }}
</td>
<th>进校时间</th>
<td>
{{ formData.schoolTime | formatterDate }}
</td>
</tr>
<tr>
<th>文化程度</th>
<td>
{{ formData.personType }}
</td>
<th>籍贯</th>
<td>
{{ formData.hometown }}
</td>
<th>职称</th>
<td>
{{ formData.jobTitle }}
</td>
<th>待遇</th>
<td>
{{ formData.treatment }}
</td>
</tr>
<tr>
<th>退休时间</th>
<td>
{{ formData.retirementTime | formatterDate }}
</td>
<th>身份证号码</th>
<td>
{{ formData.idcard }}
</td>
<th>医疗证号</th>
<td>
{{ formData.medicalCertificateNumber }}
</td>
<th>/基础病</th>
<td>
{{ formData.basicDiseaseInfo }}
</td>
</tr>
<tr>
<th>原部门</th>
<td>
{{ formData.originalDepartment }}
</td>
<th>家属姓名</th>
<td>
{{ formData.familyName }}
</td>
<th>家庭住址</th>
<td :colspan="3">
{{ formData.homeAddress }}
</td>
</tr>
<tr>
<th>联系方式</th>
<td :colspan="2">
{{ formData.mobile }}
</td>
<th>退休性质</th>
<td :colspan="1">
{{ formData.retireNature }}
</td>
</tr>
<tr>
<th>备注</th>
<td :colspan="7">
<el-input type="textarea" readonly :rows="3" v-model="formData.retireNotes" clearable></el-input>
</td>
</tr>
</table>
</border-table>
</template> </template>
<script> <script>
@@ -37,17 +123,25 @@ module.exports = {
}, },
data() { data() {
return { return {
userData: {} formData: {}
}
},
filters: {
formatterDate(val) {
if (val) {
return moment(val).format('YYYY-MM-DD')
}
return null
} }
}, },
methods: { methods: {
getInfo() { getInfo() {
if (this.id) { if (this.id) {
$.post('/platform/retiredUser/list/userInfo', {userId: this.id}).then(res => { $.post('/platform/retiredUser/list/getInfo', {id: this.id}).then(res => {
this.userData = res.data this.formData = res.data
}) })
} else { } else {
this.userData = {} this.formData = {}
} }
} }
@@ -68,4 +162,4 @@ module.exports = {
<style scoped> <style scoped>
</style> </style>
@@ -34,7 +34,7 @@ module.exports = {
props: { props: {
scan_title: { scan_title: {
type: String, type: String,
default: '请使用【手机钉钉】扫描二维码进行签字' default: '请使用【微信】扫描二维码进行签字'
}, },
prefix: { prefix: {
type: String, type: String,
@@ -81,8 +81,8 @@ module.exports = {
clearInterval(signatureInterval) clearInterval(signatureInterval)
const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString() const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString()
console.log(ts) console.log(ts)
// this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64 this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.postAddress = 'https://zhgh.hmc.edu.cn/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64 //this.postAddress = 'https://zhgh.zjitc.edu.cn/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.showQrCode = true this.showQrCode = true
@@ -34,11 +34,11 @@ layout("/layouts/platform.html"){
<el-table-column label="操作" width="220"> <el-table-column label="操作" width="220">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.applyStateId === 10010" <el-button v-if="[10010,10030].includes(row.applyStateId)"
@click="sublime.jumpPagePjax('/platform/member/change/apply?id=' + row.id)" @click="sublime.jumpPagePjax('/platform/member/change/apply?id=' + row.id)"
size="mini" type="primary">编辑</el-button> size="mini" type="primary">编辑</el-button>
<!-- <el-button v-if="row.applyStateId === 20" @click="doRevoke(row)" size="mini" type="warning">撤销</el-button>--> <!-- <el-button v-if="row.applyStateId === 20" @click="doRevoke(row)" size="mini" type="warning">撤销</el-button>-->
<el-button v-if="row.applyStateId === 10010" @click="doDelete(row)" size="mini" type="danger">删除</el-button> <el-button v-if="[10010,10030].includes(row.applyStateId)" @click="doDelete(row)" size="mini" type="danger">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -60,6 +60,11 @@ layout("/layouts/platform.html"){
background-color: rgba(0, 0, 0, 0.2); background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px; border-radius: 10px;
} }
.el-transfer-panel__list.is-filterable {
height: 300px;
padding-top: 0;
}
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<guava> <guava>
@@ -115,11 +120,12 @@ layout("/layouts/platform.html"){
@click="doSearch"></el-button> @click="doSearch"></el-button>
</div> </div>
<div class="pull-right offscreen-right"> <div class="pull-right offscreen-right"
<el-button v-if="tabActive==='groupInfo' && ${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}" type="primary" icon="el-icon-plus" v-if="${@shiro.hasRole('ltbzr') || @shiro.hasRole('sysadmin')}">
<el-button v-if="tabActive==='groupInfo'" type="primary" icon="el-icon-plus"
@click="openAddGroup">新增小组 @click="openAddGroup">新增小组
</el-button> </el-button>
<el-button v-if="tabActive==='componentUnit' && ${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}" type="primary" icon="el-icon-plus" <el-button v-if="tabActive==='componentUnit'" type="primary" icon="el-icon-plus"
@click="openAddComponentUnit">新增组成单位 @click="openAddComponentUnit">新增组成单位
</el-button> </el-button>
</div> </div>
@@ -131,9 +137,9 @@ layout("/layouts/platform.html"){
<el-table-column type="index" label="序号"></el-table-column> <el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="groupName" label="小组名称"></el-table-column> <el-table-column prop="groupName" label="小组名称"></el-table-column>
<el-table-column prop="groupCode" label="小组代码"></el-table-column> <el-table-column prop="groupCode" label="小组代码"></el-table-column>
<el-table-column label="操作" width="200px" v-if="${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}"> <el-table-column label="操作" width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button size="mini" <el-button size="mini" type="primary"
@click="groupDialogVisible=true;groupFormData={...row}"> @click="groupDialogVisible=true;groupFormData={...row}">
编辑 编辑
</el-button> </el-button>
@@ -160,7 +166,7 @@ layout("/layouts/platform.html"){
<el-table-column prop="unionname" label="所属工会" <el-table-column prop="unionname" label="所属工会"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="roleName" label="身份"></el-table-column> <el-table-column prop="roleName" label="身份"></el-table-column>
<el-table-column label="操作" width="100px" v-if="${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}"> <el-table-column label="操作" width="100px">
<template scope="{row}"> <template scope="{row}">
<el-dropdown @command="dropdownCommand"> <el-dropdown @command="dropdownCommand">
<el-button size="mini"> <el-button size="mini">
@@ -201,15 +207,15 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
</guava> </guava>
<el-dialog :visible.sync="groupDialogVisible" title="小组"> <el-dialog :visible.sync="groupDialogVisible" title="新增离退休小组" width="40%">
<el-form :model="groupFormData" label-width="120px" ref="form"> <el-form :model="groupFormData" label-width="80px" ref="form">
<el-form-item label="小组名称" prop="groupName" <el-form-item label="小组名称" prop="groupName"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="groupFormData.groupName" maxlength="20"></el-input> <el-input v-model="groupFormData.groupName" maxlength="20"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="小组代码" prop="groupCode" <el-form-item label="小组代码" prop="groupCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number v-model="groupFormData.groupCode"></el-input-number> <el-input-number v-model="groupFormData.groupCode" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@@ -219,13 +225,17 @@ layout("/layouts/platform.html"){
</el-dialog> </el-dialog>
<el-dialog :visible.sync="componentUnitDialogVisible" title="组成单位"> <el-dialog :visible.sync="componentUnitDialogVisible" title="组成单位">
<el-transfer v-model="groupComponentUnit" :data="groupComponentUnitLeft" <div style="width: 100%;">
ref="componentUnitTransfer" <el-transfer v-model="groupComponentUnit" :data="groupComponentUnitLeft"
:props="{ filterable
ref="componentUnitTransfer"
:props="{
key: 'id', key: 'id',
label: 'name' label: 'name'
}" }"
></el-transfer> :titles="['可选单位', '当前成员单位']"
></el-transfer>
</div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="componentUnitDialogVisible = false">取消</el-button> <el-button @click="componentUnitDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetComponentUnit">确定</el-button> <el-button type="primary" @click="doSetComponentUnit">确定</el-button>
@@ -476,7 +486,6 @@ layout("/layouts/platform.html"){
created() { created() {
this.getTree() this.getTree()
this.groupPageData() this.groupPageData()
console.log(${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')})
} }
}) })
</script> </script>
@@ -136,7 +136,7 @@ layout("/layouts/platform.html"){
<el-table-column prop="partyBranchCode" label="党支部代码"></el-table-column> <el-table-column prop="partyBranchCode" label="党支部代码"></el-table-column>
<el-table-column label="操作" width="200px"> <el-table-column label="操作" width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button size="mini" <el-button size="mini" type="primary"
@click="partyBranchDialogVisible=true;partyBranchFormData={...row}"> @click="partyBranchDialogVisible=true;partyBranchFormData={...row}">
编辑 编辑
</el-button> </el-button>
@@ -200,15 +200,15 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
</guava> </guava>
<el-dialog :visible.sync="partyBranchDialogVisible" title="党支部"> <el-dialog :visible.sync="partyBranchDialogVisible" title="新增离退休党支部" width="40%">
<el-form :model="partyBranchFormData" label-width="120px" ref="form"> <el-form :model="partyBranchFormData" label-width="100px" ref="form">
<el-form-item label="党支部名称" prop="partyBranchName" <el-form-item label="党支部名称" prop="partyBranchName"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="partyBranchFormData.partyBranchName" maxlength="20"></el-input> <el-input v-model="partyBranchFormData.partyBranchName" maxlength="20"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="党支部代码" prop="partyBranchCode" <el-form-item label="党支部代码" prop="partyBranchCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number v-model="partyBranchFormData.partyBranchCode"></el-input-number> <el-input-number v-model="partyBranchFormData.partyBranchCode" style="width: 100%"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@@ -217,8 +217,8 @@ layout("/layouts/platform.html"){
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="人员"> <el-dialog :visible.sync="userDialogVisible" title="新增党支部人员" width="40%">
<el-form :model="partyBranchUserFormData" label-width="120px" ref="partyBranchUserForm"> <el-form :model="partyBranchUserFormData" label-width="80px" ref="partyBranchUserForm">
<el-form-item label="人员" prop="userIds" <el-form-item label="人员" prop="userIds"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchUserFormData.userIds" <el-select v-model="partyBranchUserFormData.userIds"
@@ -244,8 +244,8 @@ layout("/layouts/platform.html"){
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="committeeDialogVisible" title="支部委员"> <el-dialog :visible.sync="committeeDialogVisible" title="新增党支部委员" width="40%">
<el-form :model="partyBranchCommitteeFormData" label-width="120px" ref="partyBranchCommitteeForm"> <el-form :model="partyBranchCommitteeFormData" label-width="80px" ref="partyBranchCommitteeForm">
<el-form-item label="人员" prop="userId" <el-form-item label="人员" prop="userId"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchCommitteeFormData.userId" <el-select v-model="partyBranchCommitteeFormData.userId"
@@ -264,7 +264,7 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
<el-form-item label="身份" prop="roleCode" <el-form-item label="身份" prop="roleCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchCommitteeFormData.roleCode"> <el-select v-model="partyBranchCommitteeFormData.roleCode" style="width: 100%;">
<el-option v-for="item in retiredPartyBranchCommitteeRoleOptions" <el-option v-for="item in retiredPartyBranchCommitteeRoleOptions"
:label="item.name" :label="item.name"
:value="item.code" :value="item.code"
@@ -10,7 +10,9 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">年度:</div> <div class="search-item-label">年度:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker v-model="pageForm.year" value-format="yyyy" format="yyyy" type="year" :clearable="false"></el-date-picker> <el-date-picker v-model="pageForm.year" value-format="yyyy"
style="width: 100%"
format="yyyy" type="year" :clearable="false"></el-date-picker>
</div> </div>
</div> </div>
@@ -193,4 +195,4 @@ layout("/layouts/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -70,7 +70,9 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this"> <table-tool label="退休人员" :app="this">
<template #func> <template #func>
<el-button size="small" type="primary" @click="openAdd">新增退休人员</el-button> <el-button size="small" type="primary" @click="openImport">导入离退休人员</el-button>
<el-button size="small" type="primary" @click="openAdd">新增退休人员(系统中不存在)</el-button>
<el-button size="small" type="primary" @click="openSet">设置退休人员(系统中存在)</el-button>
<el-button size="small" type="primary" @click="backUp">备份为历史数据</el-button> <el-button size="small" type="primary" @click="backUp">备份为历史数据</el-button>
</template> </template>
</table-tool> </table-tool>
@@ -111,15 +113,15 @@ layout("/layouts/platform.html"){
<el-dropdown-item :command="{action:openView,value:row}"> <el-dropdown-item :command="{action:openView,value:row}">
查看 查看
</el-dropdown-item> </el-dropdown-item>
<!-- <el-dropdown-item>--> <el-dropdown-item :command="{action:openEdit,value:row}">
<!-- 编辑--> 编辑
<!-- </el-dropdown-item>--> </el-dropdown-item>
<el-dropdown-item :command="{action:openChange,value:row}"> <!-- <el-dropdown-item :command="{action:openChange,value:row}">-->
变更 <!-- 变更-->
<!-- </el-dropdown-item>-->
<el-dropdown-item :command="{action:doDelete,value:row}">
删除
</el-dropdown-item> </el-dropdown-item>
<!-- <el-dropdown-item>-->
<!-- 删除-->
<!-- </el-dropdown-item>-->
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@@ -137,7 +139,11 @@ layout("/layouts/platform.html"){
<user-info :id="userId"></user-info> <user-info :id="userId"></user-info>
</template> </template>
<el-drawer title="新增退休人员" :visible.sync="retireUserAddDialogVisible" size="70%"> <template #edit>
<user-edit ref="userEdit" @finish="$refs.guava.index();pageData()"></user-edit>
</template>
<el-drawer title="设置退休人员(系统中存在)" :visible.sync="retireUserAddDialogVisible" size="70%">
<el-timeline> <el-timeline>
<el-timeline-item timestamp="" placement="top"> <el-timeline-item timestamp="" placement="top">
<el-input placeholder="请输入内容" clearable v-model="nonRetiredUserPageForm.searchKeyword" <el-input placeholder="请输入内容" clearable v-model="nonRetiredUserPageForm.searchKeyword"
@@ -185,36 +191,80 @@ layout("/layouts/platform.html"){
</span> </span>
</el-drawer> </el-drawer>
<el-dialog title="设置去世信息" :visible.sync="deadDialogVisible" width="50%"> <el-dialog
<el-form :model="deathFormData" ref="deathForm" label-width="120px"> title="导入离退休人员"
<el-form-item label="姓名"> :visible.sync="importVisible"
<el-input v-model="deathFormData.username" readonly></el-input> :close-on-click-modal="false"
</el-form-item> width="50%">
<el-form-item label="工号"> <el-timeline>
<el-input v-model="deathFormData.loginname" readonly></el-input> <el-timeline-item timestamp="下载模板" placement="top">
</el-form-item> <el-card>
<el-form-item label="单位"> <el-button size="medium" type=""
<el-input v-model="deathFormData.unitname" readonly></el-input> @click="location.href='/platform/retiredUser/list/downloadImport'"
</el-form-item> icon="el-icon-download">下载模板
<el-form-item label="去世日期" prop="deathDate" </el-button>
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" </el-card>
v-model="deathFormData.deathDate"></el-date-picker> </el-timeline-item>
</el-form-item> <el-timeline-item timestamp="上传文件" placement="top">
</el-form> <el-card>
<el-form>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList);
importResult={
errorCount:0,
successCount:0,
totalCount:0,
errorList:[]
}
}"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload"
style="width: 200px">选择文件
</el-button>
<div class="el-upload__tip" slot="tip" style="color: #F56C6C">
只能上传 xls/xlsx 文件
</div>
</el-upload>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item placement="top" timestamp="导入结果">
<el-card shadow="never">
<p>总记录数:{{errorInfoData.totalCount}}</p>
<p>成功数:<span class="text-success">{{errorInfoData.successCount}}</span></p>
<p>错误数:<span class="text-danger">{{errorInfoData.errorCount}}</span></p>
<el-link @click="exportErrors" type="primary" v-if="errorInfoData.errorCount>0">下载错误记录
</el-link>
</el-card>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="deadDialogVisible = false">取消</el-button> <el-button @click="importVisible = false" :disabled="importLoading"> </el-button>
<el-button type="primary" @click="setUserDeathInfo">确定</el-button> <el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</guava> </guava>
</div> </div>
<script src="${base!}/assets/platform/plugins/xlsx/xlsx.full.min.js"></script>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: '#app',
mixins: [initTableMixins], mixins: [initTableMixins],
components: { components: {
'user-info': httpVueLoader('/components/retiredUser/userInfo.vue'), 'user-info': httpVueLoader('/components/retiredUser/userInfo.vue?v=1.0.1'),
'user-edit': httpVueLoader('/components/retiredUser/userEdit.vue?v=1.0.1'),
}, },
data() { data() {
return { return {
@@ -233,7 +283,7 @@ layout("/layouts/platform.html"){
{prop: 'personType', label: '人员类型', sortable: true, checked: 0}, {prop: 'personType', label: '人员类型', sortable: true, checked: 0},
{prop: 'userState', label: '在职状态', sortable: true, checked: 0}, {prop: 'userState', label: '在职状态', sortable: true, checked: 0},
{prop: 'political', label: '政治面貌'}, {prop: 'political', label: '政治面貌'},
{prop: 'unionname', label: '所属工会', sortable: true}, // {prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true}, {prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true, checked: 0}, {prop: 'threeUnitName', label: '所在科室', sortable: true, checked: 0},
{prop: 'unionGroupName', label: '工会小组', sortable: true, checked: 0}, {prop: 'unionGroupName', label: '工会小组', sortable: true, checked: 0},
@@ -256,8 +306,19 @@ layout("/layouts/platform.html"){
retiredGroupOption: [], retiredGroupOption: [],
retiredPartyBranchOption: [], retiredPartyBranchOption: [],
userId: null userId: null,
importVisible: false,
importLoading: false,
importData: {
fileList: [],
},
errorInfoData: {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0,
},
} }
}, },
methods: { methods: {
@@ -277,6 +338,11 @@ layout("/layouts/platform.html"){
}, },
openAdd() { openAdd() {
this.userId = null
this.$refs.guava.edit()
this.$refs.userEdit.reset()
},
openSet() {
this.retireUserAddDialogVisible = true this.retireUserAddDialogVisible = true
this.nonRetiredUserPageForm.pageNumber = 1 this.nonRetiredUserPageForm.pageNumber = 1
this.nonRetiredUserPageData() this.nonRetiredUserPageData()
@@ -284,6 +350,12 @@ layout("/layouts/platform.html"){
this.$refs.nonRetiredUserTable.clearSelection() this.$refs.nonRetiredUserTable.clearSelection()
} }
}, },
openEdit(row) {
this.$refs.guava.edit()
this.$refs.userEdit.getInfo(row.id)
},
async nonRetiredUserPageData() { async nonRetiredUserPageData() {
const resp = await $.post(loc() + '/nonRetiredUserPageData', this.nonRetiredUserPageForm) const resp = await $.post(loc() + '/nonRetiredUserPageData', this.nonRetiredUserPageForm)
if (resp.code === 0) { if (resp.code === 0) {
@@ -351,8 +423,101 @@ layout("/layouts/platform.html"){
async openView(row) { async openView(row) {
this.userId = row.id this.userId = row.id
this.$refs.guava.view() this.$refs.guava.view()
} },
async doDelete(row) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + "/doDelete", {id: row.id})
if (resp.code == 0) {
this.$message.success(resp.msg)
this.doSearch()
} else {
this.$message.warning(resp.msg)
}
},
openImport(){
this.importData = {
fileList: [],
}
this.errorInfoData = {
totalCount: 0,
successCount: 0,
errorCount: 0,
errorList: 0,
}
this.importVisible = true;
},
doImport(){
if (this.importData.fileList.length === 0) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
data.append("isFlag", this.importData.isFlag)
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
this.importLoading = true
$.ajax({
url: loc() + "/doImport",
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
this.importLoading = false
if (data.code === 0 && data.data === null) {
this.pageData();
this.notifySuccess("导入成功")
this.importVisible = false
} else {
this.notifyWarning("导入失败")
this.errorInfoData = data.data
}
},
error: (data) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
});
},
exportErrors() {
const data = this.errorInfoData.errorList
// 创建工作簿
const workbook = XLSX.utils.book_new();
// 创建工作表
const worksheet = XLSX.utils.json_to_sheet(data);
// 将工作表添加到工作簿
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
// 将工作簿转换为二进制对象
const excelBuffer = XLSX.write(workbook, {bookType: 'xlsx', type: 'array'});
// 将二进制对象转换为Blob对象
const blob = new Blob([excelBuffer], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
// 创建下载链接并设置相关属性
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = '错误记录.xlsx';
// 模拟点击下载链接
document.body.appendChild(link);
link.click();
// 清理下载链接
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
},
}, },
async created() { async created() {
this.pageData() this.pageData()
@@ -366,4 +531,4 @@ layout("/layouts/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -427,7 +427,9 @@ layout("/layouts/platform.html"){
if (!keyWord) { if (!keyWord) {
return return
} }
$.post("/platform/staff/special/manage/queryUser", { keyWord }).then((res) => {
const con = this.formData.userId
$.post("/platform/staff/special/manage/queryUser", { keyWord:keyWord,con:con }).then((res) => {
this.users = res.data this.users = res.data
}) })
}, },
@@ -54,7 +54,7 @@ layout("/layouts/platform.html"){
placeholder="查询类型" placeholder="查询类型"
style="width: 110px;"> style="width: 110px;">
<el-option label="姓名" value="userName"></el-option> <el-option label="姓名" value="userName"></el-option>
<el-option label="号" value="loginName"></el-option> <el-option label="一卡通号" value="loginName"></el-option>
</el-select> </el-select>
<el-button slot="append" @click="doSearch">搜索</el-button> <el-button slot="append" @click="doSearch">搜索</el-button>
</el-input> </el-input>
@@ -140,7 +140,8 @@ layout("/layouts/platform.html"){
<span>选择路线:</span> <span>选择路线:</span>
<el-select v-model="pageForm.takePartInLineId" filterable clearable <el-select v-model="pageForm.takePartInLineId" filterable clearable
placeholder="请选择线路" placeholder="请选择线路"
style="width: 80%" @change="doSearch()"> style="width: 80%"
@change="lineChange(pageForm.takePartInLineId);doSearch()">
<el-option v-for="item in takePartInLines" <el-option v-for="item in takePartInLines"
:key="item.id" :key="item.id"
:label="item.lineName" :label="item.lineName"
@@ -169,6 +170,20 @@ layout("/layouts/platform.html"){
</el-option> </el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="12">
<span>出行时间:</span>
<el-select v-model="pageForm.selectId" filterable clearable
placeholder="请选择出行时间"
style="width: 80%" @change="doSearch()">
<el-option v-for="item in linePlayTimes"
:key="item.times"
:label="item.times"
:value="item.selectId">
</el-option>
</el-select>
</el-col>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
@@ -192,7 +207,7 @@ layout("/layouts/platform.html"){
v-for="item in options"> v-for="item in options">
{{ item.label }} {{ item.label }}
</el-tag> </el-tag>
<el-link :underline="false" @click="pageForm.state='';doSearch()" class="mr10" <el-link :underline="false" @click="clearState" class="mr10"
style="color: red" v-if="options.length&&pageForm.state">清空 style="color: red" v-if="options.length&&pageForm.state">清空
</el-link> </el-link>
<template <template
@@ -244,7 +259,12 @@ layout("/layouts/platform.html"){
</el-link> </el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='isFamily'"> <template scope="{row}" v-else-if="column.prop=='isFamily'">
{{row.isFamily?'携带':'未携带'}}{{row.num}} <el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
{{row.familyNumber?'携带':'未携带'}}{{row.familyNumber}}
</el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='num'"> <template scope="{row}" v-else-if="column.prop=='num'">
{{1+row.num}} {{1+row.num}}
@@ -256,9 +276,39 @@ layout("/layouts/platform.html"){
<sapn v-else style="color: #67C23A">暂无</sapn> <sapn v-else style="color: #67C23A">暂无</sapn>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300px"> <el-table-column align="center" header-align="center" label="操作" width="180px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看 <el-dropdown @command="dropdownCommand">
<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 :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<template v-if="!pageForm.regionalNature
||(pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)
||(pageForm.regionalNature==='省外'&&modifyConfig.isSwLine)">
<el-dropdown-item v-if="ifRecall(row)" :command="{type:'recall',data:row}">
撤回
</el-dropdown-item>
<el-dropdown-item v-if="ifEdit(row)" :command="{type:'handle',data:row}">
审核
</el-dropdown-item>
<template v-if="[2750].includes(row.stateId)">
<el-dropdown-item :command="{type:'modify',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
删除
</el-dropdown-item>
</template>
</template>
</el-dropdown-menu>
</el-dropdown>
<!--<el-button @click="openView(row)" size="mini" type="primary">查看
</el-button> </el-button>
<template v-if="!pageForm.regionalNature|| <template v-if="!pageForm.regionalNature||
(pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)|| (pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)||
@@ -270,8 +320,7 @@ layout("/layouts/platform.html"){
type="primary"> type="primary">
审核 审核
</el-button> </el-button>
</template> </template>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -303,17 +352,24 @@ layout("/layouts/platform.html"){
<el-input disabled v-model="formData.auditTime"></el-input> <el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-form-item label="审核意见" prop="auditOpinion"> </el-row>
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" <el-row :gutter="20">
type="textarea" <el-col :span="24">
v-model="formData.auditOpinion"></el-input> <el-form-item label="审核意见" prop="auditOpinion">
</el-form-item> <el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row style="margin: 40px 0;text-align: right"> <el-row style="margin: 40px 0;text-align: right">
<el-button @click="doAudit(false)" type="danger">退 <el-button @click="$refs.guava.index()">
</el-button> </el-button>
<el-button @click="doAudit(true)" type="primary">通过 <el-button @click="doAudit(false,true)" type="warning">调整
</el-button>
<el-button @click="doAudit(false,false)" type="danger">拒绝
</el-button>
<el-button @click="doAudit(true,false)" type="primary">通过
</el-button> </el-button>
</el-row> </el-row>
</el-form> </el-form>
@@ -330,7 +386,7 @@ layout("/layouts/platform.html"){
width="50%"> width="50%">
<el-form :model="formData" label-width="130px"> <el-form :model="formData" label-width="130px">
<el-row gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="审核人" prop="username"> <el-form-item label="审核人" prop="username">
<el-input disabled v-model="formData.username"></el-input> <el-input disabled v-model="formData.username"></el-input>
@@ -341,20 +397,150 @@ layout("/layouts/platform.html"){
<el-input disabled v-model="formData.auditTime"></el-input> <el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-form-item label="审核意见" prop="auditOpinion"> </el-row>
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="doOnekeyAudit(false)">取 消</el-button> <el-button @click="dialogVisible = false">返 回</el-button>
<el-button type="primary" @click="doOnekeyAudit(true)">确 定</el-button> <el-button @click="doOnekeyAudit(false,true)" type="warning">调 整</el-button>
</span> <el-button @click="doOnekeyAudit(false,false)" type="danger">拒 绝</el-button>
<el-button type="primary" @click="doOnekeyAudit(true,false)">通 过</el-button>
</span>
</el-dialog> </el-dialog>
<el-dialog
title="修改信息"
:visible.sync="editVisible"
:close-on-click-modal="false"
width="50%">
<el-form :model="editFormData" label-width="120px" :rules="rules" ref="editForm" style="margin-right: 40px">
<el-row>
<el-col span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="editFormData.loginName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="editFormData.userName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="userName" label="手机号">
<el-input v-model="editFormData.mobile" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="身份证号">
<el-input v-model="editFormData.idCard" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="unionName" label="工会">
<el-input v-model="editFormData.unionName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="unitName" label="单位">
<el-input v-model="editFormData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="prop" :label="labelName">
<template v-if="modifyConfig.familyInfo == 2">
<el-collapse v-model="activeNames">
<el-collapse-item title="点击可展开详细信息" name="1">
<el-card shadow="never">
<el-table :data="editFormData.companionList">
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份证号" prop="idCard" show-overflow-tooltip></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
</el-table>
</el-card>
</el-collapse-item>
</el-collapse>
</template>
<template v-else>
<el-input v-model="editFormData.bedType" readonly></el-input>
</template>
</el-form-item>
<!--<el-form-item prop="travelName" label="旅行社">
<el-select v-model="editFormData.agencyId" filterable clearable
placeholder="请选择旅行社"
style="width: 100%">
<el-option v-for="item in agencyLists"
:key="item.id"
:label="item.travelAgencyName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>-->
<el-form-item prop="travelLine" :label="lineLabelName">
<el-select v-model="editFormData.takePartInLineId" filterable clearable
placeholder="请选择线路"
@change="validateLine"
style="width: 100%">
<el-option v-for="item in unionSelectLines"
:key="item.id"
:label="item.lineName + '-' + item.regionalNature + '【' + item.lotName + '】' + '' + item.playStartTime + '至' + item.playEndTime + '' + '' + item.signUpMode + ''"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="specificTime" label="出行时间" v-if="pageForm.state==='3'">
<el-select v-model="editFormData.specificTime" filterable clearable
placeholder="请选择出行时间"
style="width: 100%">
<el-option v-for="item in editSpecificTimes"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
</div> </div>
@@ -378,8 +564,9 @@ layout("/layouts/platform.html"){
isTransferIn: false, isTransferIn: false,
}, },
options: [ options: [
{label: "总人数", value: "0"},
{label: "本工会人员(自己线路)", value: "1"}, {label: "本工会人员(自己线路)", value: "1"},
{label: "本工会人员(其他路线)", value: "2"}, // {label: "本工会人员(其他路线)", value: "2"},
{label: "其他工会人员(选我线路)", value: "3"} {label: "其他工会人员(选我线路)", value: "3"}
], ],
unionOptions: [], unionOptions: [],
@@ -394,7 +581,7 @@ layout("/layouts/platform.html"){
searchName: "userName", searchName: "userName",
}, },
tableColumns: [ tableColumns: [
{prop: 'loginName', label: '号'}, {prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'}, {prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true}, {prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true}, {prop: 'unionName', label: '工会', sortable: true},
@@ -403,20 +590,152 @@ layout("/layouts/platform.html"){
// {prop: 'userNature', label: '人员性质'}, // {prop: 'userNature', label: '人员性质'},
{prop: 'isFamily', label: '是否携带家属'}, {prop: 'isFamily', label: '是否携带家属'},
// {prop: 'num', label: '人数'}, // {prop: 'num', label: '人数'},
{prop: 'isTransferIn', label: '是否转入转出', sortable: true}, // {prop: 'isTransferIn', label: '是否转入转出', sortable: true},
{prop: 'linePlayTime', label: '出行时间', sortable: true},
{prop: 'stateId', label: '审核状态', sortable: true}, {prop: 'stateId', label: '审核状态', sortable: true},
], ],
modifyConfig: {} modifyConfig: {},
linePlayTimes: [],
editVisible: false,
editFormData: {
companionList: []
},
rules: {
loginName: [{required: true, message: '请填写工号', trigger: ['blur', 'change']}],
userName: [{required: true, message: '请填写姓名', trigger: ['blur', 'change']}],
unionName: [{required: true, message: '请选择工会', trigger: ['blur', 'change']}],
unitName: [{required: true, message: '请选择单位', trigger: ['blur', 'change']}],
// travelName: [{required: true, message: '请选择旅行社', trigger: ['blur', 'change']}],
specificTime: [{required: true, message: '请选择出行时间', trigger: ['blur', 'change']}],
// travelLine: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
editSpecificTimes: [],
labelName: '',
unionSelectLines: [],
lineLabelName: '',
activeNames:[],
} }
}, },
components: { components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue'), 'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=1.0.1'),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue') 'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
}, },
methods: { methods: {
async doOnekeyAudit(flag) { async validateLine() {
const confirm = await this.$confirm('您确定要一键审核您所勾选的信息吗, 是否继续?', '提示', { const resp = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo'
, {enroll: JSON.stringify(this.editFormData)})
if (resp.code !== 0) {
this.$message.warning(resp.msg)
this.editFormData.takePartInLineId = ''
}
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data)
} else if (type === 'recall') {
this.doRecall(data)
} else if (type === 'handle') {
this.openEdit(data)
} else if (type === 'modify') {
this.openModify(data)
} else if (type === 'delete') {
this.doDelete(data)
}
},
async doDelete(row) {
this.$confirm("您确定要删除【<span style='color: red'>" + row.userName + "</span>】的此条报名信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + row.id)
if (resp.code === 0) {
await this.doSearch()
this.$message.success('删除成功')
await this.getApplyNumAudit();
} else {
this.$message.warning(resp.msg)
}
}
}
})
},
async openModify(row) {
this.getUnionSelectLine(row.takePartInLineId)
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
this.editFormData = {...resp.data.viewData}
if (this.modifyConfig.familyInfo == 2) {
this.editFormData.companionList = resp.data.viewData.companionList
this.labelName = "家属信息"
} else {
this.editFormData.bedType = resp.data.viewData.familyNumber
this.labelName = "家属数量"
}
}
if (row.takePartInBaseManagementId) {
this.editSpecificTime(row.takePartInBaseManagementId);
this.lineLabelName = "酒店"
} else if (row.takePartInLineId) {
this.lineLabelName = '线路'
}
this.editVisible = true
},
async doEdit() {
this.$refs['editForm'].validate().then(async () => {
const confirm = await this.$confirm('您确定要修改这位老师的报名信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
if (!this.editFormData.takePartInLineId && !this.editFormData.takePartInBaseManagementId) {
this.$message.warning('请选择线路')
return
}
const resp = await $.post('/platform/theRapyRecuperation/user/query/doEdit', this.editFormData)
if (resp.code === 0) {
this.$notify.success(resp.msg)
this.editVisible = false
await this.doSearch();
} else {
this.$notify.error(resp.msg)
}
}
})
},
async lineChange(val) {
this.pageForm.selectId = '';
const data = this.takePartInLines.find(v => v.id === val)
if (!data) {
return
}
const resp = await $.get('/platform/theRapyRecuperation/TheRapyXghAudit/getLinePlayTimeByLineId', {
lineId: data.id,
year: this.pageForm.year,
signUpMode: 1,
})
if (resp.code === 0) {
this.linePlayTimes = resp.data
}
},
async doOnekeyAudit(flag, adjustment) {
let msg = '';
if (adjustment && !flag) {
msg = '您确定要一键【调整】您所勾选的报名信息吗,调整后该报名信息将不会在审核列表中展示, 是否继续?'
} else if (!adjustment && !flag) {
msg = '您确定要一键【拒绝】您所勾选的报名信息吗,是否继续?'
} else if (!adjustment && flag) {
msg = '您确定要一键【通过】您所勾选的报名信息吗,是否继续?'
}
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -425,13 +744,14 @@ layout("/layouts/platform.html"){
const resp = await $.post(loc() + "/doOnekeyAudit", { const resp = await $.post(loc() + "/doOnekeyAudit", {
ids: JSON.stringify(this.tableSelection), ids: JSON.stringify(this.tableSelection),
flag: flag, flag: flag,
adjustment: adjustment,
auditOpinion: this.formData.auditOpinion auditOpinion: this.formData.auditOpinion
}) })
if (resp.data===0){ if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg}); this.$notify.success({title: '成功', message: resp.msg});
await this.doSearch() await this.doSearch()
this.dialogVisible = false this.dialogVisible = false
}else { } else {
this.$notify.warning({title: '失败', message: resp.msg}); this.$notify.warning({title: '失败', message: resp.msg});
this.dialogVisible = false this.dialogVisible = false
} }
@@ -468,7 +788,8 @@ layout("/layouts/platform.html"){
selfUnionId, selfUnionId,
takePartInUnionId takePartInUnionId
} = row } = row
if ((stateId === 2715 || stateId === 2720 || stateId === 2750) && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") { // if ((stateId === 2715 || stateId === 2720 || stateId === 2750) && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
if ((stateId === 2715 || stateId === 2750) && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true return true
} else if ((stateId === 2725 || stateId === 2750) && takePartInUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") { } else if ((stateId === 2725 || stateId === 2750) && takePartInUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true return true
@@ -484,16 +805,24 @@ layout("/layouts/platform.html"){
}) })
if (confirm === "confirm") { if (confirm === "confirm") {
const resp = await $.post(loc() + "/doRecall", {id: row.id}) const resp = await $.post(loc() + "/doRecall", {id: row.id})
if (resp.code === 0){ if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg}); this.$notify.success({title: '成功', message: resp.msg});
await this.doSearch() await this.doSearch()
}else { } else {
this.$notify.warning({title: '失败', message: resp.msg}); this.$notify.warning({title: '失败', message: resp.msg});
} }
} }
}, },
async doAudit(flag) { async doAudit(flag, adjustment) {
const confirm = await this.$confirm('您确定要' + (flag ? '通过' : '退回') + '吗, 是否继续?', '提示', { let msg = '';
if (adjustment && !flag) {
msg = '您确定要【调整】该报名信息吗,调整后该报名信息将不会在审核列表中展示, 是否继续?'
} else if (!adjustment && !flag) {
msg = '您确定要【拒绝】该报名信息吗,是否继续?'
} else if (!adjustment && flag) {
msg = '您确定要【通过】该报名信息吗,是否继续?'
}
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -501,15 +830,16 @@ layout("/layouts/platform.html"){
if (confirm === "confirm") { if (confirm === "confirm") {
const resp = await $.post(loc() + "/doAudit", { const resp = await $.post(loc() + "/doAudit", {
flag: flag, flag: flag,
adjustment: adjustment,
id: this.formData.id, id: this.formData.id,
isTransferIn: this.formData.isTransferIn, isTransferIn: this.formData.isTransferIn,
auditOpinion: this.formData.auditOpinion auditOpinion: this.formData.auditOpinion
}) })
if (resp.code === 0){ if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg}); this.$notify.success({title: '成功', message: resp.msg});
this.doSearch() this.doSearch()
this.$refs.guava.index() this.$refs.guava.index()
}else { } else {
this.$notify.warning({title: '失败', message: resp.msg}); this.$notify.warning({title: '失败', message: resp.msg});
} }
} }
@@ -568,7 +898,7 @@ layout("/layouts/platform.html"){
this.unionOptions = data this.unionOptions = data
}, },
async getXlByUnion() { async getXlByUnion() {
const {data} = await $.post(loc() + "/getXlByUnion", { const {data} = await $.post(loc() + "/getXlByUnionAudit", {
unionId: this.pageForm.unionId, unionId: this.pageForm.unionId,
year: this.pageForm.year, year: this.pageForm.year,
regionalNature: this.pageForm.regionalNature, regionalNature: this.pageForm.regionalNature,
@@ -597,12 +927,18 @@ layout("/layouts/platform.html"){
async getApplyNumAudit() { async getApplyNumAudit() {
const {data} = await $.post(loc() + "/getApplyNumAudit", this.pageForm) const {data} = await $.post(loc() + "/getApplyNumAudit", this.pageForm)
this.options = [ this.options = [
{label: "总人数" + (data.count1 + data.count3) + "人", value: "0"},
{label: "本工会人员(自己线路)" + data.count1 + "人", value: "1"}, {label: "本工会人员(自己线路)" + data.count1 + "人", value: "1"},
{label: "本工会人员(其他路线)" + data.count2 + "人", value: "2"}, // {label: "本工会人员(其他路线)" + data.count2 + "人", value: "2"},
{label: "其他工会人员(选我线路)" + data.count3 + "人", value: "3"} {label: "其他工会人员(选我线路)" + data.count3 + "人", value: "3"}
] ]
}, },
async clearState() {
this.pageForm.state = ''
this.pageForm.unionId = ''
await this.doSearch()
},
async doSearch() { async doSearch() {
this.pageForm.pageNumber = 1; this.pageForm.pageNumber = 1;
this.pageData(); this.pageData();
@@ -615,12 +951,23 @@ layout("/layouts/platform.html"){
this.modifyConfig = res.data this.modifyConfig = res.data
} }
}, },
async getUnionSelectLine(disPlayUnionSelectId = null) {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
startYear: this.pageForm.year,
signUpMode: 1,
disPlayUnionSelectId: disPlayUnionSelectId
})
if (resp.code === 0) {
this.unionSelectLines = resp.data
}
},
}, },
async created() { async created() {
await this.getBmUserUnion() await this.getBmUserUnion()
await this.getModifyConfig() await this.getModifyConfig()
this.takePartInLines = await this.getXlByUnion() this.takePartInLines = await this.getXlByUnion()
await this.doSearch() await this.doSearch()
await this.getUnionSelectLine()
} }
}) })
</script> </script>
@@ -0,0 +1,806 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style xmlns="">
.query-row {
height: 70px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.query-row .el-col {
overflow: hidden;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row-title {
width: 120px;
}
.el-table-container {
padding-top: 0;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>&emsp;&emsp;度:</span>
<el-date-picker
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 80%" @change="doSearch">
</el-date-picker>
</el-col>
<el-col :span="12">
<span>查询类型:</span>
<el-input placeholder="请输入内容" clearable
v-model="pageForm.searchKeyword"
style="width: 80%" @keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 110px;">
<el-option label="姓名" value="userName"></el-option>
<el-option label="一卡通号" value="loginName"></el-option>
</el-select>
<el-button slot="append" @click="doSearch">搜索</el-button>
</el-input>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>所属工会:</span>
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会"
@change="unionChange"
filterable clearable style="width: 80%"
:disabled="unionDisabled">
<el-option
v-for="item in unionOptions"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<span>所属单位:</span>
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位"
@change="doSearch"
filterable clearable style="width: 80%"
:disabled="unitDisabled">
<el-option
v-for="item in unitOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>&ensp;&ensp;社:</span>
<el-select v-model="pageForm.agencyId" filterable clearable
placeholder="请选择旅行社"
style="width: 80%">
<el-option v-for="item in agencyLists"
:key="item.id"
:label="item.travelAgencyName"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="审核列表" :app="this">
<template #label_end>
</template>
<template #func>
<el-tag :effect="pageForm.state===item.value?'dark':'plain'"
:key="item.value"
:type="item.label"
@click="checkState(item.value)"
style="margin-right: 10px;cursor: pointer;font-size: 15px"
v-for="item in options">
{{ item.label }}
</el-tag>
<el-link :underline="false" @click="clearState" class="mr10"
style="color: red" v-if="options.length&&pageForm.state">清空
</el-link>
<template v-if="modifyConfig.travelAudit">
<el-button type="primary" size="small" class="mr10"
@click="openOnekeyAudit">一键审核
</el-button>
<el-radio-group @change="doSearch()" size="small"
v-model="pageForm.isAudit">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
</template>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%"
row-key="id" @sort-change="pageOrder"
v-loading="tableLoading"
@selection-change="handleSelectionChange">
<el-table-column
:selectable="ifEdit"
type="selection"
width="55">
</el-table-column>
<el-table-column align="center" header-align="center" type="index"
:index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop=='isTransferIn'">
<sapn v-if="row.takePartInUnionId!=unionId">转出</sapn>
<sapn v-else-if="row.selfUnionId!=unionId">转入</sapn>
<sapn v-else></sapn>
</template>
<template scope="{row}" v-else-if="column.prop=='isFamily'">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
{{row.familyNumber?'携带':'未携带'}}{{row.familyNumber}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='num'">
{{1+row.num}}
</template>
<template scope="{row}" v-else-if="column.prop=='stateId'">
<span v-if="row.stateId">
<vi-table-state :state="row"></vi-table-state>
</span>
<sapn v-else style="color: #67C23A">暂无</sapn>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="180px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<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 :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<template v-if="modifyConfig.travelAudit">
<el-dropdown-item v-if="ifRecall(row)" :command="{type:'recall',data:row}">
撤回
</el-dropdown-item>
<el-dropdown-item v-if="ifEdit(row)" :command="{type:'handle',data:row}">
审核
</el-dropdown-item>
<template v-if="[2750].includes(row.stateId)">
<el-dropdown-item :command="{type:'modify',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
删除
</el-dropdown-item>
</template>
</template>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<enroll-info ref="viewEnrollInfo" :union_id="unionId"></enroll-info>
</template>
<template #public>
<line-info ref="viewLineInfo"></line-info>
</template>
<template #edit>
<enroll-info ref="editEnrollInfo">
<template #handle>
<el-tab-pane label="审核" name="audit">
<el-form :model="formData" label-width="130px">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input disabled v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin: 40px 0;text-align: right">
<el-button @click="$refs.guava.index()">返回
</el-button>
<el-button @click="doAudit(false,true)" type="warning">调整
</el-button>
<el-button @click="doAudit(false,false)" type="danger">拒绝
</el-button>
<el-button @click="doAudit(true,false)" type="primary">通过
</el-button>
</el-row>
</el-form>
</el-tab-pane>
</template>
</enroll-info>
</template>
</guava>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="50%">
<el-form :model="formData" label-width="130px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input disabled v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">返 回</el-button>
<el-button @click="doOnekeyAudit(false,true)" type="warning">调 整</el-button>
<el-button @click="doOnekeyAudit(false,false)" type="danger">拒 绝</el-button>
<el-button type="primary" @click="doOnekeyAudit(true,false)">通 过</el-button>
</span>
</el-dialog>
<el-dialog
title="修改信息"
:visible.sync="editVisible"
:close-on-click-modal="false"
width="50%">
<el-form :model="editFormData" label-width="120px" :rules="rules" ref="editForm" style="margin-right: 40px">
<el-row>
<el-col span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="editFormData.loginName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="editFormData.userName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="userName" label="手机号">
<el-input v-model="editFormData.mobile" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="身份证号">
<el-input v-model="editFormData.idCard" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="unionName" label="工会">
<el-input v-model="editFormData.unionName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="unitName" label="单位">
<el-input v-model="editFormData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="prop" :label="labelName">
<template v-if="modifyConfig.familyInfo == 2">
<el-collapse v-model="activeNames">
<el-collapse-item title="点击可展开详细信息" name="1">
<el-card shadow="never">
<el-table :data="editFormData.companionList">
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份证号" prop="idCard" show-overflow-tooltip></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo.otherSleepUser ?
row.bedInfo.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
</el-table>
</el-card>
</el-collapse-item>
</el-collapse>
</template>
<template v-else>
<el-input v-model="editFormData.bedType" readonly></el-input>
</template>
</el-form-item>
<el-form-item prop="travelName" label="旅行社">
<el-select v-model="editFormData.agencyId" filterable clearable
placeholder="请选择旅行社"
style="width: 100%">
<el-option v-for="item in agencyLists"
:key="item.id"
:label="item.travelAgencyName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unionDisabled: false,
unitDisabled: false,
unionId: "${@shiro.getPrincipalProperty('unit').getUnionid()}",
dialogVisible: false,
tableSelection: [],
formData: {
id: "",
username: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD HH:mm:ss'),
auditOpinion: "",
isTransferIn: false,
},
options: [
{label: "总人数", value: "0"},
],
unionOptions: [],
unitOptions: [],
takePartInLines: [],
pageForm: {
lotId: '',
regionalNature: '',
isAudit: "",
state: "",
year: moment().format('YYYY'),
searchName: "userName",
},
tableColumns: [
{prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true},
{prop: 'travelAgencyName', label: '旅行社', sortable: true},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'stateId', label: '审核状态', sortable: true},
],
modifyConfig: {},
editVisible: false,
editFormData: {
companionList: []
},
rules: {
loginName: [{required: true, message: '请填写工号', trigger: ['blur', 'change']}],
userName: [{required: true, message: '请填写姓名', trigger: ['blur', 'change']}],
unionName: [{required: true, message: '请选择工会', trigger: ['blur', 'change']}],
unitName: [{required: true, message: '请选择单位', trigger: ['blur', 'change']}],
travelName: [{required: true, message: '请选择旅行社', trigger: ['blur', 'change']}],
specificTime: [{required: true, message: '请选择出行时间', trigger: ['blur', 'change']}],
},
editSpecificTimes: [],
labelName: '',
unionSelectLines: [],
lineLabelName: '',
activeNames:[],
agencyLists: [],
}
},
components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=1.0.1'),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
},
methods: {
async getAgencyList() {
const {data} = await $.post("/platform/theRapyRecuperation/travelAgency/selectTravelAgencyByYears", {
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear
})
this.agencyLists = data
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data)
} else if (type === 'recall') {
this.doRecall(data)
} else if (type === 'handle') {
this.openEdit(data)
} else if (type === 'modify') {
this.openModify(data)
} else if (type === 'delete') {
this.doDelete(data)
}
},
async doDelete(row) {
this.$confirm("您确定要删除【<span style='color: red'>" + row.userName + "</span>】的此条报名信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + row.id)
if (resp.code === 0) {
await this.doSearch()
this.$message.success('删除成功')
await this.getApplyNumAudit();
} else {
this.$message.warning(resp.msg)
}
}
}
})
},
async openModify(row) {
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
this.editFormData = {...resp.data.viewData}
if (this.modifyConfig.familyInfo == 2) {
this.editFormData.companionList = resp.data.viewData.companionList
this.labelName = "家属信息"
} else {
this.editFormData.bedType = resp.data.viewData.familyNumber
this.labelName = "家属数量"
}
}
if (row.takePartInBaseManagementId) {
this.editSpecificTime(row.takePartInBaseManagementId);
this.lineLabelName = "酒店"
} else if (row.takePartInLineId) {
this.lineLabelName = '线路'
}
this.editVisible = true
},
async doEdit() {
this.$refs['editForm'].validate().then(async () => {
const confirm = await this.$confirm('您确定要修改这位老师的报名信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
if (!this.editFormData.takePartInLineId && !this.editFormData.takePartInBaseManagementId) {
this.$message.warning('请选择线路')
return
}
const resp = await $.post('/platform/theRapyRecuperation/user/query/doEdit', this.editFormData)
if (resp.code === 0) {
this.$notify.success(resp.msg)
this.editVisible = false
await this.doSearch();
} else {
this.$notify.error(resp.msg)
}
}
})
},
async doOnekeyAudit(flag, adjustment) {
let msg = '';
if (adjustment && !flag) {
msg = '您确定要一键【调整】您所勾选的报名信息吗,调整后该报名信息将不会在审核列表中展示, 是否继续?'
} else if (!adjustment && !flag) {
msg = '您确定要一键【拒绝】您所勾选的报名信息吗,是否继续?'
} else if (!adjustment && flag) {
msg = '您确定要一键【通过】您所勾选的报名信息吗,是否继续?'
}
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + "/doOnekeyAudit", {
ids: JSON.stringify(this.tableSelection),
flag: flag,
adjustment: adjustment,
auditOpinion: this.formData.auditOpinion
})
if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg});
await this.doSearch()
this.dialogVisible = false
} else {
this.$notify.warning({title: '失败', message: resp.msg});
this.dialogVisible = false
}
}
},
async openOnekeyAudit() {
if (this.tableSelection.length === 0) {
this.$notify.warning({title: '警告', message: "请您先在左侧勾选在审核"});
return
}
this.dialogVisible = true
},
handleSelectionChange(val) {
this.tableSelection = val.map(v => v.id);
},
ifEdit(row) {
const {
stateId,
selfUnionId,
takePartInUnionId
} = row
if (stateId === 2710 && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else if (stateId === 2720 && takePartInUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else {
return false
}
},
ifRecall(row) {
const {
stateId,
selfUnionId,
takePartInUnionId
} = row
// if ((stateId === 2715 || stateId === 2720 || stateId === 2750) && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
if ((stateId === 2715 || stateId === 2750) && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else if ((stateId === 2725 || stateId === 2750) && takePartInUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else {
return false
}
},
async doRecall(row) {
const confirm = await this.$confirm('您确定要撤回吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + "/doRecall", {id: row.id})
if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg});
await this.doSearch()
} else {
this.$notify.warning({title: '失败', message: resp.msg});
}
}
},
async doAudit(flag, adjustment) {
let msg = '';
if (adjustment && !flag) {
msg = '您确定要【调整】该报名信息吗,调整后该报名信息将不会在审核列表中展示, 是否继续?'
} else if (!adjustment && !flag) {
msg = '您确定要【拒绝】该报名信息吗,是否继续?'
} else if (!adjustment && flag) {
msg = '您确定要【通过】该报名信息吗,是否继续?'
}
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + "/doAudit", {
flag: flag,
adjustment: adjustment,
id: this.formData.id,
isTransferIn: this.formData.isTransferIn,
auditOpinion: this.formData.auditOpinion
})
if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg});
this.doSearch()
this.$refs.guava.index()
} else {
this.$notify.warning({title: '失败', message: resp.msg});
}
}
},
openEdit(row) {
this.$set(this.formData, "isTransferIn", row.isTransferIn)
this.$set(this.formData, "id", row.id)
this.$refs.guava.edit()
this.$refs.editEnrollInfo.openAudit(row.id, 'audit')
},
openView(row) {
this.$refs.guava.view()
this.$refs.viewEnrollInfo.openView(row.id)
},
async checkState(type) {
this.pageForm.state = type
this.$set(this.pageForm, "unionIds", [])
this.$set(this.pageForm, "unionId", null)
await this.getBmUserUnion()
if (type === "1") {
this.$set(this.pageForm, "unionId", this.unionId)
this.unionDisabled = true
} else if (type === "2") {
this.unionDisabled = true
this.unitDisabled = true
} else if (type === "3") {
this.unionDisabled = false
this.unitDisabled = false
this.unionOptions = this.unionOptions.filter(v => v.id !== this.unionId)
} else {
this.unionDisabled = false
this.unitDisabled = false
}
await this.unionChange()
await this.doSearch()
},
async unionChange() {
this.pageForm.unitId = null
this.unitOptions = await getUnits(this.pageForm.unionId)
await this.doSearch()
},
/**
* 查询所有报名人员的工会
* @returns {Promise<void>}
*/
async getBmUserUnion() {
const {data} = await $.post(loc() + "/getBmUserUnion")
this.unionOptions = data
},
pageData() {
sublime.showLoadingbar();
this.tableLoading = true
const pageForm = clone(this.pageForm)
pageForm.states = JSON.stringify(pageForm.states)
$.post(loc() + "/pageData", pageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code === 0) {
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
}, "json");
},
async getApplyNumAudit() {
const {data} = await $.post(loc() + "/getApplyNumAudit", this.pageForm)
this.options = [
{label: "总人数" + (data.count1) + "人", value: "0"},
]
},
async clearState() {
this.pageForm.state = ''
this.pageForm.unionId = ''
await this.doSearch()
},
async doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
await this.getApplyNumAudit()
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
},
async created() {
await this.getBmUserUnion()
await this.getAgencyList()
await this.getModifyConfig()
await this.doSearch()
}
})
</script>
<!--#
}
#-->
@@ -42,7 +42,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
value-format="yyyy" value-format="yyyy"
placeholder="选择年" placeholder="选择年"
style="width: 80%" @change="doSearch"> style="width: 80%" @change="getLineSignNumber(); doSearch()">
</el-date-picker> </el-date-picker>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -54,7 +54,7 @@ layout("/layouts/platform.html"){
placeholder="查询类型" placeholder="查询类型"
style="width: 110px;"> style="width: 110px;">
<el-option label="姓名" value="userName"></el-option> <el-option label="姓名" value="userName"></el-option>
<el-option label="号" value="loginName"></el-option> <el-option label="一卡通号" value="loginName"></el-option>
</el-select> </el-select>
<el-button slot="append" @click="doSearch">搜索</el-button> <el-button slot="append" @click="doSearch">搜索</el-button>
</el-input> </el-input>
@@ -63,24 +63,24 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row align="middle" class="query-row" type="flex">--> <!-- <el-row align="middle" class="query-row" type="flex">-->
<!-- <el-col class="query-row-title"></el-col>--> <!-- <el-col class="query-row-title"></el-col>-->
<!-- <el-col class="query-row-content">--> <!-- <el-col class="query-row-content">-->
<!-- <span>报名路线:</span>--> <!-- <span>报名路线:</span>-->
<!-- <el-tag :effect="pageForm.state===item.value?'dark':'plain'"--> <!-- <el-tag :effect="pageForm.state===item.value?'dark':'plain'"-->
<!-- :key="item.value"--> <!-- :key="item.value"-->
<!-- :type="item.label"--> <!-- :type="item.label"-->
<!-- @click="checkState(item.value)"--> <!-- @click="checkState(item.value)"-->
<!-- style="margin-right: 10px;cursor: pointer;margin-bottom: 5px;font-size: 15px"--> <!-- style="margin-right: 10px;cursor: pointer;margin-bottom: 5px;font-size: 15px"-->
<!-- v-for="item in options">--> <!-- v-for="item in options">-->
<!-- {{ item.label }}--> <!-- {{ item.label }}-->
<!-- </el-tag>--> <!-- </el-tag>-->
<!-- <el-link :underline="false" @click="pageForm.state='';doSearch()"--> <!-- <el-link :underline="false" @click="pageForm.state='';doSearch()"-->
<!-- style="color: red" v-if="options.length&&pageForm.state">清空--> <!-- style="color: red" v-if="options.length&&pageForm.state">清空-->
<!-- </el-link>--> <!-- </el-link>-->
<!-- <span style="color: red;font-size: 12px;margin-left: 10px">温馨提示:其他工会选我线路,所在工会审核过后,才显示数量</span>--> <!-- <span style="color: red;font-size: 12px;margin-left: 10px">温馨提示:其他工会选我线路,所在工会审核过后,才显示数量</span>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- </el-row>--> <!-- </el-row>-->
<el-row align="middle" class="query-row" type="flex"> <el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col> <el-col class="query-row-title"></el-col>
@@ -140,7 +140,7 @@ layout("/layouts/platform.html"){
<span>选择路线:</span> <span>选择路线:</span>
<el-select v-model="pageForm.takePartInLineId" filterable clearable <el-select v-model="pageForm.takePartInLineId" filterable clearable
placeholder="请选择线路" placeholder="请选择线路"
style="width: 80%" @change="doSearch()"> style="width: 80%" @change="lineChange">
<el-option v-for="item in takePartInLines" <el-option v-for="item in takePartInLines"
:key="item.id" :key="item.id"
:label="item.lineName" :label="item.lineName"
@@ -169,6 +169,20 @@ layout("/layouts/platform.html"){
</el-option> </el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="12">
<span>出行时间:</span>
<el-select v-model="pageForm.selectId" filterable clearable
placeholder="请选择出行时间"
style="width: 80%" @change="playChange">
<el-option v-for="item in linePlayTimes"
:key="item.times"
:label="item.times"
:value="item.selectId">
</el-option>
</el-select>
</el-col>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
@@ -179,13 +193,23 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool label="审核列表" :app="this"> <table-tool label="审核列表" :app="this">
<template #label_end> <template #label_end>
<!-- <span style="color: red;margin-left: 10px">温馨提示:省内线路不需要审核</span>-->
</template> </template>
<template #func <template #func
v-if="!pageForm.regionalNature|| v-if="!pageForm.regionalNature||
(pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)|| (pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)||
(pageForm.regionalNature==='省外'&&modifyConfig.isSwLine)"> (pageForm.regionalNature==='省外'&&modifyConfig.isSwLine)">
<el-button size="small"
style="background-color: #fff;border-color: #b3d8ff;color: #1867b0;font-size: 15px"
>{{selectLine.lineName?selectLine.lineName:'全部'}}线路的人数:{{lineSignNumber}}人
</el-button>
<!-- <span v-if="pageForm.takePartInLineId" style="margin-left: 10px">-->
<!-- {{selectLine.lineName}}线路的报名人数:{{lineSignNumber}}-->
<!-- </span>-->
<el-button type="primary" size="small" class="mr10" <el-button type="primary" size="small" class="mr10"
@click="openOnekeyAudit">一键审核 @click="openOnekeyAudit">一键审核
</el-button> </el-button>
@@ -229,7 +253,12 @@ layout("/layouts/platform.html"){
</el-link> </el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='isFamily'"> <template scope="{row}" v-else-if="column.prop=='isFamily'">
{{row.isFamily?'携带':'未携带'}}{{row.num}} <el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
{{row.familyNumber?'携带':'未携带'}}{{row.familyNumber}}
</el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='num'"> <template scope="{row}" v-else-if="column.prop=='num'">
{{1+row.num}} {{1+row.num}}
@@ -241,9 +270,40 @@ layout("/layouts/platform.html"){
<sapn v-else style="color: #67C23A">暂无</sapn> <sapn v-else style="color: #67C23A">暂无</sapn>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300px"> <el-table-column align="center" header-align="center" label="操作" width="180px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看 <el-dropdown @command="dropdownCommand">
<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 :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<template v-if="!pageForm.regionalNature
||(pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)
||(pageForm.regionalNature==='省外'&&modifyConfig.isSwLine)">
<el-dropdown-item v-if="ifRecall(row)" :command="{type:'recall',data:row}">
撤回
</el-dropdown-item>
<el-dropdown-item v-if="ifEdit(row)" :command="{type:'handle',data:row}">
审核
</el-dropdown-item>
<template v-if="[2750].includes(row.stateId)">
<el-dropdown-item :command="{type:'modify',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
删除
</el-dropdown-item>
</template>
</template>
</el-dropdown-menu>
</el-dropdown>
<!--<el-button @click="openView(row)" size="mini" type="primary">查看
</el-button> </el-button>
<template v-if="!pageForm.regionalNature|| <template v-if="!pageForm.regionalNature||
(pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)|| (pageForm.regionalNature==='省内'&&modifyConfig.isSnLine)||
@@ -255,7 +315,7 @@ layout("/layouts/platform.html"){
type="primary"> type="primary">
审核 审核
</el-button> </el-button>
</template> </template>-->
</template> </template>
</el-table-column> </el-table-column>
@@ -288,17 +348,24 @@ layout("/layouts/platform.html"){
<el-input disabled v-model="formData.auditTime"></el-input> <el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-form-item label="审核意见" prop="auditOpinion"> </el-row>
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" <el-row gutter="20">
type="textarea" <el-col :span="24">
v-model="formData.auditOpinion"></el-input> <el-form-item label="审核意见" prop="auditOpinion">
</el-form-item> <el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row style="margin: 40px 0;text-align: right"> <el-row style="margin: 40px 0;text-align: right">
<el-button @click="doAudit(false)" type="danger">退 <el-button @click="$refs.guava.index()">
</el-button> </el-button>
<el-button @click="doAudit(true)" type="primary">通过 <!--<el-button @click="doAudit(false,true)" type="warning">调整
</el-button>-->
<el-button @click="doAudit(false,false)" type="danger">拒绝
</el-button>
<el-button @click="doAudit(true,false)" type="primary">通过
</el-button> </el-button>
</el-row> </el-row>
</el-form> </el-form>
@@ -308,7 +375,6 @@ layout("/layouts/platform.html"){
</template> </template>
</guava> </guava>
<el-dialog <el-dialog
title="提示" title="提示"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
@@ -326,20 +392,148 @@ layout("/layouts/platform.html"){
<el-input disabled v-model="formData.auditTime"></el-input> <el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-form-item label="审核意见" prop="auditOpinion"> </el-row>
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
<el-row gutter="20">
<el-col :span="24">
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="doOnekeyAudit(false)">取 消</el-button> <el-button @click="dialogVisible = false">返 回</el-button>
<el-button type="primary" @click="doOnekeyAudit(true)">确 定</el-button> <el-button @click="doOnekeyAudit(false,true)" type="warning">调 整</el-button>
</span> <el-button @click="doOnekeyAudit(false,false)" type="danger">拒 绝</el-button>
<el-button type="primary" @click="doOnekeyAudit(true,false)">通 过</el-button>
</span>
</el-dialog> </el-dialog>
<el-dialog
title="修改信息"
:visible.sync="editVisible"
:close-on-click-modal="false"
width="50%">
<el-form :model="editFormData" label-width="120px" :rules="rules" ref="editForm" style="margin-right: 40px">
<el-row>
<el-col span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="editFormData.loginName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="editFormData.userName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="userName" label="手机号">
<el-input v-model="editFormData.mobile" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="身份证号">
<el-input v-model="editFormData.idCard" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="unionName" label="工会">
<el-input v-model="editFormData.unionName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="unitName" label="单位">
<el-input v-model="editFormData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="prop" :label="labelName">
<template v-if="modifyConfig.familyInfo == 2">
<el-collapse v-model="activeNames">
<el-collapse-item title="点击可展开详细信息" name="1">
<el-card shadow="never">
<el-table :data="editFormData.companionList">
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份证号" prop="idCard" show-overflow-tooltip></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
</el-table>
</el-card>
</el-collapse-item>
</el-collapse>
</template>
<template v-else>
<el-input v-model="editFormData.bedType" readonly></el-input>
</template>
</el-form-item>
<!--<el-form-item prop="travelName" label="旅行社">
<el-select v-model="editFormData.agencyId" filterable clearable
placeholder="请选择旅行社"
style="width: 100%">
<el-option v-for="item in agencyLists"
:key="item.id"
:label="item.travelAgencyName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>-->
<el-form-item prop="travelLine" :label="lineLabelName">
<el-select v-model="editFormData.takePartInLineId" filterable clearable
placeholder="请选择线路"
@change="validateLine"
style="width: 100%">
<el-option v-for="item in unionSelectLines"
:key="item.id"
:label="item.lineName + '-' + item.regionalNature + '【' + item.lotName + '】' + '' + item.playStartTime + '至' + item.playEndTime + '' + '' + item.signUpMode + ''"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="specificTime" label="出行时间" v-if="pageForm.state==='3'">
<el-select v-model="editFormData.specificTime" filterable clearable
placeholder="请选择出行时间"
style="width: 100%">
<el-option v-for="item in editSpecificTimes"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
</div> </div>
@@ -379,7 +573,7 @@ layout("/layouts/platform.html"){
searchName: "userName", searchName: "userName",
}, },
tableColumns: [ tableColumns: [
{prop: 'loginName', label: '号'}, {prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'}, {prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true}, {prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true}, {prop: 'unionName', label: '工会', sortable: true},
@@ -388,10 +582,35 @@ layout("/layouts/platform.html"){
// {prop: 'userNature', label: '人员性质'}, // {prop: 'userNature', label: '人员性质'},
{prop: 'isFamily', label: '是否携带家属'}, {prop: 'isFamily', label: '是否携带家属'},
// {prop: 'num', label: '人数'}, // {prop: 'num', label: '人数'},
{prop: 'isTransferIn', label: '是否转入转出', sortable: true}, // {prop: 'isTransferIn', label: '是否转入转出', sortable: true},
{prop: 'linePlayTime', label: '出行时间', sortable: true},
{prop: 'stateId', label: '审核状态', sortable: true}, {prop: 'stateId', label: '审核状态', sortable: true},
], ],
modifyConfig: {} modifyConfig: {},
selectLine: {
lineName: '全部'
},
lineSignNumber: 0,
times: null,
linePlayTimes: [],
editVisible: false,
editFormData: {},
rules: {
loginName: [{required: true, message: '请填写工号', trigger: ['blur', 'change']}],
userName: [{required: true, message: '请填写姓名', trigger: ['blur', 'change']}],
unionName: [{required: true, message: '请选择工会', trigger: ['blur', 'change']}],
unitName: [{required: true, message: '请选择单位', trigger: ['blur', 'change']}],
// travelName: [{required: true, message: '请选择旅行社', trigger: ['blur', 'change']}],
specificTime: [{required: true, message: '请选择出行时间', trigger: ['blur', 'change']}],
// travelLine: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
editSpecificTimes: [],
labelName: '',
unionSelectLines: [],
lineLabelName: '',
activeNames:[]
} }
}, },
components: { components: {
@@ -400,8 +619,134 @@ layout("/layouts/platform.html"){
}, },
methods: { methods: {
async doOnekeyAudit(flag) { async validateLine() {
const confirm = await this.$confirm('您确定要一键审核您所勾选的信息吗, 是否继续?', '提示', { const resp = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo'
, {enroll: JSON.stringify(this.editFormData)})
if (resp.code !== 0) {
this.$message.warning(resp.msg)
this.editFormData.takePartInLineId = ''
}
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data)
} else if (type === 'recall') {
this.doRecall(data)
} else if (type === 'handle') {
this.openEdit(data)
} else if (type === 'modify') {
this.openModify(data)
} else if (type === 'delete') {
this.doDelete(data)
}
},
async doDelete(row){
this.$confirm("您确定要删除【<span style='color: red'>" + row.userName + "</span>】的此条报名信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + row.id)
if (resp.code === 0) {
await this.doSearch()
this.$message.success('删除成功')
await this.getLineSignNumber();
} else {
this.$message.warning(resp.msg)
}
}
}
})
},
async openModify(row) {
this.getUnionSelectLine(row.takePartInLineId)
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
this.editFormData = {...resp.data.viewData}
if (this.modifyConfig.familyInfo == 2) {
this.editFormData.companionList = resp.data.viewData.companionList
this.labelName = "家属信息"
} else {
this.editFormData.bedType = resp.data.viewData.familyNumber
this.labelName = "家属数量"
}
}
if (row.takePartInBaseManagementId) {
this.editSpecificTime(row.takePartInBaseManagementId);
this.lineLabelName = "酒店"
} else if (row.takePartInLineId) {
this.lineLabelName = '线路'
}
this.editVisible = true
},
async doEdit() {
this.$refs['editForm'].validate().then(async () => {
const confirm = await this.$confirm('您确定要修改这位老师的报名信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
if (!this.editFormData.takePartInLineId && !this.editFormData.takePartInBaseManagementId){
this.$message.warning('请选择线路')
return
}
const resp = await $.post('/platform/theRapyRecuperation/user/query/doEdit', this.editFormData)
if (resp.code === 0) {
this.$notify.success(resp.msg)
this.editVisible = false
await this.doSearch();
await this.getLineSignNumber();
} else {
this.$notify.error(resp.msg)
}
}
})
},
async lineChange(val) {
console.log(val)
this.pageForm.selectId = ''
if (val) {
this.selectLine = this.takePartInLines.find(o => o.id === val)
await this.getLinePlayTimeByLineId(val);
} else {
this.selectLine.lineName = ''
}
await this.getLineSignNumber()
await this.doSearch()
},
async playChange() {
await this.getLineSignNumber()
await this.doSearch()
},
async getLinePlayTimeByLineId(id) {
const resp = await $.get(loc() + '/getLinePlayTimeByLineId', {
lineId: id,
year: this.pageForm.year,
signUpMode: 2,
})
if (resp.code === 0) {
this.linePlayTimes = resp.data
}
},
async getLineSignNumber() {
const resp = await $.get('/platform/theRapyRecuperation/TheRapyXghAudit/getLineNumber', this.pageForm)
this.lineSignNumber = resp.data
},
async doOnekeyAudit(flag, adjustment) {
let msg = '';
if (adjustment && !flag) {
msg = '您确定要一键【调整】您所勾选的报名信息吗,调整后该报名信息将不会在审核列表中展示, 是否继续?'
} else if (!adjustment && !flag) {
msg = '您确定要一键【拒绝】您所勾选的报名信息吗,是否继续?'
} else if (!adjustment && flag) {
msg = '您确定要一键【通过】您所勾选的报名信息吗,是否继续?'
}
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -410,13 +755,14 @@ layout("/layouts/platform.html"){
const resp = await $.post(loc() + "/doOnekeyAudit", { const resp = await $.post(loc() + "/doOnekeyAudit", {
ids: JSON.stringify(this.tableSelection), ids: JSON.stringify(this.tableSelection),
flag: flag, flag: flag,
adjustment: adjustment,
auditOpinion: this.formData.auditOpinion auditOpinion: this.formData.auditOpinion
}) })
if (resp.code === 0){ if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg}); this.$notify.success({title: '成功', message: resp.msg});
await this.doSearch() await this.doSearch()
this.dialogVisible = false this.dialogVisible = false
}else { } else {
this.$notify.warning({title: '失败', message: resp.msg}); this.$notify.warning({title: '失败', message: resp.msg});
this.dialogVisible = false this.dialogVisible = false
} }
@@ -461,17 +807,25 @@ layout("/layouts/platform.html"){
}) })
if (confirm === "confirm") { if (confirm === "confirm") {
const resp = await $.post(loc() + "/doRecall", {id: row.id}) const resp = await $.post(loc() + "/doRecall", {id: row.id})
if (resp.code === 0){ if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg}); this.$notify.success({title: '成功', message: resp.msg});
await this.doSearch() await this.doSearch()
}else { } else {
this.$notify.warning({title: '失败', message: resp.msg}); this.$notify.warning({title: '失败', message: resp.msg});
} }
} }
}, },
async doAudit(flag) { async doAudit(flag, adjustment) {
const confirm = await this.$confirm('您确定要' + (flag ? '通过' : '退回') + '吗, 是否继续?', '提示', { let msg = '';
if (adjustment && !flag) {
msg = '您确定要【调整】该报名信息吗,调整后该报名信息将不会在审核列表中展示, 是否继续?'
} else if (!adjustment && !flag) {
msg = '您确定要【拒绝】该报名信息吗,是否继续?'
} else if (!adjustment && flag) {
msg = '您确定要【通过】该报名信息吗,是否继续?'
}
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -479,15 +833,16 @@ layout("/layouts/platform.html"){
if (confirm === "confirm") { if (confirm === "confirm") {
const resp = await $.post(loc() + "/doAudit", { const resp = await $.post(loc() + "/doAudit", {
flag: flag, flag: flag,
adjustment: adjustment,
id: this.formData.id, id: this.formData.id,
isTransferIn: this.formData.isTransferIn, isTransferIn: this.formData.isTransferIn,
auditOpinion: this.formData.auditOpinion auditOpinion: this.formData.auditOpinion
}) })
if (resp.code === 0){ if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg}); this.$notify.success({title: '成功', message: resp.msg});
await this.doSearch() await this.doSearch()
this.$refs.guava.index() this.$refs.guava.index()
}else { } else {
this.$notify.warning({title: '失败', message: resp.msg}); this.$notify.warning({title: '失败', message: resp.msg});
} }
@@ -591,12 +946,24 @@ layout("/layouts/platform.html"){
this.modifyConfig = res.data this.modifyConfig = res.data
} }
}, },
async getUnionSelectLine(disPlayUnionSelectId = null) {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
startYear: this.pageForm.year,
//signUpMode: 1,
disPlayUnionSelectId: disPlayUnionSelectId
})
if (resp.code === 0) {
this.unionSelectLines = resp.data
}
},
}, },
async created() { async created() {
await this.getBmUserUnion() await this.getBmUserUnion()
await this.getModifyConfig() await this.getModifyConfig()
this.takePartInLines = await this.getXlByUnion() this.takePartInLines = await this.getXlByUnion()
await this.doSearch() await this.doSearch()
await this.getLineSignNumber()
await this.getUnionSelectLine()
} }
}) })
</script> </script>
@@ -28,47 +28,45 @@ layout("/layouts/platform.html"){
</el-input> </el-input>
</div> </div>
</div> </div>
<template v-if="!isLxyGys"> <div class="search-item">
<div class="search-item"> <div class="search-item-label">旅行社:</div>
<div class="search-item-label">旅行社:</div> <div class="search-item-option">
<div class="search-item-option"> <el-select clearable filterable style="width: 100%"
<el-select clearable filterable style="width: 100%" v-model="pageForm.travelAgencyId"
v-model="pageForm.travelAgencyId" @change="doSearch">
@change="doSearch"> <el-option :key="item.id"
<el-option :key="item.id" :label="item.travelAgencyName"
:label="item.travelAgencyName" :value="item.id"
:value="item.id" v-for="item in travelAgencyList"
v-for="item in travelAgencyList" ></el-option>
></el-option> </el-select>
</el-select>
</div>
</div> </div>
<div class="search-item"> </div>
<div class="search-item-label">活动范围:</div> <div class="search-item">
<div class="search-item-option"> <div class="search-item-label">活动范围:</div>
<el-select clearable filterable style="width: 100%" <div class="search-item-option">
v-model="pageForm.regionalNature" <el-select clearable filterable style="width: 100%"
@change="doSearch"> v-model="pageForm.regionalNature"
<el-option key="1" label="省内" value="省内"></el-option> @change="doSearch">
<el-option key="1" label="省" value="省"></el-option> <el-option key="1" label="省" value="省"></el-option>
</el-select> <el-option key="1" label="省外" value="省外"></el-option>
</div> </el-select>
</div> </div>
<div class="search-item"> </div>
<div class="search-item-label">标段时间:</div> <div class="search-item">
<div class="search-item-option"> <div class="search-item-label">标段时间:</div>
<el-select clearable filterable style="width: 100%" <div class="search-item-option">
v-model="pageForm.lotId" <el-select clearable filterable style="width: 100%"
@change="doSearch"> v-model="pageForm.lotId"
<el-option :key="item.id" @change="doSearch">
:label="item.lotName" <el-option :key="item.id"
:value="item.id" :label="item.lotName"
v-for="item in modifyBdList" :value="item.id"
></el-option> v-for="item in modifyBdList"
</el-select> ></el-option>
</div> </el-select>
</div> </div>
</template> </div>
<div class="search-query"> <div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button> <el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div> </div>
@@ -78,19 +76,14 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never"> <el-card class="mt10" shadow="never">
<table-tool :app="this" label="目的地列表"> <table-tool :app="this" label="目的地列表">
<template #func> <template #func>
<template v-if="!isLxyGys"> <el-button @click="openImport" size="medium" type="primary" style="margin-right: 10px">导入目的地</el-button>
<el-button @click="openImport" size="medium" type="primary" <el-button @click="openAdd" size="medium" type="primary">新建目的地</el-button>
style="margin-right: 10px">导入目的地
</el-button>
<el-button @click="openAdd" size="medium" type="primary">新建目的地</el-button>
</template>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" align="center"
header-align="center"> header-align="center">
<el-table-column :index="indexMethod" align="center" header-align="center" <el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
label="序号" type="index"
width="80px"></el-table-column> width="80px"></el-table-column>
<el-table-column <el-table-column
:label="column.label" :label="column.label"
@@ -103,7 +96,6 @@ layout("/layouts/platform.html"){
> >
<template scope="{row}" v-if="column.prop==='isDisabled'"> <template scope="{row}" v-if="column.prop==='isDisabled'">
<el-switch <el-switch
:disabled="isLxyGys"
:active-value="false" :active-value="false"
:inactive-value="true" :inactive-value="true"
@change="(val)=>{baseStatusChange(row.id)}" @change="(val)=>{baseStatusChange(row.id)}"
@@ -126,13 +118,9 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<el-table-column label="操作" width="250px"> <el-table-column label="操作" width="250px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看 <el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
</el-button> <el-button @click="openEdit(row.id)" size="mini" type="primary">编辑</el-button>
<el-button @click="openEdit(row.id)" size="mini" type="primary">编辑 <el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger"
v-if="!isLxyGys">删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -147,7 +135,6 @@ layout("/layouts/platform.html"){
<el-date-picker style="width: 100%" <el-date-picker style="width: 100%"
@change="yearChange" @change="yearChange"
type="year" type="year"
:disabled="isLxyGys"
v-model="formData.year" v-model="formData.year"
value-format="yyyy"></el-date-picker> value-format="yyyy"></el-date-picker>
</el-form-item> </el-form-item>
@@ -166,8 +153,7 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="旅行社名称" prop="travelAgencyId"> <el-form-item label="旅行社名称" prop="travelAgencyId">
<el-select clearable filterable style="width: 100%" <el-select clearable filterable style="width: 100%" v-model="formData.travelAgencyId">
v-model="formData.travelAgencyId" :disabled="isLxyGys">
<el-option :key="item.id" <el-option :key="item.id"
:label="item.travelAgencyName+'('+ item.year +'年)'" :label="item.travelAgencyName+'('+ item.year +'年)'"
:value="item.id" :value="item.id"
@@ -180,8 +166,7 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="组织形式" prop="createMode"> <el-form-item label="组织形式" prop="createMode">
<el-radio-group size="small" v-model="formData.createMode" <el-radio-group size="small" v-model="formData.createMode">
:disabled="isLxyGys">
<el-radio :label="1" border>校工会组织</el-radio> <el-radio :label="1" border>校工会组织</el-radio>
<el-radio :label="2" border>分工会组织</el-radio> <el-radio :label="2" border>分工会组织</el-radio>
</el-radio-group> </el-radio-group>
@@ -193,8 +178,7 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="活动范围" prop="regionalNature"> <el-form-item label="活动范围" prop="regionalNature">
<el-radio-group size="small" v-model="formData.regionalNature" <el-radio-group size="small" v-model="formData.regionalNature">
:disabled="isLxyGys">
<el-radio label="省内" border>省内</el-radio> <el-radio label="省内" border>省内</el-radio>
<el-radio label="省外" border>省外</el-radio> <el-radio label="省外" border>省外</el-radio>
</el-radio-group> </el-radio-group>
@@ -206,9 +190,7 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="标段时间" prop="lotId"> <el-form-item label="标段时间" prop="lotId">
<!--<el-input clearable maxlength="50" v-model="formData.lotId"></el-input>--> <!--<el-input clearable maxlength="50" v-model="formData.lotId"></el-input>-->
<el-select clearable filterable style="width: 100%" <el-select clearable filterable style="width: 100%" v-model="formData.lotId"
v-model="formData.lotId"
:disabled="isLxyGys"
@change="doBdModify"> @change="doBdModify">
<el-option :key="item" <el-option :key="item"
:label="item.lotName" :label="item.lotName"
@@ -220,8 +202,7 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="预计费用(元/人次)" prop="estimatedCost"> <el-form-item label="预计费用(元/人次)" prop="estimatedCost">
<el-select clearable filterable style="width: 100%" <el-select clearable filterable style="width: 100%" v-model="formData.estimatedCost">
v-model="formData.estimatedCost" :disabled="isLxyGys">
<el-option :key="item.id" <el-option :key="item.id"
:label="item.activityCost" :label="item.activityCost"
:value="item.activityCost" :value="item.activityCost"
@@ -235,14 +216,12 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="目的地联系人" prop="baseContactPerson"> <el-form-item label="目的地联系人" prop="baseContactPerson">
<el-input clearable maxlength="20" <el-input clearable maxlength="20" v-model="formData.baseContactPerson"></el-input>
v-model="formData.baseContactPerson"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="联系人电话" prop="baseContactNumber"> <el-form-item label="联系人电话" prop="baseContactNumber">
<el-input clearable maxlength="20" <el-input clearable maxlength="20" v-model="formData.baseContactNumber"></el-input>
v-model="formData.baseContactNumber"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -252,7 +231,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="报名开始时间" prop="signUpStartTime"> <el-form-item label="报名开始时间" prop="signUpStartTime">
<el-date-picker style="width: 100%" <el-date-picker style="width: 100%"
:disabled="isLxyGys"
type="datetime" type="datetime"
v-model="formData.signUpStartTime" v-model="formData.signUpStartTime"
format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm"
@@ -263,7 +241,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="报名截至时间" prop="signUpEndTime"> <el-form-item label="报名截至时间" prop="signUpEndTime">
<el-date-picker style="width: 100%" <el-date-picker style="width: 100%"
:disabled="isLxyGys"
type="datetime" type="datetime"
v-model="formData.signUpEndTime" v-model="formData.signUpEndTime"
format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm"
@@ -277,7 +254,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="变更截至时间" prop="changeEndTime"> <el-form-item label="变更截至时间" prop="changeEndTime">
<el-date-picker style="width: 100%" <el-date-picker style="width: 100%"
:disabled="isLxyGys"
type="datetime" type="datetime"
v-model="formData.changeEndTime" v-model="formData.changeEndTime"
value-format="yyyy-MM-dd HH:mm:ss"> value-format="yyyy-MM-dd HH:mm:ss">
@@ -303,7 +279,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="活动开始时间" prop="activityStartTime"> <el-form-item label="活动开始时间" prop="activityStartTime">
<el-date-picker <el-date-picker
:disabled="isLxyGys"
placeholder="活动开始时间" placeholder="活动开始时间"
style="width: 100%" style="width: 100%"
type="date" type="date"
@@ -315,7 +290,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="活动结束时间" prop="activityEndTime"> <el-form-item label="活动结束时间" prop="activityEndTime">
<el-date-picker <el-date-picker
:disabled="isLxyGys"
placeholder="活动结束时间" placeholder="活动结束时间"
style="width: 100%" style="width: 100%"
type="date" type="date"
@@ -330,21 +304,7 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24"> <el-col :md="24" :sm="24" :xs="24">
<el-form-item label="详细信息" prop="content"> <el-form-item label="详细信息" prop="content">
<div id="lineContent"></div> <div id="lineContent"></div>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="上传详细信息图片">
<el-button type="primary" @click="scFilesDrawer = true" size="small">
上传详细信息图片
</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -352,7 +312,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="是否启用" prop="isDisabled"> <el-form-item label="是否启用" prop="isDisabled">
<el-switch <el-switch
:disabled="isLxyGys"
:active-value="false" :active-value="false"
:inactive-value="true" :inactive-value="true"
active-color="#13ce66" active-color="#13ce66"
@@ -366,8 +325,7 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24"> <el-col :md="24" :sm="24" :xs="24">
<el-form-item label="图片上传" prop="files"> <el-form-item label="图片上传" prop="files">
<file-upload :files.sync="formData.files" :max="1" <file-upload :files.sync="formData.files" :max="1" :type="['jpg', 'jpeg', 'png']">
:type="['jpg', 'jpeg', 'png']">
<template #el-upload__tip> <template #el-upload__tip>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
图片类请上传jpg/png/jpeg格式,上传数量为1个 图片类请上传jpg/png/jpeg格式,上传数量为1个
@@ -433,59 +391,10 @@ layout("/layouts/platform.html"){
</span> </span>
</el-dialog> </el-dialog>
</guava> </guava>
<el-drawer
size="50%"
:visible.sync="scFilesDrawer"
direction="rtl">
<el-card shadow="never">
<template #header>
<div style="display:flex;justify-content: space-between;align-items: center">
<h3 style="color: #1867b0">上传文件</h3>
<file-upload :files.sync="files" ref="fileUpload"
:source="1"
:max="20"></file-upload>
</div>
</template>
<el-table :data="files" border class="mt10" stripe
style="width: 100%">
<el-table-column label="文件名"
show-overflow-tooltip
prop="filename"></el-table-column>
<el-table-column label="文件路径" prop="url" show-overflow-tooltip>
<template scope="{row}">
{{ APP_DOMAIN + FILE_STREAM_PREVIEW_ADDRESS +
"?id=" + row.id }}
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="操作"
width="100px"
>
<template slot-scope="{row,$index}">
<el-button
icon="el-icon-folder-checked"
size="mini" type="primary"
@click="doCopy(row)">复制
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-row class="mt20 mr20" justify="end" type="flex">
<el-button @click="scFilesDrawer=false" type="primary">关闭</el-button>
</el-row>
</el-drawer>
</div> </div>
<script> <script>
const vue = new Vue({ new Vue({
el: '#app', el: '#app',
mixins: [initTableMixins], mixins: [initTableMixins],
components: { components: {
@@ -542,8 +451,6 @@ layout("/layouts/platform.html"){
callback() callback()
} }
return { return {
scFilesDrawer: false,
files: [],
pageForm: { pageForm: {
year: new Date().getFullYear().toString(), year: new Date().getFullYear().toString(),
unionId: '', unionId: '',
@@ -560,7 +467,7 @@ layout("/layouts/platform.html"){
id: '', id: '',
sortNumber: '', sortNumber: '',
baseName: '', baseName: '',
travelAgencyId: null, travelAgencyId: '',
regionalNature: '省内', regionalNature: '省内',
year: new Date().getFullYear().toString(), year: new Date().getFullYear().toString(),
isDisabled: false, isDisabled: false,
@@ -593,71 +500,29 @@ layout("/layouts/platform.html"){
{label: '是否启用', prop: 'isDisabled', sortable: true} {label: '是否启用', prop: 'isDisabled', sortable: true}
], ],
rules: { rules: {
sortNumber: [{ sortNumber: [{required: false, message: '请输入排序编号', trigger: ['change', 'blur']}],
required: false,
message: '请输入排序编号',
trigger: ['change', 'blur']
}],
baseName: [{required: true, message: '请输入目的地名称', trigger: ['change', 'blur']}], baseName: [{required: true, message: '请输入目的地名称', trigger: ['change', 'blur']}],
// travelAgencyId: [{required: true, message: '请选择旅行社', trigger: ['change', 'blur']}], travelAgencyId: [{required: true, message: '请选择旅行社', trigger: ['change', 'blur']}],
regionalNature: [{ regionalNature: [{required: true, message: '请选择区域性质', trigger: ['change', 'blur']}],
required: true,
message: '请选择区域性质',
trigger: ['change', 'blur']
}],
year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}], year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}],
lotId: [{required: true, message: '请选择出行天数', trigger: ['change', 'blur']}], lotId: [{required: true, message: '请选择出行天数', trigger: ['change', 'blur']}],
content: [{required: false, message: '请输入详细内容', trigger: ['change', 'blur']}], content: [{required: false, message: '请输入详细内容', trigger: ['change', 'blur']}],
signUpStartTime: [{ signUpStartTime: [{required: true, message: '请选择报名开始时间', trigger: ['change', 'blur']}],
required: true, signUpEndTime: [{required: true, validator: validateSignUpEndTime, trigger: ['change', 'blur']}],
message: '请选择报名开始时间', changeEndTime: [{required: true, validator: validateChangeEndTime, trigger: ['change', 'blur']}],
trigger: ['change', 'blur']
}],
signUpEndTime: [{
required: true,
validator: validateSignUpEndTime,
trigger: ['change', 'blur']
}],
changeEndTime: [{
required: true,
validator: validateChangeEndTime,
trigger: ['change', 'blur']
}],
files: [{required: true, message: '请上传图片', trigger: ['change', 'blur']}], files: [{required: true, message: '请上传图片', trigger: ['change', 'blur']}],
createMode: [{required: true, message: '请选择组织方式', trigger: ['change', 'blur']}], createMode: [{required: true, message: '请选择组织方式', trigger: ['change', 'blur']}],
activityStartTime: [{ activityStartTime: [{ required: true, validator: validateActivityStartTime, trigger: ['change', 'blur'] }],
required: true, activityEndTime: [{ required: true, validator: validateActivityEndTime, trigger: ['change', 'blur'] }],
validator: validateActivityStartTime, estimatedCost: [{required: true, message: '请输入预计费用', trigger: ['change', 'blur']}],
trigger: ['change', 'blur']
}],
activityEndTime: [{
required: true,
validator: validateActivityEndTime,
trigger: ['change', 'blur']
}],
estimatedCost: [{
required: true,
message: '请输入预计费用',
trigger: ['change', 'blur']
}],
}, },
//目的地导入 //目的地导入
importVisible: false, importVisible: false,
importLoading: false, importLoading: false,
importData: {}, importData: {},
isLxyGys: false,
} }
}, },
methods: { methods: {
doCopy(row) {
const input = document.createElement('input')
input.value = APP_DOMAIN + FILE_STREAM_PREVIEW_ADDRESS + "?id=" + row.id // 设置复制内容
document.body.appendChild(input) // 添加临时实例
input.select() // 选择实例内容
document.execCommand('Copy') // 执行复制
document.body.removeChild(input) // 删除临时实例
this.$message.success('复制成功!')
},
async doSearch() { async doSearch() {
this.formData.year = this.pageForm.year; this.formData.year = this.pageForm.year;
await this.yearChange(); await this.yearChange();
@@ -668,7 +533,6 @@ layout("/layouts/platform.html"){
this.travelAgencyList = resp.data this.travelAgencyList = resp.data
}, },
async openAdd() { async openAdd() {
this.files = []
this.$refs.guava.edit() this.$refs.guava.edit()
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs['form']) { if (this.$refs['form']) {
@@ -679,7 +543,6 @@ layout("/layouts/platform.html"){
}) })
}, },
async openEdit(id) { async openEdit(id) {
this.files = []
const resp = await $.post(loc() + '/selectBaseManageById/' + id) const resp = await $.post(loc() + '/selectBaseManageById/' + id)
if (resp.code === 0) { if (resp.code === 0) {
this.$refs.guava.edit() this.$refs.guava.edit()
@@ -803,10 +666,10 @@ layout("/layouts/platform.html"){
processData: false, processData: false,
contentType: false, contentType: false,
success: (data) => { success: (data) => {
if (data.code === 0) { if (data.code === 0){
this.pageData(); this.pageData();
this.importVisible = false this.importVisible = false
} else { }else {
this.importVisible = false this.importVisible = false
} }
}, },
@@ -818,19 +681,13 @@ layout("/layouts/platform.html"){
}, },
}, },
async created() { async created() {
//如果不是超级管理员,校工会,分工会,就是供应商
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'false') {
this.isLxyGys = true
}
await this.initPageData(); await this.initPageData();
this.pageData(); this.pageData();
}, },
computed: { computed: {
editDialogTitle() { editDialogTitle() {
return this.formData.id ? '编辑目的地' : '新增目的地' return this.formData.id ? '编辑目的地' : '新增目的地'
} }
}, },
}) })
</script> </script>
@@ -3,12 +3,16 @@ layout("/layouts/platform.html"){
#--> #-->
<style> <style>
.mr0-radio { /*.mr0-radio {*/
display: flex; /* display: flex;*/
} /*}*/
.mr0-radio label { /*.mr0-radio label {*/
margin-right: 0 !important; /* margin-right: 0 !important;*/
/*}*/
.el-radio {
margin-right: 0;
} }
</style> </style>
@@ -17,19 +21,55 @@ layout("/layouts/platform.html"){
<el-card shadow="never"> <el-card shadow="never">
<div class="search"> <div class="search">
<div class="search-item"> <div class="search-item">
<div class="search-item-label">年度:</div> <div class="search-item-label">年度范围</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
v-model="pageForm.startYear"
type="year"
class="picker-year"
format="yyyy"
style="width: 46%"
value-format="yyyy"
@change="handleChangeYear"
>
</el-date-picker>
<span></span>
<el-date-picker
v-model="pageForm.endYear"
type="year"
class="picker-year"
format="yyyy"
style="width: 46%"
value-format="yyyy"
@change="handleChangeYear"
>
</el-date-picker>
<!--<el-date-picker
style="width: 100%" style="width: 100%"
@change="doSearch" @change="doSearch"
placeholder="选择年度" placeholder="选择年度"
type="year" type="year"
v-model="pageForm.year" v-model="pageForm.year"
value-format="yyyy"> value-format="yyyy">
</el-date-picker> </el-date-picker>-->
</div> </div>
</div> </div>
<!--<div class="search-item">
<div class="search-item-label">旅行社:</div>
<div class="search-item-option">
<el-select @change="doSearch"
clearable
filterable
style="width: 100%"
v-model="pageForm.travelAgencyId">
<el-option :key="item.id"
:label="item.travelAgencyName"
:value="item.id"
v-for="item in travelAgencyOptions"></el-option>
</el-select>
</div>
</div>-->
<div class="search-item"> <div class="search-item">
<div class="search-item-label">线路名称:</div> <div class="search-item-label">线路名称:</div>
<div class="search-item-option"> <div class="search-item-option">
@@ -40,41 +80,22 @@ layout("/layouts/platform.html"){
</el-input> </el-input>
</div> </div>
</div> </div>
<template v-if="!isLxyGys"> <div class="search-item">
<div class="search-item"> <div class="search-item-label">时间标段:</div>
<div class="search-item-label">旅行社:</div> <div class="search-item-option">
<div class="search-item-option"> <el-select @change="doSearch" clearable filterable
<el-select @change="doSearch" style="width: 100%"
clearable v-model="pageForm.lotId">
filterable <el-option :key="item.id"
style="width: 100%" :label="item.lotName"
v-model="pageForm.travelAgencyId"> :value="item.id"
<el-option :key="item.id" v-for="item in lotList"
:label="item.travelAgencyName" ></el-option>
:value="item.id" </el-select>
v-for="item in travelAgencyOptions"></el-option>
</el-select>
</div>
</div> </div>
<div class="search-item"> </div>
<div class="search-item-label">时间标段:</div>
<div class="search-item-option">
<el-select @change="doSearch" clearable filterable
style="width: 100%"
v-model="pageForm.lotId">
<el-option :key="item.id"
:label="item.lotName"
:value="item.id"
v-for="item in lotList"
></el-option>
</el-select>
</div>
</div>
</template>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item-label">分工会:</div> <div class="search-item-label">分工会:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select @change="doSearch" <el-select @change="doSearch"
@@ -99,17 +120,14 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never"> <el-card class="mt10" shadow="never">
<table-tool :app="this" label="线路列表"> <table-tool :app="this" label="线路列表">
<template #func> <template #func>
<template v-if="!isLxyGys"> <el-button @click="openImport" size="medium" type="primary">导入线路</el-button>
<el-button @click="openImport" size="medium" type="primary">导入线路</el-button> <el-button @click="openAdd" size="medium" type="primary">新建线路</el-button>
<el-button @click="openAdd" size="medium" type="primary">新建线路</el-button>
</template>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" align="center"
header-align="center"> header-align="center">
<el-table-column :index="indexMethod" align="center" header-align="center" <el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
label="序号" type="index"
width="80px"></el-table-column> width="80px"></el-table-column>
<el-table-column <el-table-column
:label="column.label" :label="column.label"
@@ -123,7 +141,6 @@ layout("/layouts/platform.html"){
> >
<template scope="{row}" v-if="column.prop==='isDisabled'"> <template scope="{row}" v-if="column.prop==='isDisabled'">
<el-switch <el-switch
:disabled="isLxyGys"
:active-value="false" :active-value="false"
:inactive-value="true" :inactive-value="true"
@change="(val)=>{lineStatusChange(row.id)}" @change="(val)=>{lineStatusChange(row.id)}"
@@ -138,12 +155,15 @@ layout("/layouts/platform.html"){
<template scope="{row:{createMode}}" v-else-if="column.prop==='createMode'"> <template scope="{row:{createMode}}" v-else-if="column.prop==='createMode'">
{{createModeName(createMode)}} {{createModeName(createMode)}}
</template> </template>
<template scope="{row}" v-else-if="column.prop==='createUserName'">
{{row.createUserName + '' + row.createUnionName + ''}}
</template>
<template scope="{row}" v-else-if="column.prop==='playTime'"> <template scope="{row}" v-else-if="column.prop==='playTime'">
<el-button @click="viewUnionSelectTimeInfo(row.id)" <el-button @click="viewUnionSelectTimeInfo(row.id)"
type="text"> type="text">
查看详情 查看详情
</el-button> </el-button>
<!-- v-if="row.createMode===2 && row.signUpMode===1"--> <!-- v-if="row.createMode===2 && row.signUpMode===1"-->
<!--<span v-else> <!--<span v-else>
{{row.playStartTime + '至' + row.playEndTime}} {{row.playStartTime + '至' + row.playEndTime}}
</span>--> </span>-->
@@ -151,13 +171,9 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<el-table-column label="操作" width="250px"> <el-table-column label="操作" width="250px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看 <el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
</el-button> <el-button @click="openEdit(row.id)" size="mini" type="primary">编辑</el-button>
<el-button @click="openEdit(row.id)" size="mini" type="primary">编辑 <el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger"
v-if="!isLxyGys">删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -181,7 +197,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="年度" prop="year"> <el-form-item label="年度" prop="year">
<el-date-picker style="width: 100%" <el-date-picker style="width: 100%"
:disabled="isLxyGys"
@change="yearChange" @change="yearChange"
type="year" type="year"
v-model="formData.year" v-model="formData.year"
@@ -190,21 +205,31 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="排序号" prop="serialNumber"> <el-form-item label="排序号" prop="serialNumber">
<el-input maxlength="50" v-model="formData.serialNumber"></el-input> <el-input type="number" maxlength="50" v-model="formData.serialNumber"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="线路名称" prop="lineName"> <el-form-item label="线路名称" prop="lineName">
<el-input maxlength="50" v-model="formData.lineName" <el-input maxlength="50" v-model="formData.lineName"></el-input>
:disabled="isLxyGys"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :span="12">
<el-form-item label="旅行社名称" prop="travelAgencyId"> <el-form-item label="时间标段" prop="lotId">
<el-select clearable filterable style="width: 100%" <el-select clearable filterable style="width: 100%"
v-model="formData.travelAgencyId" :disabled="isLxyGys"> v-model="formData.lotId">
<el-option :key="item.id"
:label="item.lotName"
:value="item.id"
v-for="item in lotList"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!--<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="旅行社名称" prop="travelAgencyId">
<el-select clearable filterable style="width: 100%" v-model="formData.travelAgencyId">
<el-option :key="item.id" <el-option :key="item.id"
:label="item.travelAgencyName+'('+ item.year +'年)'" :label="item.travelAgencyName+'('+ item.year +'年)'"
:value="item.id" :value="item.id"
@@ -212,9 +237,9 @@ layout("/layouts/platform.html"){
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>-->
</el-row> </el-row>
<el-row :gutter="20"> <!--<el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="旅行社联系人"> <el-form-item label="旅行社联系人">
<el-input <el-input
@@ -229,16 +254,14 @@ layout("/layouts/platform.html"){
readonly></el-input> readonly></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>-->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="线路类型" prop="regionalNature"> <el-form-item label="线路类型" prop="regionalNature">
<el-radio-group class="mr0-radio" size="small" <el-radio-group class="mr0-radio" size="small" v-model="formData.regionalNature">
:disabled="isLxyGys"
v-model="formData.regionalNature">
<el-radio :label="item.value" <el-radio :label="item.value"
border v-for="item in regionalNatureList"> border v-for="item in regionalNatureList">
{{item.label}} {{item.label}}
@@ -246,24 +269,11 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="时间标段" prop="lotId">
<el-select clearable filterable style="width: 100%"
v-model="formData.lotId" :disabled="isLxyGys">
<el-option :key="item.id"
:label="item.lotName"
:value="item.id"
v-for="item in lotList"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="交通工具" prop="trafficTools"> <el-form-item label="交通工具" prop="trafficTools">
<el-input clearable maxlength="50" <el-input clearable maxlength="50" v-model="formData.trafficTools"></el-input>
v-model="formData.trafficTools"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -271,23 +281,21 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <!--<el-col :span="12">
<el-form-item label="最少成团人数" prop="minimumGroupSize"> <el-form-item label="最少参与教工" prop="minimumGroupSize">
<el-input-number :max="1000" <el-input-number :max="1000"
:min="config.groupNumber" :min="config.groupNumber"
:precision="0" :precision="0"
style="width: 100%" style="width: 100%"
:disabled="isLxyGys"
v-model="formData.minimumGroupSize"></el-input-number> v-model="formData.minimumGroupSize"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>-->
<el-col :span="12"> <el-col :span="24">
<el-form-item label="预计人数(含家属" prop="estimatedFamilyNumbers"> <el-form-item label="最少成团人数包括家属" prop="estimatedFamilyNumbers">
<el-input-number :max="1000" <el-input-number :max="1000"
:min="1" :min="1"
:precision="0" :precision="0"
style="width: 100%" style="width: 100%"
:disabled="isLxyGys"
v-model="formData.estimatedFamilyNumbers"></el-input-number> v-model="formData.estimatedFamilyNumbers"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -295,8 +303,7 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="预计费用(元/人次)" prop="estimatedCost"> <el-form-item label="预计费用(元/人次)" prop="estimatedCost">
<el-input clearable maxlength="50" :disabled="isLxyGys" <el-input clearable maxlength="50" v-model="formData.estimatedCost"></el-input>
v-model="formData.estimatedCost"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -304,8 +311,7 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="组织形式" prop="signUpMode"> <el-form-item label="组织形式" prop="signUpMode">
<el-radio-group class="mr0-radio" size="small" :disabled="isLxyGys" <el-radio-group class="mr0-radio" size="small" v-model="formData.signUpMode">
v-model="formData.signUpMode">
<el-radio :label="item.value" v-if="isShow(item.roles)" <el-radio :label="item.value" v-if="isShow(item.roles)"
size="small" size="small"
border v-for="item in signUpModeList"> border v-for="item in signUpModeList">
@@ -322,8 +328,7 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="联系人" prop="lineContact"> <el-form-item label="联系人" prop="lineContact">
<el-input clearable max="50" :disabled="isLxyGys" <el-input clearable max="50" v-model="formData.lineContact"></el-input>
v-model="formData.lineContact"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -331,104 +336,93 @@ layout("/layouts/platform.html"){
{ required: false, message: '手机号码不能为空', trigger: 'blur' }, { required: false, message: '手机号码不能为空', trigger: 'blur' },
{ pattern: /^1[34578]\d{9}$/, message: '手机号码格式不正确', trigger: 'blur' } { pattern: /^1[34578]\d{9}$/, message: '手机号码格式不正确', trigger: 'blur' }
]" label="联系方式" prop="lineContactPhone"> ]" label="联系方式" prop="lineContactPhone">
<el-input clearable :disabled="isLxyGys" <el-input clearable v-model="formData.lineContactPhone"></el-input>
v-model="formData.lineContactPhone"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
<!-- <template v-if="formData.signUpMode===2 || formData.createMode===1">--> <!-- <template v-if="formData.signUpMode===2 || formData.createMode===1">-->
<!-- <el-row :gutter="20">--> <!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">--> <!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="报名开始时间" prop="signUpStartTime">--> <!-- <el-form-item label="报名开始时间" prop="signUpStartTime">-->
<!-- <el-date-picker style="width: 100%"--> <!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"--> <!-- type="datetime"-->
<!-- v-model="formData.signUpStartTime"--> <!-- v-model="formData.signUpStartTime"-->
<!-- format="yyyy-MM-dd HH:mm"--> <!-- format="yyyy-MM-dd HH:mm"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">--> <!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">--> <!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="报名截至时间" prop="signUpEndTime">--> <!-- <el-form-item label="报名截至时间" prop="signUpEndTime">-->
<!-- <el-date-picker style="width: 100%"--> <!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"--> <!-- type="datetime"-->
<!-- v-model="formData.signUpEndTime"--> <!-- v-model="formData.signUpEndTime"-->
<!-- format="yyyy-MM-dd HH:mm"--> <!-- format="yyyy-MM-dd HH:mm"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">--> <!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- </el-row>--> <!-- </el-row>-->
<!-- <el-row :gutter="20">--> <!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">--> <!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="变更截至时间" prop="changeEndTime">--> <!-- <el-form-item label="变更截至时间" prop="changeEndTime">-->
<!-- <el-date-picker style="width: 100%"--> <!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"--> <!-- type="datetime"-->
<!-- v-model="formData.changeEndTime"--> <!-- v-model="formData.changeEndTime"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">--> <!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">--> <!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item>--> <!-- <el-form-item>-->
<!-- <template #label>--> <!-- <template #label>-->
<!-- <span class="text-primary">--> <!-- <span class="text-primary">-->
<!-- <i class="el-icon-warning"></i>--> <!-- <i class="el-icon-warning"></i>-->
<!-- 温馨提醒:--> <!-- 温馨提醒:-->
<!-- </span>--> <!-- </span>-->
<!-- </template>--> <!-- </template>-->
<!-- <span class="text-primary">--> <!-- <span class="text-primary">-->
<!-- 变更时间应该大于报名截至时间,小于出行时间。--> <!-- 变更时间应该大于报名截至时间,小于出行时间。-->
<!-- </span>--> <!-- </span>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- </el-row>--> <!-- </el-row>-->
<!-- <el-row :gutter="20">--> <!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">--> <!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="出行开始时间" prop="playStartTime">--> <!-- <el-form-item label="出行开始时间" prop="playStartTime">-->
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- placeholder="出行开始时间"--> <!-- placeholder="出行开始时间"-->
<!-- style="width: 100%"--> <!-- style="width: 100%"-->
<!-- type="date"--> <!-- type="date"-->
<!-- v-model="formData.playStartTime"--> <!-- v-model="formData.playStartTime"-->
<!-- value-format="yyyy-MM-dd">--> <!-- value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">--> <!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="出行结束时间" prop="playEndTime">--> <!-- <el-form-item label="出行结束时间" prop="playEndTime">-->
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- placeholder="出行结束时间"--> <!-- placeholder="出行结束时间"-->
<!-- style="width: 100%"--> <!-- style="width: 100%"-->
<!-- type="date"--> <!-- type="date"-->
<!-- v-model="formData.playEndTime"--> <!-- v-model="formData.playEndTime"-->
<!-- value-format="yyyy-MM-dd">--> <!-- value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- </el-row>--> <!-- </el-row>-->
<!-- </template>--> <!-- </template>-->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24"> <el-col :md="24" :sm="24" :xs="24">
<el-form-item label="线路内容" prop="content"> <el-form-item label="线路内容" prop="content">
<div id="lineContent"></div> <text-editor v-model="formData.content"></text-editor>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="上传详细信息图片">
<el-button type="primary" @click="scFilesDrawer = true" size="small">
上传线路内容图片
</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -436,7 +430,6 @@ layout("/layouts/platform.html"){
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="是否启用" prop="isDisabled"> <el-form-item label="是否启用" prop="isDisabled">
<el-switch <el-switch
:disabled="isLxyGys"
:active-value="false" :active-value="false"
:inactive-value="true" :inactive-value="true"
active-color="#13ce66" active-color="#13ce66"
@@ -450,11 +443,8 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24"> <el-col :md="24" :sm="24" :xs="24">
<el-form-item label="移动端缩略图" prop="files"> <el-form-item label="移动端缩略图" prop="files">
<file-upload :files.sync="formData.files" <image-Upload :height="100" :width="100" :limit="1" :file-type="['png', 'jpg']" :file-size="1"
picture_card v-model="formData.files"></image-Upload>
:max="1"
:type="['jpg', 'jpeg', 'png']"
></file-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -536,54 +526,6 @@ layout("/layouts/platform.html"){
</el-dialog> </el-dialog>
</guava> </guava>
<el-drawer
size="50%"
:visible.sync="scFilesDrawer"
direction="rtl">
<el-card shadow="never">
<template #header>
<div style="display:flex;justify-content: space-between;align-items: center">
<h3 style="color: #1867b0">上传文件</h3>
<file-upload :files.sync="files" ref="fileUpload"
:source="1"
:max="20"></file-upload>
</div>
</template>
<el-table :data="files" border class="mt10" stripe
style="width: 100%">
<el-table-column label="文件名"
show-overflow-tooltip
prop="filename"></el-table-column>
<el-table-column label="文件路径" prop="url" show-overflow-tooltip>
<template scope="{row}">
{{ APP_DOMAIN + FILE_STREAM_PREVIEW_ADDRESS +
"?id=" + row.id }}
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="操作"
width="100px"
>
<template slot-scope="{row,$index}">
<el-button
icon="el-icon-folder-checked"
size="mini" type="primary"
@click="doCopy(row)">复制
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-row class="mt20 mr20" justify="end" type="flex">
<el-button @click="scFilesDrawer=false" type="primary">关闭</el-button>
</el-row>
</el-drawer>
</div> </div>
<script> <script>
@@ -647,7 +589,7 @@ layout("/layouts/platform.html"){
{label: '年度', prop: 'year', sortable: true}, {label: '年度', prop: 'year', sortable: true},
{label: '线路名称', prop: 'lineName', sortable: true, width: '200'}, {label: '线路名称', prop: 'lineName', sortable: true, width: '200'},
{label: '时间标段', prop: 'lotName', sortable: true, sortProp: 'lotValue'}, {label: '时间标段', prop: 'lotName', sortable: true, sortProp: 'lotValue'},
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true}, /*{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},*/
// {label: '出行时间', prop: 'playTime', sortable: true}, // {label: '出行时间', prop: 'playTime', sortable: true},
{label: '线路类型', prop: 'regionalNature', sortable: true}, {label: '线路类型', prop: 'regionalNature', sortable: true},
{label: '组织形式', prop: 'signUpMode', sortable: true}, {label: '组织形式', prop: 'signUpMode', sortable: true},
@@ -659,71 +601,31 @@ layout("/layouts/platform.html"){
], ],
editDialogVisible: false, editDialogVisible: false,
rules: { rules: {
serialNumber: [{ serialNumber: [{required: true, message: '请输入排序号', trigger: ['change', 'blur']}],
required: true,
message: '请输入排序号',
trigger: ['change', 'blur']
}],
lineName: [{required: true, message: '请输入线路名称', trigger: ['change', 'blur']}], lineName: [{required: true, message: '请输入线路名称', trigger: ['change', 'blur']}],
// travelAgencyId: [{required: true, message: '请选择旅行社', trigger: ['change', 'blur']}], travelAgencyId: [{required: true, message: '请选择旅行社', trigger: ['change', 'blur']}],
regionalNature: [{ regionalNature: [{required: true, message: '请选择区域性质', trigger: ['change', 'blur']}],
required: true, minimumGroupSize: [{required: true, message: '请输入最少参与教工', trigger: ['change', 'blur']}],
message: '请选择区域性质',
trigger: ['change', 'blur']
}],
minimumGroupSize: [{
required: true,
message: '请输入最少成团人数',
trigger: ['change', 'blur']
}],
year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}], year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}],
playNumberOfDays: [{ playNumberOfDays: [{required: true, message: '请输入游玩天数', trigger: ['change', 'blur']}],
required: true,
message: '请输入游玩天数',
trigger: ['change', 'blur']
}],
//content: [{required: true, message: '请输入线路内容', trigger: ['change', 'blur']}], //content: [{required: true, message: '请输入线路内容', trigger: ['change', 'blur']}],
signUpStartTime: [{ signUpStartTime: [{
required: true, required: true,
message: '请选择报名开始时间', message: '请选择报名开始时间',
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}], }],
signUpEndTime: [{ signUpEndTime: [{required: true, validator: validateSignUpEndTime, trigger: ['change', 'blur']}],
required: true, changeEndTime: [{required: true, validator: validateChangeEndTime, trigger: ['change', 'blur']}],
validator: validateSignUpEndTime,
trigger: ['change', 'blur']
}],
changeEndTime: [{
required: true,
validator: validateChangeEndTime,
trigger: ['change', 'blur']
}],
//files: [{required: true, message: '请上传移动端缩略图', trigger: ['change', 'blur']}], //files: [{required: true, message: '请上传移动端缩略图', trigger: ['change', 'blur']}],
signUpMode: [{required: true, message: '请选择报名模式', trigger: ['change', 'blur']}], signUpMode: [{required: true, message: '请选择报名模式', trigger: ['change', 'blur']}],
playStartTime: [{ playStartTime: [{required: true, message: '请选择出行开始时间', trigger: ['change', 'blur']}],
required: true, playEndTime: [{required: true, validator: validatePlayEndTime, trigger: ['change', 'blur']}],
message: '请选择出行开始时间', trafficTools: [{required: false, message: '请输入交通工具', trigger: ['change', 'blur']}],
trigger: ['change', 'blur'] estimatedCost: [{required: false, message: '请输入预计费用', trigger: ['change', 'blur']}],
}],
playEndTime: [{
required: true,
validator: validatePlayEndTime,
trigger: ['change', 'blur']
}],
trafficTools: [{
required: false,
message: '请输入交通工具',
trigger: ['change', 'blur']
}],
estimatedCost: [{
required: false,
message: '请输入预计费用',
trigger: ['change', 'blur']
}],
estimatedFamilyNumbers: [{ estimatedFamilyNumbers: [{
required: false, required: false,
message: '请输入预计人数(含家属', message: '请输入成团人数包括家属',
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}], }],
lotId: [{required: true, message: '请选择标段时间', trigger: ['change', 'blur']}] lotId: [{required: true, message: '请选择标段时间', trigger: ['change', 'blur']}]
@@ -755,14 +657,15 @@ layout("/layouts/platform.html"){
playEndTime: null, playEndTime: null,
trafficTools: null, trafficTools: null,
estimatedCost: null, estimatedCost: null,
estimatedFamilyNumbers: 1, estimatedFamilyNumbers: null,
lotId: null, lotId: null,
lineContact: null, lineContact: null,
lineContactPhone: null lineContactPhone: null
}, },
pageForm: { pageForm: {
keywords: null, keywords: null,
year: new Date().getFullYear().toString(), startYear: '',
endYear: moment().format('YYYY'),
unionId: null, unionId: null,
lineName: null, lineName: null,
travelAgencyId: null travelAgencyId: null
@@ -777,21 +680,11 @@ layout("/layouts/platform.html"){
importVisible: false, importVisible: false,
importLoading: false, importLoading: false,
importData: {}, importData: {},
isLxyGys: false,
scFilesDrawer: false, modifyConfig:{}
files: [],
} }
}, },
methods: { methods: {
doCopy(row) {
const input = document.createElement('input')
input.value = APP_DOMAIN + FILE_STREAM_PREVIEW_ADDRESS + "?id=" + row.id // 设置复制内容
document.body.appendChild(input) // 添加临时实例
input.select() // 选择实例内容
document.execCommand('Copy') // 执行复制
document.body.removeChild(input) // 删除临时实例
this.$message.success('复制成功!')
},
isShow(roles) { isShow(roles) {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') { if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
return true return true
@@ -807,7 +700,6 @@ layout("/layouts/platform.html"){
} }
}, },
async openAdd() { async openAdd() {
this.files = []
this.$refs.guava.edit() this.$refs.guava.edit()
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs['form']) { if (this.$refs['form']) {
@@ -824,9 +716,10 @@ layout("/layouts/platform.html"){
if (this.config) { if (this.config) {
this.formData.minimumGroupSize = this.config.groupNumber this.formData.minimumGroupSize = this.config.groupNumber
} }
await this.getNumber()
this.formData.estimatedFamilyNumbers = this.modifyConfig.outsideQuota
}, },
async openEdit(id) { async openEdit(id) {
this.files = []
const resp = await $.post(loc() + '/selectLineInfoById/' + id) const resp = await $.post(loc() + '/selectLineInfoById/' + id)
if (resp.code === 0) { if (resp.code === 0) {
this.$refs.guava.edit() this.$refs.guava.edit()
@@ -849,15 +742,27 @@ layout("/layouts/platform.html"){
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
delete this.formData.travelAgency
const resp = await $.post(loc() + '/doSubmit', {line: JSON.stringify(this.formData)}) const resp = await $.post(loc() + '/doSubmit', this.formData)
loading.close() loading.close()
if (resp.code === 0) { if (resp.code === 0) {
this.$refs.guava.index() this.$message.success(resp.msg)
this.notifySuccess(resp.msg) this.$confirm('需要将该线路设置为出行线路吗?', '提示', {
this.pageData() confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
sublime.jumpPagePjax('/platform/theRapyRecuperation/lineXghSelect?mode=2')
} else {
sublime.jumpPagePjax('/platform/theRapyRecuperation/lineFghSelect?mode=1')
}
}).catch(() => {
this.$refs.guava.index()
this.pageData()
})
} else { } else {
this.notifyWarning(resp.msg) this.$message.warning(resp.msg)
} }
}, },
async lineStatusChange(id) { async lineStatusChange(id) {
@@ -918,6 +823,9 @@ layout("/layouts/platform.html"){
}, },
async initPageData() { async initPageData() {
this.regionalNatureList = await getEnumOptions('TheRapyRecuperationProvinceType') this.regionalNatureList = await getEnumOptions('TheRapyRecuperationProvinceType')
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" !== 'true') {
this.regionalNatureList = this.regionalNatureList.filter(o => o.name === 'provinceIn')
}
this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode') this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode')
this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode') this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode')
this.unionOptions = await getUnions(null) this.unionOptions = await getUnions(null)
@@ -968,21 +876,37 @@ layout("/layouts/platform.html"){
data.append("file", val.raw, val.raw.name); data.append("file", val.raw, val.raw.name);
}); });
this.importLoading = true this.importLoading = true
const resp = await $.post(loc() + "/travelLineImport", data) const resp = await $.post(loc() + "/travelLineImport",data)
if (resp.code === 0) { if (resp.code === 0){
this.pageData(); this.pageData();
this.importVisible = false this.importVisible = false
} else { }else {
this.notifyWarning("导入失败") this.notifyWarning("导入失败")
this.importLoading = false this.importLoading = false
} }
}, },
handleChangeYear(){
if (this.pageForm.startYear && this.pageForm.endYear){
if (this.pageForm.startYear > this.pageForm.endYear){
this.pageForm.endYear = '';
this.$message.error('起始年份需小于结束年份!');
}
}
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
async getNumber() {
const resp = await $.post(loc() + '/getNo')
this.formData.serialNumber = resp.data
},
}, },
async created() { async created() {
//如果不是超级管理员,校工会,分工会,就是供应商 await this.getModifyConfig()
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'false') { this.pageForm.startYear = this.modifyConfig.provinceStartYear+''
this.isLxyGys = true
}
await this.initPageData() await this.initPageData()
this.pageData() this.pageData()
} }
@@ -111,11 +111,19 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24"> <el-col :md="12" :sm="12" :xs="12">
<el-form-item label="旅行社名称" prop="travelAgencyName"> <el-form-item label="旅行社名称" prop="travelAgencyName">
<el-input maxlength="50" v-model="formData.travelAgencyName"></el-input> <el-input maxlength="50" v-model="formData.travelAgencyName"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="12">
<el-form-item label="是否自由组团" prop="signUpTravelAgency">
<el-radio-group v-model="formData.signUpTravelAgency">
<el-radio-button :label="true"></el-radio-button>
<el-radio-button :label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
@@ -170,11 +178,8 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24"> <el-col :md="24" :sm="24" :xs="24">
<el-form-item label="移动端缩略图" prop="files"> <el-form-item label="移动端缩略图" prop="files">
<file-upload :files.sync="formData.files" <image-Upload :height="100" :width="100" :limit="1" :file-type="['png', 'jpg']" :file-size="1"
picture_card v-model="formData.files"></image-Upload>
:max="1"
:type="['jpg', 'jpeg', 'png']"
></file-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -295,6 +300,7 @@ layout("/layouts/platform.html"){
{type: 'url', message: '请输入正确的官网地址', trigger: ['blur', 'change']}], {type: 'url', message: '请输入正确的官网地址', trigger: ['blur', 'change']}],
note: [{required: false, message: '请输入备注', trigger: ['change', 'blur']}], note: [{required: false, message: '请输入备注', trigger: ['change', 'blur']}],
year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}], year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}],
signUpTravelAgency: [{required: true, message: '请选择是否自由组团', trigger: ['change', 'blur']}],
//files: [{required: true, message: '请上传移动端缩略图', trigger: ['change', 'blur']}], //files: [{required: true, message: '请上传移动端缩略图', trigger: ['change', 'blur']}],
}, },
viewData: {}, viewData: {},
@@ -308,7 +314,8 @@ layout("/layouts/platform.html"){
officialWebsite: null, officialWebsite: null,
note: null, note: null,
year: null, year: null,
isDisabled: false isDisabled: false,
signUpTravelAgency: false
}, },
pageForm: { pageForm: {
keywords: null, keywords: null,
@@ -342,7 +349,8 @@ layout("/layouts/platform.html"){
officialWebsite: null, officialWebsite: null,
note: null, note: null,
year: null, year: null,
isDisabled: false isDisabled: false,
signUpTravelAgency: false,
} }
}) })
}, },
@@ -413,15 +421,28 @@ layout("/layouts/platform.html"){
}); });
this.importLoading = true this.importLoading = true
const resp = await $.post(loc() + '/travelAgencyImport',data) $.ajax({
if (resp.code===0){ url: loc() + '/travelAgencyImport',
this.pageData(); type: "post",
this.importVisible = false data: data,
this.importLoading = false processData: false,
}else { contentType: false,
this.notifyWarning("导入失败") success: (resp) => {
this.importLoading = false if (resp.code===0){
} this.pageData();
this.importVisible = false
this.importLoading = false
}else {
this.notifyWarning("导入失败")
this.importLoading = false
}
},
error: (resp) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
})
}, },
}, },
async created() { async created() {
@@ -45,7 +45,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
value-format="yyyy" value-format="yyyy"
placeholder="选择年" placeholder="选择年"
style="width: 80%" @change="pageData"> style="width: 80%" @change="pageData();getApplyNumAudit()">
</el-date-picker> </el-date-picker>
</el-col> </el-col>
<el-col :span="12" v-if="pageForm.lb==='ry'||pageForm.lb===''"> <el-col :span="12" v-if="pageForm.lb==='ry'||pageForm.lb===''">
@@ -57,7 +57,7 @@ layout("/layouts/platform.html"){
placeholder="查询类型" placeholder="查询类型"
style="width: 110px;"> style="width: 110px;">
<el-option label="姓名" value="userName"></el-option> <el-option label="姓名" value="userName"></el-option>
<el-option label="号" value="loginName"></el-option> <el-option label="一卡通号" value="loginName"></el-option>
</el-select> </el-select>
<el-button slot="append" @click="pageData">搜索</el-button> <el-button slot="append" @click="pageData">搜索</el-button>
</el-input> </el-input>
@@ -152,10 +152,10 @@ layout("/layouts/platform.html"){
<span>选择路线:</span> <span>选择路线:</span>
<el-select v-model="pageForm.takePartInLineId" filterable clearable <el-select v-model="pageForm.takePartInLineId" filterable clearable
placeholder="请选择线路" placeholder="请选择线路"
style="width: 80%" @change="pageData()"> style="width: 80%" @change="lineChange(pageForm.takePartInLineId); doSearch()">
<el-option v-for="item in takePartInLines" <el-option v-for="item in takePartInLines"
:key="item.id" :key="item.id"
:label="item.lineName+''+item.playStartTime1+''+''+item.unionname+''" :label="item.lineName"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@@ -198,6 +198,7 @@ layout("/layouts/platform.html"){
<el-row v-if="!pageForm.state"> <el-row v-if="!pageForm.state">
<el-col :span="24" style="color: red;margin-top: 10px"> <el-col :span="24" style="color: red;margin-top: 10px">
<span>温馨提醒:当前操作查询是【本工会当年参加疗休养的人员(包含校工会线路)】和【其他工会选择本工会线路的疗休养人员】</span> <span>温馨提醒:当前操作查询是【本工会当年参加疗休养的人员(包含校工会线路)】和【其他工会选择本工会线路的疗休养人员】</span>
<!--<span>温馨提醒:当前操作查询是【本工会当年参加疗休养的人员(包含校工会线路)】</span>-->
</el-col> </el-col>
</el-row> </el-row>
@@ -208,6 +209,18 @@ layout("/layouts/platform.html"){
v-if="pageForm.state=='1'||pageForm.state=='3'"> v-if="pageForm.state=='1'||pageForm.state=='3'">
<el-col class="query-row-title"></el-col> <el-col class="query-row-title"></el-col>
<el-col class="query-row-content"> <el-col class="query-row-content">
<el-col :span="12">
<span>出行时间:</span>
<el-select v-model="pageForm.selectId" filterable clearable
placeholder="请选择出行时间"
style="width: 80%" @change="doSearch()">
<el-option v-for="item in linePlayTimes"
:key="item.times"
:label="item.times"
:value="item.selectId">
</el-option>
</el-select>
</el-col>
<el-col :span="12"> <el-col :span="12">
<span>选择标段:</span> <span>选择标段:</span>
<el-select v-model="pageForm.lotId" filterable clearable <el-select v-model="pageForm.lotId" filterable clearable
@@ -230,19 +243,19 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool label="" :app="this" ref="table_tool"> <table-tool label="" :app="this" ref="table_tool">
<template #label_end> <template #label_end>
<el-radio-group size="medium" v-model="pageForm.lb" class="ml10" <el-radio-group size="small" v-model="pageForm.lb" class="ml10"
@change="pageData()" @change="pageData()"
v-if="pageForm.state=='1'"> v-if="pageForm.state=='1'">
<el-radio-button label="xl">线路列表</el-radio-button> <el-radio-button label="xl">线路列表</el-radio-button>
<el-radio-button label="ry">人员列表</el-radio-button> <el-radio-button label="ry">人员列表</el-radio-button>
</el-radio-group> </el-radio-group>
<el-radio-group size="medium" v-model="pageForm.lb" class="ml10" <el-radio-group size="small" v-model="pageForm.lb" class="ml10"
@change="pageData()" @change="pageData()"
v-if="pageForm.state=='2'"> v-if="pageForm.state=='2'">
<el-radio-button label="lxs">旅行社列表</el-radio-button> <el-radio-button label="lxs">旅行社列表</el-radio-button>
<el-radio-button label="ry">人员列表</el-radio-button> <el-radio-button label="ry">人员列表</el-radio-button>
</el-radio-group> </el-radio-group>
<el-radio-group size="medium" v-model="pageForm.lb" class="ml10" <el-radio-group size="small" v-model="pageForm.lb" class="ml10"
@change="pageData()" @change="pageData()"
v-if="pageForm.state=='3'"> v-if="pageForm.state=='3'">
<el-radio-button label="jd">酒店列表</el-radio-button> <el-radio-button label="jd">酒店列表</el-radio-button>
@@ -252,31 +265,48 @@ layout("/layouts/platform.html"){
style="color: red">当前报名人数有教职工{{applyNum.count1}}人,家属有{{applyNum.count2}}人</span> style="color: red">当前报名人数有教职工{{applyNum.count1}}人,家属有{{applyNum.count2}}人</span>
</template> </template>
<template #func> <template #func>
<el-button icon="el-icon-s-promotion" @click="openImport" size="medium" <el-button icon="el-icon-s-promotion" @click="openImport" size="small"
type="primary">参加人员导入 type="primary">参加人员导入
</el-button> </el-button>
<!--# if(@shiro.hasRole('H04')){ #--> <!--# if(@shiro.hasRole('H04')){ #-->
<template> <template>
<el-button icon="el-icon-s-promotion" <el-button icon="el-icon-s-promotion"
@click="location.href='/platform/theRapyRecuperation/query/exportDeclareForm'" @click="location.href='/platform/theRapyRecuperation/query/exportDeclareForm'"
size="medium" type="primary">申报表导出 size="small" type="primary">申报表导出
</el-button> </el-button>
<el-button icon="el-icon-s-promotion" <el-button icon="el-icon-s-promotion"
@click="location.href='/platform/theRapyRecuperation/query/exportTravelers'" @click="location.href='/platform/theRapyRecuperation/query/exportTravelers'"
size="medium" type="primary">出行人员导出 size="small" type="primary">出行人员导出
</el-button> </el-button>
</template> </template>
<!--# } #--> <!--# } #-->
<el-button icon="el-icon-s-promotion" size="medium" type="primary" <el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="userDrawer = true" @click="userDrawer = true"
:disabled="multipleSelection.length==0" :disabled="multipleSelection.length==0"
class="mr10" v-if="pageForm.lb=='ry'||!pageForm.lb">设置参加人员 class="mr5" v-if="pageForm.lb=='ry'||!pageForm.lb">设置参加人员
</el-button> </el-button>
<el-button icon="el-icon-s-promotion" size="medium" type="primary"
@click="doExport" <el-button icon="el-icon-s-promotion" size="small" type="primary"
class="mr10" v-if="pageForm.state">导出 @click="doReimbursement"
:disabled="multipleSelection.length==0"
class="mr5" v-if="pageForm.state == '2' && pageForm.lb == 'ry'">一键报销
</el-button> </el-button>
<el-radio-group @change="pageData()" size="medium"
<el-dropdown v-if="pageForm.state" class="ml10 mr10">
<el-button size="small" type="primary">
导出报名人员<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="doExport">
导出压缩包(zip)
</el-dropdown-item>
<el-dropdown-item @click.native="doExportExcel">
导出表格(excel)
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-radio-group @change="pageData()" size="small"
v-model="pageForm.regionalNature" v-model="pageForm.regionalNature"
v-if="pageForm.state=='1'"> v-if="pageForm.state=='1'">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
@@ -298,13 +328,13 @@ layout("/layouts/platform.html"){
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" type="index" label="序号" <el-table-column align="center" header-align="center" type="index" label="序号"
width="80px" key="#index"> width="80px" key="#index">
<template scope="scope"> <template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span> <span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.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"
@@ -319,15 +349,23 @@ layout("/layouts/platform.html"){
</el-link> </el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='isFamily'"> <template scope="{row}" v-else-if="column.prop=='isFamily'">
<el-link type="primary" @click="openUser(row)"> <el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}} {{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link> </el-link>
<el-link v-else type="primary">
{{row.familyNumber?'携带':'未携带'}}{{row.familyNumber}}
</el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='lineNum'"> <template scope="{row}" v-else-if="column.prop=='lineNum'">
<el-link type="primary" @click="openApplyUser(row)">
<el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
{{row.lineNum}}{{row.signUpUserFamilyNum}} {{row.lineNum}}{{row.signUpUserFamilyNum}}
</el-link> </el-link>
<el-link v-else type="primary">
{{row.lineNum}}{{row.familyNumber}}
</el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='signUpMode'"> <template scope="{row}" v-else-if="column.prop=='signUpMode'">
{{signUpModeName(row.signUpMode)}} {{signUpModeName(row.signUpMode)}}
@@ -408,23 +446,32 @@ layout("/layouts/platform.html"){
{{row.lotName}} {{row.lotName}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150px" <el-table-column label="操作" width="250px"
v-if="pageForm.lb==='ry'||pageForm.lb===''||pageForm.lb==='xl'"> v-if="pageForm.lb==='ry'||pageForm.lb===''||pageForm.lb==='xl'">
<template scope="{row}"> <template scope="{row}">
<template v-if="pageForm.lb==='xl'"> <template v-if="pageForm.lb==='xl'">
<el-button @click="openApplyUser(row)" size="mini" type="primary"> <el-button @click="openApplyUser(row)" size="mini" type="primary">
查看 查看
</el-button> </el-button>
<el-button @click="doRemind(row)" size="mini" type="primary"> <!--<el-button @click="doRemind(row)" size="mini" type="primary">
提醒 提醒
</el-button> </el-button>-->
</template> </template>
<template v-else> <template v-else>
<el-button @click="openView(row)" size="mini" type="primary" <el-button @click="openView(row)" size="mini" type="primary">查看
plain="">查看
</el-button> </el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑
</el-button>
<el-dropdown class="ml10 mr10" trigger="click">
<el-button size="mini" type="primary">
调整<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="doModify(row)">保留报名记录</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row)">删除报名记录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
</template> </template>
@@ -474,18 +521,18 @@ layout("/layouts/platform.html"){
<el-table-column label="年龄" prop="age"></el-table-column> <el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType"> <el-table-column label="床型" prop="bedType">
<template scope="{row}"> <template scope="{row}">
{{ row.bedInfo.bedType }} {{ row.bedInfo?.bedType }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="床位" prop="bedNum"> <el-table-column label="床位" prop="bedNum">
<template scope="{row}"> <template scope="{row}">
{{ row.bedInfo.bedNum }} {{ row.bedInfo?.bedNum }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser"> <el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}"> <template scope="{row}">
{{ row.bedInfo.otherSleepUser ? {{ row.bedInfo?.otherSleepUser ?
row.bedInfo.otherSleepUser : '暂无' }} row.bedInfo?.otherSleepUser : '暂无' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column> <el-table-column label="关系" prop="relation"></el-table-column>
@@ -562,7 +609,7 @@ layout("/layouts/platform.html"){
<el-dialog <el-dialog
title="查看个人信息" title="查看个人信息"
:visible.sync="userFindDialogVisible" :visible.sync="userFindDialogVisible"
width="80%"> width="80%" top="2%">
<enroll-info ref="viewEnrollInfo" :union_id="unionId"></enroll-info> <enroll-info ref="viewEnrollInfo" :union_id="unionId"></enroll-info>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="userFindDialogVisible = false" type="primary">关闭</el-button> <el-button @click="userFindDialogVisible = false" type="primary">关闭</el-button>
@@ -617,7 +664,7 @@ layout("/layouts/platform.html"){
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column type="index" label="序号" width="80"></el-table-column> <el-table-column type="index" label="序号" width="80"></el-table-column>
<el-table-column prop="loginName" label="号"></el-table-column> <el-table-column prop="loginName" label="一卡通号"></el-table-column>
<el-table-column prop="userName" label="姓名"></el-table-column> <el-table-column prop="userName" label="姓名"></el-table-column>
<el-table-column prop="unitName" label="单位"></el-table-column> <el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="unionName" label="工会"></el-table-column> <el-table-column prop="unionName" label="工会"></el-table-column>
@@ -642,7 +689,7 @@ layout("/layouts/platform.html"){
<el-timeline> <el-timeline>
<el-timeline-item timestamp="下载模板" placement="top"> <el-timeline-item timestamp="下载模板" placement="top">
<el-card> <el-card>
<el-button size="medium" type="" <el-button size="small" type=""
@click="location.href='/platform/basics/downloadTemplate?filePath=travel/TravelEnrollImport.xlsx&fileName=参加人员导入模板.xls'" @click="location.href='/platform/basics/downloadTemplate?filePath=travel/TravelEnrollImport.xlsx&fileName=参加人员导入模板.xls'"
icon="el-icon-download">下载模板 icon="el-icon-download">下载模板
</el-button> </el-button>
@@ -663,7 +710,7 @@ layout("/layouts/platform.html"){
:auto-upload="false" :auto-upload="false"
:limit="1" :limit="1"
:file-list="importData.fileList"> :file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload" <el-button size="small" type="" icon="el-icon-upload"
style="width: 200px">选择文件 style="width: 200px">选择文件
</el-button> </el-button>
<div class="el-upload__tip" slot="tip" style="color: #F56C6C"> <div class="el-upload__tip" slot="tip" style="color: #F56C6C">
@@ -715,6 +762,129 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
</el-drawer> </el-drawer>
<el-dialog
title="修改信息"
:visible.sync="editVisible"
:close-on-click-modal="false"
width="50%">
<el-form :model="editFormData" label-width="120px" :rules="rules" ref="editForm" style="margin-right: 40px">
<el-row>
<el-col span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="editFormData.loginName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="editFormData.userName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="userName" label="手机号">
<el-input v-model="editFormData.mobile" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="身份证号">
<el-input v-model="editFormData.idCard" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="unionName" label="工会">
<el-input v-model="editFormData.unionName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="unitName" label="单位">
<el-input v-model="editFormData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="prop" :label="labelName">
<template v-if="modifyConfig.familyInfo == 2">
<el-collapse v-model="activeNames">
<el-collapse-item title="点击可展开详细信息" name="1">
<el-card shadow="never">
<el-table :data="editFormData.companionList">
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份证号" prop="idCard" show-overflow-tooltip></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
</el-table>
</el-card>
</el-collapse-item>
</el-collapse>
</template>
<template v-else>
<el-input v-model="editFormData.bedType" readonly></el-input>
</template>
</el-form-item>
<el-form-item prop="travelName" label="旅行社" v-if="pageForm.state==='2'">
<el-select v-model="editFormData.agencyId" filterable clearable
placeholder="请选择旅行社"
style="width: 100%">
<el-option v-for="item in agencyLists"
:key="item.id"
:label="item.travelAgencyName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="travelLine" :label="lineLabelName" v-if="pageForm.state==='1'">
<el-select v-model="editFormData.takePartInLineId" filterable clearable
placeholder="请选择线路"
@change="validateLine"
style="width: 100%">
<el-option v-for="item in unionSelectLines"
:key="item.id"
:label="item.lineName + '-' + item.regionalNature + '【' + item.lotName + '】' + '' + item.playStartTime + '至' + item.playEndTime + '' + '' + item.signUpMode + ''"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="specificTime" label="出行时间" v-if="pageForm.state==='3'">
<el-select v-model="editFormData.specificTime" filterable clearable
placeholder="请选择出行时间"
style="width: 100%">
<el-option v-for="item in editSpecificTimes"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
</div> </div>
<script> <script>
@@ -769,7 +939,7 @@ layout("/layouts/platform.html"){
lotId: '' lotId: ''
}, },
tableColumnUsers: [ tableColumnUsers: [
{prop: 'loginName', label: '号'}, {prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'}, {prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true}, {prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true}, {prop: 'unionName', label: '工会', sortable: true},
@@ -787,25 +957,198 @@ layout("/layouts/platform.html"){
], ],
options: [ options: [
{label: "线路", value: "1"}, {label: "线路", value: "1"},
// {label: "旅行社", value: "2"}, {label: "旅行社", value: "2"},
{label: "酒店", value: "3"}, // {label: "酒店", value: "3"},
], ],
unionDisabled: false, unionDisabled: false,
unitDisabled: false, unitDisabled: false,
modifyConfig: {}, modifyConfig: {},
multipleSelection: [], multipleSelection: [],
linePlayTimes: [],
multipleSelection2: [], multipleSelection2: [],
//人员导入 //人员导入
importVisible: false, importVisible: false,
importLoading: false, importLoading: false,
importData: {}, importData: {},
editVisible: false,
editFormData: {},
rules: {
loginName: [{required: true, message: '请填写工号', trigger: ['blur', 'change']}],
userName: [{required: true, message: '请填写姓名', trigger: ['blur', 'change']}],
unionName: [{required: true, message: '请选择工会', trigger: ['blur', 'change']}],
unitName: [{required: true, message: '请选择单位', trigger: ['blur', 'change']}],
// travelName: [{required: true, message: '请选择旅行社', trigger: ['blur', 'change']}],
specificTime: [{required: true, message: '请选择出行时间', trigger: ['blur', 'change']}],
// travelLine: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
editSpecificTimes: [],
labelName: '',
unionSelectLines: [],
lineLabelName: '',
activeNames:[]
} }
}, },
components: { components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue'), 'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=1.0.1'),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue') 'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
}, },
methods: { methods: {
doModify(row){
this.$confirm("您确定要调整【<span style='color: red'>" + row.userName + "</span>】的此条报名信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doModify/' + row.id)
if (resp.code === 0) {
await this.doSearch()
this.$message.success('调整成功')
}
}
}
})
},
async doReimbursement(){
if (this.multipleSelection && this.multipleSelection.length > 0){
const enrollIds = this.multipleSelection.filter(v=>v.isTakePartIn).map(v=>v.id)
let msg = ''
if(enrollIds.length == this.multipleSelection.length){
msg='您确定要将勾选的报名信息设为已报销吗?'
} else {
msg='已为您忽略未参加的教工信息,您确定要将忽略后的数据设为已报销吗?'
}
if (!enrollIds || enrollIds.length == 0){
this.$message.warning('暂无已参加的老师,不能报销')
this.$refs.table.clearSelection();
return
}
console.log(enrollIds)
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
debugger
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/user/query/doReimbursement',{data:JSON.stringify(enrollIds)})
if (resp.code === 0) {
await this.doSearch()
this.$refs.table.clearSelection();
if (enrollIds.length == this.multipleSelection.length){
this.$message.success('操作成功')
} else {
this.$message.success('操作成功,已为您过滤未参加人员')
}
} else {
this.$message.warning('操作失败')
}
}
}
})
} else {
this.$message.warning('请勾选需要报销的报名信息')
}
},
async lineChange(val) {
this.pageForm.selectId = '';
const data = this.takePartInLines.find(v => v.id === val)
if (!data) {
return
}
const resp = await $.get('/platform/theRapyRecuperation/TheRapyXghAudit/getLinePlayTimeByLineId', {
lineId: data.id,
year: this.pageForm.year,
signUpMode: 1,
})
if (resp.code === 0) {
this.linePlayTimes = resp.data
}
},
async validateLine() {
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo'
, {enroll: JSON.stringify(this.editFormData)})
if (resp.code !== 0) {
this.$message.warning(resp.msg)
this.editFormData.takePartInLineId = ''
}
},
async doDelete(row) {
this.$confirm("您确定要删除【<span style='color: red'>" + row.userName + "</span>】的此条报名信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + row.id)
if (resp.code === 0) {
await this.doSearch()
this.$message.success('删除成功')
await this.getApplyNumAudit();
} else {
this.$message.warning(resp.msg)
}
}
}
})
},
async doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
await this.getApplyNumAudit()
await this.getXlByUnion()
},
async doEdit() {
this.$refs['editForm'].validate().then(async () => {
const confirm = await this.$confirm('您确定要修改这位老师的报名信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
if (!this.editFormData.takePartInLineId && !this.editFormData.takePartInBaseManagementId) {
this.$message.warning('请选择线路')
return
}
const resp = await $.post('/platform/theRapyRecuperation/user/query/doEdit', this.editFormData)
if (resp.code === 0) {
this.$notify.success(resp.msg)
this.editVisible = false
await this.doSearch();
} else {
this.$notify.error(resp.msg)
}
}
})
},
async openEdit(row) {
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
this.editFormData = {...resp.data.viewData}
if (this.modifyConfig.familyInfo == 2) {
this.editFormData.companionList = resp.data.viewData.companionList
this.labelName = "家属信息"
} else {
this.editFormData.bedType = resp.data.viewData.familyNumber
this.labelName = "家属数量"
}
}
if (row.takePartInBaseManagementId) {
this.editSpecificTime(row.takePartInBaseManagementId);
this.lineLabelName = "酒店"
} else if (row.takePartInLineId) {
this.lineLabelName = '线路'
}
this.editVisible = true
},
openUser(row) { openUser(row) {
this.companionList = row.companionList this.companionList = row.companionList
this.familyDrawer = true this.familyDrawer = true
@@ -941,26 +1284,61 @@ layout("/layouts/platform.html"){
}, },
doExport() { doExport() {
const { const {
year,
searchName, searchName,
year,
searchKeyword, searchKeyword,
unionId, unionId,
unitId,
agencyId, agencyId,
specificTime,
takePartInLineId, takePartInLineId,
state, state,
lotId, lotId,
linePlayTime,
} = this.pageForm } = this.pageForm
window.open(loc() + "/doExport?year=" + year + let types = this.pageForm.state == 1 ? JSON.stringify(['line']) : JSON.stringify(['travel'])
"&searchName=" + searchName + window.open("/platform/theRapyRecuperation/user/query/doExport?" +
"&searchKeyword" + searchKeyword + "searchName=" + searchName +
"&searchKeyword=" + searchKeyword +
"&startYear=" + year +
"&endYear=" + year +
"&unionId=" + unionId + "&unionId=" + unionId +
"&unitId=" + unitId +
"&agencyId=" + agencyId + "&agencyId=" + agencyId +
"&specificTime=" + specificTime +
"&takePartInLineId=" + takePartInLineId + "&takePartInLineId=" + takePartInLineId +
"&state=" + state + "&state=" + state +
"&lotId=" + lotId) "&lotId=" + lotId +
"&satisfyPeople=false" +
"&types=" + types +
"&linePlayTime=" + linePlayTime)
},
doExportExcel() {
const {
searchName,
year,
searchKeyword,
unionId,
agencyId,
specificTime,
takePartInLineId,
state,
lotId,
linePlayTime,
} = this.pageForm
let types = this.pageForm.state == 1 ? JSON.stringify(['line']) : JSON.stringify(['travel'])
window.open("/platform/theRapyRecuperation/user/query/doExportExcel?" +
"searchName=" + searchName +
"&searchKeyword=" + searchKeyword +
"&startYear=" + year +
"&endYear=" + year +
"&unionId=" + unionId +
"&agencyId=" + agencyId +
"&specificTime=" + specificTime +
"&takePartInLineId=" + takePartInLineId +
"&state=" + state +
"&lotId=" + lotId +
"&satisfyPeople=false" +
"&types=" + types +
"&linePlayTime=" + linePlayTime)
}, },
pageSizeChange(val) { pageSizeChange(val) {
this.pageForm.pageNumber = val; this.pageForm.pageNumber = val;
@@ -1032,10 +1410,22 @@ layout("/layouts/platform.html"){
} }
}, },
pageOrder1(column) { async pageOrder1(column) {
this.pageForm.pageOrderName = column.prop; this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order; this.pageForm.pageOrderBy = column.order;
this.getSelfUnionUser(); if (this.pageForm.lb === "") {
this.getSelfUnionUser()
} else if (this.pageForm.lb === "xl") {
await this.getXlData()
} else if (this.pageForm.lb === "lxs") {
this.getLxsData()
await this.getAgencyList()
} else if (this.pageForm.lb === "jd") {
this.getJdData()
await this.getJdList()
} else {
await this.getRyData()
}
}, },
getSelfUnionUser() { getSelfUnionUser() {
this.tableLoading = true this.tableLoading = true
@@ -1055,29 +1445,32 @@ layout("/layouts/platform.html"){
async pageData() { async pageData() {
if (this.pageForm.lb === "") { if (this.pageForm.lb === "") {
this.tableColumns = [ this.tableColumns = [
{prop: 'loginName', label: '号'}, {prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'}, {prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true}, {prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true}, {prop: 'unionName', label: '工会', sortable: true},
{prop: 'lineOrMaName', label: '线路/酒店', sortable: true}, {prop: 'lineOrMaName', label: '线路/旅行社', sortable: true},
//{prop: 'travelAgencyName', label: '旅行社', sortable: true},
{prop: 'times', label: '出行时间'}, {prop: 'times', label: '出行时间'},
{prop: 'regionalNature', label: '线路类型', sortable: true}, {prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'isFamily', label: '是否携带家属'}, {prop: 'isFamily', label: '是否携带家属'},
{prop: 'isTakePartIn', label: '是否参加'}, {prop: 'isTakePartIn', label: '是否参加'},
{prop: 'stateId', label: '审核状态'}, //{prop: 'reimbursementStatus', label: '是否报销'},
// {prop: 'stateId', label: '审核状态'},
] ]
this.getSelfUnionUser() this.getSelfUnionUser()
} else if (this.pageForm.lb === "xl") { } else if (this.pageForm.lb === "xl") {
this.tableColumns = [ this.tableColumns = [
{prop: 'year', label: '年度'}, {prop: 'year', label: '年度'},
{prop: 'lineName', label: '线路名称', sortable: true}, {prop: 'lineName', label: '线路名称', sortable: true},
{prop: 'times', label: '出行时间'}, // {prop: 'times', label: '出行时间'},
{prop: 'linePlayTime', label: '出行时间'},
{prop: 'travelAgencyName', label: '承担旅行社', sortable: true}, {prop: 'travelAgencyName', label: '承担旅行社', sortable: true},
{prop: 'unionname', label: '创建工会', sortable: true}, {prop: 'unionname', label: '创建工会', sortable: true},
{prop: 'regionalNature', label: '线路类型', sortable: true}, {prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'signUpMode', label: '组织形式', sortable: true}, {prop: 'signUpMode', label: '组织形式', sortable: true},
{prop: 'contact', label: '联系人', sortable: true}, {prop: 'contact', label: '联系人', sortable: true, checked: 0},
{prop: 'contactMobileNumber', label: '联系方式'}, {prop: 'contactMobileNumber', label: '联系方式', checked: 0},
{prop: 'lineNum', label: '报名人数(家属)'} {prop: 'lineNum', label: '报名人数(家属)'}
] ]
await this.getXlData() await this.getXlData()
@@ -1085,11 +1478,11 @@ layout("/layouts/platform.html"){
this.tableColumns = [ this.tableColumns = [
{label: '年度', prop: 'year'}, {label: '年度', prop: 'year'},
{label: '旅行社名称', prop: 'travelAgencyName', sortable: true}, {label: '旅行社名称', prop: 'travelAgencyName', sortable: true},
{label: '旅行社编号', prop: 'serialNumber', sortable: true}, //{label: '旅行社编号', prop: 'serialNumber', sortable: true},
{label: '联系人', prop: 'contact'}, {label: '联系人', prop: 'contact'},
{label: '联系人手机', prop: 'contactMobileNumber'}, {label: '联系人手机', prop: 'contactMobileNumber'},
{label: '邮箱', prop: 'email'}, {label: '邮箱', prop: 'email'},
{label: '官网', prop: 'officialWebsite'}, //{label: '官网', prop: 'officialWebsite'},
{label: '报名人数', prop: 'agencyNum', sortable: true}, {label: '报名人数', prop: 'agencyNum', sortable: true},
] ]
this.getLxsData() this.getLxsData()
@@ -1098,7 +1491,7 @@ layout("/layouts/platform.html"){
this.tableColumns = [ this.tableColumns = [
{label: '年度', prop: 'year'}, {label: '年度', prop: 'year'},
{label: '酒店名称', prop: 'baseName', sortable: true}, {label: '酒店名称', prop: 'baseName', sortable: true},
// {label: '酒店编号', prop: 'serialNumber', sortable: true}, //{label: '酒店编号', prop: 'serialNumber', sortable: true},
{label: '联系人', prop: 'baseContactPerson'}, {label: '联系人', prop: 'baseContactPerson'},
{label: '联系人手机', prop: 'baseContactNumber'}, {label: '联系人手机', prop: 'baseContactNumber'},
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true}, {label: '承担旅行社', prop: 'travelAgencyName', sortable: true},
@@ -1109,17 +1502,33 @@ layout("/layouts/platform.html"){
this.getJdData() this.getJdData()
await this.getJdList() await this.getJdList()
} else { } else {
this.tableColumns = [ if(this.pageForm.state == '2') {
{prop: 'loginName', label: '工号'}, this.tableColumns = [
{prop: 'userName', label: '姓名'}, {prop: 'loginName', label: '一卡通号'},
{prop: 'unitName', label: '单位', sortable: true}, {prop: 'userName', label: '姓名'},
{prop: 'unionName', label: '工会', sortable: true}, {prop: 'unitName', label: '单位', sortable: true},
{prop: 'lineOrMaName', label: '线路/酒店'}, {prop: 'unionName', label: '工会', sortable: true},
{prop: 'times', label: '出行时间'}, {prop: 'travelAgencyName', label: '旅行社'},
{prop: 'isFamily', label: '是否携带家属'}, {prop: 'isFamily', label: '是否携带家属'},
{prop: 'isTakePartIn', label: '是否参加'}, {prop: 'isTakePartIn', label: '是否参加'},
{prop: 'stateId', label: '审核状态'}, {prop: 'reimbursementStatus', label: '是否报销'},
] //{prop: 'stateId', label: '审核状态'},
]
} else {
this.tableColumns = [
{prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true},
{prop: 'lineOrMaName', label: '线路/酒店'},
{prop: 'times', label: '出行时间'},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'isTakePartIn', label: '是否参加'},
//{prop: 'reimbursementStatus', label: '是否报销'},
//{prop: 'stateId', label: '审核状态'},
]
}
await this.getRyData() await this.getRyData()
} }
await this.getApplyNum() await this.getApplyNum()
@@ -1141,11 +1550,6 @@ layout("/layouts/platform.html"){
year: this.pageForm.year, year: this.pageForm.year,
state: this.pageForm.state2 state: this.pageForm.state2
}) })
data.forEach(v => {
if (!v.unionname) {
v.unionname = '校工会'
}
})
this.takePartInLines = data this.takePartInLines = data
}, },
async getAgencyList() { async getAgencyList() {
@@ -1233,7 +1637,8 @@ layout("/layouts/platform.html"){
state2: this.pageForm.state2, state2: this.pageForm.state2,
regionalNature: this.pageForm.regionalNature, regionalNature: this.pageForm.regionalNature,
takePartInLineId: this.pageForm.takePartInLineId, takePartInLineId: this.pageForm.takePartInLineId,
year: this.pageForm.year year: this.pageForm.year,
selectId: this.pageForm.selectId
}) })
this.applyNum = data this.applyNum = data
}, },
@@ -1249,7 +1654,6 @@ layout("/layouts/platform.html"){
{label: "其他工会人员(选我线路)" + data.count3 + "人", value: "3"}, {label: "其他工会人员(选我线路)" + data.count3 + "人", value: "3"},
{label: "选择校工会线路人员" + data.count4 + "人", value: "4"} {label: "选择校工会线路人员" + data.count4 + "人", value: "4"}
] ]
}, },
async getModifyConfig() { async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne') const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
@@ -1275,11 +1679,11 @@ layout("/layouts/platform.html"){
}); });
this.importLoading = true this.importLoading = true
const resp = await $.post('/platform/theRapyRecuperation/user/query/enrollImport',data) const resp = await $.post('/platform/theRapyRecuperation/user/query/enrollImport', data)
if (resp.code === 0){ if (resp.code === 0) {
await this.pageData(); await this.pageData();
this.importVisible = false this.importVisible = false
}else { } else {
this.notifyWarning("导入失败") this.notifyWarning("导入失败")
this.importLoading = false this.importLoading = false
} }
@@ -1288,6 +1692,15 @@ layout("/layouts/platform.html"){
this.importVisible = false; this.importVisible = false;
this.pageData(); this.pageData();
}, },
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
year: this.pageForm.year,
signUpMode: 1,
})
if (resp.code === 0) {
this.unionSelectLines = resp.data
}
},
}, },
async created() { async created() {
await this.getModifyConfig() await this.getModifyConfig()
@@ -1311,6 +1724,7 @@ layout("/layouts/platform.html"){
} }
} }
this.flushUnits() this.flushUnits()
await this.getUnionSelectLine()
} }
}) })
</script> </script>
@@ -47,7 +47,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
value-format="yyyy" value-format="yyyy"
placeholder="选择年" placeholder="选择年"
style="width: 38%" @change="doSearch"> style="width: 38%" @change="getUnionSelectLine(); doSearch()">
</el-date-picker> </el-date-picker>
<span></span> <span></span>
<el-date-picker <el-date-picker
@@ -56,7 +56,7 @@ layout("/layouts/platform.html"){
type="year" type="year"
value-format="yyyy" value-format="yyyy"
placeholder="选择年" placeholder="选择年"
style="width: 38%" @change="doSearch"> style="width: 38%" @change="getUnionSelectLine(); doSearch()">
</el-date-picker> </el-date-picker>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -68,7 +68,7 @@ layout("/layouts/platform.html"){
placeholder="查询类型" placeholder="查询类型"
style="width: 110px;"> style="width: 110px;">
<el-option label="姓名" value="userName"></el-option> <el-option label="姓名" value="userName"></el-option>
<el-option label="号" value="loginName"></el-option> <el-option label="一卡通号" value="loginName"></el-option>
</el-select> </el-select>
<el-button slot="append" @click="doSearch">搜索</el-button> <el-button slot="append" @click="doSearch">搜索</el-button>
</el-input> </el-input>
@@ -138,12 +138,12 @@ layout("/layouts/platform.html"){
:key="item.value" :key="item.value"
:type="item.label" :type="item.label"
size="medium" size="medium"
@click="checkSignUpModeState(item.value)" @click="checkSignUpModeState(item.value);doSearch()"
style="margin-right: 10px;cursor: pointer;margin-bottom: 5px;" style="margin-right: 10px;cursor: pointer;margin-bottom: 5px;"
v-for="item in signUpModeOptions"> v-for="item in signUpModeOptions">
{{ item.label }} {{ item.label }}
</el-tag> </el-tag>
<el-link :underline="false" @click="signUpModeClear" <el-link :underline="false" @click="signUpModeClear();doSearch()"
type="danger" v-if="signUpModeOptions.length && pageForm.signUpMode">清空 type="danger" v-if="signUpModeOptions.length && pageForm.signUpMode">清空
</el-link> </el-link>
</el-col> </el-col>
@@ -175,7 +175,7 @@ layout("/layouts/platform.html"){
style="width: 80%" @change="doSearch()"> style="width: 80%" @change="doSearch()">
<el-option v-for="item in takePartInLines" <el-option v-for="item in takePartInLines"
:key="item.id" :key="item.id"
:label="item.lineName+''+item.playStartTime1+''+''+item.unionname+''" :label="item.lineName+''+item.unionname+''"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@@ -217,14 +217,23 @@ layout("/layouts/platform.html"){
<table-tool label="人员列表" :app="this"> <table-tool label="人员列表" :app="this">
<template #func> <template #func>
<el-button style="margin-right: 10px" @click="openImport" size="medium" type="primary">参加人员导入 <el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="doExport"
v-if="pageForm.state">导出
</el-button> </el-button>
<el-button icon="el-icon-s-promotion" size="medium" type="primary" <el-button @click="openImport" size="small" type="primary">参加人员导入
</el-button>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="userDrawer = true" @click="userDrawer = true"
:disabled="multipleSelection.length==0" :disabled="multipleSelection.length==0"
class="mr10">设置参加人员 class="mr5">设置参加人员
</el-button> </el-button>
<el-radio-group @change="doSearch()" size="medium" <el-button size="small" type="primary"
@click="doReimbursement"
:disabled="multipleSelection.length==0"
class="mr10">一键报销
</el-button>
<el-radio-group @change="doSearch()" size="small"
v-model="pageForm.regionalNature" v-model="pageForm.regionalNature"
v-if="pageForm.state=='1'"> v-if="pageForm.state=='1'">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
@@ -264,7 +273,12 @@ layout("/layouts/platform.html"){
</el-link>--> </el-link>-->
</template> </template>
<template scope="{row}" v-else-if="column.prop=='isFamily'"> <template scope="{row}" v-else-if="column.prop=='isFamily'">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}} <el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
{{row.familyNumber?'携带':'未携带'}}{{row.familyNumber}}
</el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='isTakePartIn'"> <template scope="{row}" v-else-if="column.prop=='isTakePartIn'">
{{row.isTakePartIn?'已参加':'未参加'}} {{row.isTakePartIn?'已参加':'未参加'}}
@@ -275,10 +289,23 @@ layout("/layouts/platform.html"){
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100px"> <el-table-column label="操作" width="250px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看 <el-button @click="openView(row)" size="mini" type="primary">查看
</el-button> </el-button>
<el-button
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
@click="openEdit(row)" size="mini" type="primary">编辑
</el-button>
<el-dropdown class="ml10 mr10" trigger="click">
<el-button size="mini" type="primary">
调整<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="doModify(row)">保留报名记录</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row)">删除报名记录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -286,7 +313,6 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
</template> </template>
<template #view> <template #view>
<enroll-info ref="viewEnrollInfo"></enroll-info> <enroll-info ref="viewEnrollInfo"></enroll-info>
@@ -295,7 +321,6 @@ layout("/layouts/platform.html"){
<line-info ref="viewLineInfo"></line-info> <line-info ref="viewLineInfo"></line-info>
</template> </template>
<el-drawer <el-drawer
size="70%" size="70%"
title="批量设置参加人员" title="批量设置参加人员"
@@ -343,7 +368,7 @@ layout("/layouts/platform.html"){
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column type="index" label="序号" width="80"></el-table-column> <el-table-column type="index" label="序号" width="80"></el-table-column>
<el-table-column prop="loginName" label="号"></el-table-column> <el-table-column prop="loginName" label="一卡通号"></el-table-column>
<el-table-column prop="userName" label="姓名"></el-table-column> <el-table-column prop="userName" label="姓名"></el-table-column>
<el-table-column prop="unitName" label="单位"></el-table-column> <el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="unionName" label="工会"></el-table-column> <el-table-column prop="unionName" label="工会"></el-table-column>
@@ -358,7 +383,6 @@ layout("/layouts/platform.html"){
</span> </span>
</el-drawer> </el-drawer>
<el-dialog <el-dialog
title="参加人员导入" title="参加人员导入"
:visible.sync="importVisible" :visible.sync="importVisible"
@@ -407,7 +431,142 @@ layout("/layouts/platform.html"){
</span> </span>
</el-dialog> </el-dialog>
<el-dialog
title="修改信息"
:visible.sync="editVisible"
:close-on-click-modal="false"
width="50%">
<el-form :model="editFormData" label-width="120px" :rules="rules" ref="editForm" style="margin-right: 40px">
<el-row>
<el-col span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="editFormData.loginName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="editFormData.userName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="userName" label="手机号">
<el-input v-model="editFormData.mobile" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="身份证号">
<el-input v-model="editFormData.idCard" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="12">
<el-form-item prop="unionName" label="工会">
<el-input v-model="editFormData.unionName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="unitName" label="单位">
<el-input v-model="editFormData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="prop" :label="labelName">
<template v-if="modifyConfig.familyInfo == 2">
<el-collapse v-model="activeNames">
<el-collapse-item title="点击可展开详细信息" name="1">
<el-card shadow="never">
<el-table :data="editFormData.companionList">
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份证号" prop="idCard" show-overflow-tooltip></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
</el-table>
</el-card>
</el-collapse-item>
</el-collapse>
</template>
<template v-else>
<el-input v-model="editFormData.bedType" readonly></el-input>
</template>
</el-form-item>
<!--<el-form-item prop="travelName" label="旅行社">
<el-select v-model="editFormData.agencyId" filterable clearable
placeholder="请选择旅行社"
style="width: 100%">
<el-option v-for="item in agencyLists"
:key="item.id"
:label="item.travelAgencyName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>-->
<el-form-item prop="travelLine" :label="lineLabelName">
<div v-if="pageForm.state==='1'">
<el-select v-model="editFormData.takePartInLineId" filterable clearable
placeholder="请选择线路"
@change="validateLine"
style="width: 100%">
<el-option v-for="item in unionSelectLines"
:key="item.id"
:label="item.lineName + '-' + item.regionalNature + '【' + item.lotName + '】' + '' + item.playStartTime + '至' + item.playEndTime + '' + '' + item.signUpMode + ''"
:value="item.id">
</el-option>
</el-select>
</div>
<div v-if="pageForm.state==='3'">
<el-select v-model="editFormData.takePartInBaseManagementId" filterable clearable
placeholder="请选择目的地"
style="width: 100%"
@change="editSpecificTime(editFormData.takePartInBaseManagementId)">
<el-option :key="item.id"
:label="item.baseName +''+item.lotName+''"
:value="item.id"
v-for="item in jdList">
</el-option>
</el-select>
</div>
</el-form-item>
<el-form-item prop="specificTime" label="出行时间" v-if="pageForm.state==='3'">
<el-select v-model="editFormData.specificTime" filterable clearable
placeholder="请选择出行时间"
style="width: 100%">
<el-option v-for="item in editSpecificTimes"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
</guava> </guava>
</div> </div>
@@ -427,15 +586,15 @@ layout("/layouts/platform.html"){
options: [ options: [
{label: "线路", value: "1"}, {label: "线路", value: "1"},
// {label: "旅行社", value: "2"}, {label: "旅行社", value: "2"},
{label: "酒店", value: "3"}, // {label: "酒店", value: "3"},
], ],
agencyLists: [], agencyLists: [],
unionOptions: [], unionOptions: [],
unitOptions: [], unitOptions: [],
takePartInLines: [], takePartInLines: [],
tableColumns: [ tableColumns: [
{prop: 'loginName', label: '号'}, {prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'}, {prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true}, {prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true}, {prop: 'unionName', label: '工会', sortable: true},
@@ -447,17 +606,20 @@ layout("/layouts/platform.html"){
{prop: 'isFamily', label: '是否携带家属'}, {prop: 'isFamily', label: '是否携带家属'},
{prop: 'signingUptime', label: '报名时间', checked: 0}, {prop: 'signingUptime', label: '报名时间', checked: 0},
{prop: 'isTakePartIn', label: '是否参加'}, {prop: 'isTakePartIn', label: '是否参加'},
{prop: 'reimbursementStatus', label: '是否报销'},
{prop: 'takePartInTime', label: '参加时间', checked: 0}, {prop: 'takePartInTime', label: '参加时间', checked: 0},
], ],
pageForm: { pageForm: {
startYear: (moment().format('YYYY') - 2) + '', startYear: moment().format('YYYY'),
endYear: moment().format('YYYY'), endYear: moment().format('YYYY'),
searchName: "userName", searchName: "userName",
unionId: '', unionId: '',
agencyId: '', agencyId: '',
state: '1', state: '1',
regionalNature: '', regionalNature: '',
signUpMode: null signUpMode: '',
lotId: '',
takePartInLineId: '',
}, },
multipleSelection: [], multipleSelection: [],
multipleSelection2: [], multipleSelection2: [],
@@ -469,13 +631,210 @@ layout("/layouts/platform.html"){
{label: '校工会组织', value: 2}, {label: '校工会组织', value: 2},
{label: '分工会组织', value: 1}, {label: '分工会组织', value: 1},
], ],
editVisible: false,
editFormData: {},
rules: {
loginName: [{required: true, message: '请填写工号', trigger: ['blur', 'change']}],
userName: [{required: true, message: '请填写姓名', trigger: ['blur', 'change']}],
unionName: [{required: true, message: '请选择工会', trigger: ['blur', 'change']}],
unitName: [{required: true, message: '请选择单位', trigger: ['blur', 'change']}],
// travelName: [{required: true, message: '请选择旅行社', trigger: ['blur', 'change']}],
specificTime: [{required: true, message: '请选择出行时间', trigger: ['blur', 'change']}],
// travelLine: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
editSpecificTimes: [],
labelName: '',
unionSelectLines: [],
lineLabelName: '',
activeNames: [],
title:'',
dialogVisible:false,
} }
}, },
components: { components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue'), 'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=1.0.1'),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue') 'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
}, },
methods: { methods: {
async doReimbursement(){
if (this.multipleSelection && this.multipleSelection.length > 0){
const enrollIds = this.multipleSelection.filter(v=>v.isTakePartIn).map(v=>v.id)
let msg = ''
if(enrollIds.length == this.multipleSelection.length){
msg='您确定要将勾选的报名信息设为已报销吗?'
} else {
msg='已为您忽略未参加的教工信息,您确定要将忽略后的数据设为已报销吗?'
}
if (!enrollIds || enrollIds.length == 0){
this.$message.warning('暂无已参加的老师,不能报销')
this.$refs.table.clearSelection();
return
}
console.log(enrollIds)
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
debugger
if ("confirm" === a) {//确认后再执行
const resp = await $.post(loc() + '/doReimbursement',{data:JSON.stringify(enrollIds)})
if (resp.code === 0) {
await this.doSearch()
this.$refs.table.clearSelection();
if (enrollIds.length == this.multipleSelection.length){
this.$message.success('操作成功')
} else {
this.$message.success('操作成功,已为您过滤未参加人员')
}
} else {
this.$message.warning('操作失败')
}
}
}
})
} else {
this.$message.warning('请勾选需要报销的报名信息')
}
},
doModify(row){
this.$confirm("您确定要调整【<span style='color: red'>" + row.userName + "</span>】的此条报名信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doModify/' + row.id)
if (resp.code === 0) {
await this.doSearch()
this.$message.success('调整成功')
}
}
}
})
},
doExport() {
const {
takePartInBaseManagementId,
searchName,
startYear,
endYear,
signUpMode,
searchKeyword,
unionId,
agencyId,
specificTime,
takePartInLineId,
state,
lotId,
linePlayTime,
} = this.pageForm
let types = this.pageForm.state == 1 ? JSON.stringify(['line']) : JSON.stringify(['travel'])
window.open(loc() + "/doExport?takePartInBaseManagementId=" + takePartInBaseManagementId +
"&searchName=" + searchName +
"&searchKeyword=" + searchKeyword +
"&startYear=" + startYear +
"&endYear=" + endYear +
"&signUpMode=" + signUpMode +
"&unionId=" + unionId +
"&agencyId=" + agencyId +
"&specificTime=" + specificTime +
"&takePartInLineId=" + takePartInLineId +
"&state=" + state +
"&lotId=" + lotId +
"&satisfyPeople=false" +
"&types=" + types +
"&linePlayTime=" + linePlayTime)
},
async validateLine() {
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo'
, {enroll: JSON.stringify(this.editFormData)})
if (resp.code !== 0) {
this.$message.warning(resp.msg)
this.editFormData.takePartInLineId = ''
}
},
async doEdit() {
this.$refs['editForm'].validate().then(async () => {
const confirm = await this.$confirm('您确定要修改这位老师的报名信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
if (!this.editFormData.takePartInLineId && !this.editFormData.takePartInBaseManagementId) {
this.$message.warning('请选择线路')
return
}
const resp = await $.post('/platform/theRapyRecuperation/user/query/doEdit', this.editFormData)
if (resp.code === 0) {
this.$notify.success(resp.msg)
this.editVisible = false
await this.doSearch();
} else {
this.$notify.error(resp.msg)
}
}
})
},
async openEdit(row) {
this.getUnionSelectLine(row.takePartInLineId)
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
this.editFormData = {...resp.data.viewData}
if (this.modifyConfig.familyInfo == 2) {
this.editFormData.companionList = resp.data.viewData.companionList
this.labelName = "家属信息"
} else {
this.editFormData.bedType = resp.data.viewData.familyNumber
this.labelName = "家属数量"
}
}
if (row.takePartInBaseManagementId) {
this.editSpecificTime(row.takePartInBaseManagementId);
this.lineLabelName = "酒店"
} else if (row.takePartInLineId) {
this.lineLabelName = '线路'
}
this.editVisible = true
},
editSpecificTime(id) {
const jd = this.jdList.find(v => v.id === id)
if (jd) {
const lot = this.modifyConfig.lots.find(v => v.id === jd.lotId)
if (lot.lotName === '四晚五天') {
this.editSpecificTimes = this.getTimeByLot1(jd)
} else if (lot.lotName === '两晚三天') {
this.editSpecificTimes = this.getTimeByLot2(jd)
}
}
},
doDelete(row) {
this.$confirm("您确定要删除【<span style='color: red'>" + row.userName + "</span>】的此条报名信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning',
callback: async (a, b) => {
if ("confirm" === a) {//确认后再执行
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + row.id)
if (resp.code === 0) {
await this.doSearch()
this.$message.success('删除成功')
}
}
}
})
},
async signUpModeClear() { async signUpModeClear() {
this.pageForm.signUpMode = '' this.pageForm.signUpMode = ''
this.takePartInLines = await this.getXlByUnion() this.takePartInLines = await this.getXlByUnion()
@@ -580,6 +939,39 @@ layout("/layouts/platform.html"){
this.pageForm.pageNumber = 1 this.pageForm.pageNumber = 1
this.pageData() this.pageData()
await this.getXlLxsUserCount() await this.getXlLxsUserCount()
this.takePartInLines = await this.getXlByUnion()
if (this.pageForm.state == '2') {
this.tableColumns = [
{prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true},
{prop: 'travelAgencyName', label: '旅行社'},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'signingUptime', label: '报名时间', checked: 0},
{prop: 'isTakePartIn', label: '是否参加'},
{prop: 'reimbursementStatus', label: '是否报销'},
{prop: 'takePartInTime', label: '参加时间', checked: 0},
]
} else {
this.tableColumns = [
{prop: 'loginName', label: '一卡通号'},
{prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true},
// {prop: 'travelAgencyName', label: '旅行社'},
{prop: 'lineName', label: '线路/酒店'},
{prop: 'playStartTime', label: '出行时间'},
{prop: 'regionalNature', label: '线路类型'},
{prop: 'lotName', label: '标段'},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'signingUptime', label: '报名时间', checked: 0},
{prop: 'isTakePartIn', label: '是否参加'},
{prop: 'reimbursementStatus', label: '是否报销'},
{prop: 'takePartInTime', label: '参加时间', checked: 0},
]
}
}, },
async getLines() { async getLines() {
const {data} = await $.post("/platform/theRapyRecuperation/travelAgency/selectLineByAgencyId", { const {data} = await $.post("/platform/theRapyRecuperation/travelAgency/selectLineByAgencyId", {
@@ -604,7 +996,8 @@ layout("/layouts/platform.html"){
async getXlByUnion() { async getXlByUnion() {
const {data} = await $.post("/platform/theRapyRecuperation/TheRapyAudit/getXlByUnion", { const {data} = await $.post("/platform/theRapyRecuperation/TheRapyAudit/getXlByUnion", {
unionId: this.pageForm.unionId, unionId: this.pageForm.unionId,
year: this.pageForm.year, year: this.pageForm.startYear,
endYear: this.pageForm.endYear,
signUpMode: this.pageForm.signUpMode, signUpMode: this.pageForm.signUpMode,
}) })
data.forEach(v => { data.forEach(v => {
@@ -636,7 +1029,8 @@ layout("/layouts/platform.html"){
const {data} = await $.post("/platform/theRapyRecuperation/user/query/getXlLxsUserCount", { const {data} = await $.post("/platform/theRapyRecuperation/user/query/getXlLxsUserCount", {
unionId: this.pageForm.unionId, unionId: this.pageForm.unionId,
startYear: this.pageForm.startYear, startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear endYear: this.pageForm.endYear,
signUpMode: this.pageForm.signUpMode
}) })
this.options.forEach((v, index) => { this.options.forEach((v, index) => {
if (v.value === "1") { if (v.value === "1") {
@@ -679,10 +1073,10 @@ layout("/layouts/platform.html"){
processData: false, processData: false,
contentType: false, contentType: false,
success: (data) => { success: (data) => {
if (data.code === 0){ if (data.code === 0) {
this.pageData(); this.pageData();
this.importVisible = false this.importVisible = false
}else { } else {
this.importLoading = false this.importLoading = false
} }
}, },
@@ -696,9 +1090,21 @@ layout("/layouts/platform.html"){
this.importVisible = false; this.importVisible = false;
this.pageData(); this.pageData();
}, },
async getUnionSelectLine(disPlayUnionSelectId = null) {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear,
disPlayUnionSelectId: disPlayUnionSelectId
})
if (resp.code === 0) {
this.unionSelectLines = resp.data
}
},
}, },
async created() { async created() {
await this.getModifyConfig() await this.getModifyConfig()
await this.getAgencyList()
await this.getUnionSelectLine();
this.unionOptions = await getUnions(null) this.unionOptions = await getUnions(null)
this.flushUnits() this.flushUnits()
await this.getXlLxsUserCount() await this.getXlLxsUserCount()
@@ -129,7 +129,7 @@ layout("/layouts/platform.html"){
</div> </div>
<el-table :data="tableData"> <el-table :data="tableData">
<el-table-column label="号" prop="loginName"></el-table-column> <el-table-column label="一卡通号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column> <el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="参加时间" prop="takePartInTime"></el-table-column> <el-table-column label="参加时间" prop="takePartInTime"></el-table-column>
</el-table> </el-table>
@@ -75,6 +75,34 @@ layout("/layouts/platform.html"){
</div> </div>
</div> </div>
<div class="search-item">
<div class="search-item-label">线路类型:</div>
<div class="search-item-option">
<el-radio-group class="mr0-radio"
v-model="pageForm.regionalNature">
<el-radio-button :label="item.value"
border v-for="item in regionalNatureList">
{{item.label}}
</el-radio-button>
</el-radio-group>
</div>
</div>
<div class="search-item">
<div class="search-item-label">时间标段:</div>
<div class="search-item-option">
<el-select @change="doSearch" clearable filterable
style="width: 100%"
v-model="pageForm.lotId">
<el-option :key="item.id"
:label="item.lotName"
:value="item.id"
v-for="item in lotList"
></el-option>
</el-select>
</div>
</div>
<div class="search-query"> <div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button> <el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div> </div>
@@ -119,9 +147,12 @@ layout("/layouts/platform.html"){
</el-switch> </el-switch>
</template> </template>
<template scope="{row}" v-else-if="column.prop==='signUpUserAndFamilyNum'"> <template scope="{row}" v-else-if="column.prop==='signUpUserAndFamilyNum'">
<span class="text-primary"> <span class="text-primary" v-if="configData.familyInfo == 2">
{{row.signUpUserNum + row.signUpUserFamilyNum}} {{row.signUpUserNum + row.signUpUserFamilyNum}}
</span> </span>
<span class="text-primary" v-else>
{{row.signUpUserNum + row.familyNumber}}
</span>
</template> </template>
<template scope="{row}" v-else-if="column.prop==='playTime'"> <template scope="{row}" v-else-if="column.prop==='playTime'">
<template v-if="row.playStartTime">{{row.playStartTime + '至' + row.playEndTime}}</template> <template v-if="row.playStartTime">{{row.playStartTime + '至' + row.playEndTime}}</template>
@@ -131,7 +162,7 @@ layout("/layouts/platform.html"){
<el-table-column label="操作" width="100px"> <el-table-column label="操作" width="100px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openViewSignUpUsers(row.id,row.unionId)" size="mini" type="primary">调整 <el-button @click="openViewSignUpUsers(row.usId,row.unionId)" size="mini" type="primary">调整
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -153,7 +184,7 @@ layout("/layouts/platform.html"){
<el-table :row-class-name="getRowClassName" :cell-class-name="getColumnClassName" <el-table :row-class-name="getRowClassName" :cell-class-name="getColumnClassName"
:data="schoolFreeSignUpUserList" ref="adjustTable"> :data="schoolFreeSignUpUserList" ref="adjustTable">
<el-table-column :selectable="(row)=>{return row.isNormal}" type="selection"></el-table-column> <el-table-column selectable="" type="selection"></el-table-column>
<el-table-column label="序号" type="expand" width="150px"> <el-table-column label="序号" type="expand" width="150px">
<template scope="{row}"> <template scope="{row}">
<el-card class="companion_card" shadow="never"> <el-card class="companion_card" shadow="never">
@@ -161,7 +192,7 @@ layout("/layouts/platform.html"){
家属信息 家属信息
</h4> </h4>
<el-table :data="row.companionList"> <el-table :data="row.companionList">
<el-table-column label="号" prop="loginName"></el-table-column> <el-table-column label="一卡通号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column> <el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column> <el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column> <el-table-column label="关系" prop="relation"></el-table-column>
@@ -171,16 +202,19 @@ layout("/layouts/platform.html"){
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column> <el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="号" prop="loginName"></el-table-column> <el-table-column label="一卡通号" prop="loginName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column> <el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="单位" prop="unitName" show-overflow-tooltip sortable></el-table-column> <el-table-column label="单位" prop="unitName" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="工会" prop="unionName" show-overflow-tooltip sortable></el-table-column> <el-table-column label="工会" prop="unionName" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="报名时间" prop="signingUptime"></el-table-column> <el-table-column label="报名时间" prop="signingUptime"></el-table-column>
<el-table-column label="家属人数" prop="companionCount"> <el-table-column label="家属人数" prop="companionCount">
<template scope="{row}"> <template scope="{row}">
<span class="text-primary"> <span v-if="configData.familyInfo === 2" class="text-primary">
{{row.companionCount}} {{row.companionCount}}
</span> </span>
<span v-else class="text-primary">
{{row.familyNumber}}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否调整" prop="isNormal"> <el-table-column label="是否调整" prop="isNormal">
@@ -218,6 +252,8 @@ layout("/layouts/platform.html"){
}, },
data() { data() {
return { return {
lotList: [],
regionalNatureList: [],
schoolFreeLineList: [], schoolFreeLineList: [],
pageForm: { pageForm: {
year: new Date().getFullYear().toString(), year: new Date().getFullYear().toString(),
@@ -236,7 +272,7 @@ layout("/layouts/platform.html"){
// {label: '组织形式', prop: 'signUpMode', sortable: true}, // {label: '组织形式', prop: 'signUpMode', sortable: true},
{label: '创建模式', prop: 'createMode'}, {label: '创建模式', prop: 'createMode'},
// {label: '报名模式', prop: 'signUpMode'}, // {label: '报名模式', prop: 'signUpMode'},
{label: '最少成团人数', prop: 'minimumGroupSize'}, {label: '最少参与教工', prop: 'minimumGroupSize'},
{label: '报名人数(含家属)', prop: 'signUpUserAndFamilyNum', width: '150px'}, {label: '报名人数(含家属)', prop: 'signUpUserAndFamilyNum', width: '150px'},
{label: '是否启用', prop: 'isDisabled', sortable: true} {label: '是否启用', prop: 'isDisabled', sortable: true}
@@ -244,11 +280,15 @@ layout("/layouts/platform.html"){
schoolFreeSignUpUserList: [], schoolFreeSignUpUserList: [],
currentLineId: null, currentLineId: null,
currentLineSelectUnionId: null, currentLineSelectUnionId: null,
unionOptions: [] unionOptions: [],
configData: {},
} }
}, },
methods: { methods: {
async getLotList() {
const {data} = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.lotList = data.lots
},
getRowClassName({row, rowIndex}) { getRowClassName({row, rowIndex}) {
if (row.companionCount === 0) { if (row.companionCount === 0) {
return 'row-expand-cover' return 'row-expand-cover'
@@ -332,20 +372,52 @@ layout("/layouts/platform.html"){
}) })
if (confirm !== 'confirm') return if (confirm !== 'confirm') return
const lineId = this.currentLineId const lineId = this.currentLineId
const selection = this.$refs.adjustTable.selection const selection = this.$refs.adjustTable.selection
const loginNames = selection.map(v => v.loginName) const loginNames = selection.filter(v=>v.isNormal === true).map(v => v.loginName)
if (loginNames.length == 0) {
this.$message.warning('所有教职工已调整,请勿重复勾选')
return
}
const resp = await $.post(loc() + '/adjustmentUser', {lineId, loginNames: JSON.stringify(loginNames)}) const resp = await $.post(loc() + '/adjustmentUser', {lineId, loginNames: JSON.stringify(loginNames)})
if (resp.code === 0) { if (resp.code === 0) {
this.notifySuccess(resp.msg) this.notifySuccess(resp.msg)
await this.openViewSignUpUsers(this.currentLineId, this.currentLineSelectUnionId) await this.openViewSignUpUsers(this.currentLineId, this.currentLineSelectUnionId)
await this.pageData();
} else { } else {
this.notifyWarning(resp.msg) this.notifyWarning(resp.msg)
} }
}, },
smsAlerts() { async smsAlerts() {
if (this.$refs.adjustTable.selection.length === 0) {
this.notifyWarning('请选择需要发送短信通知的人员')
return
}
const confirm = await this.$confirm('此操作会向已调整的人员发送短信,您确定要发送短信提醒吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') return
const lineId = this.currentLineId
const selection = this.$refs.adjustTable.selection
const loginNames = selection.filter(v=>v.isNormal === false).map(v => v.loginName)
if (loginNames.length == 0) {
this.$message.warning('暂无已调整人员,请先进行人员调整')
return
}
const resp = await $.post( loc() + '/smsAlerts',{lineId:lineId,loginNames: JSON.stringify(loginNames)})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.openViewSignUpUsers(this.currentLineId, this.currentLineSelectUnionId)
await this.pageData();
} else {
this.notifyWarning(resp.msg)
}
}, },
async lineStatusChange(id) { async lineStatusChange(id) {
const resp = await $.post('/platform/theRapyRecuperation/line/openClosedLine/' + id) const resp = await $.post('/platform/theRapyRecuperation/line/openClosedLine/' + id)
@@ -355,12 +427,19 @@ layout("/layouts/platform.html"){
this.notifyWarning(resp.msg) this.notifyWarning(resp.msg)
} }
}, },
async getConfigData() {
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
},
}, },
async created() { async created() {
await this.getConfigData()
this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode') this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode')
this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode') this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode')
this.regionalNatureList = await getEnumOptions('TheRapyRecuperationProvinceType')
this.unionOptions = await getUnions(null) this.unionOptions = await getUnions(null)
await this.findUnionSignUpModeLineList() await this.findUnionSignUpModeLineList()
this.lotList = this.getLotList()
await this.pageData() await this.pageData()
} }
}) })
@@ -233,7 +233,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never"> <el-card shadow="never">
<el-table :data="clusterTableData"> <el-table :data="clusterTableData">
<el-table-column label="序号" type="index"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="号" prop="loginName"></el-table-column> <el-table-column label="一卡通号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column> <el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column> <el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="工会" prop="unionName"></el-table-column> <el-table-column label="工会" prop="unionName"></el-table-column>
@@ -265,7 +265,7 @@ layout("/layouts/platform.html"){
ref="originalGroupMembersTable" ref="originalGroupMembersTable"
v-show="batchMoveData.originalGroup && batchMoveData.originalGroup.members"> v-show="batchMoveData.originalGroup && batchMoveData.originalGroup.members">
<el-table-column type="selection"></el-table-column> <el-table-column type="selection"></el-table-column>
<el-table-column label="号" prop="loginName"></el-table-column> <el-table-column label="一卡通号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column> <el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column> <el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="工会" prop="unionName"></el-table-column> <el-table-column label="工会" prop="unionName"></el-table-column>
@@ -328,7 +328,7 @@ layout("/layouts/platform.html"){
{label: '旅行社名称', prop: 'travelAgencyName', sortable: true}, {label: '旅行社名称', prop: 'travelAgencyName', sortable: true},
{label: '线路类型', prop: 'regionalNature', sortable: true}, {label: '线路类型', prop: 'regionalNature', sortable: true},
{label: '出行时间', prop: 'times', sortable: true}, {label: '出行时间', prop: 'times', sortable: true},
{label: '最少成团人数', prop: 'minimumGroupSize', sortable: true}, {label: '最少参与教工', prop: 'minimumGroupSize', sortable: true},
// {label: '创建工会', prop: 'createUnionName'}, // {label: '创建工会', prop: 'createUnionName'},
// {label: '创建人', prop: 'createUserName', sortable: true}, // {label: '创建人', prop: 'createUserName', sortable: true},
// {label: '创建模式', prop: 'createMode'}, // {label: '创建模式', prop: 'createMode'},
@@ -31,6 +31,7 @@ layout("/layouts/platform.html"){
style="width: 100%" style="width: 100%"
placeholder="选择年度" placeholder="选择年度"
type="year" type="year"
@change="doSearch"
v-model="pageForm.year" v-model="pageForm.year"
value-format="yyyy"> value-format="yyyy">
</el-date-picker> </el-date-picker>
@@ -48,11 +49,26 @@ layout("/layouts/platform.html"){
<el-option :key="item.id" <el-option :key="item.id"
:label="item.travelAgencyName" :label="item.travelAgencyName"
:value="item.id" :value="item.id"
v-for="item in travelAgencyOptions"></el-option> v-for="item in travelAgencyArray"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="search-item">
<div class="search-item-label">线路类型:</div>
<div class="search-item-option">
<el-radio-group class="mr0-radio"
@change="doSearch"
:disabled = "pageForm.mode == 1"
v-model="pageForm.regionalNature">
<el-radio-button :label="item.value"
border v-for="item in regionalNatureList">
{{item.label}}
</el-radio-button>
</el-radio-group>
</div>
</div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">线路名称:</div> <div class="search-item-label">线路名称:</div>
<div class="search-item-option"> <div class="search-item-option">
@@ -98,10 +114,16 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
<el-card class="mt10" shadow="never"> <el-card class="mt10" shadow="never">
<table-tool :app="this" label="线路列表"> <table-tool :app="this" label="线路列表(温馨提示:如查询条件的年度为空时,已选择默认查询当年选择的线路)">
<template #func> <template #func>
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.selectStatus">
<el-radio-button :label="0">全部</el-radio-button> <el-button @click="showGiveTimes" type="primary"
size="small" style="margin-right: 10px">
一键统赋时间
</el-button>
<el-radio-group @change="doSearch" size="small" v-model="pageForm.selectStatus">
<!--<el-radio-button :label="0">全部</el-radio-button>-->
<el-radio-button :label="1">已选择</el-radio-button> <el-radio-button :label="1">已选择</el-radio-button>
<el-radio-button :label="-1">可选择</el-radio-button> <el-radio-button :label="-1">可选择</el-radio-button>
</el-radio-group> </el-radio-group>
@@ -110,8 +132,11 @@ layout("/layouts/platform.html"){
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
ref="table" ref="table"
align="center" align="center"
row-key="id"
@selection-change="handleSelectionChange"
header-align="center"> header-align="center">
<el-table-column type="selection"></el-table-column> <el-table-column type="selection" reserve-selection width="55px"
:selectable="(row)=>{return row.isDisabled==true || !(row.usId==null || row.usId == '')}"></el-table-column>
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" <el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column> width="80px"></el-table-column>
@@ -123,6 +148,7 @@ layout("/layouts/platform.html"){
header-align="center" header-align="center"
:show-overflow-tooltip="column.prop!=='playTime'" :show-overflow-tooltip="column.prop!=='playTime'"
:key="column.prop" :key="column.prop"
v-if="pageForm.mode != 2 || (pageForm.mode == 2 && column.prop !== 'isOpen')"
v-for="column in tableColumns" v-for="column in tableColumns"
:width="column.width" :width="column.width"
> >
@@ -142,6 +168,9 @@ layout("/layouts/platform.html"){
<template scope="{row:{createMode}}" v-else-if="column.prop==='createMode'"> <template scope="{row:{createMode}}" v-else-if="column.prop==='createMode'">
{{createModeName(createMode)}} {{createModeName(createMode)}}
</template> </template>
<template scope="{row}" v-else-if="column.prop==='belongUnionName'">
{{pageForm.mode == 2 && pageForm.selectStatus == 1 ? '校工会' : row.belongUnionName}}
</template>
<template scope="{row}" v-else-if="column.prop==='playTime'"> <template scope="{row}" v-else-if="column.prop==='playTime'">
<template v-if="row.playTimes"> <template v-if="row.playTimes">
<!--<el-tooltip placement="top"> <!--<el-tooltip placement="top">
@@ -154,11 +183,14 @@ layout("/layouts/platform.html"){
</el-tooltip>--> </el-tooltip>-->
<el-tooltip placement="top"> <el-tooltip placement="top">
<div slot="content"> <div slot="content">
<div v-for="(t,ti) in row.playTimes.split(',')" :key="t" :class="[ti==row.playTimes.split(',').length-1?'':'mb10']"> <div v-for="(t,ti) in row.playTimes.split(',')" :key="t"
:class="[ti==row.playTimes.split(',').length-1?'':'mb10']">
{{t}} {{t}}
</div> </div>
</div> </div>
<div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis">{{row.playTimes}}</div> <div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis">
{{row.playTimes}}
</div>
</el-tooltip> </el-tooltip>
<!-- <div v-for="t in row.playTimes.split(',')" :key="t"> <!-- <div v-for="t in row.playTimes.split(',')" :key="t">
{{t}} {{t}}
@@ -175,6 +207,20 @@ layout("/layouts/platform.html"){
<span v-else>{{row.belongUnionName}}</span> <span v-else>{{row.belongUnionName}}</span>
</template> </template>
<template scope="{row}" v-else-if="column.prop==='isOpen'">
<template v-if="row.usId">
<el-switch
@change="doEditOpen(row)"
v-model="row.isOpen"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
<template v-else>
<span>暂未选择</span>
</template>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100px"> <el-table-column label="操作" width="100px">
@@ -240,7 +286,11 @@ layout("/layouts/platform.html"){
<el-row class="playPeriod"> <el-row class="playPeriod">
<el-descriptions border :column="3" class="playPeriodTable"> <el-descriptions border :column="3" class="playPeriodTable">
<el-descriptions-item label="报名开始时间"> <el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
报名开始时间
</template>
<el-form-item :prop="'times.' + $index + '.signUpStartTime'" <el-form-item :prop="'times.' + $index + '.signUpStartTime'"
:rules="{required:true,message:'报名开始时间',trigger:['change','blur']}" :rules="{required:true,message:'报名开始时间',trigger:['change','blur']}"
label-width="0"> label-width="0">
@@ -251,19 +301,28 @@ layout("/layouts/platform.html"){
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="报名结束时间"> <el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
报名结束时间
</template>
<el-form-item :prop="'times.' + $index + '.signUpEndTime'" <el-form-item :prop="'times.' + $index + '.signUpEndTime'"
:rules="{required:true,message:'报名结束时间',trigger:['change','blur']}" :rules="{required:true,message:'报名结束时间',trigger:['change','blur']}"
label-width="0"> label-width="0">
<el-date-picker style="width: 100%" <el-date-picker style="width: 100%"
type="datetime" type="datetime"
@change="doSetChangeTimeByZjxu($index,row.signUpEndTime)"
v-model="row.signUpEndTime" v-model="row.signUpEndTime"
value-format="yyyy-MM-dd HH:mm:ss"> value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="变更截至时间"> <el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
变更截至时间
</template>
<el-form-item :prop="'times.' + $index + '.changeEndTime'" <el-form-item :prop="'times.' + $index + '.changeEndTime'"
:rules="{required:true,message:'变更截至时间',trigger:['change','blur']}" :rules="{required:true,message:'变更截至时间',trigger:['change','blur']}"
label-width="0"> label-width="0">
@@ -275,7 +334,11 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="出行开始时间"> <el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
出行开始时间
</template>
<el-form-item :prop="'times.' + $index + '.playStartTime'" <el-form-item :prop="'times.' + $index + '.playStartTime'"
:rules="{required:true,message:'出行开始时间',trigger:['change','blur']}" :rules="{required:true,message:'出行开始时间',trigger:['change','blur']}"
label-width="0"> label-width="0">
@@ -287,7 +350,11 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="出行结束时间"> <el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
出行结束时间
</template>
<el-form-item :prop="'times.' + $index + '.playEndTime'" <el-form-item :prop="'times.' + $index + '.playEndTime'"
:rules="{required:true,message:'出行结束时间',trigger:['change','blur']}" :rules="{required:true,message:'出行结束时间',trigger:['change','blur']}"
label-width="0"> label-width="0">
@@ -298,7 +365,29 @@ layout("/layouts/platform.html"){
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="联系人"> <el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
旅行社
</template>
<el-form-item :prop="'times.' + $index + '.travelAgencyId'"
:rules="{required:true,message:'联系人',trigger:['change','blur']}"
label-width="0">
<el-select v-model="row.travelAgencyId" style="width: 100%" clearable filterable
placeholder="请选择旅行社" @change="(val) => {selectTravelChange(val, row)}">
<el-option :key="item.id"
:label="item.travelAgencyName+'('+ item.year +'年)'"
:value="item.id"
v-for="item in travelAgencyList"
></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
联系人
</template>
<el-form-item :prop="'times.' + $index + '.contact'" <el-form-item :prop="'times.' + $index + '.contact'"
:rules="{required:true,message:'联系人',trigger:['change','blur']}" :rules="{required:true,message:'联系人',trigger:['change','blur']}"
label-width="0"> label-width="0">
@@ -306,7 +395,11 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="联系方式"> <el-descriptions-item>
<template slot="label">
<span class="text-danger">*</span>
联系方式
</template>
<el-form-item :prop="'times.' + $index + '.contactPhone'" <el-form-item :prop="'times.' + $index + '.contactPhone'"
:rules="[ :rules="[
{ required: true, message: '手机号码不能为空', trigger: 'blur' }, { required: true, message: '手机号码不能为空', trigger: 'blur' },
@@ -317,16 +410,16 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="最少成团人数"> <!--<el-descriptions-item label="最少参与教工">
<el-form-item :prop="'times.' + $index + '.minimumGroupSize'" <el-form-item :prop="'times.' + $index + '.minimumGroupSize'"
:rules="[ :rules="[
{ required: true, message: '最少成团人数不能为空', trigger: 'blur' }, { required: true, message: '最少参与教工不能为空', trigger: 'blur' },
{ pattern: /^[0-9]*$/, message: '最少成团人数格式不正确', trigger: 'blur' } { pattern: /^[0-9]*$/, message: '最少参与教工格式不正确', trigger: 'blur' }
]" ]"
label-width="0"> label-width="0">
<el-input clearable v-model="row.minimumGroupSize"></el-input> <el-input clearable v-model="row.minimumGroupSize"></el-input>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>-->
<el-descriptions-item label="交通工具"> <el-descriptions-item label="交通工具">
<el-form-item :prop="'times.' + $index + '.trafficTools'" <el-form-item :prop="'times.' + $index + '.trafficTools'"
@@ -345,11 +438,11 @@ layout("/layouts/platform.html"){
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="预计人数(含家属"> <el-descriptions-item label="最少成团人数(包括家属)">
<el-form-item :prop="'times.' + $index + '.estimatedFamilyNumbers'" <el-form-item :prop="'times.' + $index + '.estimatedFamilyNumbers'"
:rules="[ :rules="[
{ required: false, message: '预计人数(含家属)不能为空', trigger: 'blur' }, { required: false, message: '最少成团人数不能为空', trigger: 'blur' },
{ pattern: /^[0-9]*$/, message: '预计人数(含家属)格式不正确', trigger: 'blur' } { pattern: /^[0-9]*$/, message: '最少成团人数格式不正确', trigger: 'blur' }
]" ]"
label-width="0"> label-width="0">
<el-input clearable v-model="row.estimatedFamilyNumbers"></el-input> <el-input clearable v-model="row.estimatedFamilyNumbers"></el-input>
@@ -376,7 +469,7 @@ layout("/layouts/platform.html"){
<div class="text-right"> <div class="text-right">
<el-button <el-button
@click="formData.times.push({enable:true,minimumGroupSize:lineConfig.groupNumber,estimatedCost:lineConfig.cost})" @click="formData.times.push({enable:true,minimumGroupSize:lineConfig.groupNumber,estimatedCost:lineConfig.cost, estimatedFamilyNumbers: lineConfig.outsideQuota})"
size="mini" type="primary">新增出行时间 size="mini" type="primary">新增出行时间
</el-button> </el-button>
</div> </div>
@@ -422,6 +515,11 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="出行结束时间"> <el-descriptions-item label="出行结束时间">
{{row.playEndTime}} {{row.playEndTime}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="旅行社">
{{row.travelAgencyName}}
</el-descriptions-item>
<el-descriptions-item label="联系人"> <el-descriptions-item label="联系人">
{{row.contact}} {{row.contact}}
</el-descriptions-item> </el-descriptions-item>
@@ -430,9 +528,9 @@ layout("/layouts/platform.html"){
{{row.contactPhone}} {{row.contactPhone}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="最少成团人数"> <!--<el-descriptions-item label="最少参与教工">
{{row.minimumGroupSize}} {{row.minimumGroupSize}}
</el-descriptions-item> </el-descriptions-item>-->
<el-descriptions-item label="交通工具"> <el-descriptions-item label="交通工具">
{{row.trafficTools}} {{row.trafficTools}}
@@ -442,7 +540,7 @@ layout("/layouts/platform.html"){
{{row.estimatedCost}} {{row.estimatedCost}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="预计人数(含家属"> <el-descriptions-item label="成团人数包括家属">
{{row.estimatedFamilyNumbers}} {{row.estimatedFamilyNumbers}}
</el-descriptions-item> </el-descriptions-item>
@@ -467,6 +565,103 @@ layout("/layouts/platform.html"){
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :close-on-click-modal="false" :visible.sync="setGiveLineTimeDialog" title="统赋出行时间段信息"
width="80%">
<el-form :model="giveLineTimesData" :rules="giveLineTimesRules" label-width="0" ref="giveLineTimesForm"
size="small">
<div v-for="(row,$index) in giveLineTimesData.times" :key="row.id" class="panel panel-default mt20"
style="border: none">
<div class="panel-heading"
style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none;display: flex;align-items: center;justify-content: space-between">
<h3 class="panel-title">
出行时间段
</h3>
</div>
<el-row class="playPeriod">
<el-descriptions border :column="3" class="playPeriodTable">
<el-descriptions-item label="报名开始时间">
<el-form-item :prop="'times.' + $index + '.signUpStartTime'"
:rules="{required:false,message:'报名开始时间',trigger:['change','blur']}"
label-width="0">
<el-date-picker style="width: 100%"
type="datetime"
v-model="row.signUpStartTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="报名结束时间">
<el-form-item :prop="'times.' + $index + '.signUpEndTime'"
:rules="{required:false,message:'报名结束时间',trigger:['change','blur']}"
label-width="0">
<el-date-picker style="width: 100%"
type="datetime"
v-model="row.signUpEndTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="变更截至时间">
<el-form-item :prop="'times.' + $index + '.changeEndTime'"
:rules="{required:false,message:'变更截至时间',trigger:['change','blur']}"
label-width="0">
<el-date-picker style="width: 100%"
type="datetime"
v-model="row.changeEndTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出行开始时间">
<el-form-item :prop="'times.' + $index + '.playStartTime'"
:rules="{required:false,message:'出行开始时间',trigger:['change','blur']}"
label-width="0">
<el-date-picker style="width: 100%"
type="datetime"
v-model="row.playStartTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出行结束时间">
<el-form-item :prop="'times.' + $index + '.playEndTime'"
:rules="{required:false,message:'出行结束时间',trigger:['change','blur']}"
label-width="0">
<el-date-picker style="width: 100%"
type="datetime"
v-model="row.playEndTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="是否开启">
<el-form-item :prop="'times.' + $index + '.enable'"
label-width="0">
<el-switch
v-model="row.enable"
:active-value="true"
:inactive-value="false"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-row>
</div>
<el-alert closable show-icon style="margin:10px 0"
title="温馨提醒:变更时间应该大于报名截至时间,小于出行时间。"
type="warning"></el-alert>
</el-form>
<el-row justify="end" type="flex">
<el-button @click="setGiveLineTimeDialog=false">取消</el-button>
<el-button @click="doSetGiveLineTimes" type="primary">提交</el-button>
</el-row>
</el-dialog>
</guava> </guava>
</div> </div>
@@ -517,20 +712,61 @@ layout("/layouts/platform.html"){
callback() callback()
} }
//统赋时间
const validateGiveSignUpEndTime = (rule, value, callback) => {
console.log(value)
if (!value) {
callback(new Error('请选择报名截至时间'))
}
if (this.giveLineTimesData.signUpStartTime) {
if (Date.parse(value) <= Date.parse(this.giveLineTimesData.signUpStartTime)) {
callback(new Error('报名截至时间必须大于报名开始时间'))
}
}
callback()
}
const validateGiveChangeEndTime = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择变更截至时间'))
}
if (this.giveLineTimesData.signUpEndTime) {
if (Date.parse(value) <= Date.parse(this.giveLineTimesData.signUpEndTime)) {
callback(new Error('变更截至时间必须大于报名截至时间'))
}
}
callback()
}
const validateGivePlayEndTime = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择出行结束时间'))
}
if (this.giveLineTimesData.playStartTime) {
if (Date.parse(value) <= Date.parse(this.giveLineTimesData.playStartTime)) {
callback(new Error('出行结束时间必须大于出行开始时间'))
}
}
callback()
}
return { return {
travelAgencyArray: [],
travelAgencyList: [],
tableColumns: [ tableColumns: [
{label: '年度', prop: 'year', sortable: true}, // {label: '年度', prop: 'year', sortable: true},
{label: '线路名称', prop: 'lineName', sortable: true}, {label: '线路名称', prop: 'lineName', sortable: true},
{label: '线路类型', prop: 'regionalNature', sortable: true}, {label: '线路类型', prop: 'regionalNature', sortable: true},
{label: '时间标段', prop: 'lotName', sortable: true, sortProp: 'lotValue'}, {label: '时间标段', prop: 'lotName', sortable: true, sortProp: 'lotValue'},
{label: '出行时间', prop: 'playTime', sortable: true, sortProp: 'playStartTime', width: 230}, {label: '出行时间', prop: 'playTime', sortable: 'custom', sortProp: 'playStartTime', width: 230},
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true}, //{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},
// {label: '所属分工会', prop: 'belongUnionName', sortable: true}, // {label: '所属分工会', prop: 'belongUnionName', sortable: true},
{label: '组织形式', prop: 'signUpMode', sortable: true}, {label: '组织形式', prop: 'signUpMode', sortable: true},
// {label: '编号', prop: 'serialNumber', sortable: true}, // {label: '编号', prop: 'serialNumber', sortable: true},
// {label: '创建模式', prop: 'createMode', sortable: true}, // {label: '创建模式', prop: 'createMode', sortable: true},
//{label: '创建人', prop: 'createUserName', sortable: true}, //{label: '创建人', prop: 'createUserName', sortable: true},
{label: '创建工会', prop: 'createUnionName', sortable: true}, {label: '选择工会', prop: 'belongUnionName', sortable: true},
{label: '是否开放对外报名', prop: 'isOpen', sortable: true},
// {label: '是否启用', prop: 'isDisabled', sortable: true} // {label: '是否启用', prop: 'isDisabled', sortable: true}
], ],
rules: { rules: {
@@ -557,9 +793,9 @@ layout("/layouts/platform.html"){
}, },
pageForm: { pageForm: {
keywords: null, keywords: null,
year: new Date().getFullYear().toString(),
selectStatus: -1, selectStatus: -1,
unionId: null unionId: null,
regionalNature: '省内'
}, },
createModeList: [], createModeList: [],
signUpModeList: [], signUpModeList: [],
@@ -572,11 +808,66 @@ layout("/layouts/platform.html"){
lineConfig: { lineConfig: {
groupNumber: null, groupNumber: null,
cost: null cost: null
} },
regionalNatureList: [{label:'全部线路',name:'provinceAll',ordinal:0,provinceIn:'provinceIn',provinceOut:'provinceOut',value:'全部'}],
multipleSelection: [],
giveLineTimesData: {
times: []
},
giveLineTimesRules: {
signUpStartTime: [{required: false, message: '请选择报名开始时间', trigger: ['change', 'blur']}],
signUpEndTime: [{
required: false,
validator: validateGiveSignUpEndTime,
trigger: ['change', 'blur']
}],
changeEndTime: [{
required: false,
validator: validateGiveChangeEndTime,
trigger: ['change', 'blur']
}],
playStartTime: [{required: false, message: '请选择出行开始时间', trigger: ['change', 'blur']}],
playEndTime: [{required: false, validator: validateGivePlayEndTime, trigger: ['change', 'blur']}],
},
setGiveLineTimeDialog: false,
} }
}, },
computed: {}, computed: {
computedChangeEndTime() {
return this.formData.times.map(row => ({
...row,
changeEndTime: row.signUpEndTime,
}));
},
},
methods: { methods: {
doSearch() {
this.tableData = []
this.tableKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.pageData()
},
selectTravelChange(val, row) {
const o = this.travelAgencyList.find(o => o.id === val)
console.log(o)
row.contact = o.contact
row.contactPhone = o.contactMobileNumber
},
pageOrder(column) {
if(column.prop === 'playTime') {
this.pageForm.pageOrderName = 'playStartTime'
} else {
this.pageForm.pageOrderName = column.prop;
}
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
doSetChangeTimeByZjxu(index, value){
this.$set(this.formData.times[index], "changeEndTime", value)
},
async openViewLineInfo({id, usUnionId}) { async openViewLineInfo({id, usUnionId}) {
this.$refs.guava.view() this.$refs.guava.view()
this.$refs.viewLineInfo.openView(id, usUnionId) this.$refs.viewLineInfo.openView(id, usUnionId)
@@ -585,7 +876,8 @@ layout("/layouts/platform.html"){
const resp = await $.post(loc() + '/selectLineInfo', { const resp = await $.post(loc() + '/selectLineInfo', {
lineId: id, lineId: id,
unionId: usUnionId, unionId: usUnionId,
mode: GetQueryString('mode') mode: GetQueryString('mode'),
year: this.pageForm.year
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.timeLots = resp.data this.timeLots = resp.data
@@ -601,13 +893,22 @@ layout("/layouts/platform.html"){
const resp = await $.post(loc() + '/selectLineInfo', { const resp = await $.post(loc() + '/selectLineInfo', {
lineId: id, lineId: id,
unionId: usUnionId, unionId: usUnionId,
mode: GetQueryString('mode') mode: GetQueryString('mode'),
year: this.pageForm.year
}) })
if (resp.code === 0 && resp.data) { if (resp.code === 0 && resp.data) {
this.$set(this.formData, 'times', resp.data) this.formData = {
times:[]
}
if(resp.data && resp.data.length > 0){
this.$set(this.formData, 'times', resp.data)
}else{
this.formData.times.push({enable:true,minimumGroupSize:this.lineConfig.groupNumber,estimatedCost:this.lineConfig.cost, estimatedFamilyNumbers: this.lineConfig.outsideQuota})
}
this.formData.lineId = id this.formData.lineId = id
this.formData.signUpMode = signUpMode this.formData.signUpMode = signUpMode
this.$set(this.formData, 'lineName', lineName) this.$set(this.formData, 'lineName', lineName)
this.setLineTimeDialog = true this.setLineTimeDialog = true
} else { } else {
this.notifyWarning(resp.msg) this.notifyWarning(resp.msg)
@@ -669,7 +970,7 @@ layout("/layouts/platform.html"){
}, },
async getTravelAgencyOptions() { async getTravelAgencyOptions() {
const {data} = await $.get(loc() + '/getTravelAgencyOptions') const {data} = await $.get(loc() + '/getTravelAgencyOptions')
this.travelAgencyOptions = data this.travelAgencyArray = data
}, },
async getLotList() { async getLotList() {
const {data} = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne') const {data} = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
@@ -678,15 +979,88 @@ layout("/layouts/platform.html"){
async getLineConfig(lineId) { async getLineConfig(lineId) {
const {data} = await $.post(loc() + '/getLineConfig/' + lineId) const {data} = await $.post(loc() + '/getLineConfig/' + lineId)
this.lineConfig = data this.lineConfig = data
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
async selectTravelAgencyList() {
const resp = await $.post('/platform/theRapyRecuperation/travelAgency/selectTravelAgency', {year: new Date().getFullYear()})
this.travelAgencyList = resp.data
},
showGiveTimes() {
if (!this.multipleSelection || this.multipleSelection.length == 0) {
this.$message.warning('请在线路列表中勾选您想要统赋时间的线路!');
return
}
this.giveLineTimesData = {
times: [{
signUpStartTime: '',
signUpEndTime: '',
changeEndTime: '',
playStartTime: '',
playEndTime: '',
}]
}
this.setGiveLineTimeDialog = true;
},
async doSetGiveLineTimes() {
const valid = await this.$refs['giveLineTimesForm'].validate()
if (!valid) return
const confirm = await this.$confirm('请再次确认,是否为选择线路统赋时间?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') return
const lineIds = this.multipleSelection.map(v => v.usId)
const fmtData = this.giveLineTimesData.times.map(v => {
return {
...v,
signUpMode: this.formData.signUpMode,
mode: GetQueryString('mode')
}
})
const resp = await $.post(loc() + '/setGiveLineTimes', {
lineIds: JSON.stringify(lineIds),
lineUnionSelects: JSON.stringify(fmtData)
})
if (resp.code === 0) {
this.setGiveLineTimeDialog = false
this.pageData()
this.$message.success(resp.msg)
this.$refs.table.clearSelection()
} else {
this.$message.warning(resp.msg)
}
},
async doEditOpen(row){
console.log(row)
const resp = await $.get(loc() + '/doEditOpen',{id:row.usId})
if (resp.code === 0){
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
this.pageData()
} }
}, },
async created() { async created() {
this.$set(this.pageForm, 'mode', GetQueryString('mode')) this.$set(this.pageForm, 'mode', GetQueryString('mode'))
if(this.pageForm.mode == 2) {
this.$set(this.pageForm, 'regionalNature', '全部')
}
this.pageData() this.pageData()
this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode') this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode')
this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode') this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode')
this.regionalNatureList.push(...await getEnumOptions('TheRapyRecuperationProvinceType'))
// const result = await getEnumOptions('TheRapyRecuperationProvinceType')
this.unionOptions = await getUnions(null) this.unionOptions = await getUnions(null)
this.travelAgencyOptions = this.getTravelAgencyOptions() this.travelAgencyOptions = this.selectTravelAgencyList()
await this.getTravelAgencyOptions()
this.lotList = this.getLotList() this.lotList = this.getLotList()
} }
}) })
@@ -695,4 +1069,4 @@ layout("/layouts/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -0,0 +1,505 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.query-row {
height: 70px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.query-row .el-col {
overflow: hidden;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row-title {
width: 120px;
}
.el-table-container {
padding-top: 0;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>&emsp;&emsp;度:</span>
<el-date-picker
:clearable="false"
v-model="pageForm.startYear"
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 38%" @change="getUnionSelectLine(); doSearch()">
</el-date-picker>
<span></span>
<el-date-picker
:clearable="false"
v-model="pageForm.endYear"
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 38%" @change="doSearch">
</el-date-picker>
</el-col>
<el-col :span="12">
<span>所属工会:</span>
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会"
@change="doSearch()"
filterable clearable style="width: 80%">
<el-option
v-for="item in unions"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>路线类型:</span>
<el-select v-model="pageForm.regionalNature" filterable
placeholder="请选择线路"
style="width: 80%"
@change="lineTypeChange">
<el-option label="全部" value=""></el-option>
<el-option label="省内" value="省内"></el-option>
<el-option label="省外" value="省外"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<span>线&emsp;&emsp;路:</span>
<el-select v-model="pageForm.takePartInLineId" filterable clearable
placeholder="请选择线路"
style="width: 80%" @change="lineChange">
<el-option v-for="item in lineList"
:key="item.id"
:label="item.lineName + '-' + item.regionalNature + '【' + item.lotName + '】' + '' + item.signUpMode + ''"
:value="item.lineId">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>&emsp;&emsp;段:</span>
<el-select v-model="pageForm.lotId" filterable clearable
placeholder="请选择标段"
style="width: 80%" @change="doSearch()">
<el-option v-for="item in modifyConfig.lots"
:key="item.id"
:label="item.lotName"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<span>出行时间:</span>
<el-select v-model="pageForm.selectId" filterable clearable
placeholder="请选择出行时间"
style="width: 80%" @change="playChange">
<el-option v-for="item in linePlayTimes"
:key="item.times"
:label="item.times"
:value="item.selectId">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="" :app="this" ref="table_tool">
<template #func>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="doExport"
class="mr10">导出成团线路人员
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%"
ref="table"
row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" label="序号"
width="80px" key="#index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:width="column.width"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop=='lineName'">
<el-link type="primary" @click="openLine(row)">{{row.lineName}}
</el-link>
</template>
<template scope="{row}" v-if="column.prop=='signUpMode'">
<span>{{row.signUpMode == '1' ? '校工会组织' : '分工会组织'}}</span>
</template>
<template scope="{row}" v-else-if="column.prop=='lineNum'">
<el-link v-if="!row.familyNumber" type="primary" @click="openUserData(row)">
{{row.lineNum + row.signUpUserFamilyNum}}{{row.signUpUserFamilyNum}}
</el-link>
<el-link v-else type="primary">
{{row.lineNum + row.familyNumber}}{{row.familyNumber}}
</el-link>
</template>
</el-table-column>
<el-table-column label="操作" width="380px">
<template scope="{row}">
<template>
<el-button @click="openUserData(row)" size="mini" type="primary">
查看人员
</el-button>
<el-button size="mini" type="primary" @click="sendSuccess(row)">
发送成团通知
</el-button>
<el-dropdown class="ml10 mr10" trigger="click">
<el-button size="mini" type="primary">
发送未成团通知<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="sendFail(row, true)">保留报名记录</el-dropdown-item>
<el-dropdown-item @click.native="sendFail(row, false)">删除报名记录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #public>
<line-info ref="viewLineInfo"></line-info>
</template>
<template #edit>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">工号姓名</div>
<div class="search-item-option">
<el-input v-model="userPageForm.searchKeyword" maxlength="10" clearable></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('SchoolUnionMemberAdmin')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="userPageForm.unionId">
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="userPageForm.unitId">
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="getUserDataByLineId" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="userData">
<el-table-column
align="center"
header-align="center"
v-for="column in userDataTableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop=='isFamily'">
<el-link v-if="!row.familyNumber" type="primary">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
{{row.familyNumber?'携带':'未携带'}}{{row.familyNumber}}
</el-link>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="userPageSizeChange"
@current-change="userPageNumberChange"
:current-page="userPageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="userPageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="userPageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
startYear: moment().format('YYYY'),
endYear: moment().format('YYYY'),
unionId: '',
regionalNature: '',
signUpMode: '',
lotId: '',
takePartInLineId: '',
selectId: '',
},
linePlayTimes: [],
tableColumns: [
{prop: 'year', label: '年度', width: 60},
{prop: 'lineName', label: '线路名称', sortable: true, width: 200},
{prop: 'linePlayTime', label: '出行时间', width: 180},
{prop: 'travelAgencyName', label: '承担旅行社', sortable: true, width: 180},
{prop: 'unionname', label: '选择线路工会', sortable: true},
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'contact', label: '联系人', sortable: true, checked: 0},
{prop: 'contactMobileNumber', label: '联系方式', checked: 0},
{prop: 'estimatedFamilyNumbers', label: '最少成团人数', width: 80},
{prop: 'lineNum', label: '报名人数(家属)'},
],
modifyConfig: {},
lineList: [],
unions: [],
units:[],
signUpModeOptions: [
{label: '校工会组织', value: 2},
{label: '分工会组织', value: 1},
],
userPageForm:{
pageNumber:1,
pageSize: 10
},
userData:[],
userDataTableColumns:[
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'unionName', label: '所属工会'},
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'linePlayTime', label: '出行时间', sortable: true}
],
lineUId: '',
selectLine: {
lineName: '全部'
},
takePartInLines: [],
}
},
components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=1.0.1'),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
},
methods: {
doExport() {
const {
startYear,
endYear,
unionId,
takePartInLineId,
lotId,
linePlayTime,
regionalNature,
} = this.pageForm
window.open("/platform/theRapyRecuperation/user/query/doExport?" +
"startYear=" + startYear +
"&endYear=" + endYear +
"&unionId=" + unionId +
"&takePartInLineId=" + takePartInLineId +
"&lotId=" + lotId +
"&regionalNature=" + regionalNature +
"&satisfyPeople=true" +
"&types=" + JSON.stringify(['line']) +
"&linePlayTime=" + linePlayTime)
},
async getLinePlayTimeByLineId(id) {
const resp = await $.get('/platform/theRapyRecuperation/TheRapyXghAudit/getLinePlayTimeByLineId', {
lineId: id,
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear,
flag: true
})
if (resp.code === 0) {
this.linePlayTimes = resp.data
}
},
async lineChange(val) {
this.pageForm.selectId = ''
await this.getLinePlayTimeByLineId(val);
await this.doSearch()
},
async playChange() {
await this.doSearch()
},
lineTypeChange() {
this.pageForm.takePartInLineId = ''
this.getUnionSelectLine()
this.doSearch()
},
async sendSuccess(row) {
this.$confirm("确定发送<span style='color: red'>成团通知</span>吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/statistics/sendSuccess', {id: row.lineUId})
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
})
},
sendFail(row, type) {
this.$confirm("确定发送<span style='color: red'>未成团通知</span><span style='color: red'>" + (type ? '保留' : '删除') + "报名记录</span>吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/statistics/sendFail', {id: row.lineUId, type: type})
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
})
},
openLine(row) {
this.$refs.guava.public()
if (row.regionalNature === "省内") {
this.$refs.viewLineInfo.findOne(row.lineId, null)
} else {
this.$refs.viewLineInfo.findOne(row.lineId, row.usUnionId)
}
},
openUserData(row){
this.lineUId = row.lineUId
this.$refs.guava.edit();
this.getUserDataByLineId(row)
},
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear,
signUpMode: this.pageForm.signUpMode,
flag: true,
regionalNature: this.pageForm.regionalNature
})
if (resp.code === 0) {
this.lineList = resp.data
}
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
async flushUnits() {
this.$set(this.userData, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === 'true') {
this.units = await getUnits(this.userData.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
userPageSizeChange(val) {
this.userPageForm.pageSize = val;
this.getUserDataByLineId();
},
userPageNumberChange(val) {
this.userPageForm.pageNumber = val;
this.getUserDataByLineId();
},
async getUserDataByLineId(row){
this.userPageForm.takePartLineId = this.lineUId
const resp = await $.post(loc() + '/getUserDateByLine',this.userPageForm)
if (resp.code === 0){
this.userData = resp.data.list
this.userPageForm.totalCount = resp.data.totalCount
}
}
},
async created() {
this.unions = await getUnions()
await this.getModifyConfig();
await this.getUnionSelectLine();
this.pageData();
this.flushUnits();
}
})
</script>
<!--#
}
#-->
@@ -12,11 +12,11 @@ layout("/layouts/platform.html"){
padding: 12px 25px; padding: 12px 25px;
} }
.el-dialog__title { /*.el-dialog__title {
font-size: 18px; /* 修改标题字体大小 */ font-size: 18px; !* 修改标题字体大小 *!
color: red; /* 修改标题字体颜色 */ color: red; !* 修改标题字体颜色 *!
border-bottom: none; /* 去掉标题底部边框线 */ border-bottom: none; !* 去掉标题底部边框线 *!
} }*/
</style> </style>
@@ -33,28 +33,34 @@ layout("/layouts/platform.html"){
<el-input v-model="formData.configName" placeholder="请输入配置名称"></el-input> <el-input v-model="formData.configName" placeholder="请输入配置名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="activityGroupId" label="参加人员范围"> <el-form-item prop="activityGroupId" label="参加人员范围">
<el-select v-model="formData.activityGroupId" placeholder="请选择参加人员范围" filterable <div style="display: flex; justify-content: space-between">
clearable <div style="width: 99%">
style="width: 100%"> <el-select v-model="formData.activityGroupId" placeholder="请选择参加人员范围" filterable
<el-option v-for="item in activityGroupList" clearable
:value="item.groupId" style="width: 99%">
:key="item.groupId" <el-option v-for="item in activityGroupList"
:label="item.groupName"></el-option> :value="item.groupId"
</el-select> :key="item.groupId"
:label="item.groupName"></el-option>
</el-select>
</div>
<div>
<el-button @click="$refs.drawerUserScope.userScopeDialog = true" type="primary">设置</el-button>
</div>
</div>
</el-form-item> </el-form-item>
<el-form-item label="省外名额分配" prop="outsideQuota"> <el-form-item label="省外最少成团人数(包括家属)" prop="outsideQuota">
<el-input v-model.number="formData.outsideQuota" <el-input v-model.number="formData.outsideQuota"
placeholder="请输入省外名额分配"></el-input> placeholder="请输入省外最少成团人数(包括家属)"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="省外名额分配比例" prop="outsideQuotaProportion"> <!--<el-form-item label="省外名额分配比例" prop="outsideQuotaProportion">
<el-slider <el-input placeholder="请输入省外名额分配比例" v-model="formData.outsideQuotaProportion">
show-input <template slot="append">%</template>
v-model="formData.outsideQuotaProportion"> </el-input>
</el-slider> </el-form-item>-->
</el-form-item>
<el-form-item label="省外几年去一次" prop="outsideNumber"> <el-form-item label="省外几年去一次" prop="outsideNumber">
@@ -64,22 +70,22 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
<el-form-item label="每年旅行频率" prop="travelFrequency"> <el-form-item label="每年旅行频率" prop="travelFrequency">
<el-input max="100" disabled <el-input max="100"
placeholder="请输入每年旅行频率" placeholder="请输入每年旅行频率"
v-model.number="formData.travelFrequency"></el-input> v-model.number="formData.travelFrequency"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="组团人数" prop="groupNumber"> <!--<el-form-item label="最少教工人数" prop="groupNumber">
<el-input max="100" <el-input max="100"
placeholder="请输入组团人数" placeholder="请输入最少教工人数"
v-model.number="formData.groupNumber"></el-input> v-model.number="formData.groupNumber"></el-input>
</el-form-item> </el-form-item>-->
<el-form-item label="不可取消修改天数" prop="modifyDays"> <!--<el-form-item label="不可取消修改天数" prop="modifyDays">
<el-input max="100" <el-input max="100"
placeholder="请输入不可取消修改天数" placeholder="请输入不可取消修改天数"
v-model.number="formData.modifyDays"></el-input> v-model.number="formData.modifyDays"></el-input>
</el-form-item> </el-form-item>-->
<el-form-item label="可以修改几次" prop="modifyNumber"> <el-form-item label="可以修改几次" prop="modifyNumber">
<el-input max="100" <el-input max="100"
@@ -101,6 +107,13 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="旅行社是否需要审核" prop="travelAudit">
<el-radio-group v-model="formData.travelAudit">
<el-radio-button :label="true">需要</el-radio-button>
<el-radio-button :label="false">不需要</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="全批次最多报名人数" prop="allLineSignUpNumber"> <el-form-item label="全批次最多报名人数" prop="allLineSignUpNumber">
<el-input max="100" <el-input max="100"
placeholder="请输入全批次最多报名人数" placeholder="请输入全批次最多报名人数"
@@ -113,6 +126,20 @@ layout("/layouts/platform.html"){
v-model.number="formData.provinceStartYear"></el-input> v-model.number="formData.provinceStartYear"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="床位信息" prop="bedInfo">
<el-radio-group v-model="formData.bedInfo">
<el-radio-button :label="true">需要</el-radio-button>
<el-radio-button :label="false">不需要</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="家属信息" prop="familyInfo">
<el-radio-group v-model="formData.familyInfo">
<el-radio-button :label="1">数量</el-radio-button>
<el-radio-button :label="2">详细信息</el-radio-button>
</el-radio-group>
</el-form-item>
<vi-title title="标段管理"></vi-title> <vi-title title="标段管理"></vi-title>
<el-form-item label="标段"> <el-form-item label="标段">
<el-button type="primary" @click="formData.lots.push({})" <el-button type="primary" @click="formData.lots.push({})"
@@ -153,7 +180,7 @@ layout("/layouts/platform.html"){
<vi-title title="服务须知"></vi-title> <vi-title title="服务须知"></vi-title>
<el-form-item label="疗休养服务须知" prop="notice"> <el-form-item label="疗休养服务须知" prop="notice">
<div id="lineContent"></div> <text-editor v-model="formData.notice"></text-editor>
</el-form-item> </el-form-item>
<el-form-item class="item-button"> <el-form-item class="item-button">
@@ -200,6 +227,12 @@ layout("/layouts/platform.html"){
</span> </span>
</el-dialog> </el-dialog>
</guava> </guava>
<drawer-user-scope
@group_change="getActivityGroup"
ref="drawerUserScope"
:group_id.sync="formData.activityGroupId"
></drawer-user-scope>
</div> </div>
<script> <script>
@@ -213,6 +246,7 @@ layout("/layouts/platform.html"){
formData: { formData: {
isSnLine: 0, isSnLine: 0,
isSwLine: 0, isSwLine: 0,
travelAudit: 0,
lots: [], lots: [],
configName: '智慧工会疗休养配置', configName: '智慧工会疗休养配置',
outsideQuota: null, outsideQuota: null,
@@ -225,14 +259,17 @@ layout("/layouts/platform.html"){
allLineSignUpNumber: null, allLineSignUpNumber: null,
notice: null, notice: null,
provinceStartYear: null, provinceStartYear: null,
bedInfo: true,
familyInfo: 1,
}, },
formRules: { formRules: {
configName: [{required: true, message: '请填写配置名称', trigger: ['blur', 'change']}], configName: [{required: true, message: '请填写配置名称', trigger: ['blur', 'change']}],
isSnLine: [{required: true, message: '请选择省内线路是否需要审核', trigger: ['blur', 'change']}], isSnLine: [{required: true, message: '请选择省内线路是否需要审核', trigger: ['blur', 'change']}],
isSwLine: [{required: true, message: '请选择省外线路是否需要审核', trigger: ['blur', 'change']}], isSwLine: [{required: true, message: '请选择省外线路是否需要审核', trigger: ['blur', 'change']}],
travelAudit: [{required: true, message: '请选择旅行社是否需要审核', trigger: ['blur', 'change']}],
outsideQuota: [{ outsideQuota: [{
required: true, required: true,
message: '请填写省外名额分配', message: '省外最少成团人数(包括家属)',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}], }],
outsideNumber: [{ outsideNumber: [{
@@ -247,7 +284,7 @@ layout("/layouts/platform.html"){
}], }],
groupNumber: [{ groupNumber: [{
required: true, required: true,
message: '请填写组团人数', message: '请填写最少教工人数',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}], }],
modifyDays: [{ modifyDays: [{
@@ -272,6 +309,8 @@ layout("/layouts/platform.html"){
}], }],
notice: [{required: true, message: '请输入详细内容', trigger: ['change', 'blur']}], notice: [{required: true, message: '请输入详细内容', trigger: ['change', 'blur']}],
provinceStartYear: [{required: true, message: '请输入省内起始年份', trigger: ['change', 'blur']}], provinceStartYear: [{required: true, message: '请输入省内起始年份', trigger: ['change', 'blur']}],
bedInfo: [{required: true, message: '请选择床位信息', trigger: ['change', 'blur']}],
familyInfo: [{required: true, message: '请选择家属信息', trigger: ['change', 'blur']}],
}, },
marks: [], marks: [],
@@ -280,8 +319,12 @@ layout("/layouts/platform.html"){
centerDialogVisible:false, centerDialogVisible:false,
tableScopeId:'', tableScopeId:'',
tableScopeIndex:'', tableScopeIndex:'',
userScopeDialog: false,
} }
}, },
components: {
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
},
methods: { methods: {
async deleteLotsRow(scope) { async deleteLotsRow(scope) {
//this.lotDeleteList.push(scope.row.id); //this.lotDeleteList.push(scope.row.id);
@@ -399,7 +442,16 @@ layout("/layouts/platform.html"){
async created() { async created() {
this.findOne(); this.findOne();
this.initLineContentEditor(); this.initLineContentEditor();
} },
watch: {
'formData.activityGroupId': {
async handler(newVal, oldVal) {
this.activityGroupList = await getActivityGroup()
this.userScopeDialog = false
},
deep: true
},
},
}) })
</script> </script>