This commit is contained in:
@jyuhsin
2025-05-28 14:27:32 +08:00
parent 0b5e7a173c
commit afc1508d55
84 changed files with 8154 additions and 2791 deletions
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -14,18 +13,20 @@ import lombok.Getter;
**/
@AllArgsConstructor
@Getter
@SelectEnum
@io.v.nutz.base.annontation.SelectEnum
public enum TheRapyRecuperationSignUpMode {
/**
* 分工会模式
*/
UNION(1, "分工会组织", new String[]{"H04", "A06", "sysadmin"}),
/**
* 自由模式
*/
FREE(2, "校工会组织", new String[]{"A06", "sysadmin"});
FREE(2, "校工会组织", new String[]{"SchoolUnionAdmin", "sysadmin"}),
/**
* 分工会模式
*/
UNION(1, "分工会组织", new String[]{"H04", "SchoolUnionAdmin", "sysadmin"}),
PERSONAL(3, "个人组织", new String[]{"H01", "H04", "SchoolUnionAdmin", "sysadmin"});
private final int value;
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.constant;
import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -32,7 +31,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"),
/**
* 酒店
@@ -0,0 +1,413 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.analysis;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.result.Result;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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 java.util.*;
import java.util.stream.Collectors;
/**
* @version 1.0
* @Author zzr
* @nameTheRapyRecuperationAnnualAnalysisController`
* @Date 2025/2/10 9:16
* @注释
*/
@IocBean
@At("/platform/theRapyRecuperation/annualAnalysis")
@Ok("json:full")
public class TheRapyRecuperationAnnualAnalysisController {
@Inject
private Dao dao;
@Inject
private TheRapyRecuperationLineService lineService;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/analysis/annualAnalysis.html")
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public void index() {
}
/**
* 获取年度出行人数、线路数、省内、省外、校工会组织线路数、校省内、校省外线路数
* @param year
* @param lineType
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getNumData(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
// 对于嘉兴来说,这一坨吊用没有,直接去报名记录里边找线路
// Cnd cnd = Cnd.NEW();
// cnd.and("delFlag", "=", false);
// cnd.and("YEAR(selectTime)", "=", year);
// // 本年选择的所有线路
// List<TheRapyRecuperationLineUnionSelect> selectLineList = dao.query(TheRapyRecuperationLineUnionSelect.class, cnd);
// 获取选择线路表的id,后面发现了,报名表里有线路id不在线路表的情况,这类人员要排除掉
Sql selectIdSql = Sqls.create("select id from the_rapy_recuperation_line_union_select");
selectIdSql.setCallback(Sqls.callback.strList());
dao.execute(selectIdSql);
List<String> selectIdList = selectIdSql.getList(String.class);
// 获取今年报名的所有人数,还要确保报名线路是属于上面选择线路的id
Sql sql = Sqls.create("""
SELECT
takePartInLineId
FROM
`the_rapy_recuperation_enroll`
WHERE
YEAR(signingUptime) = @thisYear
AND isNormal = 1
AND stateId = @stateId
AND takePartInLineId in (@selectIdList)
""");
sql.setParam("thisYear", year);
sql.setParam("stateId", TheRapyRecuperationState.PASS);
sql.setParam("selectIdList", selectIdList);
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
// 今年的报名记录
List<String> enrollTakePartLineIdList = sql.getList(String.class);
List<String> takePartInLineIdList = enrollTakePartLineIdList.stream().distinct().collect(Collectors.toList());
// 今年报名的线路
List<TheRapyRecuperationLineUnionSelect> selectLineList = dao.query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "in", takePartInLineIdList));
// 找出选择的线路详情,用于区分省内还是省外
List<String> lineIdList = selectLineList.stream().map(TheRapyRecuperationLineUnionSelect::getLineId).distinct().collect(Collectors.toList());
List<TheRapyRecuperationLine> lineList = dao.query(TheRapyRecuperationLine.class, Cnd.where("id", "in", lineIdList));
// 如果不是全部,按搜索条件查询省内还是省外
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
lineList = lineList.stream().filter(line -> line.getRegionalNature().equals(lineType)).collect(Collectors.toList());
List<String> lineTypeIdList = lineList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList());
selectLineList = selectLineList.stream().filter(v-> lineTypeIdList.contains(v.getLineId())).collect(Collectors.toList());
}
// 省内线路
List<TheRapyRecuperationLine> inLineList = lineList.stream().filter(line -> "省内".equals(line.getRegionalNature())).collect(Collectors.toList());
Set<String> inLineIds = inLineList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toSet());
// 选择省内的线路
List<String> selectInLineIds = selectLineList.stream().filter(v -> inLineIds.contains(v.getLineId()))
.map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList());
// 省外线路
List<TheRapyRecuperationLine> outLineList = lineList.stream().filter(line -> "省外".equals(line.getRegionalNature())).collect(Collectors.toList());
Set<String> outLineIds = outLineList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toSet());
// 选择省外的线路
List<String> selectOutLineIds = selectLineList.stream().filter(v -> outLineIds.contains(v.getLineId()))
.map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList());
// List<TheRapyRecuperationEnroll> enrollList = dao.query(TheRapyRecuperationEnroll.class, Cnd.where("YEAR(signingUptime)", "=", year).and("isNormal", "=", true));
// List<String> enrollTakePartLineIdList = enrollList.stream().map(TheRapyRecuperationEnroll::getTakePartInLineId).collect(Collectors.toList());
// 返回前端的数据展示
NutMap nutMap = NutMap.NEW();
// 总出行人数
int allNum = enrollTakePartLineIdList.size();
// 省内出行人数
int provinceNum = (int) enrollTakePartLineIdList.stream().filter(selectInLineIds::contains).count();
// 省外出行人数
int outProvinceNum = (int) enrollTakePartLineIdList.stream().filter(selectOutLineIds::contains).count();
nutMap.addv("allNum", allNum).addv("provinceNum", provinceNum).addv("outProvinceNum", outProvinceNum);
// 总线路数
int lineNum = selectLineList.size();
// 总省内
int inLineNum = selectInLineIds.size();
// 总省外
int outLineNum = selectOutLineIds.size();
nutMap.addv("lineNum", lineNum).addv("inLineNum", inLineNum).addv("outLineNum", outLineNum);
// 校工会组织线路
List<TheRapyRecuperationLineUnionSelect> schoolSelectLineList = selectLineList.stream().filter(v -> v.getSignUpMode() == 2).collect(Collectors.toList());
int schoolUnionLineNum = schoolSelectLineList.size();
// 校省内
int schoolInLineNum = (int) schoolSelectLineList.stream().filter(s -> inLineIds.contains(s.getLineId())).count();
// 校省外
int schoolOutLineNum = (int) schoolSelectLineList.stream().filter(s -> outLineIds.contains(s.getLineId())).count();
nutMap.addv("schoolUnionLineNum", schoolUnionLineNum).addv("schoolInLineNum", schoolInLineNum).addv("schoolOutLineNum", schoolOutLineNum);
// 分工会组织线路
List<TheRapyRecuperationLineUnionSelect> unionSelectLineList = selectLineList.stream().filter(v -> v.getSignUpMode() == 1).collect(Collectors.toList());
int unionLineNum = unionSelectLineList.size();
// 分省内
int unionInLineNum = (int) unionSelectLineList.stream().filter(s -> inLineIds.contains(s.getLineId())).count();
// 分省外
int unionOutLineNum = (int) unionSelectLineList.stream().filter(s -> outLineIds.contains(s.getLineId())).count();
nutMap.addv("unionLineNum", unionLineNum).addv("unionInLineNum", unionInLineNum).addv("unionOutLineNum", unionOutLineNum);
return Result.success().addData(nutMap);
}
/**
* 出行时间标段统计
* @param year
* @param lineType
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getLotNum(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
if (year == null) {
year = DateUtil.thisYear();
}
List<TheRapyRecuperationLot> lotList = dao.query(TheRapyRecuperationLot.class, Cnd.NEW().asc("lotValue"));
Sql sql = Sqls.create("""
SELECT
enroll.*,
line.lotId AS lineLotId
FROM
the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(signingUpTime)", "=", year);
cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
cnd.andEX("line.regionalNature", "=", lineType);
}
sql.setCondition(cnd);
List<NutMap> list = lineService.listMap(sql);
List<NutMap> resultMap = new ArrayList<>();
lotList.forEach(item -> {
NutMap map = NutMap.NEW();
int value = list.stream().filter(v -> item.getId().equals(v.getString("lineLotId"))).collect(Collectors.toList()).size();
map.put("label", item.getLotName());
map.put("value", value);
resultMap.add(map);
});
return Result.success().addData(resultMap);
}
/**
* 出行年龄分布统计
* @param year
* @param lineType
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getAgeNum(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
if (year == null) {
year = DateUtil.thisYear();
}
Map<String, Integer> result = new HashMap<>();
result.put("35岁以下", 0);
result.put("35至45岁", 0);
result.put("45岁以上", 0);
Sql sql = Sqls.create("""
SELECT
enroll.idCard
FROM
the_rapy_recuperation_enroll enroll
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = enroll.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(signingUpTime)", "=", year);
cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.and("enroll.idCard", "is not", null);
cnd.groupBy("enroll.idCard");
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
cnd.andEX("line.regionalNature", "=", lineType);
}
sql.setCondition(cnd);
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
List<String> idCardList = sql.getList(String.class);
for (String idCard : idCardList) {
if (StrUtil.isBlank(idCard)) {
continue;
}
int birthYear = getBirthYearFromIdCard(idCard);
if (birthYear == 0) {
continue;
}
int age = year - birthYear;
if (age < 35) {
result.put("35岁以下", result.get("35岁以下") + 1);
} else if (age <= 45) {
result.put("35至45岁", result.get("35至45岁") + 1);
} else {
result.put("45岁以上", result.get("45岁以上") + 1);
}
}
List<NutMap> list = new ArrayList<>();
result.forEach((k, v) -> {
NutMap map = NutMap.NEW();
map.put("label", k);
map.put("value", v);
list.add(map);
});
return Result.success().addData(list);
}
private static int getBirthYearFromIdCard(String idCard) {
String birthYearStr;
if (idCard.length() == 18) {
// 18位身份证号,直接取第7到第10位作为出生年份
birthYearStr = idCard.substring(6, 10);
} else if (idCard.length() == 15) {
// 15位身份证号,取第7到第8位作为出生年份的后两位 15位身份证号均为19xx年
birthYearStr = "19" + idCard.substring(6, 8);
} else {
return 0;
}
return Integer.parseInt(birthYearStr);
}
/**
* 获取线路出行人数和年龄统计数据
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getLineTravelAndAgeData(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
Sql sql = Sqls.create("""
SELECT
us.id,
CONCAT(line.lineName,'(',DATE_FORMAT(us.playStartTime,'%m月%d'),'至',DATE_FORMAT(us.playEndTime,'%m月%d'),')') AS lineName,
su.unionname,
lot.lotName,
COUNT(enroll.id) AS takePartInLineNum,
SUM(CASE
WHEN @year - (CASE
WHEN LENGTH(enroll.idCard) = 18 THEN CAST(SUBSTR(enroll.idCard, 7, 4) AS UNSIGNED)
WHEN LENGTH(enroll.idCard) = 15 THEN 1900 + CAST(SUBSTR(enroll.idCard, 7, 2) AS UNSIGNED)
ELSE NULL
END) < 35 THEN 1 ELSE 0 END) AS underThirtyFive,
SUM(CASE
WHEN @year - (CASE
WHEN LENGTH(enroll.idCard) = 18 THEN CAST(SUBSTR(enroll.idCard, 7, 4) AS UNSIGNED)
WHEN LENGTH(enroll.idCard) = 15 THEN 1900 + CAST(SUBSTR(enroll.idCard, 7, 2) AS UNSIGNED)
ELSE NULL
END) BETWEEN 35 AND 45 THEN 1 ELSE 0 END) AS thirtyFiveToFortyFive,
SUM(CASE
WHEN @year - (CASE
WHEN LENGTH(enroll.idCard) = 18 THEN CAST(SUBSTR(enroll.idCard, 7, 4) AS UNSIGNED)
WHEN LENGTH(enroll.idCard) = 15 THEN 1900 + CAST(SUBSTR(enroll.idCard, 7, 2) AS UNSIGNED)
ELSE NULL
END) > 45 THEN 1 ELSE 0 END) AS aboveFortyFive
FROM
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON us.lineId = line.id
LEFT JOIN the_rapy_recuperation_enroll enroll ON enroll.takePartInLineId = us.id
LEFT JOIN the_rapy_recuperation_lot lot ON lot.id = line.lotId
LEFT JOIN sys_union su ON su.id = us.unionId
$condition
""").setParam("year", year == null ? DateUtil.thisYear() : year);
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(us.selectTime)", "=", year);
cnd.and("enroll.isNormal", "=", true);
cnd.and("us.`enable`", "=", true);
cnd.groupBy("us.id");
if (StrUtil.isNotBlank(lineType) && !"全部".equals(lineType)) {
cnd.andEX("line.regionalNature", "=", lineType);
}
sql.setCondition(cnd);
List<NutMap> list = lineService.listMap(sql);
NutMap result = NutMap.NEW();
// 柱状图
List<NutMap> uvData = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("value", v.getInt("takePartInLineNum"));
return map;
}).sorted(Comparator.comparing(v -> v.getString("lineName"))).collect(Collectors.toList());
// 折线图
List<NutMap> underThirtyFiveList = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("count", v.getInt("underThirtyFive"));
map.put("name", "35岁以下");
return map;
}).collect(Collectors.toList());
List<NutMap> thirtyFiveToFortyFiveList = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("count", v.getInt("thirtyFiveToFortyFive"));
map.put("name", "35至45岁");
return map;
}).collect(Collectors.toList());
List<NutMap> aboveFortyFiveList = list.stream().map(v -> {
NutMap map = NutMap.NEW();
map.put("lineName", v.getString("lineName"));
map.put("count", v.getInt("aboveFortyFive"));
map.put("name", "45岁以上");
return map;
}).collect(Collectors.toList());
underThirtyFiveList.addAll(thirtyFiveToFortyFiveList);
underThirtyFiveList.addAll(aboveFortyFiveList);
List<NutMap> collect = underThirtyFiveList.stream().sorted(Comparator.comparing(v -> v.getString("lineName"))).collect(Collectors.toList());
result.put("uvData", uvData);
result.put("transformData", collect);
return Result.success().addData(result);
}
/**
* 获取分工会出行人数和年龄统计数据
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.annualAnalysis")
public Object getLineTravelAgeData(@Param(value = "year", required = false) Integer year,
@Param(value = "lineType", required = false) String lineType){
return Result.success().addData(null);
}
}
@@ -2,17 +2,15 @@ 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.model.AuditState;
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.base.query.PageForm;
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.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
@@ -67,18 +65,19 @@ public class TheRapyRecuperationAuditController {
@At
@ViReturn
@RequiresAuthentication
public Object getXlByUnion(Integer state, String unionId, String regionalNature, String year, String endYear, Integer signUpMode) {
public Object getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode) {
List<NutMap> xlByUnion = auditService.getXlByUnion(state, unionId, regionalNature, year, endYear, signUpMode);
List<NutMap> xlByUnion = auditService.getXlByUnion(state, unionId, regionalNature, year,endYear, signUpMode);
return xlByUnion;
}
@At
@ViReturn
@RequiresAuthentication
public Object getXlByUnionAudit(String unionId, String regionalNature, String year, Integer signUpMode) {
public Object getXlByUnionAudit(String unionId,String regionalNature, String year, Integer signUpMode) {
Sql sql = Sqls.create("""
SELECT
line.id,
@@ -93,20 +92,21 @@ public class TheRapyRecuperationAuditController {
$condition
""");
Cnd cnd = Cnd.NEW();
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")){
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.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
@@ -143,7 +143,7 @@ public class TheRapyRecuperationAuditController {
cnd.andEX("enroll.selfUnionId", "=", unionId);
cnd.and("enroll.takePartInLineId", "is not", null);
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("lineu.lineId", "=", takePartInLineId);
cnd.andEX("enroll.takePartInLineId", "=", takePartInLineId);
cnd.andEX("enroll.isNormal", "=", true);
cnd.andEX("lineu.signUpMode", "=", 1);
cnd.andEX("lineu.id", "=", selectId);
@@ -157,7 +157,7 @@ public class TheRapyRecuperationAuditController {
} else if (state.equals("2")) {
cnd.andEX("enroll.takePartInUnionId", "!=", Vi.getUnionId());
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
} else if (state.equals("3")) {
} else if (state.equals("3")){
cnd.andEX("enroll.selfUnionId", "!=", Vi.getUnionId());
cnd.andEX("enroll.takePartInUnionId", "=", Vi.getUnionId());
}
@@ -173,14 +173,11 @@ public class TheRapyRecuperationAuditController {
((enroll.stateId = %s OR enroll.stateId=%s )AND enroll.takePartInUnionId='%s')
""".formatted(TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId())));
} else {
/*cnd.and(new Static("""
cnd.and(new Static("""
((( enroll.stateId = %s OR enroll.stateId = %s OR enroll.stateId = %s ) AND enroll.selfUnionId = '%s' )
OR
((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())));*/
cnd.and(new Static("""
((enroll.stateId = %s OR enroll.stateId=%s )AND enroll.takePartInUnionId='%s')
""".formatted(TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId())));
""".formatted(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNIT, TheRapyRecuperationState.PASS, vi.getUnionId(), TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.PASS, vi.getUnionId())));
}
} else {
cnd.and(new Static("""
@@ -226,7 +223,7 @@ public class TheRapyRecuperationAuditController {
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doAudit(String id, boolean flag, Boolean adjustment, boolean isTransferIn, String auditOpinion) {
public Object doAudit(String id, boolean flag,Boolean adjustment, boolean isTransferIn, String auditOpinion) {
Trans.exec(() -> {
TheRapyRecuperationEnroll enroll = auditService.dao().fetch(TheRapyRecuperationEnroll.class, id);
Audit audit = new Audit();
@@ -264,10 +261,10 @@ public class TheRapyRecuperationAuditController {
}
auditService.updateIgnoreNull(enroll);
auditMsg(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
if (adjustment) {
auditMsg(enroll.getStateId(), enroll.getLoginName(),adjustment, enroll.getTakePartInLineId());
if (adjustment){
// enroll.setNormal(false);
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enroll.getId()));
auditService.dao().clear(TheRapyRecuperationEnroll.class,Cnd.where("id","=",enroll.getId()));
}
});
return null;
@@ -322,7 +319,7 @@ public class TheRapyRecuperationAuditController {
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.TheRapyAudit")
public Object doOnekeyAudit(String[] ids, String auditOpinion, boolean flag, Boolean adjustment) {
public Object doOnekeyAudit(String[] ids, String auditOpinion, boolean flag,Boolean adjustment) {
Audit audit = new Audit();
audit.setAuditOpinion(auditOpinion);
audit.setAuditor(ShiroUtil.getUserId());
@@ -346,14 +343,14 @@ public class TheRapyRecuperationAuditController {
enroll.setStateId(flag ? TheRapyRecuperationState.PASS : TheRapyRecuperationState.LINEUNITFAIL);
enroll.setJoinLineUnionAuditId(insert.getId());
}
if (adjustment) {
if (adjustment){
// enroll.setNormal(false);
enrollIdList.add(id);
}
auditService.updateIgnoreNull(enroll);
auditMsg(enroll.getStateId(), enroll.getLoginName(), adjustment, enroll.getTakePartInLineId());
auditMsg(enroll.getStateId(), enroll.getLoginName(),adjustment, enroll.getTakePartInLineId());
}
auditService.dao().clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "in", enrollIdList));
auditService.dao().clear(TheRapyRecuperationEnroll.class,Cnd.where("id","in",enrollIdList));
return null;
}
@@ -364,22 +361,20 @@ public class TheRapyRecuperationAuditController {
* @param loginName
* @param takePartInLineId
*/
private void auditMsg(Integer stateId, String loginName, Boolean adjustment, String takePartInLineId) {
private void auditMsg(Integer stateId, String loginName,Boolean adjustment, String takePartInLineId) {
Sys_user user = auditService.dao().fetch(Sys_user.class, Cnd.where("loginname", "=", loginName));
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));
String content = "【智慧工会】%s老师您好,您报名的%s线路因报名人数不足已取消,请尽快进入智慧工会重新选择线路。"
.formatted(user.getUsername(), theRapyRecuperationLine.getLineName());
.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());
msgApi.sendTextMsg(content,user.getLoginname());
}
@@ -403,9 +398,8 @@ public class TheRapyRecuperationAuditController {
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
cnd.and("takePartInLineId", "IS NOT", null);
cnd.and("takePartInLineId", "!=", "");
cnd.and(Cnd.exps("takePartInUnionId", "=", vi.getUnionId()).or("selfUnionId", "=", vi.getUnionId()));
//cnd.and("selfUnionId", "=", vi.getUnionId());
// cnd.and(Cnd.exps("takePartInUnionId", "=", vi.getUnionId()).or("selfUnionId", "=", vi.getUnionId()));
cnd.and("selfUnionId", "=", vi.getUnionId());
}
cnd.groupBy("selfUnionId");
sql.setCondition(cnd);
@@ -423,25 +417,17 @@ public class TheRapyRecuperationAuditController {
@At
@ViReturn
@RequiresAuthentication
public Object getApplyNumAudit(String takePartInLineId, String mode, String isAudit, Integer year, String selectId) {
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
public Object getApplyNumAudit(String takePartInLineId,String mode, String isAudit, Integer year,String selectId) {
String unionId = Vi.getUnionId();
Sql sql = Sqls.create("""
SELECT
COUNT(1) as signUpNum,
$val as familyNumber
IFNULL(sum(familyNumber),0) as familyNumber
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
$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 sql3 = sql;
Sql sql4 = sql;
@@ -453,16 +439,16 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1)
.andEX("lineu.id", "=", selectId);
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(mode)) {
cnd1.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd1.and("lineu.id","=",selectId);
sql.setCondition(cnd1);
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)));
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum", 0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber",0)));
//本工会人员(其他路线)
Cnd cnd2 = Cnd.NEW();
@@ -470,16 +456,16 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId", "=", takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1)
.andEX("lineu.id", "=", selectId);
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(mode)) {
cnd2.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd2.and("lineu.id","=",selectId);
sql2.setCondition(cnd2);
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)));
int count2 = Integer.parseInt(String.valueOf(map2.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map2.getOrDefault("familyNumber",0)));
//其他工会人员(选我线路)
Cnd cnd3 = Cnd.NEW();
@@ -487,32 +473,32 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 1)
.andEX("lineu.id", "=", selectId);
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(mode)) {
cnd3.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd3.and("lineu.id","=",selectId);
sql3.setCondition(cnd3);
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)));
int count3 = Integer.parseInt(String.valueOf(map3.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map3.getOrDefault("familyNumber",0)));
//选择校工会线路人员
Cnd cnd4 = Cnd.NEW();
cnd4.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.andEX("signUpMode", "=", 2)
.andEX("lineu.id", "=", selectId);
.andEX("signUpMode", "=", 2);
if (StrUtil.isNotBlank(mode)) {
cnd4.and("stateId", "=", TheRapyRecuperationState.PASS);
}
if (StrUtil.isNotBlank(selectId)) cnd4.and("lineu.id","=",selectId);
sql4.setCondition(cnd4);
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)));
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);
}
@@ -524,13 +510,14 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(selectId)) cnd1.and("lineu.id","=",selectId);
sql.setCondition(cnd1);
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)));
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber",0)));
//本工会人员(其他路线)
@@ -551,13 +538,14 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", ">", TheRapyRecuperationState.LINEUNIT)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(selectId)) cnd3.and("lineu.id","=",selectId);
sql3.setCondition(cnd3);
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)));
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);
@@ -571,13 +559,14 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.UNIT)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(selectId)) cnd1.and("lineu.id","=",selectId);
sql.setCondition(cnd1);
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)));
int count1 = Integer.parseInt(String.valueOf(map.getOrDefault("signUpNum",0))) + Integer.parseInt(String.valueOf(map.getOrDefault("familyNumber",0)));
//本工会人员(其他路线)
@@ -598,13 +587,14 @@ public class TheRapyRecuperationAuditController {
.and("selfUnionId", "!=", unionId)
.and("isNormal", "=", true)
.and("takePartInLineId", "is not", null)
.andEX("lineu.lineId", "=", takePartInLineId)
.andEX("takePartInLineId","=",takePartInLineId)
.andEX("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.LINEUNIT)
.andEX("signUpMode", "=", 1);
if (StrUtil.isNotBlank(selectId)) cnd3.and("lineu.id","=",selectId);
sql3.setCondition(cnd3);
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)));
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);
@@ -2,19 +2,15 @@ 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.model.Audit;
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.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
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;
@@ -28,18 +24,15 @@ 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.IocBean;
import org.nutz.lang.Lang;
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.stream.Collectors;
@IocBean
@At("/platform/theRapyRecuperation/TheRapyXghAudit")
@@ -293,19 +286,37 @@ public class TheRapyRecuperationXghAuditController {
@ViReturn
@RequiresAuthentication
@RequiresPermissions("theRapyRecuperation.TheRapyXghAudit")
public Object getXghLine() {
public Object getXghLine(Integer year,String regionalNature) {
// Sql sql = Sqls.create("""
// SELECT
// line.*,
// un.unionname
// 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 sys_union un ON un.id = enroll.takePartInUnionId
// where line.signUpMode='2' and line.createMode='2'
// group by line.id
// """);
Sql sql = Sqls.create("""
SELECT
line.*,
un.unionname
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id = enroll.takePartInLineId
the_rapy_recuperation_line_union_select lineu
LEFT JOIN the_rapy_recuperation_line line ON line.id = lineu.lineId
LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId
where line.signUpMode='2' and line.createMode='2'
group by line.id
LEFT JOIN sys_union un ON un.id = lineu.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(lineu.selectTime)","=",year);
if (StrUtil.isNotBlank(regionalNature) && !"全部".equals(regionalNature)){
cnd.and("line.regionalNature","=",regionalNature);
}
cnd.groupBy("line.id");
sql.setCondition(cnd);
return baseService.listMap(sql);
}
@@ -313,48 +324,21 @@ public class TheRapyRecuperationXghAuditController {
@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);
public Object getLinePlayTimeByLineId(String lineId, Integer signUpMode, Integer year) {
List<TheRapyRecuperationLineUnionSelect> query = dao.query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "=", lineId)
.andEX("signUpMode", "=", signUpMode).andEX("YEAR(selectTime)", "=", year));
//.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("times", startTime + "-" + endTime);
map.setv("selectId", v.getId());
nutMaps.add(map);
});
return nutMaps;
}
}
@@ -12,15 +12,15 @@ import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
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.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.baseManage.TheRapyRecuperationBaseManagerService;
import io.v.nutz.base.utils.ViTool;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -92,7 +92,7 @@ public class TheRapyRecuperationBaseManagerController {
@POST
@Ok("json:full")
@ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, Integer year, String lotId, String baseName, String unionId, String travelAgencyId, String regionalNature) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
@@ -114,7 +114,7 @@ public class TheRapyRecuperationBaseManagerController {
tb.files,
tb.baseContactPerson,
tb.baseContactNumber,
tb.files AS fileId,
cast( tb.files ->> '$[0].id' AS CHAR ) AS fileId,
gh.unionname createUnionName,
u.username createUserName,
ta.travelAgencyName,
@@ -136,7 +136,7 @@ public class TheRapyRecuperationBaseManagerController {
cnd.desc("tb.`year`");
cnd.asc("tb.sortNumber");
cnd.asc("tb.id");
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) {
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "SchoolUnionAdmin"))) {
if (ShiroUtil.hasRole("H04")) {
cnd.and("tb.createUnionId", "=", Vi.getUnionId());
}
@@ -192,7 +192,7 @@ public class TheRapyRecuperationBaseManagerController {
@POST
@ViReturn
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04"}, logical = Logical.OR)
public Object doSubmit(@Param("base") TheRapyRecuperationBaseManagement baseManagement) {
baseManagement.setOpBy((String) ShiroUtil.getPrincipalProperty("id"));
baseManagement.setCreateUnionId((String) ShiroUtil.getPrincipalProperty("unionid"));
@@ -9,20 +9,19 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
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.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationLineCreateMode;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyTravelLineExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import io.v.nutz.base.utils.ViTool;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
@@ -42,6 +41,7 @@ import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
@@ -82,28 +82,22 @@ public class TheRapyRecuperationLineController {
@POST
@Ok("json:full")
@ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, Integer startYear , Integer endYear, String keywords, String travelAgencyId, String lineName, String unionId, String lotId) {
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04", "H01"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, Integer startYear, Integer endYear, Integer signUpMode, String travelAgencyId, String lineName, String unionId, String lotId) {
Cnd cnd = Cnd.NEW();
cnd.andEX("line.`year`", ">=", startYear);
cnd.andEX("line.`year`", "<=", endYear);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.signUpMode", "=", signUpMode);
cnd.and(Cnd.likeEX("line.lineName", lineName));
/*if (StrUtil.isNotBlank(keywords)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("line.lineName", keywords);
seg.orLike("line.travelAgencyName", keywords);
cnd.and(seg);
}*/
cnd.desc("year");
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) {
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "SchoolUnionAdmin"))) {
if (ShiroUtil.hasRole("H04")) {
cnd.and("line.createUnionId", "=", Vi.getUnionId());
}else{
cnd.and("line.opBy", "=", ShiroUtil.getUserId());
}
} else {
cnd.andEX("line.createUnionId", "=", unionId);
}
cnd.desc("regionalNature").asc("serialNumber").asc("line.opBy");
return lineService.pageData(pageForm, cnd);
@@ -113,7 +107,7 @@ public class TheRapyRecuperationLineController {
@POST
@ViReturn
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04", "H01"}, logical = Logical.OR)
public Object getNo() {
Object serialNumber = dao.func2(TheRapyRecuperationLine.class, "max", "serialNumber");
serialNumber = Objects.requireNonNullElse(serialNumber, 0);
@@ -130,8 +124,8 @@ public class TheRapyRecuperationLineController {
@POST
@ViReturn
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object doSubmit(TheRapyRecuperationLine line) {
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04", "H01"}, logical = Logical.OR)
public Object doSubmit(@Param("line") TheRapyRecuperationLine line) {
if (StrUtil.isBlank(line.getId())) {
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber())) > 0) {
return Result.error("编号已存在");
@@ -219,7 +213,7 @@ public class TheRapyRecuperationLineController {
@ViReturn
@RequiresAuthentication
public Object getCreateMode() {
boolean hasSchoolAdminRole = ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"));
boolean hasSchoolAdminRole = ShiroUtil.hasAnyRoles(List.of("sysadmin", "SchoolUnionAdmin"));
if (hasSchoolAdminRole) {
return TheRapyRecuperationLineCreateMode.SCHOOL.getValue();
}
@@ -5,11 +5,9 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.io.FileUtil;
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.PageUtil;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyTravelAgencyExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
@@ -84,7 +82,7 @@ public class TheRapyRecuperationTravelAgencyController {
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
cnd.asc("serialNumber * 1");
cnd.asc("serialNumber");
}
return travelAgencyService.pageData(pageForm, cnd);
}
@@ -176,14 +174,10 @@ public class TheRapyRecuperationTravelAgencyController {
@At("/selectTravelAgencyByYears")
@ViReturn
@RequiresAuthentication
public Object selectTravelAgencyByYears(Integer startYear, Integer endYear, Integer year) {
public Object selectTravelAgencyByYears(Integer startYear, Integer endYear) {
Cnd cnd = Cnd.NEW();
if(startYear != null && endYear != null) {
cnd.andEX("year", ">=", startYear);
cnd.andEX("year", "<=", endYear);
}else {
cnd.andEX("year", "=", year);
}
cnd.andEX("year", ">=", startYear);
cnd.andEX("year", "<=", endYear);
return travelAgencyService.selectAllTravelAgencyByYear(cnd);
}
@@ -0,0 +1,168 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.enrollAudit;
import cn.hutool.core.date.DateUtil;
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.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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 java.util.ArrayList;
import java.util.List;
/**
* @author zhf
* @date 2025/5/21 15:02
* @description 线路审核公用
*/
@IocBean
@At("/platform/theRapyRecuperation/enrollAudit/commonAudit")
@Ok("json:full")
public class TheRapyRecuperationEnrollCommonAuditController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
/**
*
* 查询某一条选择线路的审核记录
* @param id
* @return
*/
@At
@ViReturn
public Object findOne(String id){
Sql sql = Sqls.create("""
select * from the_rapy_recuperation_line_union_select where id=@id
""").setParam("id", id);
NutMap nutMap = enrollService.fetch(sql);
if (StrUtil.isNotBlank(nutMap.getString("unionAuditId"))){
nutMap.put("unionAudit",enrollService.dao().fetch(Audit.class,nutMap.getString("unionAuditId")));
}
if (StrUtil.isNotBlank(nutMap.getString("unitLeaderAuditId"))){
nutMap.put("unitLeaderAudit",enrollService.dao().fetch(Audit.class,nutMap.getString("unitLeaderAuditId")));
}
if (StrUtil.isNotBlank(nutMap.getString("schoolAuditId"))){
nutMap.put("schoolAudit",enrollService.dao().fetch(Audit.class,nutMap.getString("schoolAuditId")));
}
return nutMap;
}
@At
@ViReturn
public Object getUnionSelectLine(Integer startYear, Integer endYear, Integer signUpMode) {
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,
CASE
WHEN rlus.signUpMode = 1 THEN '个人组织'
WHEN rlus.signUpMode = 2 THEN '分工会组织'
WHEN rlus.signUpMode = 3 THEN '校工会组织'
ELSE '未知'
END 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 (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionLxyAdmin")){
cnd.and("rlus.unionId", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(rlus.selectTime)", ">=", startYear);
cnd.andEX("YEAR(rlus.selectTime)", "<=", endYear);
cnd.andEX("rlus.signUpMode", "=", signUpMode);
cnd.groupBy("rlus.lineId");
cnd.desc("lot.lotValue");
cnd.desc("rl.lineName");
sql.setCondition(cnd);
return enrollService.listMap(sql);
}
@At
@ViReturn
public Object getLinePlayTimeByLineId(String lineId, Integer signUpMode, Integer year) {
List<TheRapyRecuperationLineUnionSelect> query = enrollService.dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "=", lineId)
.andEX("signUpMode", "=", signUpMode).andEX("YEAR(selectTime)", "=", year));
//.and("selectUserId", "=", ShiroUtil.getUserId()).and("unionId", "=", Vi.getUnionId()));
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();
map.setv("times", startTime + "-" + endTime);
map.setv("selectId", v.getId());
nutMaps.add(map);
});
return nutMaps;
}
@At
@ViReturn
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);
}
}
@@ -0,0 +1,163 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.enrollAudit;
import cn.wizzer.framework.base.Result;
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.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
/**
* @author zhf
* @date 2025/5/20 19:17
* @description 校工会审核
*/
@IocBean
@At("/platform/theRapyRecuperation/enrollAudit/schoolAudit")
@Ok("json:full")
public class TheRapyRecuperationEnrollSchoolAuditController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private MsgApi msgApi;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/enrollAudit/schoolAudit.html")
@RequiresPermissions("theRapyRecuperation.enrollAudit.schoolAudit")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.enrollAudit.schoolAudit")
public Object pageData(PageForm pageForm,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param("unionId") 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 = "isAudit", required = false) Integer isAudit,
@Param(value = "regionalNature", required = false) String regionalNature) {
Sql sql = Sqls.create("""
SELECT
st.stateName,
u.username,
u.loginname,
line.id,
line.lineName,
line.regionalNature,
lineu.lineId,
lineu.id as lineUId,
lineu.signUpMode,
lineu.auditState,
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,
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_line_union_select lineu
LEFT JOIN `the_rapy_recuperation_enroll` enroll ON lineu.id=enroll.takePartInLineId
left join `user` u on u.id=lineu.selectUserId
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 line.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = lineu.unionId
left join audit_state st on st.stateId=lineu.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
if (isAudit != 0) {
cnd.andEX("lineu.auditState", isAudit == 1 ? ">" : "=", 7712);
}else{
cnd.andEX("lineu.auditState", ">=", 7712);
}
cnd.andEX("groupSuccess", "=", 1);
cnd.andEX("YEAR(lineu.selectTime)", ">=", startYear);
cnd.andEX("YEAR(lineu.selectTime)", "<=", endYear);
cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.andEX("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);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.enrollAudit.schoolAudit")
public Result doPass(String id, Audit audit) {
audit.setAuditTime(new Date());
audit.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername());
audit.setAuditor(ShiroUtil.getUserId());
enrollService.insert(audit);
TheRapyRecuperationLineUnionSelect unionSelect = enrollService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, id);
unionSelect.setAuditState(7720);
unionSelect.setSchoolAuditId(audit.getId());
enrollService.update(unionSelect);
return Result.success();
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.enrollAudit.schoolAudit")
public Result doBack(String id, Audit audit) {
audit.setAuditTime(new Date());
audit.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername());
audit.setAuditor(ShiroUtil.getUserId());
enrollService.insert(audit);
TheRapyRecuperationLineUnionSelect unionSelect = enrollService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, id);
unionSelect.setAuditState(7715);
unionSelect.setSchoolAuditId(audit.getId());
enrollService.update(unionSelect);
TheRapyRecuperationLine line = enrollService.dao().fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
Sys_user user = enrollService.dao().fetch(Sys_user.class, unionSelect.getSelectUserId());
msgApi.sendTextMsg("您备案的疗休养【"+line.getLineName()+"】校工会退回,请修改后在提交审核!", user.getLoginname());
return Result.success();
}
}
@@ -0,0 +1,164 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.enrollAudit;
import cn.hutool.core.date.DateUtil;
import cn.wizzer.framework.base.Result;
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.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
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.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
/**
* @author zhf
* @date 2025/5/20 18:42
* @description 分工会审核
*/
@IocBean
@At("/platform/theRapyRecuperation/enrollAudit/unionAudit")
@Ok("json:full")
public class TheRapyRecuperationEnrollUnionAuditController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private MsgApi msgApi;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/enrollAudit/unionAudit.html")
@RequiresPermissions("theRapyRecuperation.enrollAudit.unionAudit")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.enrollAudit.unionAudit")
public Object pageData(PageForm pageForm,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@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 = "isAudit", required = false) Integer isAudit,
@Param(value = "regionalNature", required = false) String regionalNature) {
Sql sql = Sqls.create("""
SELECT
st.stateName,
u.username,
u.loginname,
line.id,
line.lineName,
line.regionalNature,
lineu.lineId,
lineu.id as lineUId,
lineu.signUpMode,
lineu.auditState,
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,
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_line_union_select lineu
LEFT JOIN `the_rapy_recuperation_enroll` enroll ON lineu.id=enroll.takePartInLineId
left join `user` u on u.id=lineu.selectUserId
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 line.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = lineu.unionId
left join audit_state st on st.stateId=lineu.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
if (isAudit != 0) {
cnd.andEX("lineu.auditState", isAudit == 1 ? ">" : "=", 7700);
}
cnd.andEX("groupSuccess", "=", 1);
cnd.andEX("YEAR(lineu.selectTime)", ">=", startYear);
cnd.andEX("YEAR(lineu.selectTime)", "<=", endYear);
cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.and("lineu.unionId", "=", Vi.getUnionId());
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);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.enrollAudit.unionAudit")
public Result doPass(String id, Audit audit) {
audit.setAuditTime(new Date());
audit.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername());
audit.setAuditor(ShiroUtil.getUserId());
enrollService.insert(audit);
TheRapyRecuperationLineUnionSelect unionSelect = enrollService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, id);
unionSelect.setAuditState(7707);
unionSelect.setUnionAuditId(audit.getId());
enrollService.update(unionSelect);
return Result.success();
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.enrollAudit.unionAudit")
public Result doBack(String id, Audit audit) {
audit.setAuditTime(new Date());
audit.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername());
audit.setAuditor(ShiroUtil.getUserId());
enrollService.insert(audit);
TheRapyRecuperationLineUnionSelect unionSelect = enrollService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, id);
unionSelect.setAuditState(7703);
unionSelect.setUnionAuditId(audit.getId());
enrollService.update(unionSelect);
TheRapyRecuperationLine line = enrollService.dao().fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
Sys_user user = enrollService.dao().fetch(Sys_user.class, unionSelect.getSelectUserId());
msgApi.sendTextMsg("您备案的疗休养【"+line.getLineName()+"】分工会退回,请修改后在提交审核!", user.getLoginname());
return Result.success();
}
}
@@ -0,0 +1,172 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.enrollAudit;
import cn.wizzer.framework.base.Result;
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.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
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.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
import java.util.List;
/**
* @author zhf
* @date 2025/5/20 19:16
* @description 单位领导审核
*/
@IocBean
@At("/platform/theRapyRecuperation/enrollAudit/unitLeaderAudit")
@Ok("json:full")
public class TheRapyRecuperationEnrollUnitLeaderAuditController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private MsgApi msgApi;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/enrollAudit/unitLeaderAudit.html")
@RequiresPermissions("theRapyRecuperation.enrollAudit.unitLeaderAudit")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.enrollAudit.unitLeaderAudit")
public Object pageData(PageForm pageForm,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@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 = "isAudit", required = false) Integer isAudit,
@Param(value = "regionalNature", required = false) String regionalNature) {
Sql sql = Sqls.create("""
SELECT
st.stateName,
u.username,
u.loginname,
line.id,
line.lineName,
line.regionalNature,
lineu.lineId,
lineu.id as lineUId,
lineu.signUpMode,
lineu.auditState,
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,
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_line_union_select lineu
LEFT JOIN `the_rapy_recuperation_enroll` enroll ON lineu.id=enroll.takePartInLineId
left join `user` u on u.id=lineu.selectUserId
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 line.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = lineu.unionId
left join audit_state st on st.stateId=lineu.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
if (isAudit != 0) {
cnd.andEX("lineu.auditState", isAudit == 1 ? ">" : "=", 7707);
}else{
cnd.andEX("lineu.auditState", ">=", 7707);
}
cnd.andEX("groupSuccess", "=", 1);
cnd.andEX("YEAR(lineu.selectTime)", ">=", startYear);
cnd.andEX("YEAR(lineu.selectTime)", "<=", endYear);
cnd.andEX("lineu.signUpMode", "=", signUpMode);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionLxyAdmin")){
if (Vi.getUnion().getUnioncode().equals("01")){
cnd.and("lineu.unionId", "in", List.of("7406938f3d6645308245eab9394943d8","fc38a500c0d64218ada03ac49b39c856","9c8639134e1547259c4b2e0f509641aa"));
}else{
cnd.and("lineu.unionId", "=", Vi.getUnionId());
}
}
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);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.enrollAudit.unitLeaderAudit")
public Result doPass(String id, Audit audit) {
audit.setAuditTime(new Date());
audit.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername());
audit.setAuditor(ShiroUtil.getUserId());
enrollService.insert(audit);
TheRapyRecuperationLineUnionSelect unionSelect = enrollService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, id);
unionSelect.setAuditState(7712);
unionSelect.setUnitLeaderAuditId(audit.getId());
enrollService.update(unionSelect);
return Result.success();
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.enrollAudit.unitLeaderAudit")
public Result doBack(String id, Audit audit) {
audit.setAuditTime(new Date());
audit.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername());
audit.setAuditor(ShiroUtil.getUserId());
enrollService.insert(audit);
TheRapyRecuperationLineUnionSelect unionSelect = enrollService.dao().fetch(TheRapyRecuperationLineUnionSelect.class, id);
unionSelect.setAuditState(7710);
unionSelect.setUnitLeaderAuditId(audit.getId());
enrollService.update(unionSelect);
TheRapyRecuperationLine line = enrollService.dao().fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
Sys_user user = enrollService.dao().fetch(Sys_user.class, unionSelect.getSelectUserId());
msgApi.sendTextMsg("您备案的疗休养【"+line.getLineName()+"】单位领导退回,请修改后在提交审核!", user.getLoginname());
return Result.success();
}
}
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
@@ -8,18 +7,15 @@ import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
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.TheRapyRecuperationType;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationCommonService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationLineService;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationTravelAgencyService;
import io.v.nutz.web.commons.slog.annotation.SLog;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
@@ -35,7 +31,7 @@ import java.util.*;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.therapyRecuperation.controller.process.TheRapyRecuperationEnroll
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.process.TheRapyRecuperationEnroll
* @Description: 疗休养报名报名
* @Author zxc
* @Date 2022/5/31:16:58
@@ -83,7 +79,7 @@ public class TheRapyRecuperationEnrollController {
* @param unionId 选择的工会id
* @param theRapyRecuperationType 线路类型 见下枚举类
* @return {@link Object}
* @see TheRapyRecuperationType
* @see io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType
*/
@At
@POST
@@ -94,27 +90,40 @@ public class TheRapyRecuperationEnrollController {
}
@At
@POST
@ViReturn
@RequiresAuthentication
public Object getSelectLineById(String lineId, String unionId, int theRapyRecuperationType, Integer lineUnionType) {
return enrollService.getSelectLineById(lineId, unionId, theRapyRecuperationType, lineUnionType);
@SLog(type = "lxy", tag = "我的疗休养", msg = "疗休养评价")
public Object doEvaluate(TheRapyRecuperationEvaluate rapyRecuperationEvaluate) {
rapyRecuperationEvaluate.setUserId(ShiroUtil.getUserId());
rapyRecuperationEvaluate.setUserName(ShiroUtil.getPlatformUsername());
rapyRecuperationEvaluate.setLoginName(ShiroUtil.getPlatformLoginname());
rapyRecuperationEvaluate.setApplyDate(new Date());
enrollService.dao().insertOrUpdate(rapyRecuperationEvaluate);
return null;
}
@At
@ViReturn
public Object finOneEvaluate(String lineId) {
TheRapyRecuperationEvaluate fetch = enrollService.dao().fetch(TheRapyRecuperationEvaluate.class,
Cnd.where("userId", "=", ShiroUtil.getUserId())
.and("lineId", "=", lineId));
return fetch;
}
@At
@POST
@ViReturn
@RequiresAuthentication
public Object openSignUser(String usId, String travelId, String searchKeyWord) {
return enrollService.openSignUser(usId, travelId, searchKeyWord);
public Object getSelectLineById(String lineId, String unionId, int theRapyRecuperationType, @Param(value = "lineUnionType", required = false) Integer lineUnionType) {
return enrollService.getSelectLineById(lineId, unionId, theRapyRecuperationType, lineUnionType);
}
//获取设置了公开线路的分工会
@At
@ViReturn
@RequiresAuthentication
public Object getTheRapyUnions(Integer year, int theRapyRecuperationType) {
return enrollService.getTheRapyUnions(year, theRapyRecuperationType);
public Object getTheRapyUnions(Integer year) {
return enrollService.getTheRapyUnions(year);
}
@@ -131,15 +140,7 @@ public class TheRapyRecuperationEnrollController {
public Object doSignUpForLine(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
//省外的线路报名需要判断
// if (lineInfo.getRegionalNature().equals(TheRapyRecuperationProvinceType.provinceOut.getValue())) {
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> validResult = new HashMap<>();
if("zjxu".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("zjiet".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
validResult = enrollService.validSignUpInfoForZJNU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
}
Map<Boolean, String> validResult = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
if (validResult.containsKey(false)) {
return Result.error(validResult.get(false));
}
@@ -163,15 +164,7 @@ public class TheRapyRecuperationEnrollController {
@ViReturn
@RequiresAuthentication
public Object doSignUpForTravelAgency(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> resultMap = new HashMap<>();
if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("zjiet".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJNU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
}
Map<Boolean, String> resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
if (resultMap.containsKey(false)) {
return Result.error(resultMap.get(false));
}
@@ -194,17 +187,10 @@ public class TheRapyRecuperationEnrollController {
@ViReturn
@RequiresAuthentication
public Object doSignUpForBaseManagement(@Param("enroll") TheRapyRecuperationEnroll enrollInfo) {
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> resultMap = new HashMap<>();
if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
} else {
resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
}
Map<Boolean, String> resultMap = enrollService.validSignUpInfo((String) ShiroUtil.getPrincipalProperty("loginname"), enrollInfo);
if (resultMap.containsKey(false)) {
return Result.error(resultMap.get(false));
}
if (StrUtil.isBlank(enrollInfo.getId())) {
enrollService.doSignUpForHotel(enrollInfo);
} else {
@@ -300,20 +286,10 @@ public class TheRapyRecuperationEnrollController {
&& StrUtil.isBlank(enrollInfo.getTakePartInLineId())) {
return Result.error("线路信息不能为空");
}
if (StrUtil.isBlank(enrollInfo.getLoginName())){
enrollInfo.setLoginName(ShiroUtil.getPrincipalProperty("loginname").toString());
}
Sys_config config = dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "recuperationVersion"));
Map<Boolean, String> resultMap = new HashMap<>();
if("zjxu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJXU(enrollInfo.getLoginName(), enrollInfo);
} else if("zjiet".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfo(enrollInfo.getLoginName(), enrollInfo);
} else if("zjnu".equals(config.getConfigValue())) {
resultMap = enrollService.validSignUpInfoForZJNU(enrollInfo.getLoginName(), enrollInfo);
}
Map<Boolean, String> resultMap = enrollService.validSignUpInfo(enrollInfo.getLoginName(), enrollInfo);
if (resultMap.containsKey(false)) {
return Result.error(resultMap.get(false));
}
@@ -335,22 +311,6 @@ public class TheRapyRecuperationEnrollController {
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;
}
/**
* 能取消吗
*
@@ -426,8 +386,8 @@ public class TheRapyRecuperationEnrollController {
Sql sql = Sqls.create("""
select
(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 isNormal=true and takePartInUnionId = @unionId AND takePartInLineId = @lineId AND stateId = @signUpSuccessCode)) as signUpUserFamilyNum
(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_companion where trreId in (select id from the_rapy_recuperation_enroll where takePartInUnionId = @unionId AND takePartInLineId = @lineId AND stateId = @signUpSuccessCode)) as signUpUserFamilyNum
""");
sql.setParam("signUpSuccessCode", TheRapyRecuperationState.PASS);
sql.setParam("lineId", lineId);
@@ -447,25 +407,8 @@ public class TheRapyRecuperationEnrollController {
@GET
@ViReturn
@RequiresAuthentication
public Object selectLineAllInfo(@Param("usId") String usId,
@Param("usUnionId") String usUnionId,
@Param("year") String year) {
public Object selectLineAllInfo(@Param("usId") String usId, @Param("usUnionId") String usUnionId) {
Assert.notBlank(usId);
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;
}
return enrollService.selectLineAllInfo(usId, usUnionId);
}
}
@@ -10,9 +10,9 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
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.service.TheRapyRecuperationEnrollJoinUserImportService;
import io.v.nutz.base.utils.ViTool;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -3,8 +3,8 @@ package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.lang.Assert;
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.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
@@ -73,7 +73,7 @@ public class TheRapyRecuperationLineAdjustmentController {
@POST
@Ok("json:full")
@ViReturn
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm,
Integer year,
String lineId,
@@ -193,7 +193,7 @@ public class TheRapyRecuperationLineAdjustmentController {
String username = usernameMap.get(v);
String content = "%s老师您好,您报名的%s【%s-%s】(%s至%s)线路未达到成团标准,现已解散,请您选择其他线路进行报名!"
.formatted(username,lineName,lotName,regionalNature,playStartTime,playEndTime);
//msgApi.sendWxMsg(content,v);
// msgApi.sendWxMsg(content,v);
});
}
return Result.success();
@@ -4,10 +4,10 @@ import cn.hutool.core.lang.Assert;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
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.TheRapyRecuperationClusterMember;
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.RequiresPermissions;
import org.nutz.dao.Cnd;
@@ -2,15 +2,23 @@ package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationSignUpMode;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
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 lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -23,10 +31,12 @@ import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.dao.util.cri.SqlExpressionGroup;
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.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
@@ -43,24 +53,25 @@ import java.util.stream.Collectors;
* @date 2023/06/26
*/
@IocBean
@At(value = {"/platform/theRapyRecuperation/lineFghSelect", "/platform/theRapyRecuperation/lineXghSelect", "/platform/theRapyRecuperation/lineUnionSelect"})
@At(value = {
"/platform/theRapyRecuperation/lineFghSelect",
"/platform/theRapyRecuperation/lineXghSelect",
"/platform/theRapyRecuperation/linePersonalSelect",
})
@Ok("json:full")
@Slf4j
public class TheRapyRecuperationLineUnionSelectController {
@Inject
private Vi vi;
@Inject
private Dao dao;
@Inject
private TheRapyRecuperationLineUnionSelectService unionSelectService;
@At("")
@Ok("re")
// @Ok("beetl:/platform/theRapyRecuperation/process/lineUnionSelect.html")
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public String index(@Param("mode") Integer mode) {
return "beetl:/platform/theRapyRecuperation/process/lineUnionSelect.html";
}
@@ -75,62 +86,64 @@ public class TheRapyRecuperationLineUnionSelectController {
@At
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, Integer year, String keywords, int selectStatus, String unionId,
String lotId, String travelAgencyId, Integer mode, String regionalNature) {
TheRapyRecuperationConfig config = unionSelectService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
year = year == null ? DateUtil.thisYear() : year;
Cnd cnd = Cnd.NEW();
cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("us.travelAgencyId", "=", travelAgencyId);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
if (!"全部".equals(regionalNature)) {
cnd.andEX("line.regionalNature", "=", regionalNature);
}
cnd.and("line.signUpMode", "=", mode);
//当前登录用户已选择的线路id
Sql hasSelectLineSql;
if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
cnd.and(Cnd.exps("line.createUnionId", "=", Vi.getUnionId()).or("createMode", "=", 2));
Sql hasSelectLineSql = null;
if(mode == 1) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.or("line.openChoose", "=", true);
group.or(Cnd.exps("line.openChoose", "=", false).and("line.createUnionId", "=", Vi.getUnionId()));
cnd.and(group);
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 {
""", ShiroUtil.getUserId(), Vi.getUnionId(), year);
} else if(mode == 2) {
hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where year(selectTime) = %s
""", year == null ? DateUtil.thisYear() : year);
select lineId from the_rapy_recuperation_line_union_select where year(selectTime) = %s and signUpMode = %s
""", year, TheRapyRecuperationSignUpMode.FREE.getValue());
} else if(mode == 3) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.or("line.openChoose", "=", true);
group.or(Cnd.exps("line.openChoose", "=", false).and("line.opBy", "=", ShiroUtil.getUserId()));
cnd.and(group);
//个人
hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where selectUserId = '%s' and year(selectTime) = %s and signUpMode = %s
""", ShiroUtil.getUserId(), year, TheRapyRecuperationSignUpMode.PERSONAL.getValue());
}
/*hasSelectLineSql = Sqls.createf("""
select lineId from the_rapy_recuperation_line_union_select where unionId = '%s'
""", Vi.getUnionId());*/
switch (selectStatus) {
//查询未选择的线路
case -1 -> {
cnd.and("line.id", "not in", hasSelectLineSql);
cnd.and("line.year", "in", year == null ? Lang.array(config.getProvinceStartYear(), config.getProvinceStartYear() + 1) : year);
cnd.and("line.year", "in", year);
}
case 0 -> {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("us.signUpMode", "is", null);
seg.or("us.signUpMode", "=", mode);
cnd.and(seg);
}
/*case 0 -> {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(Cnd.exps("line.id", "not in", hasSelectLineSql).and("line.createMode", "=", TheRapyRecuperationLineCreateMode.SCHOOL.getValue()));
seg.or("line.id", "in", hasSelectLineSql);
cnd.and(seg);
}*/
//查询已选择的线路
case 1 -> {
cnd.and("line.id", "in", hasSelectLineSql);
cnd.and("us.signUpMode", "=", mode);
cnd.and("year(us.selectTime)", "=", year == null ? DateUtil.thisYear() : year);
cnd.and("year(us.selectTime)", "=", year);
}
}
@@ -147,7 +160,7 @@ public class TheRapyRecuperationLineUnionSelectController {
} else {
cnd.asc("createUnionId").desc("year").asc("serialNumber");
}
return unionSelectService.pageData(pageForm, cnd, year);
return unionSelectService.pageData(pageForm, cnd, year, mode);
}
/**
@@ -159,7 +172,7 @@ public class TheRapyRecuperationLineUnionSelectController {
@At("/selectLine")
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public Object selectLine(TheRapyRecuperationLineUnionSelect us) {
unionSelectService.selectLine(us);
return null;
@@ -174,15 +187,12 @@ public class TheRapyRecuperationLineUnionSelectController {
@At("/selectLineTimes")
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
@Aop(TransAop.READ_COMMITTED)
public Object selectLineTimes(@Param("lineUnionSelects") TheRapyRecuperationLineUnionSelect[] lineUnionSelects) {
if (Lang.isNotEmpty(lineUnionSelects)) {
TheRapyRecuperationLineUnionSelect lineUnionSelect = lineUnionSelects[0];
List<TheRapyRecuperationLineUnionSelect> oldUnionSelects = unionSelectService.query(Cnd.where("unionId", "=", Vi.getUnionId()).and("lineId", "=", lineUnionSelect.getUnionId()));
//组织形式
int signUpMode = ShiroUtil.hasRole("H04") ? 1 : 2;
List<TheRapyRecuperationLineUnionSelect> oldUnionSelects = unionSelectService.query(Cnd.where("selectUserId", "=", ShiroUtil.getUserId()).and("lineId", "=", lineUnionSelect.getLineId()));
TheRapyRecuperationLineUnionSelect theRapyRecuperationLineUnionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", lineUnionSelect.getId()));
@@ -190,16 +200,35 @@ public class TheRapyRecuperationLineUnionSelectController {
unionSelect.setSelectTime(new Date());
unionSelect.setSelectUserId(ShiroUtil.getPlatformUid());
unionSelect.setUnionId(Vi.getUnionId());
unionSelect.setIsOpen(Lang.isNotEmpty(theRapyRecuperationLineUnionSelect) ? theRapyRecuperationLineUnionSelect.getIsOpen() : true);
//unionSelect.setDelFlag(signUpMode == 2);
unionSelect.setSignUpMode(signUpMode);
unionSelect.setIsOpen(Lang.isNotEmpty(theRapyRecuperationLineUnionSelect)?theRapyRecuperationLineUnionSelect.getIsOpen():false);
unionSelect.setDelFlag(false);
//如果是个人组织,加自己
if(unionSelect.getSignUpMode() == 3) {
if(Lang.isEmpty(unionSelect.getChooseUserList())) {
unionSelect.setChooseUserList(new ArrayList<>());
}
List<String> list = unionSelect.getChooseUserList().stream().map(o -> o.getString("id")).toList();
Sys_user currentUser = (Sys_user) ShiroUtil.getPrincipal();
if(currentUser != null && !list.contains(ShiroUtil.getUserId())) {
NutMap map = new NutMap();
map.put("id", currentUser.getId());
map.put("sex", currentUser.getSex());
map.put("mobile", currentUser.getMobile());
map.put("unitname", currentUser.getUnit() != null ? currentUser.getUnit().getName() : "");
map.put("username", currentUser.getUsername());
map.put("loginname", currentUser.getLoginname());
map.put("unionname", currentUser.getUnion() != null ? currentUser.getUnion().getUnionname() : "");
unionSelect.getChooseUserList().add(map);
}
}
}
//新增或修改
dao.insertOrUpdate(lineUnionSelects);
List<String> newIds = Arrays.stream(lineUnionSelects).map(v -> v.getId()).collect(Collectors.toList());
List<String> newIds = Arrays.stream(lineUnionSelects).map(TheRapyRecuperationLineUnionSelect::getId).toList();
//删除
List<String> deleteIds = oldUnionSelects.stream().map(v -> v.getId()).filter(v -> !newIds.contains(v)).collect(Collectors.toList());
List<String> deleteIds = oldUnionSelects.stream().map(TheRapyRecuperationLineUnionSelect::getId).filter(v -> !newIds.contains(v)).collect(Collectors.toList());
unionSelectService.clear(Cnd.where("id", "in", deleteIds));
}
return null;
@@ -208,19 +237,19 @@ public class TheRapyRecuperationLineUnionSelectController {
@At
@POST
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public Object selectLineInfo(@Param("lineId") String lineId, @Param("unionId") String unionId, @Param("mode") Integer mode, @Param("year") Integer year) {
try {
Assert.notBlank(lineId);
Assert.notNull(mode);
unionId = StrUtil.emptyToNull(Vi.getUnionId());
if (mode == 1 && !ShiroUtil.hasRole("H04")&&!ShiroUtil.hasRole("sysadmin")) {
if (mode == 1 && !ShiroUtil.hasRole("H04")) {
return Result.error("您没有分工会角色权限!");
} else if (mode == 2 && !ShiroUtil.hasRole("SchoolUnionAdmin")&&!ShiroUtil.hasRole("sysadmin")) {
} else if (mode == 2 && !ShiroUtil.hasRole("SchoolUnionAdmin")) {
return Result.error("您没有校工会角色权限!");
}
return Result.success(unionSelectService.selectLineInfo(lineId, unionId, mode, year));
return Result.success(unionSelectService.selectLineInfo(lineId, unionId,mode, year));
} catch (Exception e) {
log.error(e.getMessage());
return Result.error(e.getMessage());
@@ -237,7 +266,7 @@ public class TheRapyRecuperationLineUnionSelectController {
@At
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public Object findUsLineInfo(String lineId, String usUnionId) {
return unionSelectService.findUsLineInfo(lineId, usUnionId);
}
@@ -245,7 +274,7 @@ public class TheRapyRecuperationLineUnionSelectController {
@At("/deSelect")
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
@SLog(tag = "疗休养", msg = "取消选择线路", param = true, result = true)
@Aop(TransAop.READ_COMMITTED)
public Object deSelect(@Param("lineId") String lineId, @Param("unionId") String unionId) {
@@ -256,29 +285,8 @@ public class TheRapyRecuperationLineUnionSelectController {
// enrollCnd.and("takePartInLineId", "=", lineId);
Cnd enrollCnd = Cnd.where("unionId", "=", unionId);
enrollCnd.and("lineId", "=", lineId);
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();
} catch (Exception e) {
return Result.error(e.getMessage());
@@ -293,7 +301,7 @@ public class TheRapyRecuperationLineUnionSelectController {
*/
@At
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public Object getTravelAgencyOptions() {
List<TheRapyRecuperationTravelAgency> travelAgencies = unionSelectService.dao().query(TheRapyRecuperationTravelAgency.class, Cnd.NEW().asc("serialNumber"));
return travelAgencies;
@@ -321,7 +329,7 @@ public class TheRapyRecuperationLineUnionSelectController {
@At("/getLineConfig/?")
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public Object getLineConfig(String id) {
Sql sql = Sqls.create("select lotId from the_rapy_recuperation_line where id = @lineId");
sql.setParam("lineId", id);
@@ -330,52 +338,89 @@ public class TheRapyRecuperationLineUnionSelectController {
Integer cost = Optional.ofNullable(lotInfo).map(v -> v.getActivityCost()).orElse(0);
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
Integer groupNumber = Optional.ofNullable(config).map(TheRapyRecuperationConfig::getGroupNumber).orElse(0);
Integer outsideQuota = Optional.ofNullable(config).map(TheRapyRecuperationConfig::getOutsideQuota).orElse(0);
return Result.success(Map.of("cost", cost, "groupNumber", groupNumber, "outsideQuota", outsideQuota));
return Result.success(Map.of("cost", cost, "groupNumber", groupNumber));
}
/**
* 一键统赋时间,针对于已选择的线路
*
* @param lineIds 线路Id数组
* @param lineIds 线路Id数组
* @param lineUnionSelects 出行时段
* @return {@link Object}
*/
@At("/setGiveLineTimes")
@POST
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect"}, logical = Logical.OR)
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, 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) {
@SLog(type = "普惠疗休养",tag = "分工会/校工会选择线路",msg = "一键统赋时间,针对于已选择的线路",param = true,result = true)
public Object setGiveLineTimes(@Param("lineIds") String[] lineIds,@Param("lineUnionSelects") TheRapyRecuperationLineUnionSelect[] lineUnionSelects,
@Param(value = "year",required = false) Integer year) {
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());
Cnd cnd = Cnd.NEW();
cnd.and("unionId","=",Vi.getUnionId());
cnd.and("selectUserId","=", ShiroUtil.getUserId());
cnd.and("YEAR(selectTime)","=",year == null ? DateUtil.thisYear() : year);
List<TheRapyRecuperationLineUnionSelect> unionSelectList = dao.query(TheRapyRecuperationLineUnionSelect.class, cnd);
dao.update(TheRapyRecuperationLineUnionSelect.class, chain, Cnd.where("id", "in", lineIds));
List<String> selectIdList = unionSelectList.stream().map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList());
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",selectIdList));
}
return null;
}
@At
@ViReturn
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, 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;
}
@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;
@RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR)
public Object queryJoinUser(String keyWord){
Sql sql = Sqls.create("""
select
id,
username,
loginname,
sex,
mobile,
unitname,
unionname
from
user
$condition
""");
Cnd cnd = Cnd.NEW();
if(StrUtil.isNotBlank(keyWord)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("userName", keyWord);
seg.orLike("loginName", keyWord);
cnd.and(seg);
}
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
cnd.and(new Static("id in (select userId from activity_user_scope where groupId = '%s')".formatted(config.getActivityGroupId())));
cnd.groupBy("id");
cnd.asc("loginname");
sql.setCondition(cnd);
Pagination pagination = unionSelectService.listPageMap(1, 30, sql);
return pagination.getList();
}
}
@@ -1,9 +1,8 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.process;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
@@ -47,7 +46,7 @@ public class TheRapyRecuperationStatisticsController {
Sql sql = Sqls.create("""
SELECT
line.lineName,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE isNormal=true and line.id = takePartInLineId ) AS enrollNum,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE line.id = takePartInLineId ) AS enrollNum,
(
SELECT
COUNT( 1 )
@@ -123,7 +122,7 @@ public class TheRapyRecuperationStatisticsController {
Sql sql = Sqls.create("""
SELECT
agency.travelAgencyName,
( SELECT AVG( evaluationForTravelAgency ) FROM the_rapy_recuperation_enroll where isNormal=true and agency.id=takePartInTravelAgencyId) AS avg
( SELECT AVG( evaluationForTravelAgency ) FROM the_rapy_recuperation_enroll where agency.id=takePartInTravelAgencyId) AS avg
FROM
`the_rapy_recuperation_travel_agency` agency
WHERE
@@ -140,7 +139,7 @@ public class TheRapyRecuperationStatisticsController {
Sql sql = Sqls.create("""
SELECT
line.lineName,
( SELECT AVG( evaluationForLine ) FROM the_rapy_recuperation_enroll where isNormal=true and line.id=takePartInLineId) AS avg
( SELECT AVG( evaluationForLine ) FROM the_rapy_recuperation_enroll where line.id=takePartInLineId) AS avg
FROM
`the_rapy_recuperation_line` line
WHERE
@@ -7,26 +7,21 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
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.utils.EmailUtil;
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_user;
import io.v.nutz.web.commons.base.Globals;
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 io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -81,22 +76,15 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getXlData(PageForm pageForm,
String year,
String unionId,
String takePartInLineId,
String regionalNature,
String lotId,
String state,
String selectId) {
public Object getXlData(PageForm pageForm, String year, String unionId, String takePartInLineId, String regionalNature, String lotId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
enroll.id as enrollId,
lineu.id,
line.id,
line.lineName,
line.regionalNature,
lineu.lineId,
lineu.id AS selectId,
lineu.signUpMode,
YEAR(lineu.selectTime) as `year`,
CONCAT(DATE_FORMAT(lineu.playStartTime,'%m月%d日'),'-',DATE_FORMAT(lineu.playEndTime,'%m月%d日')) AS linePlayTime,
@@ -109,15 +97,15 @@ public class TheRapyRecuperationUnionQueryController {
un.unionname,
lot.lotName,
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
SUM(enroll.familyNumber) AS familyNumber,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE 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 takePartInLineId = lineu.id $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 the_rapy_recuperation_travel_agency lxs ON line.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = enroll.takePartInUnionId
$condition
""").setParam("stateId", TheRapyRecuperationState.PASS);
@@ -128,10 +116,10 @@ public class TheRapyRecuperationUnionQueryController {
if (!ShiroUtil.hasAnyRoles("sysadmin,H06")) {
// 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);
String unionCndSql = StrUtil.isBlank(year) ? "and selfUnionId='%s'".formatted(Vi.getUnionId()) : "and selfUnionId='%s' and YEAR(signingUptime)='%s'".formatted(Vi.getUnionId(), year);
sql.setVar("unionCnd", unionCndSql);
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
//cnd.and("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)) {
cnd.andEX("enroll.selfUnionId", "=", unionId);
//cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
@@ -141,38 +129,21 @@ public class TheRapyRecuperationUnionQueryController {
}*/
} else {
if (Strings.isNotBlank(unionId)) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
//cnd.and("enroll.selfUnionId", "=", unionId);
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
cnd.and("enroll.selfUnionId", "=", unionId);
}
}
if (Strings.isNotBlank(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("lineu.lineId", "=", takePartInLineId);
cnd.andEX("lineu.id", "=", selectId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.groupBy("enroll.takePartInLineId");
cnd.desc("un.unioncode");
sql.setCondition(cnd);
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;
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@@ -181,8 +152,7 @@ public class TheRapyRecuperationUnionQueryController {
@RequiresAuthentication
public Object getRyData(PageForm pageForm, String year, String unionId, String unitId,
String takePartInLineId, String regionalNature, String state,
String state2, String agencyId, String takePartInBaseManagementId,
String lotId, String selectId) {
String state2, String agencyId, String takePartInBaseManagementId, String lotId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
@@ -193,7 +163,6 @@ public class TheRapyRecuperationUnionQueryController {
agency.travelAgencyName,
ma.baseName,
enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
@@ -226,10 +195,10 @@ public class TheRapyRecuperationUnionQueryController {
cnd.and(seg);
}
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
if (Strings.isNotBlank(unionId) && state.equals("1")) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
//cnd.and("enroll.selfUnionId", "=", unionId);
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
cnd.and("enroll.selfUnionId", "=", unionId);
}
cnd.andEX("enroll.selfUnionId", "=", unionId);
} else {
@@ -249,21 +218,18 @@ public class TheRapyRecuperationUnionQueryController {
cnd.andEX("lineu.signUpMode", "=", 2);
}
} else {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
//cnd.and("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("lineu.lineId", "=", takePartInLineId);
cnd.andEX("lineu.id", "=", selectId);
cnd.andEX("line.id", "=", takePartInLineId);
if (state.equals("1")) {
cnd.andEX("line.regionalNature", "=", regionalNature);
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");
} else if (state.equals("2")) {
cnd.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd.and("enroll.takePartInTravelAgencyId", "!=", "");
cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
} else if ("3".equals(state)) {
cnd.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -292,7 +258,7 @@ public class TheRapyRecuperationUnionQueryController {
Sql sql = Sqls.create("""
SELECT
*,
files AS fileId,
cast( files ->> '$[0].id' AS CHAR ) AS fileId,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE agency.id = takePartInTravelAgencyId and isNormal=true and stateId=@stateId $unionCnd $yearCnd) agencyNum
FROM
the_rapy_recuperation_travel_agency agency
@@ -357,7 +323,6 @@ public class TheRapyRecuperationUnionQueryController {
state.stateName,
state.stateColor,
enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
@@ -385,17 +350,17 @@ public class TheRapyRecuperationUnionQueryController {
cnd.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("enroll.isNormal", "=", true);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
if (StrUtil.isNotBlank(unionId)) {
cnd.and("enroll.selfUnionId", "=", unionId);
} else {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
//cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", Vi.getUnionId()).or("enroll.selfUnionId", "=", Vi.getUnionId()));
cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
}
} else {
if (StrUtil.isNotBlank(unionId)) {
cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
//cnd.and("enroll.selfUnionId", "=", unionId);
// cnd.and(Cnd.exps("enroll.takePartInUnionId", "=", unionId).or("enroll.selfUnionId", "=", unionId));
cnd.and("enroll.selfUnionId", "=", unionId);
}
}
cnd.desc("enroll.stateId");
@@ -444,6 +409,9 @@ public class TheRapyRecuperationUnionQueryController {
if (Strings.isNotBlank(searchKeyword) && Strings.isNotBlank(searchName)) {
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (!ShiroUtil.hasAnyRoles("sysadmin, SchoolUnionAdmin")) {
cnd.and(Cnd.exps("takePartInUnionId", "=", Vi.getUnionId()).or("selfUnionId", "=", Vi.getUnionId()));
}
cnd.and("stateId", "=", TheRapyRecuperationState.PASS);
cnd.and("isNormal", "=", true);
cnd.desc("unitName");
@@ -536,7 +504,7 @@ public class TheRapyRecuperationUnionQueryController {
@At
@ViReturn
@RequiresAuthentication
public Object getApplyNum(String state, String state2, String unionId, Integer year, String regionalNature, String takePartInLineId, String selectId) {
public Object getApplyNum(String state, String state2, String unionId, Integer year, String regionalNature, String takePartInLineId) {
Cnd cnd1 = Cnd.NEW();
Sql sql1 = Sqls.create("""
SELECT
@@ -552,16 +520,13 @@ public class TheRapyRecuperationUnionQueryController {
if (Strings.isNotBlank(state)) {
if (state.equals("1")) {
cnd1.andEX("line.regionalNature", "=", regionalNature);
cnd1.and("enroll.takePartInLineId", "is not", null);
cnd1.and("enroll.takePartInLineId", "!=", "");
// cnd1.and("enroll.takePartInTravelAgencyId", "is", null);
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()));
// 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")) {
cnd1.and("enroll.takePartInTravelAgencyId", "is not", null)
.and("enroll.takePartInTravelAgencyId", "!=", "")
.and("enroll.selfUnionId", "=", Vi.getUnionId());
cnd1.and("enroll.takePartInTravelAgencyId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
} else {
cnd1.and("enroll.takePartInBaseManagementId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
}
@@ -582,8 +547,8 @@ public class TheRapyRecuperationUnionQueryController {
}
}
} else {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
//cnd1.and(Cnd.exps("enroll.selfUnionId", "=", 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 (Strings.isNotBlank(state)) {
@@ -593,10 +558,8 @@ public class TheRapyRecuperationUnionQueryController {
}
cnd1.andEX("line.regionalNature", "=", regionalNature);
cnd1.and("enroll.takePartInLineId", "is not", null);
cnd1.and("enroll.takePartInLineId", "!=", "");
} else if (state.equals("2")) {
cnd1.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd1.and("enroll.takePartInTravelAgencyId", "!=", "");
cnd1.andEX("enroll.selfUnionId", "=", unionId);
} else if (state.equals("3")) {
cnd1.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -605,13 +568,12 @@ public class TheRapyRecuperationUnionQueryController {
}
} else {
if (Strings.isNotBlank(unionId)) {
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
//cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId));
// cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
cnd1.and(Cnd.exps("enroll.selfUnionId", "=", unionId));
}
}
}
cnd1.andEX("lineu.lineId", "=", takePartInLineId);
cnd1.andEX("lineu.id", "=", selectId);
cnd1.andEX("line.id", "=", takePartInLineId);
cnd1.andEX("YEAR(enroll.signingUptime)", "= ", year);
cnd1.andEX("enroll.isNormal", "= ", true);
cnd1.andEX("enroll.stateId", "= ", TheRapyRecuperationState.PASS);
@@ -626,13 +588,13 @@ public class TheRapyRecuperationUnionQueryController {
FROM
the_rapy_recuperation_enroll_companion
WHERE
trreId IN ( SELECT enroll.id FROM the_rapy_recuperation_enroll enroll
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
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
""");
@@ -643,15 +605,12 @@ public class TheRapyRecuperationUnionQueryController {
if (state.equals("1")) {
cnd2.andEX("line.regionalNature", "=", regionalNature);
cnd2.and("enroll.takePartInLineId", "is not", null);
cnd2.and("enroll.takePartInLineId", "!=", "");
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()));
// 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")) {
cnd2.and("enroll.takePartInTravelAgencyId", "is not", null)
.and("enroll.takePartInTravelAgencyId", "!=", "")
.and("enroll.selfUnionId", "=", Vi.getUnionId());
cnd2.and("enroll.takePartInTravelAgencyId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
} else {
cnd2.and("enroll.takePartInBaseManagementId", "is not", null).and("enroll.selfUnionId", "=", Vi.getUnionId());
}
@@ -671,22 +630,20 @@ public class TheRapyRecuperationUnionQueryController {
}
}
} else {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", Vi.getUnionId()).or("enroll.takePartInUnionId", "=", Vi.getUnionId()));
//cnd2.and(Cnd.exps("enroll.selfUnionId", "=", 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 (Strings.isNotBlank(state)) {
if (state.equals("1")) {
if (Strings.isNotBlank(unionId)) {
cnd2.and(Cnd.exps("enroll.selfUnionId", "=", unionId).or("enroll.takePartInUnionId", "=", unionId));
//cnd2.and(Cnd.exps("enroll.selfUnionId", "=", 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.and("enroll.takePartInLineId", "is not", null);
cnd2.and("enroll.takePartInLineId", "!=", "");
} else if (state.equals("2")) {
cnd2.and("enroll.takePartInTravelAgencyId", "is not", null);
cnd2.and("enroll.takePartInTravelAgencyId", "!=", "");
cnd2.andEX("enroll.selfUnionId", "=", unionId);
} else {
cnd2.and("enroll.takePartInBaseManagementId", "is not", null);
@@ -695,8 +652,7 @@ public class TheRapyRecuperationUnionQueryController {
cnd2.andEX("enroll.selfUnionId", "=", unionId);
}
}
cnd2.andEX("lineu.lineId", "=", takePartInLineId);
cnd2.andEX("lineu.id", "=", selectId);
cnd2.andEX("line.id", "=", takePartInLineId);
cnd2.andEX("YEAR(enroll.signingUptime)", "=", year);
cnd2.andEX("enroll.isNormal", "=", true);
cnd2.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS);
@@ -731,19 +687,12 @@ public class TheRapyRecuperationUnionQueryController {
.and("YEAR(signingUptime)", "=", year)
.and("stateId", "=", TheRapyRecuperationState.PASS));
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) {
enrollList.forEach(v -> {
baseService.dao().fetchLinks(v, "companionList");
});
List<NutMap> arrayList = new ArrayList<>();
enrollList.forEach(v -> {
String schoolTime = userMap.getOrDefault(v.getLoginName(), "");
String sTime = TherapyRecuperationCommon.getRemarkBySchoolTime(schoolTime);
arrayList.add(new NutMap() {{
addv("userName", v.getUserName());
addv("loginName", v.getLoginName());
@@ -753,7 +702,6 @@ public class TheRapyRecuperationUnionQueryController {
addv("idCard", v.getIdCard());
addv("relation", "本人");
addv("bz", v.getUserName());
addv("remark", sTime);
}});
v.getCompanionList().forEach(c -> {
arrayList.add(new NutMap() {{
@@ -778,7 +726,7 @@ public class TheRapyRecuperationUnionQueryController {
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 60));
exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 60));
exportEntities.add(new ExcelExportEntity("备注", "bz", 20));
exportEntities.add(new ExcelExportEntity("备注2", "remark", 30));
File xls = new File("C:\\疗休养报名信息表.xls");
FileOutputStream fileOutputStream = null;
@@ -798,6 +746,7 @@ public class TheRapyRecuperationUnionQueryController {
return null;
}
@At
@ViReturn
public Object doAttend(@Param("data") String multipleSelection) {
@@ -877,7 +826,7 @@ public class TheRapyRecuperationUnionQueryController {
}
});
map.put("maplist", nutMaps);
map.put("unionName", ((Sys_union) io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("union")).getUnionname());
map.put("unionName", ((Sys_union) ShiroUtil.getPrincipalProperty("union")).getUnionname());
try {
response.setContentType("application/octet-stream");
ViTool.excelResponse(response, "教职工疗休养组团时间路线申报表.xlsx");
@@ -5,21 +5,15 @@ 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.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
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.service.BaseService;
import io.v.nutz.base.utils.Vi;
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.base.query.PageForm;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.mode.TheRapyRecuperationEnrollExcelMode;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
@@ -28,7 +22,6 @@ import org.apache.poi.ss.usermodel.Workbook;
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.Sqls;
import org.nutz.dao.sql.Sql;
@@ -42,23 +35,17 @@ import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
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.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@IocBean
@At("/platform/theRapyRecuperation/user/query")
@@ -84,7 +71,7 @@ public class TheRapyRecuperationUserQueryController {
public Object pageData(String regionalNature, Integer state, PageForm pageForm,
Integer startYear, Integer endYear, String unionId,
String unitId, String takePartInLineId, String agencyId, String lotId,
String takePartInBaseManagementId, String signUpMode) {
String takePartInBaseManagementId,String signUpMode) {
Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
@@ -96,17 +83,14 @@ public class TheRapyRecuperationUserQueryController {
sql = Sqls.create("""
SELECT
enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lxs.travelAgencyName,
( 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 AND relation = '亲属' ) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = enroll.takePartInTravelAgencyId
$condition
""");
if (!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
}
cnd.andEX("enroll.selfUnionId", "=", Vi.getUnionId());
cnd.andEX("lxs.`year`", ">=", startYear);
cnd.andEX("lxs.`year`", "<=", endYear);
cnd.andEX("enroll.takePartInTravelAgencyId", "=", agencyId);
@@ -119,11 +103,10 @@ public class TheRapyRecuperationUserQueryController {
line.lineName,
ma.baseName,
enroll.*,
IF(enroll.isReimbursement = 1,'已报销','未报销') AS reimbursementStatus,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
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
@@ -138,7 +121,7 @@ public class TheRapyRecuperationUserQueryController {
cnd.andEX("enroll.selfUnitId", "=", unitId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.andEX("lineu.signUpMode","=",signUpMode);
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);
@@ -146,7 +129,6 @@ public class TheRapyRecuperationUserQueryController {
} else {
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", "!=", "");
}
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -158,9 +140,9 @@ public class TheRapyRecuperationUserQueryController {
if (StrUtil.isNotBlank(unionId)) {
cnd.and("enroll.selfUnionId", "=", unionId);
}
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
}
cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.desc("enroll.unionName");
sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -177,23 +159,19 @@ public class TheRapyRecuperationUserQueryController {
}
cnd.and("isNormal", "=", true);
cnd.and("takePartInLineId", "is not", null);
cnd.and("takePartInLineId", "!=", "");
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 count1 = baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInTravelAgencyId", "is not", null)
.and("takePartInTravelAgencyId", "!=", "")
.andEX("selfUnionId", "=", unionId)
.andEX("YEAR(signingUptime)", ">=", startYear)
.andEX("YEAR(signingUptime)", "<=", endYear)
.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)
.andEX("selfUnionId", "=", unionId)
.andEX("YEAR(signingUptime)", ">=", startYear)
.andEX("YEAR(signingUptime)", "<=", endYear)
.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);
@@ -292,9 +270,10 @@ public class TheRapyRecuperationUserQueryController {
return null;
}
@At
@ViReturn
public Object getUnionSelectLine(Integer startYear, Integer endYear, Integer signUpMode, String regionalNature, Boolean flag, String disPlayUnionSelectId) {
public Object getUnionSelectLine(Integer year,Integer signUpMode){
Sql sql = Sqls.create("""
SELECT
rlus.id,
@@ -305,7 +284,7 @@ public class TheRapyRecuperationUserQueryController {
DATE_FORMAT( rlus.playEndTime, '%Y-%m-%d' ) AS playEndTime,
rl.lineName,
rl.regionalNature,
if(rlus.signUpMode=2,'工会','工会') AS signUpMode,
if(rlus.signUpMode=1,'工会','工会') AS signUpMode,
lot.lotName
FROM
`the_rapy_recuperation_line_union_select` rlus
@@ -314,388 +293,30 @@ public class TheRapyRecuperationUserQueryController {
$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.and(Cnd.exps("rlus.isOpen","=",1).or("rlus.unionId","=",Vi.getUnionId()));
cnd.and("YEAR(rlus.selectTime)","=",DateUtil.thisYear());
// cnd.and("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,
public void doExport(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,
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));
cnd.and(Cnd.likeEX(searchName,searchKeyword));
}
Sql sql;
@@ -714,8 +335,6 @@ public class TheRapyRecuperationUserQueryController {
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
@@ -727,7 +346,7 @@ public class TheRapyRecuperationUserQueryController {
enroll.*,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id AND relation = '亲属' ) isFamily
FROM
`the_rapy_recuperation_enroll` enroll
@@ -743,9 +362,7 @@ public class TheRapyRecuperationUserQueryController {
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", "!=", "");
cnd.andEX("lineu.signUpMode","=",signUpMode);
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);
@@ -764,9 +381,9 @@ public class TheRapyRecuperationUserQueryController {
if (StrUtil.isNotBlank(unionId)) {
cnd.and("enroll.selfUnionId", "=", unionId);
}
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
}
cnd.and("enroll.isNormal", "=", true);
cnd.and("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.desc("enroll.unionName");
sql.setCondition(cnd);
@@ -779,10 +396,8 @@ public class TheRapyRecuperationUserQueryController {
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);
}
TheRapyRecuperationLine line = baseService.dao().fetch(TheRapyRecuperationLine.class, v.getLineId());
v.setLineInfo(line);
});
List<NutMap> arrayList = new ArrayList<>();
String takePartInLineId2 = "";
@@ -792,9 +407,8 @@ public class TheRapyRecuperationUserQueryController {
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());
TheRapyRecuperationTravelAgency agency = baseService.dao().fetch(TheRapyRecuperationTravelAgency.class, line.getTravelAgencyId());
agencyName = agency.getTravelAgencyName();
lotName = lot.getLotName();
} else {
@@ -823,6 +437,7 @@ public class TheRapyRecuperationUserQueryController {
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("cxsj", DateUtil.formatDateTime(v.getPlayStartTime()) + "" + DateUtil.formatDateTime(v.getPlayEndTime()));
addv("agencyName", finalAgencyName);
addv("lotName", finalLotName);
addv("bz", v.getUserName());
@@ -843,6 +458,7 @@ public class TheRapyRecuperationUserQueryController {
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("cxsj", DateUtil.formatDateTime(v.getPlayStartTime()) + "" + DateUtil.formatDateTime(v.getPlayEndTime()));
addv("agencyName", finalAgencyName);
addv("lotName", finalLotName);
addv("bz", v.getUserName());
@@ -871,6 +487,7 @@ public class TheRapyRecuperationUserQueryController {
exportEntities.add(new ExcelExportEntity("旅行社", "agencyName", 20));
exportEntities.add(new ExcelExportEntity("报名时间", "signingUptime", 20));
exportEntities.add(new ExcelExportEntity("备注", "bz", 20));
exportEntities.add(new ExcelExportEntity("出行时间", "cxsj", 50));
try {
response.setContentType("application/octet-stream");
@@ -882,17 +499,4 @@ public class TheRapyRecuperationUserQueryController {
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,409 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.query;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
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.TheRapyRecuperationEnrollBed;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import org.apache.poi.ss.usermodel.Workbook;
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.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
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 javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
/**
* 分工会人员信息查询
*/
@IocBean
@At("/platform/theRapyRecuperation/branchUnionUserQuery")
@Ok("json:full")
public class TheRapyRecuperationBranchUnionUserQueryController {
@Inject
private Dao dao;
@Inject
private BaseService baseService;
@Inject
private TheRapyRecuperationEnrollService enrollService;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/branchUnionUserQuery/index.html")
@RequiresPermissions("theRapyRecuperation.branchUnionUserQuery")
public void index() {
}
/**
* 分工会人员信息查询
*
* @param pageForm 分页
* @param year 年度
* @param userName 姓名
* @param loginName 登录名
* @param signUpMode 报名方式(1分工会 2校工会 3个人)
* @param unionId
* @param takePartInLineId 线路id
* @param lotId 标段id
* @param regionalNature 区域性质 省内 省外
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.branchUnionUserQuery")
public Result pageData(PageForm pageForm,
Integer year,
String userName,
String loginName,
String signUpMode,
String unionId,
String takePartInLineId,
String lotId,
String regionalNature) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
state.stateName,
state.stateColor,
line.regionalNature,
line.lineName,
agency.travelAgencyName,
ma.baseName,
enroll.*,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
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_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
$condition
""");
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC");
}
// 年度
cnd.andEX("YEAR ( enroll.signingUptime )", "=", year);
if (StrUtil.isNotBlank(userName)) {
cnd.where().andLike("enroll.userName", loginName);
}
if (StrUtil.isNotBlank(loginName)) {
cnd.where().andLike("enroll.loginName", userName);
}
// 线路
cnd.andEX("enroll.takePartInLineId", "=", takePartInLineId);
// 标段
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
cnd.and(seg);
}
// 区域
cnd.andEX("line.regionalNature", "=", regionalNature);
// 分工会只查本分工会的人员
cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
// 报名模式
if (StrUtil.isNotBlank(signUpMode)) {
if (signUpMode.equals("1")) {
cnd.andEX("line.signUpMode", "=", 2);
} else if (signUpMode.equals("2")) {
cnd.andEX("lineu.unionId", "=", Vi.getUnionId());
cnd.andEX("line.signUpMode", "=", 1);
} else if (signUpMode.equals("3")) {
cnd.andEX("lineu.unionId", "!=", Vi.getUnionId());
cnd.andEX("line.signUpMode", "=", 1);
} else if (signUpMode.equals("4")) {
cnd.andEX("line.signUpMode", "=", 3);
}
}
cnd.desc("enroll.stateId");
cnd.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.andEX("enroll.isNormal", "=", true);
sql.setCondition(cnd);
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("id")));
for (TheRapyRecuperationEnrollCompanion enrollCompanion : companionList) {
baseService.fetchLinks(enrollCompanion, "bedInfo");
}
v.setv("companionList", companionList);
});
return Result.success(pagination);
}
/**
* 设置出行人员
*
* @return
*/
@At
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.branchUnionUserQuery")
public Result setUpParticipants(@Param("data") String data) {
List<NutMap> list = Json.fromJsonAsList(NutMap.class, data);
for (NutMap map : list) {
Chain chain = Chain.make("lotId", map.getString("lotId")).add("takePartInTime", map.getString("takePartInTime")).add("isTakePartIn", true);
baseService.update("the_rapy_recuperation_enroll", chain, Cnd.where("id", "=", map.getString("id")));
}
return Result.success();
}
/**
* 删除报名信息
*/
@At
public Result deleteMyEnrollInfoById(String id) {
enrollService.deleteMyEnrollInfoById(id);
return Result.success();
}
/**
* 编辑查询详细信息
*/
@At
@RequiresPermissions("theRapyRecuperation.branchUnionUserQuery")
public Result findOne(String id) {
Sql sql = Sqls.create("""
SELECT
lxs.travelAgencyName,
enroll.*,
line.lineName,
if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn,
(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_travel_agency lxs ON lxs.id = line.travelAgencyId
where enroll.id=@id
""");
sql.setParam("id", id);
sql.setCallback(Sqls.callback.map());
dao.execute(sql);
NutMap data = (NutMap) sql.getResult();
List<TheRapyRecuperationEnrollCompanion> companionList = dao.query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id));
companionList.forEach(v -> {
v.setBedInfo(dao.fetch(TheRapyRecuperationEnrollBed.class, v.getBedInfoId()));
});
data.put("companionList", companionList);
return Result.success(data);
}
/**
* 获取线路
*
* @param year 年度
* @param signUpMode 报名模式
* @param regionalNature 区域
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.branchUnionUserQuery")
public Result listLine(Integer year, String signUpMode, String regionalNature) {
Sql sql = Sqls.create("""
SELECT
t1.takePartInLineId,
t3.lineName,
t4.unionname as unionName
FROM
the_rapy_recuperation_enroll t1
LEFT JOIN the_rapy_recuperation_line_union_select t2 ON t2.id = t1.takePartInLineId
LEFT JOIN the_rapy_recuperation_line t3 ON t3.id = t2.lineId
LEFT JOIN sys_union t4 ON t4.id = t2.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t1.selfUnionId", "=", Vi.getUnionId());
cnd.andEX("YEAR(t2.selectTime)", "=", year);
cnd.andEX("t3.regionalNature", "=", regionalNature);
if (signUpMode.equals("1")) {
cnd.andEX("t3.signUpMode", "=", 2);
} else if (signUpMode.equals("2")) {
cnd.andEX("t2.unionId", "=", Vi.getUnionId());
cnd.and("t3.signUpMode", "=", 1);
} else if (signUpMode.equals("3")) {
cnd.andEX("t2.unionId", "!=", Vi.getUnionId());
cnd.and("t3.signUpMode", "=", 1);
} else if (signUpMode.equals("4")) {
cnd.andEX("t3.signUpMode", "=", 3);
}
cnd.groupBy("t1.takePartInLineId");
sql.setCondition(cnd);
List<NutMap> list = enrollService.listMap(sql);
return Result.success(list);
}
@At
@Ok("void")
@RequiresPermissions("theRapyRecuperation.branchUnionUserQuery")
public void exportXlsx(Integer year,
String userName,
String loginName,
String signUpMode,
String unionId,
String takePartInLineId,
String lotId,
String regionalNature,
HttpServletResponse response) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
state.stateName,
state.stateColor,
line.regionalNature,
line.lineName,
agency.travelAgencyName,
ma.baseName,
enroll.*,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
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_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
$condition
""");
// 年度
cnd.andEX("YEAR ( enroll.signingUptime )", "=", year);
if (StrUtil.isNotBlank(userName)) {
cnd.where().andLike("enroll.userName", userName);
}
if (StrUtil.isNotBlank(loginName)) {
cnd.where().andLike("enroll.loginName", loginName);
}
// 线路
cnd.andEX("enroll.takePartInLineId", "=", takePartInLineId);
// 标段
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
cnd.and(seg);
}
// 区域
cnd.andEX("line.regionalNature", "=", regionalNature);
// 分工会只查本分工会的人员
cnd.and("enroll.selfUnionId", "=", Vi.getUnionId());
// 报名模式
if (StrUtil.isNotBlank(signUpMode)) {
if (signUpMode.equals("1")) {
cnd.andEX("line.signUpMode", "=", 2);
} else if (signUpMode.equals("2")) {
cnd.andEX("lineu.unionId", "=", Vi.getUnionId());
cnd.andEX("line.signUpMode", "=", 1);
} else if (signUpMode.equals("3")) {
cnd.andEX("lineu.unionId", "!=", Vi.getUnionId());
cnd.andEX("line.signUpMode", "=", 1);
} else if (signUpMode.equals("4")) {
cnd.andEX("line.signUpMode", "=", 3);
}
}
cnd.desc("enroll.stateId");
cnd.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.andEX("enroll.isNormal", "=", true);
sql.setCondition(cnd);
List<NutMap> list = enrollService.listMap(sql);
list.forEach(v -> {
List<TheRapyRecuperationEnrollCompanion> companionList = baseService.dao().query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", v.getString("id")));
for (TheRapyRecuperationEnrollCompanion enrollCompanion : companionList) {
baseService.fetchLinks(enrollCompanion, "bedInfo");
}
v.setv("companionList", companionList);
});
// 配置
TheRapyRecuperationConfig config = baseService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
List<ExcelExportEntity> excelEntities = new ArrayList<>();
excelEntities.add(new ExcelExportEntity("姓名", "userName", 20));
excelEntities.add(new ExcelExportEntity("工号", "loginName", 20));
excelEntities.add(new ExcelExportEntity("性别", "sex", 20));
excelEntities.add(new ExcelExportEntity("单位", "unitName", 20));
excelEntities.add(new ExcelExportEntity("工会", "unionName", 20));
excelEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
excelEntities.add(new ExcelExportEntity("手机号", "mobile", 20));
if (config.getFamilyInfo() == 2) {
excelEntities.add(new ExcelExportEntity("与本人关系", "relation", 10));
excelEntities.add(new ExcelExportEntity("床型", "bedType", 10));
excelEntities.add(new ExcelExportEntity("床位数", "bedNum", 10));
excelEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 10));
} else {
excelEntities.add(new ExcelExportEntity("携带家属数", "familyNumber", 10));
}
excelEntities.add(new ExcelExportEntity("备注", "bz", 20));
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + new String(("报名人员.xlsx").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
try {
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, excelEntities, list);
workbook.write(response.getOutputStream());
workbook.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,122 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.query;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
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.service.TheRapyRecuperationEnrollService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @author zhf
* @date 2025/5/23 09:04
* @description 线路查询
*/
@IocBean
@At("/platform/theRapyRecuperation/lineQuery")
@Ok("json:full")
public class TheRapyRecuperationLineQueryController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/lineQuery/index.html")
@RequiresPermissions("theRapyRecuperation.lineQuery")
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(value = "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 = "travelAgencyPlace", required = false) String travelAgencyPlace,
@Param(value = "travelAgencyId", required = false) String travelAgencyId,
@Param(value = "regionalNature", required = false) String regionalNature) {
Sql sql = Sqls.create("""
SELECT
u.username,
st.stateName,
line.id,
line.lineName,
line.regionalNature,
line.travelAgencyPlace,
lineu.auditState,
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,
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_line_union_select lineu
LEFT JOIN `the_rapy_recuperation_enroll` enroll ON lineu.id = enroll.takePartInLineId
left join `user` u on u.id=lineu.selectUserId
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 line.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = lineu.unionId
left join audit_state st on st.stateId=lineu.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(lineu.selectTime)", ">=", startYear);
cnd.andEX("YEAR(lineu.selectTime)", "<=", endYear);
cnd.andEX("lineu.signUpMode", "=", signUpMode);
cnd.andEX("lineu.unionId", "=", unionId);
cnd.andEX("line.travelAgencyId", "=", travelAgencyId);
cnd.andEX("line.travelAgencyPlace", "=", travelAgencyPlace);
if (!ShiroUtil.hasAnyRoles("sysadmin, SchoolUnionAdmin")) {
if (ShiroUtil.hasAnyRoles("gh01")) {
cnd.andEX("lineu.unionId", "=", Vi.getUnionId());
} else {
cnd.and("lineu.selectUserId", "=", ShiroUtil.getUserId());
}
}
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())){
SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("u.username", pageForm.getSearchKeyword());
group.orLike("u.loginname", pageForm.getSearchKeyword());
cnd.and(group);
}
cnd.andEX("line.lotId", "=", lotId);
cnd.andEX("line.id", "=", takePartInLineId);
cnd.andEX("lineu.id", "=", selectId);
cnd.andEX("line.regionalNature", "=", regionalNature);
cnd.groupBy("lineu.id");
cnd.asc("line.serialNumber").asc("lineu.playStartTime");
sql.setCondition(cnd);
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
}
@@ -0,0 +1,397 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.query;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollBed;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import org.apache.poi.ss.usermodel.Workbook;
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.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
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 javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
/**
* 校工会人员信息查询
*/
@IocBean
@At("/platform/theRapyRecuperation/schoolUnionUserQuery")
@Ok("json:full")
public class TheRapyRecuperationSchoolUnionUserQueryController {
@Inject
private Dao dao;
@Inject
private BaseService baseService;
@Inject
private TheRapyRecuperationEnrollService enrollService;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/schoolUnionUserQuery/index.html")
@RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery")
public void index() {
}
/**
* 校工会人员信息查询
*
* @param pageForm 分页
* @param year 年度
* @param userName 姓名
* @param loginName 登录名
* @param signUpMode 报名方式(1分工会 2校工会 3个人)
* @param unionId 分工会id
* @param takePartInLineId 线路id
* @param lotId 标段id
* @param regionalNature 区域性质 省内 省外
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery")
public Result pageData(PageForm pageForm,
Integer year,
String userName,
String loginName,
String signUpMode,
String unionId,
String takePartInLineId,
String lotId,
String regionalNature) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
state.stateName,
state.stateColor,
line.regionalNature,
line.lineName,
agency.travelAgencyName,
ma.baseName,
enroll.*,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
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_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
$condition
""");
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC");
}
// 年度
cnd.andEX("YEAR ( enroll.signingUptime )", "=", year);
if (StrUtil.isNotBlank(userName)) {
cnd.where().andLike("enroll.userName", userName);
}
if (StrUtil.isNotBlank(loginName)) {
cnd.where().andLike("enroll.loginName", loginName);
}
// 线路
cnd.andEX("enroll.takePartInLineId", "=", takePartInLineId);
// 标段
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
cnd.and(seg);
}
// 区域
cnd.andEX("line.regionalNature", "=", regionalNature);
// 校工会可查询指定分工会
cnd.andEX("enroll.selfUnionId", "=", unionId);
// // 报名模式
// if (StrUtil.isNotBlank(signUpMode)) {
// if (signUpMode.equals("1")) {
// cnd.andEX("line.signUpMode", "=", 2);
// } else if (signUpMode.equals("2")) {
// cnd.andEX("lineu.unionId", "=", Vi.getUnionId());
// cnd.andEX("line.signUpMode", "=", 1);
// } else if (signUpMode.equals("3")) {
// cnd.andEX("lineu.unionId", "!=", Vi.getUnionId());
// cnd.andEX("line.signUpMode", "=", 1);
// } else if (signUpMode.equals("4")) {
// cnd.andEX("line.signUpMode", "=", 3);
// }
// }
cnd.desc("enroll.stateId");
cnd.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.andEX("enroll.isNormal", "=", true);
sql.setCondition(cnd);
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("id")));
for (TheRapyRecuperationEnrollCompanion enrollCompanion : companionList) {
baseService.fetchLinks(enrollCompanion, "bedInfo");
}
v.setv("companionList", companionList);
});
return Result.success(pagination);
}
/**
* 设置出行人员
*
* @return
*/
@At
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery")
public Result setUpParticipants(@Param("data") String data) {
List<NutMap> list = Json.fromJsonAsList(NutMap.class, data);
for (NutMap map : list) {
Chain chain = Chain.make("lotId", map.getString("lotId")).add("takePartInTime", map.getString("takePartInTime")).add("isTakePartIn", true);
baseService.update("the_rapy_recuperation_enroll", chain, Cnd.where("id", "=", map.getString("id")));
}
return Result.success();
}
/**
* 删除报名信息
*/
@At
@RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery")
public Result deleteMyEnrollInfoById(String id) {
enrollService.deleteMyEnrollInfoById(id);
return Result.success();
}
/**
* 编辑查询详细信息
*/
@At
@RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery")
public Result findOne(String id) {
Sql sql = Sqls.create("""
SELECT
lxs.travelAgencyName,
enroll.*,
line.lineName,
if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn,
(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_travel_agency lxs ON lxs.id = line.travelAgencyId
where enroll.id=@id
""");
sql.setParam("id", id);
sql.setCallback(Sqls.callback.map());
dao.execute(sql);
NutMap data = (NutMap) sql.getResult();
List<TheRapyRecuperationEnrollCompanion> companionList = dao.query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id));
companionList.forEach(v -> {
v.setBedInfo(dao.fetch(TheRapyRecuperationEnrollBed.class, v.getBedInfoId()));
});
data.put("companionList", companionList);
return Result.success(data);
}
/**
* 获取线路
*
* @param year 年度
* @param signUpMode 报名模式
* @param unionId 分工会id
* @param regionalNature 区域
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery")
public Result listLine(Integer year, String signUpMode, String unionId, String regionalNature) {
Sql sql = Sqls.create("""
SELECT
t1.takePartInLineId,
t3.lineName,
t4.unionname as unionName
FROM
the_rapy_recuperation_enroll t1
LEFT JOIN the_rapy_recuperation_line_union_select t2 ON t2.id = t1.takePartInLineId
LEFT JOIN the_rapy_recuperation_line t3 ON t3.id = t2.lineId
LEFT JOIN sys_union t4 ON t4.id = t2.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("t1.selfUnionId", "=", unionId);
cnd.andEX("YEAR(t2.selectTime)", "=", year);
cnd.andEX("t3.regionalNature", "=", regionalNature);
cnd.groupBy("t1.takePartInLineId");
sql.setCondition(cnd);
List<NutMap> list = enrollService.listMap(sql);
return Result.success(list);
}
@At
@Ok("void")
@RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery")
public void exportXlsx(Integer year,
String userName,
String loginName,
String signUpMode,
String unionId,
String takePartInLineId,
String lotId,
String regionalNature,
HttpServletResponse response) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
state.stateName,
state.stateColor,
line.regionalNature,
line.lineName,
agency.travelAgencyName,
ma.baseName,
enroll.*,
lineu.lineId,
lineu.playStartTime,
lineu.playEndTime,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id ) isFamily
$lotSql
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_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_base_management ma on ma.id = enroll.takePartInBaseManagementId
LEFT JOIN audit_state state ON state.stateId = enroll.stateId
$condition
""");
// 年度
cnd.andEX("YEAR ( enroll.signingUptime )", "=", year);
if (StrUtil.isNotBlank(userName)) {
cnd.where().andLike("enroll.userName", userName);
}
if (StrUtil.isNotBlank(loginName)) {
cnd.where().andLike("enroll.loginName", loginName);
}
// 线路
cnd.andEX("enroll.takePartInLineId", "=", takePartInLineId);
// 标段
if (StrUtil.isNotBlank(lotId)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.lotId", "=", lotId);
seg.or("ma.lotId", "=", lotId);
cnd.and(seg);
}
// 区域
cnd.andEX("line.regionalNature", "=", regionalNature);
// 校工会可查询指定分工会
cnd.andEX("enroll.selfUnionId", "=", unionId);
// // 报名模式
// if (StrUtil.isNotBlank(signUpMode)) {
// if (signUpMode.equals("1")) {
// cnd.andEX("line.signUpMode", "=", 2);
// } else if (signUpMode.equals("2")) {
// cnd.andEX("lineu.unionId", "=", Vi.getUnionId());
// cnd.andEX("line.signUpMode", "=", 1);
// } else if (signUpMode.equals("3")) {
// cnd.andEX("lineu.unionId", "!=", Vi.getUnionId());
// cnd.andEX("line.signUpMode", "=", 1);
// } else if (signUpMode.equals("4")) {
// cnd.andEX("line.signUpMode", "=", 3);
// }
// }
cnd.desc("enroll.stateId");
cnd.andEX("enroll.stateId", "=", TheRapyRecuperationState.PASS);
cnd.andEX("enroll.isNormal", "=", true);
sql.setCondition(cnd);
List<NutMap> list = enrollService.listMap(sql);
list.forEach(v -> {
List<TheRapyRecuperationEnrollCompanion> companionList = baseService.dao().query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", v.getString("id")));
for (TheRapyRecuperationEnrollCompanion enrollCompanion : companionList) {
baseService.fetchLinks(enrollCompanion, "bedInfo");
}
v.setv("companionList", companionList);
});
// 配置
TheRapyRecuperationConfig config = baseService.dao().fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
List<ExcelExportEntity> excelEntities = new ArrayList<>();
excelEntities.add(new ExcelExportEntity("姓名", "userName", 20));
excelEntities.add(new ExcelExportEntity("工号", "loginName", 20));
excelEntities.add(new ExcelExportEntity("性别", "sex", 20));
excelEntities.add(new ExcelExportEntity("单位", "unitName", 20));
excelEntities.add(new ExcelExportEntity("工会", "unionName", 20));
excelEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
excelEntities.add(new ExcelExportEntity("手机号", "mobile", 20));
if (config.getFamilyInfo() == 2) {
excelEntities.add(new ExcelExportEntity("与本人关系", "relation", 10));
excelEntities.add(new ExcelExportEntity("床型", "bedType", 10));
excelEntities.add(new ExcelExportEntity("床位数", "bedNum", 10));
excelEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 10));
} else {
excelEntities.add(new ExcelExportEntity("携带家属数", "familyNumber", 10));
}
excelEntities.add(new ExcelExportEntity("备注", "bz", 20));
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + new String(("报名人员.xlsx").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
try {
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, excelEntities, list);
workbook.write(response.getOutputStream());
workbook.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -49,10 +49,8 @@ public class TheRapyRecuperationLineStatisticsController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private MsgApi msgApi;
@Inject
private Dao dao;
@@ -69,16 +67,19 @@ public class TheRapyRecuperationLineStatisticsController {
@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 = "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
u.username,
st.stateName,
line.id,
line.lineName,
line.regionalNature,
lineu.auditState,
lineu.lineId,
lineu.id as lineUId,
lineu.signUpMode,
@@ -92,7 +93,7 @@ public class TheRapyRecuperationLineStatisticsController {
lxs.contact,
lxs.contactMobileNumber,
enroll.takePartInUnionId AS usUnionId,
if(lineu.signUpMode = 2, '校工会', un.unionname) as unionname,
un.unionname as unionname,
lot.lotName,
lot.lotValue,
enroll.familyNumber,
@@ -101,17 +102,19 @@ public class TheRapyRecuperationLineStatisticsController {
FROM
`the_rapy_recuperation_enroll` enroll
LEFT JOIN the_rapy_recuperation_line_union_select lineu ON lineu.id=enroll.takePartInLineId
left join `user` u on u.id=lineu.selectUserId
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 the_rapy_recuperation_travel_agency lxs ON line.travelAgencyId = lxs.id
LEFT JOIN sys_union un ON un.id = lineu.unionId
left join audit_state st on st.stateId=lineu.auditState
$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")){
/*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());
@@ -119,6 +122,9 @@ public class TheRapyRecuperationLineStatisticsController {
if (Strings.isNotBlank(unionId)) {
cnd.and("lineu.unionId", "=", unionId);
}
}*/
if (!ShiroUtil.hasAnyRoles("sysadmin, SchoolUnionAdmin")) {
cnd.and("lineu.selectUserId", "=", ShiroUtil.getUserId());
}
cnd.andEX("line.lotId", "=", lotId);
@@ -131,7 +137,6 @@ public class TheRapyRecuperationLineStatisticsController {
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
/**
* 根据线路查询报名详情
* @param searchKeyword
@@ -187,28 +192,54 @@ public class TheRapyRecuperationLineStatisticsController {
@At
@ViReturn
@RequiresAuthentication
public Object sendSuccess(String id) {
public Object sendSuccess(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("报名还未结束,不能发送");
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)));
unionSelect.setGroupSuccess(true);
unionSelect.setGroupTime(DateUtil.now());
switch (unionSelect.getSignUpMode()) {
case 1 -> unionSelect.setAuditState(7707);
case 2 -> unionSelect.setAuditState(7712);
case 3 -> unionSelect.setAuditState(7700);
}
dao.update(unionSelect);
//发短信
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<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")
);
msgApi.sendTextMsg(content, item.getLoginName());
});
}
return null;
}
@At
@ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
public Object deleteJoinUser(String id) {
if (StrUtil.isBlank(id)) {
return Result.error("需要的删除的信息为空");
}
TheRapyRecuperationEnroll enroll = dao.fetch(TheRapyRecuperationEnroll.class, id);
dao.clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", id));
dao.clear(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id));
dao.clear(TheRapyRecuperationEnrollBed.class, Cnd.where("id", "=", enroll.getBedInfo().getId()));
return null;
}
@@ -217,16 +248,22 @@ public class TheRapyRecuperationLineStatisticsController {
@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("报名还未结束,不能发送");
return Result.error("报名还未结束");
}
unionSelect.setGroupSuccess(false);
unionSelect.setGroupTime(null);
dao.update(unionSelect);
//找出报名人员
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)));
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 -> {
@@ -235,13 +272,12 @@ public class TheRapyRecuperationLineStatisticsController {
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());
msgApi.sendTextMsg(content, item.getLoginName());
});
if(!type) {
List<String> enrollIds = enrolls.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
List<TheRapyRecuperationEnrollBed> bedIds = enrolls.stream().map(TheRapyRecuperationEnroll::getBedInfo).collect(Collectors.toList());
List<String> bedIds = enrolls.stream().map(TheRapyRecuperationEnroll::getBedInfoId).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));
@@ -0,0 +1,182 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.summary;
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.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import io.v.nutz.base.utils.ViTool;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@IocBean
@Ok("json:full")
@At("/platform/therapyRecuperation/evaluate/statistics")
public class TherapyRecuperationEvaluateStatisticsController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/summary/evaluateStatistics.html")
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public Object pageData(PageForm pageForm,
String lineId,
String unionId,
String unitId,
String personType,
String userState,
String evaluateScore) {
Sql sql = Sqls.create("""
SELECT
we.evaluateText,
we.evaluateScore,
we.userName,
we.loginName,
u.unionname,
u.unitname,
u.userState,
u.personType,
line.lineName,
us.playStartTime
FROM
`the_rapy_recuperation_evaluate` we
LEFT JOIN `user` u ON u.id = we.userId
LEFT JOIN the_rapy_recuperation_enroll en ON en.takePartInLineId = we.lineId
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = en.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(pageForm.getSearchName()) && StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equals("ascending") ? "asc" : "desc");
} else {
cnd.desc("we.evaluateScore");
}
if(StrUtil.isNotBlank(lineId)) {
cnd.andEX("we.lineId", "in", lineId.split(","));
}
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState);
cnd.andEX("we.evaluateScore", "=", evaluateScore);
cnd.groupBy("we.lineId");
sql.setCondition(cnd);
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public Object lineList(Integer year) {
Sql sql = Sqls.create("""
SELECT
GROUP_CONCAT(us.id) as id,
line.lineName,
if(us.signUpMode = 2, '校工会', un.unionname) as unionName
FROM
the_rapy_recuperation_line_union_select us
LEFT JOIN the_rapy_recuperation_line line ON us.lineId = line.id
LEFT JOIN sys_union un ON un.id = us.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("year(us.selectTime)", "=", year);
cnd.groupBy("lineId, unionid");
sql.setCondition(cnd);
return enrollService.listMap(sql);
}
@At
@Ok("void")
@RequiresPermissions("theRapyRecuperation.evaluate.statistics")
public void exportEvaluate(String lineId,
String unionId,
String unitId,
String evaluateScore,
String searchKeyword,
String searchName,
HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
we.evaluateText,
we.evaluateScore,
we.userName,
we.loginName,
u.unionname,
u.unitname,
u.userState,
u.personType,
line.lineName,
us.playStartTime
FROM
`the_rapy_recuperation_evaluate` we
LEFT JOIN `user` u ON u.id = we.userId
LEFT JOIN the_rapy_recuperation_enroll en ON en.takePartInLineId = we.lineId
LEFT JOIN the_rapy_recuperation_line_union_select us ON us.id = en.takePartInLineId
LEFT JOIN the_rapy_recuperation_line line ON line.id = us.lineId
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) {
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if(StrUtil.isNotBlank(lineId)) {
cnd.andEX("we.lineId", "in", lineId.split(","));
}
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("we.evaluateScore", "=", evaluateScore);
cnd.groupBy("we.lineId");
sql.setCondition(cnd);
List<NutMap> listMap = enrollService.listMap(sql);
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("线路","lineName",20));
entities.add(new ExcelExportEntity("出行时间","playStartTime",20));
entities.add(new ExcelExportEntity("工号","loginName",20));
entities.add(new ExcelExportEntity("姓名","userName",20));
entities.add(new ExcelExportEntity("所属单位","unitname",20));
entities.add(new ExcelExportEntity("所属工会","unionname",20));
entities.add(new ExcelExportEntity("在职状态","userState",20));
entities.add(new ExcelExportEntity("人员类型","personType",20));
entities.add(new ExcelExportEntity("评分","evaluateScore",20));
entities.add(new ExcelExportEntity("评价","evaluateText",40));
try {
ViTool.excelResponse(response, "评价人员名单.xls");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entities, listMap);
workbook.write(response.getOutputStream());
} catch (Exception ignored) {}
}
}
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.theRapyConfig;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
@@ -1,7 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
@@ -67,21 +68,13 @@ public class TheRapyRecuperationConfig {
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("省内线路是否审核")
@Default(value = "0")
private Boolean isSnLine;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("省外线路是否审核")
@Default(value = "0")
private Boolean isSwLine;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("旅行社是否审核")
@Default(value = "0")
private Boolean travelAudit;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("标段")
@@ -109,12 +102,15 @@ public class TheRapyRecuperationConfig {
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("床位信息")
@Default(value = "0")
private Boolean bedInfo;
@Column
@ColDefine(type = ColType.INT)
@Comment("家属信息")
@Default(value = "0")
private Integer familyInfo;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("承诺书")
private List<Sys_file> files;
}
@@ -157,6 +157,10 @@ public class TheRapyRecuperationEnroll extends BaseModel {
private String lineId;
private Date playStartTime;
private Date playEndTime;
/**
* 床位信息
*/
@@ -199,9 +203,8 @@ public class TheRapyRecuperationEnroll extends BaseModel {
private Integer familyNumber;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否报销")
private Boolean isReimbursement;
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("签字")
private String sign;
private String firstLetter;
}
@@ -0,0 +1,58 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@Table
public class TheRapyRecuperationEvaluate extends BaseModel implements Serializable {
@Name
@Column
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("参加线路id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String lineId;
@Column
@Comment("用户ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userName;
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String loginName;
@Column
@Comment("评分")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String evaluateScore;
@Column
@Comment("评价内容")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String evaluateText;
@Column
@Comment("评价时间")
@ColDefine(type = ColType.DATETIME)
private Date applyDate;
}
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.wizzer.framework.base.model.BaseModel;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@@ -8,6 +9,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine
@@ -120,11 +122,11 @@ public class TheRapyRecuperationLine extends BaseModel {
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("缩略图")
private String files;
private List<Sys_file> files;
@Column
@ColDefine(type = ColType.INT)
@Comment("报名模式(1.分工会 2.自由)")
@Comment("报名模式(1.分工会 2.自由 3.个人)")
private Integer signUpMode;
@Column
@@ -147,7 +149,18 @@ public class TheRapyRecuperationLine extends BaseModel {
@Comment("联系电话")
private String lineContactPhone;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("旅行社地点")
private String travelAgencyPlace;
@One(field = "travelAgencyId")
private TheRapyRecuperationTravelAgency travelAgency;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("开放选择")
@Default("0")
private boolean openChoose;
}
@@ -6,8 +6,10 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.lang.util.NutMap;
import java.util.Date;
import java.util.List;
/**
@@ -117,7 +119,7 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
@Column
@ColDefine(type = ColType.INT)
@Comment("报名模式、组织形式(1.分工会 2.校工会)")
@Comment("报名模式、组织形式(1.分工会 2.校工会 3.个人)")
private Integer signUpMode;
@Column
@@ -126,7 +128,43 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
private Boolean enable;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("旅行社id")
private String travelAgencyId;
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("报名范围(1.自己选择 2.分工会 3.全校)")
private List<Integer> signScope;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("人员名单")
private List<NutMap> chooseUserList;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否成团")
private Boolean groupSuccess;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("成团时间")
private String groupTime;
@Column
@ColDefine(type = ColType.INT)
@Comment("审核状态")
private Integer auditState;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@Comment("分工会审核id")
private String unionAuditId;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@Comment("单位领导审核id")
private String unitLeaderAuditId;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@Comment("校工会审核id")
private String schoolAuditId;
}
@@ -1,12 +1,15 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.wizzer.framework.base.model.BaseModel;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency
* @Description: 疗休养旅行社管理
@@ -74,10 +77,10 @@ public class TheRapyRecuperationTravelAgency extends BaseModel {
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("缩略图")
private String files;
private List<Sys_file> files;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否自由组团")
private Boolean signUpTravelAgency;
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("旅行社地点")
private List<String> travelAgencyPlaces;
}
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.ViService;
import org.nutz.lang.util.NutMap;
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType;
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import io.v.nutz.base.service.ViService;
import org.nutz.lang.util.NutMap;
@@ -1,10 +1,8 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import org.nutz.dao.Cnd;
@@ -33,8 +31,6 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
List<NutMap> getSelectLineById(String lineId, String unionId, int trrt, Integer lineUnionType);
Object openSignUser(String usId, String travelId, String searchKeyWord);
/**
* 线路报名
*
@@ -73,19 +69,8 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
*/
void updateSignUpTravelAgency(TheRapyRecuperationEnroll enrollInfo);
/**
* 验证报名登记信息
*
* @param enrollInfo 登记信息
* @param loginName 用户名
* @return {@link Map}<{@link Boolean}, {@link String}>
*/
Map<Boolean, String> validSignUpInfo(String loginName, TheRapyRecuperationEnroll enrollInfo);
Map<Boolean, String> validSignUpInfoForZJXU(String loginName, TheRapyRecuperationEnroll enrollInfo);
Map<Boolean, String> validSignUpInfoForZJNU(String loginName, TheRapyRecuperationEnroll enrollInfo);
/**
* 我报名的页面数据
*
@@ -120,7 +105,7 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
* @param usUnionId usUnionId
* @return {@link NutMap}
*/
NutMap selectLineAllInfo(String usId, String usUnionId, String year);
NutMap selectLineAllInfo(String usId, String usUnionId);
List<Sys_union> getTheRapyUnions(Integer year, int theRapyRecuperationType);
List<Sys_union> getTheRapyUnions(Integer year);
}
@@ -1,11 +1,9 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import java.util.List;
public interface TheRapyRecuperationLineAdjustmentService extends ViService {
@@ -1,7 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster;
@@ -1,7 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
@@ -1,7 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
@@ -25,7 +24,7 @@ public interface TheRapyRecuperationLineUnionSelectService extends ViService<The
* @param cnd cnd
* @return {@link Pagination}
*/
Pagination pageData(PageForm pageForm, Cnd cnd, Integer year);
Pagination pageData(PageForm pageForm, Cnd cnd, Integer year , Integer mode);
/**
@@ -41,7 +40,7 @@ public interface TheRapyRecuperationLineUnionSelectService extends ViService<The
*
* @return {@link List}<{@link String}>
*/
List<String> getHasSelectLineIds();
List<String> getHasSelectLineIds(Integer mode);
/**
@@ -1,7 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.service;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
@@ -2,9 +2,9 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.model.Audit;
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.base.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollBed;
@@ -22,7 +22,6 @@ import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.Map;
@IocBean(args = {"refer:dao"})
public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> implements TheRapyRecuperationAuditService {
@@ -37,7 +36,7 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
public List<NutMap> getXlByUnion(Integer state, String unionId, String regionalNature, String year,String endYear, Integer signUpMode) {
Sql sql = Sqls.create("""
SELECT
SELECT
line.*,
lineu.id as selectId,
un.unionname,
@@ -83,7 +82,6 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
Sql sql = Sqls.create("""
SELECT
lxs.travelAgencyName,
ta.travelAgencyName as joinTravelAgencyName,
enroll.*,
line.lineName,
if(enroll.takePartInUnionId!=enroll.selfUnionId,true,false) isTransferIn,
@@ -92,8 +90,7 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
`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_travel_agency lxs ON lxs.id = lineu.travelAgencyId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = enroll.takePartInTravelAgencyId
LEFT JOIN the_rapy_recuperation_travel_agency lxs ON lxs.id = line.travelAgencyId
where enroll.id=@id
""").setParam("id", id);
@@ -117,7 +114,9 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
}
List<TheRapyRecuperationEnrollCompanion> companionList = dao().query(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id));
companionList.forEach(v -> {
v.setBedInfo(dao().fetch(TheRapyRecuperationEnrollBed.class, v.getBedInfoId()));
if(StrUtil.isNotBlank(v.getBedInfoId())) {
v.setBedInfo(dao().fetch(TheRapyRecuperationEnrollBed.class, v.getBedInfoId()));
}
});
map.addv("viewData", fetch.setv("companionList", companionList));
@@ -135,11 +134,10 @@ public class TheRapyRecuperationAuditServiceImpl extends ViServiceImpl<Audit> im
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());
msgApi.sendTextMsg(content,user.getLoginname());
}
}
@@ -1,8 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationType;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationConfig;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
@@ -1,8 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollJoinUserImportService;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
@@ -2,10 +2,9 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.util.StrUtil;
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.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.service.TheRapyRecuperationLineAdjustmentService;
@@ -55,7 +54,8 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
us.id as usId,
us.playStartTime,
us.playEndTime,
line.files AS fileId,
line.files,
cast( line.files ->> '$[0].id' AS CHAR ) AS fileId,
create_gh.unionname AS createUnionName,
ta.travelAgencyName,
us.unionId,
@@ -81,7 +81,7 @@ public class TheRapyRecuperationLineAdjustmentServiceImpl extends ViServiceImpl
cnd.and("us.playStartTime", "is not", null);
//cnd.andEX("line.year", "=", year);
cnd.andEX("line.id", "=", lineId);
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
cnd.andEX("us.unionId", "=", unionId);
cnd.andEX("us.signUpMode", "=", Strings.isNotBlank(unionId) ? 1 : 2);
} else {
@@ -2,9 +2,8 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationCluster;
@@ -122,7 +121,7 @@ public class TheRapyRecuperationLineClusterServiceImpl extends ViServiceImpl<The
// Cnd lineCnd = Cnd.NEW();
// //如果是超管 前端传工会id 就不查自由模式的线路 只查线路归属分工会的线路
// //如果是分工会管理员 不查不查自由模式的线路 由校工会去组团
// if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
// if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
// if (StrUtil.isNotBlank(unionId)) {
// sql.setVar("lineCnd", Cnd.where("1", "!=", "1"));
// } else {
@@ -181,11 +180,10 @@ public class TheRapyRecuperationLineClusterServiceImpl extends ViServiceImpl<The
""");
Cnd cnd = Cnd.NEW();
Cnd summaryCnd = Cnd.NEW();
summaryCnd.and("isNormal", "=", true);
summaryCnd.and("takePartInLineId", "=", "us.id");
summaryCnd.and("stateId", "=", TheRapyRecuperationState.PASS);
//如果是超级管理和校工会管理员,查看校工会线路
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
cnd.andEX("us.unionId", "=", unionId);
cnd.andEX("us.signUpMode", "=", Strings.isNotBlank(unionId) ? 1 : 2);
}else{
@@ -2,11 +2,12 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.util.StrUtil;
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.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.TheRapyRecuperationSignUpMode;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnrollCompanion;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLine;
@@ -23,6 +24,7 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.plugins.wkcache.annotation.CacheRemove;
import java.util.Date;
import java.util.List;
/**
@@ -60,33 +62,10 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
@Override
@Aop(TransAop.READ_COMMITTED)
public void addLine(TheRapyRecuperationLine line) {
boolean hasSchoolAdminRole = ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"));
if (hasSchoolAdminRole) {
line.setCreateUnionId(null);
line.setCreateMode(TheRapyRecuperationLineCreateMode.SCHOOL.getValue());
insert(line);
} else if (ShiroUtil.hasRole("H04")) {
if(line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) {
line.setCreateUnionId(Vi.getUnionId());
line.setCreateMode(TheRapyRecuperationLineCreateMode.UNION.getValue());
insert(line);
/*if (line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) {
TheRapyRecuperationLineUnionSelect unionSelect = new TheRapyRecuperationLineUnionSelect();
unionSelect.setUnionId(line.getCreateUnionId());
unionSelect.setLineId(line.getId());
unionSelect.setSelectTime(new Date());
unionSelect.setSelectUserId((String) io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id"));
unionSelect.setSignUpStartTime(line.getSignUpStartTime());
unionSelect.setSignUpEndTime(line.getSignUpEndTime());
unionSelect.setChangeEndTime(line.getChangeEndTime());
unionSelect.setPlayStartTime(line.getPlayStartTime());
unionSelect.setPlayEndTime(line.getPlayEndTime());
insert(unionSelect);
}*/
}
insert(line);
}
/**
@@ -98,34 +77,7 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
@Aop(TransAop.READ_COMMITTED)
public void editLine(TheRapyRecuperationLine line) {
update(line);
/*if (line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) {
TheRapyRecuperationLineUnionSelect unionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "=", line.getId()));
if (unionSelect != null) {
unionSelect.setSignUpStartTime(line.getSignUpStartTime());
unionSelect.setSignUpEndTime(line.getSignUpEndTime());
unionSelect.setChangeEndTime(line.getChangeEndTime());
unionSelect.setPlayStartTime(line.getPlayStartTime());
unionSelect.setPlayEndTime(line.getPlayEndTime());
updateIgnoreNull(unionSelect);
} else {
TheRapyRecuperationLineUnionSelect insertUnionSelect = new TheRapyRecuperationLineUnionSelect();
insertUnionSelect.setUnionId(line.getCreateUnionId());
insertUnionSelect.setLineId(line.getId());
insertUnionSelect.setSelectTime(new Date());
insertUnionSelect.setSelectUserId((String) io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id"));
insertUnionSelect.setSignUpStartTime(line.getSignUpStartTime());
insertUnionSelect.setSignUpEndTime(line.getSignUpEndTime());
insertUnionSelect.setChangeEndTime(line.getChangeEndTime());
insertUnionSelect.setPlayStartTime(line.getPlayStartTime());
insertUnionSelect.setPlayEndTime(line.getPlayEndTime());
insert(insertUnionSelect);
}
}
deleteLineInfoCache(line.getId());*/
deleteLineInfoCache(line.getId());
}
/**
@@ -161,8 +113,10 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
line.createUnionId,
line.signUpMode,
line.createMode,
line.files AS fileId,
ifnull(gh.unionname, '校工会') AS createUnionName,
line.files,
line.travelAgencyPlace,
cast( line.files ->> '$[0].id' AS CHAR ) AS fileId,
gh.unionname AS createUnionName,
u.username AS createUserName,
ta.travelAgencyName,
ta.contact,
@@ -209,19 +163,20 @@ public class TheRapyRecuperationLineServiceImpl extends ViServiceImpl<TheRapyRec
enroll.userName,
enroll.unionName,
enroll.unitName,
enroll.familyNumber,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll_companion WHERE trreId = enroll.id) 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
WHERE
enroll.takePartInLineId = @takePartInLineId
lineu.id = @takePartInLineId
and enroll.stateId=@stateId
$unionCnd
""").setParam("takePartInLineId", lineId).setParam("stateId", TheRapyRecuperationState.PASS);
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.selfUnionId='%s'".formatted(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);
List<NutMap> list = pagination.getList();
@@ -3,10 +3,12 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLineUnionSelect;
@@ -21,9 +23,11 @@ import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.service.impl.TheRapyRecuperationLineUnionSelectServiceImpl
@@ -48,7 +52,7 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
* @return {@link Pagination}
*/
@Override
public Pagination pageData(PageForm pageForm, Cnd cnd, Integer year) {
public Pagination pageData(PageForm pageForm, Cnd cnd, Integer year, Integer mode) {
Sql sql = Sqls.create("""
select
line.id,
@@ -60,14 +64,14 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
line.isDisabled,
line.playNumberOfDays,
line.createUnionId,
GROUP_CONCAT(us.playStartTime,'至',us.playEndTime,ifnull(concat('', ta.travelAgencyName, ''), '') order by us.playStartTime) as playTimes,
GROUP_CONCAT(us.playStartTime,'至',us.playEndTime) as playTimes,
us.signUpStartTime,
us.signUpEndTime,
us.playStartTime,
us.playEndTime,
us.changeEndTime,
us.isOpen,
us.signUpMode,
line.signUpMode,
line.createMode,
gh.unionname AS createUnionName,
u.username AS createUserName,
@@ -79,35 +83,27 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
us.unionId as usUnionId,
us.id as usId,
usUnion.unionname as belongUnionName,
(SELECT COUNT(*) FROM the_rapy_recuperation_enroll WHERE takePartInLineId=us.id and isNormal=true) applyCount
su.username as selectUserName,
(SELECT COUNT(*) FROM the_rapy_recuperation_enroll WHERE takePartInLineId=line.id AND takePartInUnionId=@unionId) applyCount
from
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_user u ON u.id = line.opBy
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 the_rapy_recuperation_line_union_select us on us.lineId = line.id and year(selectTime) = @year $us
LEFT JOIN sys_union usUnion on usUnion.id = us.unionId
LEFT JOIN sys_user su on us.selectUserId = su.id
LEFT JOIN the_rapy_recuperation_lot lot on lot.id = line.lotId
$condition
""");
if(!ShiroUtil.hasAnyRoles("sysadmin, A06")) {
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.setVar("us", "AND us.selectUserId = '%s'".formatted(ShiroUtil.getPlatformUid()));
sql.setParam("year", year == null ? DateUtil.thisYear() : year);
/*SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("line.createUnionId", "=", Vi.getUnionId());
seg.or("line.createMode", "=", TheRapyRecuperationLineCreateMode.SCHOOL.getValue());
cnd.and(seg);*/
cnd.groupBy("line.id");
sql.setCondition(cnd);
Pagination pagination = list(pageForm, sql);
List<NutMap> list = pagination.getList();
List<String> hasSelectLineIds = getHasSelectLineIds();
List<String> hasSelectLineIds = getHasSelectLineIds(mode);
for (NutMap m : list) {
m.setv("isSelect", hasSelectLineIds.contains(m.getString("id")));
@@ -140,12 +136,26 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
* @return {@link List}<{@link String}>
*/
@Override
public List<String> getHasSelectLineIds() {
public List<String> getHasSelectLineIds(Integer mode) {
Sql sql = Sqls.create("""
select lineId from the_rapy_recuperation_line_union_select
where selectUserId = @userId
select lineId from the_rapy_recuperation_line_union_select $condition
""");
sql.setParam("userId", ShiroUtil.getPrincipalProperty("id"));
Cnd cnd = Cnd.NEW();
cnd.and("signUpMode", "=", mode);
if(mode == 1) {
cnd.and("unionId", "=", Vi.getUnionId());
} else if(mode == 2) {
//既然你想校工会组织的线路,校工会的人都可以看,那就又根据角色查又根据部门查,可以吧
//想得多
List<Sys_user_role> userRoles = dao().query(Sys_user_role.class, Cnd.where("roleId", "=", "9b01918f873645048f8a85a4fc06d135"));
List<String> list = userRoles.stream().map(Sys_user_role::getUserId).distinct().toList();
List<User> userList = dao().query(User.class, Cnd.where("unitId", "=", "100414"));
List<String> idListByUnit = userList.stream().map(User::getId).toList();
cnd.and("selectUserId", "in", Stream.concat(list.stream(), idListByUnit.stream()).toList());
} else {
cnd.and("selectUserId", "=", ShiroUtil.getUserId());
}
sql.setCondition(cnd);
List<NutMap> lineIdsMap = (List<NutMap>) Daos.query(dao(), sql.toString(), Sqls.callback.maps());
return lineIdsMap.stream().map(v -> v.getString("lineId")).collect(Collectors.toList());
}
@@ -159,34 +169,16 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
@Override
public Object selectLineInfo(String lineId, String unionId, Integer mode, Integer year) {
Sql sql;
sql = Sqls.create("""
select
us.id,
lineId,
signUpStartTime,
signUpEndTime,
changeEndTime,
playStartTime,
playEndTime,
us.contact,
us.contactPhone,
minimumGroupSize,
trafficTools,
estimatedCost,
estimatedFamilyNumbers,
us.travelAgencyId,
signUpMode,
enable,
ta.travelAgencyName
*
from
the_rapy_recuperation_line_union_select us
left join the_rapy_recuperation_travel_agency ta on ta.id = us.travelAgencyId
the_rapy_recuperation_line_union_select
where unionId = @unionId
and lineId = @lineId
and signUpMode = @mode
and year(selectTime) = @year
ORDER BY signUpStartTime,playStartTime ASC
and lineId = @lineId
and signUpMode = @mode
and year(selectTime) = @year
ORDER BY signUpStartTime ASC
""");
sql.setParam("unionId", unionId);
sql.setParam("lineId", lineId);
@@ -194,7 +186,6 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
sql.setParam("year", year == null ? DateUtil.thisYear() : year);
return listMap(sql);
// TheRapyRecuperationLine line = dao().fetch(TheRapyRecuperationLine.class, lineId);
// if (line.getSignUpMode() == TheRapyRecuperationSignUpMode.UNION.getValue()) {
// sql = Sqls.create("""
@@ -3,9 +3,6 @@ package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.query.PageForm;
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.service.TheRapyRecuperationTravelAgencyService;
import org.nutz.dao.Chain;
@@ -84,7 +81,7 @@ public class TheRapyRecuperationTravelAgencyServiceImpl extends ViServiceImpl<Th
Sql sql = Sqls.create("""
select
*,
files as fileId
cast(files ->> '$[0].id' as char) as fileId
from
the_rapy_recuperation_travel_agency $condition
""");
@@ -119,8 +116,7 @@ public class TheRapyRecuperationTravelAgencyServiceImpl extends ViServiceImpl<Th
LEFT JOIN the_rapy_recuperation_travel_agency agency ON agency.id = enroll.takePartInTravelAgencyId
WHERE
enroll.takePartInTravelAgencyId = @takePartInTravelAgencyId
and enroll.selfUnionId = @unionId
""").setParam("takePartInTravelAgencyId", id).setParam("unionId", Vi.getUnionId());
""").setParam("takePartInTravelAgencyId", id);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
}
@@ -10,7 +10,7 @@
</h3>
</div>
<el-descriptions :column="2" border class="viewTable">
<el-descriptions-item label="号">{{ viewData.loginName }}</el-descriptions-item>
<el-descriptions-item label="一卡通号">{{ viewData.loginName }}</el-descriptions-item>
<el-descriptions-item label="姓名">{{ viewData.userName }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
<el-descriptions-item label="身份证号">{{ viewData.idCard }}</el-descriptions-item>
@@ -42,19 +42,21 @@
{{ viewData.isFamily ? '携带' : '未携带' }}
</span>
</el-descriptions-item>
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
<el-descriptions-item label="床">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<template v-if="modifyConfig.bedInfo">
<el-descriptions-item label="床">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
<el-descriptions-item label="床位">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>
</template>
</el-descriptions>
</div>
<div class="panel panel-default mt20" style="border: none">
<div v-if="modifyConfig.familyInfo == 2" class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
同伴信息
@@ -86,7 +88,7 @@
</div>
</div>
</el-tab-pane>
<el-tab-pane label="所属分工会审核信息" name="2" v-if="viewData.selfUnionAuditId">
<el-tab-pane label="所属分工会审核信息" name="2" v-if="viewData.selfUnionAuditId && viewData.selfUnionAudit">
<div class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
@@ -104,7 +106,7 @@
</el-descriptions>
</div>
</el-tab-pane>
<el-tab-pane label="意向线路分工会审核信息" name="3" v-if="viewData.joinLineUnionAuditId">
<el-tab-pane label="意向线路分工会审核信息" name="3" v-if="viewData.joinLineUnionAuditId && viewData.joinLineUnionAudit">
<div class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
@@ -147,6 +149,7 @@ module.exports = {
bedInfo: {},
},
loading: false,
modifyConfig:{}
}
},
methods: {
@@ -169,9 +172,16 @@ module.exports = {
openAudit(id, activeName) {
this.findOne(id)
this.activeName = activeName
}
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
},
created() {
async created() {
await this.getModifyConfig();
}
}
</script>
@@ -10,7 +10,7 @@
</h3>
</div>
<el-descriptions :column="2" border class="viewTable">
<el-descriptions-item label="号">{{ viewData.loginName }}</el-descriptions-item>
<el-descriptions-item label="一卡通号">{{ viewData.loginName }}</el-descriptions-item>
<el-descriptions-item label="姓名">{{ viewData.userName }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
<el-descriptions-item label="身份证号">{{ viewData.idCard }}</el-descriptions-item>
@@ -42,19 +42,22 @@
{{ viewData.isFamily ? '携带' : '未携带' }}
</span>
</el-descriptions-item>
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
<el-descriptions-item label="床位">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>
<template v-if="modifyConfig.bedInfo">
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
<el-descriptions-item label="床位">{{
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
}}
</el-descriptions-item>
<el-descriptions-item label="意向拼床人">
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
</el-descriptions-item>
</template>
</el-descriptions>
</div>
<div class="panel panel-default mt20" style="border: none">
<div v-if="modifyConfig.familyInfo == 2" class="panel panel-default mt20" style="border: none">
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
<h3 class="panel-title">
同伴信息
@@ -129,6 +132,7 @@ module.exports = {
bedInfo: {},
},
loading: false,
modifyConfig:{}
}
},
methods: {
@@ -149,9 +153,16 @@ module.exports = {
openAudit(id, activeName) {
this.findOne(id)
this.activeName = activeName
}
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
},
created() {
async created() {
await this.getModifyConfig();
}
}
</script>
@@ -279,9 +279,9 @@ layout("/mobile/platform.html"){
</div>
<div class="van-card-body">
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
<van-field label="号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号" v-model="formData.idCard"></van-field>
<van-field label="一卡通号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号、护照、台胞证等" v-model="formData.idCard"></van-field>
<van-field label="手机号" name="mobile" :rules="[{ required: true }]"
placeholder="请填写手机号" v-model="formData.mobile"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
@@ -335,7 +335,7 @@ layout("/mobile/platform.html"){
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<!--<van-field label="一卡通号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
@@ -346,7 +346,7 @@ layout("/mobile/platform.html"){
</van-radio-group>
</template>
</van-field>
<van-field label="身份证" name="idCard" placeholder="请填写身份证号"
<van-field label="身份证" name="idCard" placeholder="请填写身份证号、护照、台胞证等"
:rules="[{ required: true }]" type="digit"
v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
@@ -445,7 +445,7 @@ layout("/mobile/platform.html"){
active: 0,
roomColumns: ['大床房', '标准间'],
bedColumns: ['1', '2'],
companionColumns: ['亲属', '朋友'],
companionColumns: ['配偶', '子女'],
bedVisible: false,
roomVisible: false,
companionVisible: false,
@@ -36,16 +36,16 @@ layout("/mobile/platform.html"){
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="职工疗休养"></van-nav-bar>
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder title="职工疗休养"></van-nav-bar>
</van-sticky>
<!--顶部轮播图-->
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item>
<van-image width="100%" height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpg"></van-image>
<van-image width="100%" height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpeg"></van-image>
</van-swipe-item>
<van-swipe-item>
<van-image height="180" src="/assets/mobile/img/therapyRecuperation/index2.jpg"></van-image>
<van-image height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpeg"></van-image>
</van-swipe-item>
</van-swipe>
@@ -60,20 +60,11 @@ layout("/mobile/platform.html"){
</div>
<!--疗休养描述-->
<div class="van-doc-card" style="margin-top: 20px;margin-bottom: 60px">
<div class="van-doc-card" style="margin-top: 20px">
<van-image width="190" height="43" src="/assets/mobile/img/therapyRecuperation/title.png"></van-image>
<div class="pre_text" v-html="configData.notice"></div>
</div>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养报名
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的疗休养
</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
const vue = new Vue({
@@ -83,7 +74,6 @@ layout("/mobile/platform.html"){
return {
chooseButton: [],
configData: {},
tarBarActive: 0,
}
},
methods: {
@@ -98,7 +88,7 @@ layout("/mobile/platform.html"){
return
}
localStorage.setItem("clickIndex", JSON.stringify({clickIndex: index}))
location.href = '/platform/mobile/theRapyRecuperation/mobileLineListPage'
pjaxReplace('/platform/mobile/theRapyRecuperation/mobileLineListPage')
},
async getConfigData() {
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
@@ -3,6 +3,10 @@ layout("/mobile/platform.html"){
#-->
<style>
#app {
font-family: ,serif;
}
.container img {
background-size: contain;
width: 100%;
@@ -11,13 +15,22 @@ layout("/mobile/platform.html"){
display: block;
}
.backTop {
display: none !important;
}
.header {
padding: 20px;
}
.content {
line-height: 26px;
padding: 0px 20px 56px 20px;
padding: 0px 10px 56px 10px;
}
.pdf_div {
padding-bottom: 70px;
height: 800px;
}
.title {
@@ -179,10 +192,11 @@ layout("/mobile/platform.html"){
.submitButton {
background-color: white !important;
width: 100%;
height: 60px;
/*height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
align-items: center;*/
text-align: center;
}
.submitButton .van-button {
@@ -195,84 +209,133 @@ layout("/mobile/platform.html"){
background-color: white;
}
.van-tag {
color: white !important;
}
.viewerContainer {
overflow: unset !important;
}
.sign_div {
background-color: white;
margin-bottom: 16px;
padding: 18px;
border-radius: 6px;
box-shadow: 0 8px 12px #ebedf0;
}
.van-action-sheet {
max-height: 90%;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.go(-1)" fixed left-arrow placeholder title="职工疗休养-线路介绍"></van-nav-bar>
<van-nav-bar @click-left="history.go(-1)" fixed left-arrow placeholder
title="职工疗休养-线路介绍"></van-nav-bar>
</van-sticky>
<!--线路详情-->
<van-skeleton title :loading="skeLoading" :row="12">
<div class="container">
<div class="header">
<div class="title">
<van-tag size="large" color="#1867b0" style="color: white;position: relative; top: -2px">
{{lineData.lotName}}
</van-tag>
{{lineData.lineName}}
</div>
<div style="margin-top: 10px">
<div>
<span class="line_label">成团人数:</span>
{{lineData.minimumGroupSize ? lineData.minimumGroupSize : 0}}人(最少)
<template v-if="isLoad">
<!--线路详情-->
<van-skeleton title :loading="skeLoading" :row="12">
<div class="container">
<div class="header">
<div class="title">
<van-tag size="large" color="#1867b0" style="position: relative; top: -2px">
{{lineData.lotName}}
</van-tag>
{{lineData.lineName}}
</div>
<div>
<span>当前报名:</span>
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '(家属' + lineData.signUpUserFamilyNum +
'人)'}}
</div>
<div>
<span>报名时间:</span>
{{moment(lineData.signUpStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.signUpEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>出行时间:</span>
{{moment(lineData.playStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.playEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>&ensp;&ensp;社:</span>
{{lineData.travelAgencyName}}
</div>
<div>
<span>联系方式:</span>
{{lineData.contactMobileNumber}}
<div style="margin-top: 10px">
<div v-if="lineData.regionalNature == '省内'">
<div>
<span class="line_label">成团人数包括家属:</span>
<label v-if="lineData.estimatedFamilyNumbers">{{lineData.estimatedFamilyNumbers}}人</label>
<label v-else>不限制</label>
</div>
<div v-if="configData.familyInfo == 2">
<span>当前报名:</span>
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '(家属' + lineData.signUpUserFamilyNum + '人)'}}
</div>
<div v-else>
<span>当前报名:</span>
{{lineData.signUpUserNum + lineData.familyNumber + '(家属' + lineData.familyNumber + '人)'}}
</div>
</div>
<div v-else>
<div>
<span class="line_label">最多成团人数:</span>
<label>{{configData.outsideQuota}}人</label>
</div>
<div v-if="configData.familyInfo == 2">
<span>当前报名:</span>
{{lineData.signUpUserNum + '(家属' + lineData.signUpUserFamilyNum + '人)'}}
</div>
<div v-else>
<span>当前报名:</span>
{{lineData.signUpUserNum + '(家属' + lineData.familyNumber + '人)'}}
</div>
</div>
<div>
<span>报名时间:</span>
{{moment(lineData.signUpStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.signUpEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>出行时间:</span>
{{moment(lineData.playStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(lineData.playEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>&ensp;&ensp;社:</span>
{{lineData.travelAgencyName}}
</div>
<div>
<span>联系方式:</span>
{{lineData.contactMobileNumber}}
</div>
</div>
</div>
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看,再单击返回</van-divider>
<!--<div v-if="lineData.content" v-html="lineData.content" class="content"></div>
<div v-else v-html="configData.notice" class="content"></div>-->
<div v-if="isPdf" v-html="lineData.content" class="content"></div>
<div v-else id="demo" class="pdf_div"></div>
<!--<van-empty
v-else class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无详细信息"
></van-empty>-->
</div>
<van-divider></van-divider>
<div v-if="lineData.content" v-html="lineData.content" class="content"></div>
<div v-else v-html="configData.notice" class="content"></div>
<!--<van-empty
v-else class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无详细信息"
></van-empty>-->
</van-skeleton>
<!--置顶图标-->
<image v-if="btnFlag" @click="backTop" src="/assets/mobile/svg/therapyRecuperation/top.svg"
class="top_icon"></image>
<!--底部报名按钮-->
<div class="footer" v-if="fromUrlByMy != 'edit'">
<template v-if="lineData.isNormal==0&&lineData.isNormalFalse>0">
<van-button @click="join"
class="join">我要报名
</van-button>
</template>
<template v-else>
<van-button v-if="moment().unix() <= moment(lineData.changeEndTime).unix()" @click="join"
class="join">我要报名
</van-button>
<van-button v-if="moment().unix() > moment(lineData.changeEndTime).unix()" class="join">报名结束
</van-button>
</template>
</div>
</van-skeleton>
</template>
<!--置顶图标-->
<image v-if="btnFlag" @click="backTop" src="/assets/mobile/svg/therapyRecuperation/top.svg"
class="top_icon"></image>
<!--底部报名按钮-->
<div class="footer" v-if="fromUrlByMy != 'edit'">
<template v-if="lineData.isNormal==0&&lineData.isNormalFalse>0">
<van-button @click="join"
class="join">我要报名
</van-button>
</template>
<template v-else>
<van-button v-if="moment().unix() <= moment(lineData.signUpEndTime).unix()" @click="join"
class="join">我要报名
</van-button>
<van-button v-if="moment().unix() > moment(lineData.signUpEndTime).unix()" class="join">报名结束</van-button>
</template>
</div>
<!--报名弹出框-->
<van-popup v-model:show="joinPopup" position="right" class="joinPopup">
<van-nav-bar @click-left="joinPopup = false" fixed left-arrow placeholder title="疗休养报名"></van-nav-bar>
@@ -288,9 +351,9 @@ layout("/mobile/platform.html"){
</div>
<div class="van-card-body">
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
<van-field label="号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号" v-model="formData.idCard"></van-field>
<van-field label="一卡通号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号、护照、台胞证等" v-model="formData.idCard"></van-field>
<van-field label="手机号" name="mobile" :rules="[{ required: true }]"
placeholder="请填写手机号" v-model="formData.mobile"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
@@ -299,7 +362,7 @@ layout("/mobile/platform.html"){
</div>
<!--床位信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<div v-if="configData.bedInfo === true" class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
床位信息
@@ -312,7 +375,8 @@ layout("/mobile/platform.html"){
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
:rules="[{ required: true }]"></van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间'" :rules="[{ validator, message: '请选择是否拼房' }]"
<van-field v-if="formData.bedInfo.bedType == '标准间'"
:rules="[{ validator, message: '请选择是否拼房' }]"
label="是否拼房" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.bedInfo.isSleepTogether">
@@ -321,10 +385,11 @@ layout("/mobile/platform.html"){
</van-radio-group>
</template>
</van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>
<van-field
v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>
</div>
</div>
@@ -334,71 +399,97 @@ layout("/mobile/platform.html"){
<div class="van-card-header"
style="display: flex; justify-content: space-between; align-items: center">
<span style="float:left;">随行人信息</span>
<div>
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">删除随行人</van-tag>
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人</van-tag>
<div v-if="configData.familyInfo === 2">
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">删除随行人
</van-tag>
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人
</van-tag>
</div>
</div>
<div v-if="formData.companionList.length > 0" class="van-card-body">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
<van-radio name="男" shape="square"></van-radio>
<van-radio name="女" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="身份证号" name="idCard" placeholder="请填写身份证号"
:rules="[{ required: true }]" type="digit"
v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
:rules="[{ required: true }]" type="digit"
v-model="item.mobile"></van-field>
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
name="relation"
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<template v-if="configData.familyInfo === 2">
<div v-if="formData.companionList.length > 0" class="van-card-body">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名"
v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="一卡通号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别"
name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
<van-radio name="男" shape="square"></van-radio>
<van-radio name="女" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="身份证件" name="idCard" placeholder="请填写身份证号、护照、台胞证等"
:rules="[{ required: true }]"
v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
:rules="[{ required: true }]" type="digit"
v-model="item.mobile"></van-field>
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
name="relation"
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
name="bedType" placeholder="请选择房间"
v-model="item.bedInfo.bedType"></van-field>
<div style="font-size: 12px; color:orangered; padding-left: 16px; padding-bottom: 4px">
提醒:如果跟报名人员同一房间,无须选择!
</div>
<van-field v-if="item.bedInfo.bedType == '标准间'" @click="self = false; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="item.bedInfo.bedNum"></van-field>
<van-field v-if="item.bedInfo.bedType == '标准间'"
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
<template #input>
<van-radio-group direction="horizontal" v-model="item.bedInfo.isSleepTogether">
<van-radio :name="true" shape="square"></van-radio>
<van-radio :name="false" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="item.bedInfo.otherSleepUser"></van-field>
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
<span>
如有随行人出行,请添加随行人
<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
name="bedType" placeholder="请选择房间"
v-model="item.bedInfo.bedType"></van-field>
<div style="font-size: 12px; color:orangered; padding-left: 16px; padding-bottom: 4px">
提醒:如果跟报名人员同一房间,无须选择!
</div>
<van-field v-if="item.bedInfo.bedType == '标准间'"
@click="self = false; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位"
v-model="item.bedInfo.bedNum"></van-field>
<van-field v-if="item.bedInfo.bedType == '标准间'"
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
<template #input>
<van-radio-group direction="horizontal"
v-model="item.bedInfo.isSleepTogether">
<van-radio :name="true" shape="square"></van-radio>
<van-radio :name="false" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="item.bedInfo.otherSleepUser"></van-field>
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
<span>
如有随行人出行,请添加随行人
</span>
</div>
</template>
<template v-else>
<van-field label="家属数量" name="familyNumber" placeholder="请填写家属数量" v-model="formData.familyNumber"
type="digit" :rules="[{ required: true }]"></van-field>
</template>
</div>
<div class="sign_div" v-if="formData.companionList.length > 0">
<div style="display: flex">
<van-checkbox v-model="hasRead" shape="square" @change="readChange" class="mr10"></van-checkbox>
我已查看
<span @click="openRead" style="color: #0e5996; text-decoration: underline">
《{{configData.files[0].filename.replace(/\.[^/.]+$/, '')}}》
</span>
<van-tag @click="openRead" size="large" type="primary" color="#1867b0">查看</van-tag>
</div>
<mobile-sign v-if="hasRead" class="mt10" ref="signature" v-model="formData.sign" :is_value_base64="false"></mobile-sign>
</div>
<div class="submitButton">
<van-button class="join join_submit">提交报名</van-button>
<van-button class="join join_submit" style="margin: 10px 0">提交报名</van-button>
</div>
</van-form>
@@ -437,6 +528,14 @@ layout("/mobile/platform.html"){
</van-picker>
</van-popup>
<van-action-sheet v-model="readVisible" title="请仔细阅读确认后签字">
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看,再单击返回</van-divider>
<div id="readFile" style="height: 530px; overflow-y: auto"></div>
<div class="submitButton">
<van-button @click="onRead" class="join join_submit" style="margin: 10px 0">我已阅读确认</van-button>
</div>
</van-action-sheet>
</div>
<script>
function getQueryString(name) {
@@ -446,15 +545,21 @@ layout("/mobile/platform.html"){
return null;
}
let pdfh5 = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
readVisible: false,
hasRead: false,
clickRead: false,
isPdf: false,
isLoad: false,
active: 0,
roomColumns: ['大床房', '标准间'],
bedColumns: ['1', '2'],
companionColumns: ['亲属', '朋友'],
companionColumns: ['配偶', '子女'],
bedVisible: false,
roomVisible: false,
companionVisible: false,
@@ -483,7 +588,32 @@ layout("/mobile/platform.html"){
configData: {},
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v=' + new Date().getTime()),
},
methods: {
openRead() {
this.readVisible = true
this.$nextTick(() => {
if(this.configData.files && this.configData.files.length > 0) {
const pdf = new Pdfh5('#readFile', {
pdfurl: CREATE_PREVIEW_URL(this.configData.files[0].id),
})
this.readPDFPicture(pdf)
}
})
},
onRead() {
this.clickRead = true
this.hasRead = true
this.readVisible = false
},
readChange() {
if(this.clickRead === false) {
this.$toast('请先阅读携带家属须知')
this.hasRead = false
}
},
roomCancel() {
if (!this.self) {
this.formData.companionList[this.active].bedInfo.bedType = ''
@@ -510,36 +640,51 @@ layout("/mobile/platform.html"){
return value != null
},
async joinSubmit() {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const cloneData = clone(this.formData)
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
cloneData.companionList.splice(index, 1)
if(this.formData.companionList.length > 0) {
if(this.hasRead === false) {
this.$toast('请先阅读携带家属须知')
return
}
})
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForLine', {
enroll: JSON.stringify(cloneData),
})
setTimeout(() => {
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
} else {
toast.message = resp.msg
toast.type = 'fail'
if(!this.formData.sign) {
this.$toast('请签字')
return
}
}
vant.Dialog.confirm({
title: '温馨提示',
message: '确定要报名吗?',
}).then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const cloneData = clone(this.formData)
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
cloneData.companionList.splice(index, 1)
}
})
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForLine', {
enroll: JSON.stringify(cloneData),
})
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}
}, 1000)
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
} else {
toast.message = resp.msg
toast.type = 'fail'
}
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0) {
pjaxReplace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
}
}, 1000)
})
},
addCompanion() {
this.formData.companionList.push({userName: '', loginName: '', sex: '', relation: '', bedInfo: {}})
@@ -557,19 +702,21 @@ layout("/mobile/platform.html"){
}),
})
if (re.code !== 0) {
if(re.msg === '您今年已报名,如要继续报名请进入我的疗休养,取消已选择') {
if (re.msg === '您今年已报名,如要继续报名请进入我的疗休养,取消已选择') {
vant.Dialog.confirm({
title: '温馨提示',
message: re.msg,
confirmButtonText: '跳转页面',
}).then(() => {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}).catch(() => {});
}).catch(() => {
});
} else {
vant.Dialog.alert({
title: '温馨提示',
message: re.msg,
}).then(() => {})
}).then(() => {
})
}
return
}
@@ -641,6 +788,34 @@ layout("/mobile/platform.html"){
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
},
readPDFPicture(pdf) {
if(pdf != null) {
pdf.on("complete", function () {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(o.getAttribute('class') !== 'top_icon') {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
})
}
},
},
async created() {
this.id = getQueryString('id') ? getQueryString('id') : ''
@@ -653,16 +828,37 @@ layout("/mobile/platform.html"){
if (this.enrollId) {
await this.findSignUpInfoById()
}
this.getData()
await this.getData()
this.isLoad = true
try {
const parser = new DOMParser();
const doc = parser.parseFromString(this.lineData.content, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
this.$nextTick(() => {
pdfh5 = new Pdfh5('#demo', {
pdfurl: href,
});
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
}
this.$nextTick(() => {
this.readPDFPicture(pdfh5)
})
},
mounted() {
window.addEventListener('scroll', this.scrollToTop)
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview([event.target.src])
}
})
},
destroyed() {
window.removeEventListener('scroll', this.scrollToTop)
@@ -3,6 +3,10 @@ layout("/mobile/platform.html"){
#-->
<style>
#app {
font-family: 微软雅黑, serif;
}
.van-doc-card {
margin: 10px;
padding: 12px 12px 12px 12px;
@@ -29,7 +33,6 @@ layout("/mobile/platform.html"){
.list-card > .content {
padding: 16px 10px;
display: flex;
max-height: 100px;
}
.content-right {
@@ -77,19 +80,21 @@ layout("/mobile/platform.html"){
.footer {
background-color: white;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
}
.footer .van-button {
height: 34px;
height: 30px;
font-size: 12px;
border-radius: 6px;
padding: 0 8px;
}
.van-divider {
margin: 8px 0;
}
.active {
@@ -122,6 +127,20 @@ layout("/mobile/platform.html"){
font-size: 12px;
}
.sign_button .van-button {
width: 74px;
height: 28px;
color: white;
background: rgb(24, 103, 176);
border-color: rgb(24, 103, 176);
font-size: 12px;
border-radius: 6px;
}
[v-cloak] {
display: none;
}
</style>
<div id="app" v-cloak>
@@ -129,10 +148,10 @@ layout("/mobile/platform.html"){
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="疗休养线路"></van-nav-bar>
</van-sticky>
<van-dropdown-menu>
<!--<van-dropdown-menu>
<van-dropdown-item v-model="pageForm.year" :options="yearArray"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</van-dropdown-menu>-->
<!--按钮导航-->
<div class="choose_button van-doc-card">
@@ -145,20 +164,42 @@ layout("/mobile/platform.html"){
</div>
</van-grid-item>
</van-grid>
<van-divider></van-divider>
<div class="footer" v-if="['0', '1', 0 , 1].includes(pageForm.theRapyRecuperationType)">
<van-button :class="pageForm.lineUnionType == 3 ? 'active' : 'no_active'"
@click="pageForm.lineUnionType = 3; getData()">
校工会组织
</van-button>
<van-button :class="pageForm.lineUnionType == 1 ? 'active' : 'no_active'"
@click="pageForm.lineUnionType = 1; getData()">
本分工会
</van-button>
<van-button :class="pageForm.lineUnionType == 2 ? 'active' : 'no_active'"
@click="otherUnionClick">
其他分工会
</van-button>
<van-button :class="pageForm.lineUnionType == 4 ? 'active' : 'no_active'"
@click="pageForm.lineUnionType = 4; getData()">
个人组织
</van-button>
</div>
</div>
<van-list
:finished="finished"
:immediate-check="true"
@load="onLoad"
finished-text="没有更多了"
@load="onLoad"
v-model="loading">
<div @click.stop="findOne(o)" class="list-card" v-for="o in tableData">
<div @click.stop="clickLineRow(o)" class="list-card" v-for="o in tableData">
<div class="content">
<van-image
height="100"
radius="8"
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + o.fileId"
:src="CREATE_PREVIEW_URL(o.fileId)"
width="150">
</van-image>
<div v-if="pageForm.theRapyRecuperationType != '2' && pageForm.theRapyRecuperationType != '3'"
@@ -166,22 +207,30 @@ layout("/mobile/platform.html"){
<div class="cr-title">
<span>{{o.lineName}}</span>
<div>
<van-tag color="#1867b0">{{o.lotName}}</van-tag>
<van-tag color="#1867b0">{{o.signUpMode === 2 ? '校工会' :
o.usUnionName}}
</van-tag>
<van-tag color="#1867b0">{{o.travelAgencyPlace}}</van-tag>
<van-tag v-if="o.signUpMode === 1" color="#1867b0">{{o.usUnionName}}</van-tag>
<van-tag v-if="o.signUpMode === 2" color="#1867b0">{{'校工会'}}</van-tag>
<van-tag v-if="o.signUpMode === 3" color="#1867b0">{{o.selectUserName}}</van-tag>
</div>
</div>
<div class="desc_info">
<!--<div class="union">
<span>组织形式:</span>{{o.createMode === 2 && o.signUpMode === 2 ? '校工会' : o.usUnionName}}
</div>-->
<div class="concat">
<div class="concat" v-if="modifyConfig.familyInfo == 2">
<span>已报人数:</span>{{o.signUpUserNum + o.signUpUserFamilyNum + '(家属' +
o.signUpUserFamilyNum + '人)'}}
</div>
<div class="mobile" style="color: red">
<span>出行时间:</span>{{moment(o.playStartTime).format('YYYY-MM-DD')}}
<div class="concat" v-else>
<!--<span>已报人数:</span>{{o.signUpUserNum + o.familyNumber + '(家属' +
o.familyNumber + '人)'}}-->
<span>&ensp;&ensp;人:</span>{{o.contact}}
</div>
<div class="mobile">
<!--<span>出行时间:</span>{{moment(o.playStartTime).format('YYYY-MM-DD')}}-->
<span>联系方式:</span>{{o.contactMobileNumber}}
</div>
<div class="mobile">
<span>&ensp;&ensp;社:</span>{{o.travelAgencyName}}
@@ -244,22 +293,6 @@ layout("/mobile/platform.html"){
</div>
</van-list>
<div class="footer"
v-if="['0', '1', 0 , 1].includes(pageForm.theRapyRecuperationType)">
<van-button :class="pageForm.lineUnionType == 2 ? 'active' : 'no_active'"
@click="otherUnionClick">
其他工会
</van-button>
<van-button :class="pageForm.lineUnionType == 1 ? 'active' : 'no_active'"
@click="pageForm.lineUnionType = 1; getData()">
本工会
</van-button>
<van-button :class="pageForm.lineUnionType == 3 ? 'active' : 'no_active'"
@click="pageForm.lineUnionType = 3; getData()">
校工会
</van-button>
</div>
<van-popup position="bottom" round v-model:show="unionPop">
<van-picker
title="选择分工会" show-toolbar
@@ -268,6 +301,30 @@ layout("/mobile/platform.html"){
@cancel="unionPop = false"
></van-picker>
</van-popup>
<van-action-sheet
v-model="selectLinePopup"
cancel-text="取消"
:description="clickRow.lineName"
close-on-click-action>
<button @click="onSelect(item)" v-for="(item,index) in selectLineList" type="button"
class="van-action-sheet__item">
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<div class="van-action-sheet__name">{{item.name}}</div>
<div class="van-action-sheet__name">{{item.playTime}}</div>
<div class="van-action-sheet__subname">{{item.subname}}</div>
</div>
<div class="sign_button">
<van-button @click.stop="onSelect(item)" size="mini" type="info"
style="margin-right: 8px">
点击报名
</van-button>
</div>
</div>
</button>
</van-action-sheet>
</div>
<script>
@@ -279,7 +336,6 @@ layout("/mobile/platform.html"){
}
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
@@ -291,20 +347,52 @@ layout("/mobile/platform.html"){
chooseButton: [],
pageForm: {
theRapyRecuperationType: 0,
lineUnionType: 1,
//lineUnionType: 1,
unionId: "${@shiro.getPrincipalProperty('union').getId()}",
year: new Date().getFullYear()
year: null
},
loading: false,
finished: false,
refreshing: false,
lineData: {},
modifyConfig: {},
clickRow: {},
selectLineList: [],
selectLinePopup: false,
}
},
methods: {
async clickLineRow(o) {
this.clickRow = o
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/getSelectLineById',
{
lineId: o.lineId,
unionId: this.pageForm.unionId,
theRapyRecuperationType: this.pageForm.theRapyRecuperationType,
lineUnionType: this.pageForm.lineUnionType,
}
)
this.selectLineList = resp.data
this.selectLineList.forEach((item, index) => {
item.name = '出行时间' + (index + 1) + ' ' + item.playStartTime
if (this.modifyConfig.familyInfo == 2) {
item.subname = '已报人数:'
+ (item.signUpUserNum + item.signUpUserFamilyNum)
+ '(家属' + item.signUpUserFamilyNum + '人)'
} else {
item.subname = '已报人数:'
+ (item.signUpUserNum + item.signUpUserFamilyNum)
+ '(家属' + item.familyNumber + '人)'
}
})
this.selectLinePopup = true
},
onSelect(item) {
this.findOne(item)
},
otherUnionClick() {
if(this.unionColumns.length === 0) {
vant.Toast('暂时没有工会公开线路')
if (this.unionColumns.length === 0) {
vant.Toast('暂时没有其他分工会公开线路')
return
}
this.pageForm.lineUnionType = 2
@@ -349,7 +437,7 @@ layout("/mobile/platform.html"){
toast.clear()
}, 500)
if (resp.code === 0) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.pageForm.theRapyRecuperationType
pjaxReplace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.pageForm.theRapyRecuperationType)
}
}, 1000)
},
@@ -362,20 +450,20 @@ layout("/mobile/platform.html"){
const type = Number(this.pageForm.theRapyRecuperationType)
localStorage.setItem("clickIndex", JSON.stringify({clickIndex: type}))
if (type !== 2 && type !== 3) {
location.href = '/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType
+ '&takePartInUnionId=' + o.takePartInUnionId
pjaxReplace('/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType
+ '&takePartInUnionId=' + o.takePartInUnionId)
} else if (type === 3) {
location.href = '/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType
pjaxReplace('/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType)
}
},
getData() {
async getData() {
this.loading = true
if (this.pageForm.lineUnionType === 1) {
this.pageForm.unionId = "${@shiro.getPrincipalProperty('union').getId()}"
}
this.pageForm.pageNumber = 1
this.tableData = []
this.onLoad()
await this.onLoad()
},
async onLoad() {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/pageData', this.pageForm)
@@ -385,6 +473,7 @@ layout("/mobile/platform.html"){
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.finished = false
this.pageForm.pageNumber++
}
}
@@ -394,6 +483,7 @@ layout("/mobile/platform.html"){
for (let i = 2023; i <= 2043; i++) {
this.yearArray.push({value: i, text: i + '年'})
}
this.yearArray.unshift({value: null, text: '全部'})
},
async getTheRapyUnions() {
const resp = await $.get('/platform/theRapyRecuperation/line/enroll/getTheRapyUnions', {
@@ -401,18 +491,31 @@ layout("/mobile/platform.html"){
})
return resp.data
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
},
mounted() {
if (localStorage.getItem('clickIndex') !== null) {
const clickIndex = localStorage.getItem('clickIndex')
this.pageForm.theRapyRecuperationType = JSON.parse(clickIndex).clickIndex
}
/*if(this.pageForm.theRapyRecuperationType == 1){
this.$set(this.pageForm, 'lineUnionType', 3)
}*/
},
async created() {
this.createYear()
const clickIndex = localStorage.getItem('clickIndex')
this.pageForm.theRapyRecuperationType = JSON.parse(clickIndex).clickIndex
await this.getModifyConfig()
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
const unions = await this.getTheRapyUnions()
unions.forEach(item => {
this.unionColumns.push({text: item.unionname, value: item.id})
})
}
})
</script>
@@ -29,7 +29,6 @@ layout("/mobile/platform.html"){
.list-card > .content {
padding: 16px 10px 8px;
display: flex;
max-height: 100px;
}
.content-right {
@@ -72,21 +71,28 @@ layout("/mobile/platform.html"){
.footer {
background-color: white;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
}
.footer .van-button {
height: 34px;
height: 30px;
font-size: 12px;
border-radius: 6px;
}
.evaluateVisible .van-button {
height: 30px;
font-size: 12px;
border-radius: 6px;
}
.van-divider {
margin: 8px 0;
}
.active {
background-color: #1867b0;
color: white;
@@ -172,11 +178,59 @@ layout("/mobile/platform.html"){
margin-left: 4px;
}
.evaluateVisible {
width: 100%;
height: 80%;
}
.title_container {
display: flex;
justify-content: flex-end;
align-items: center;
position: relative;
padding: 9px;
}
.title {
position: absolute;
left: 0;
right: 0;
margin: auto;
text-align: center;
}
.content {
padding: 10px 20px;
}
.line_info {
display: flex;
align-items: center;
}
.evaluate_item_content {
display: flex;
gap: 20px;
}
.evaluate_item {
padding: 6px 20px;
border: 1px grey solid;
text-align: center;
border-radius: 10px;
}
.evaluate_active {
background-color: #07C160;
color: white;
border-color: #07C160;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder
title="我的疗休养"></van-nav-bar>
</van-sticky>
@@ -188,7 +242,7 @@ layout("/mobile/platform.html"){
<!--按钮导航-->
<div class="choose_button van-doc-card">
<van-grid :column-num="chooseButton.length" :border="false">
<van-grid-item @click="pageForm.theRapyRecuperationType = item.value; doSearch()"
<van-grid-item @click="pageForm.theRapyRecuperationType = item.value;doSearch()"
v-for="item in chooseButton">
<van-image width="46" height="46" :src="item.imgUrl"></van-image>
<div :style="pageForm.theRapyRecuperationType == item.value ? 'color: #1867b0; font-weight: bold' : 'color: black; font-weight: normal'"
@@ -196,6 +250,14 @@ layout("/mobile/platform.html"){
</div>
</van-grid-item>
</van-grid>
<van-divider></van-divider>
<div class="footer">
<van-button @click="pageForm.signUpStateId = 1; getData()" :class="pageForm.signUpStateId == 1 ? 'active' : 'no_active'">已报名</van-button>
<van-button @click="pageForm.signUpStateId = 2; getData()" :class="pageForm.signUpStateId == 2 ? 'active' : 'no_active'">已参加</van-button>
<van-button @click="pageForm.signUpStateId = 3; getData()" :class="pageForm.signUpStateId == 3 ? 'active' : 'no_active'">未参加</van-button>
</div>
</div>
<van-list
@@ -209,7 +271,7 @@ layout("/mobile/platform.html"){
<van-image
height="100"
radius="8"
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + o.fileId"
:src="CREATE_PREVIEW_URL(o.fileId)"
width="150"
></van-image>
@@ -241,7 +303,8 @@ layout("/mobile/platform.html"){
<span>联系方式:</span>{{o.contactMobileNumber}}
</div>
<div class="mobile" v-if="![2715,2725,2735].includes(o.stateId)">
<span>随行家属:</span>{{o.companionUserNames ? o.companionUserNames : '无'}}
<span v-if="configData.familyInfo === 1">随行家属:</span>{{o.companionUserNames ? o.companionUserNames : '无'}}
<span v-else>随行家属:</span>{{o.familyNumber}}人
</div>
<div class="mobile" v-else>
<span>审核状态:</span><span :style="'color: ' + o.stateColor">{{o.stateName}}</span>
@@ -295,6 +358,9 @@ layout("/mobile/platform.html"){
</div>
<div class="operateDiv">
<van-button v-if="pageForm.signUpStateId == 2" @click="openEvaluate(o)" type="info" size="small" color="#1867b0">
&ensp;
</van-button>
<van-button v-if="pageForm.theRapyRecuperationType != '2' && moment().unix() < moment(o.changeEndTime).unix()
&& ![2715,2725,2735].includes(o.stateId)" @click="edit(o)"
type="info" size="small" color="#1867b0" :disabled="o.isTakePartIn == true || getDisabled(o)">
@@ -302,21 +368,15 @@ layout("/mobile/platform.html"){
</van-button>
<van-button type="info" size="small" color="#1867b0" @click="cancel(o)"
:disabled="getDisabled(o)">
&ensp;
&ensp;
</van-button>
<van-button v-if="o.isTakePartIn == true" type="info" size="small" color="#1867b0"
@click="satisfaction(o)">满意度反馈</van-button>
<!--<van-button v-if="o.isTakePartIn == true" type="info" size="small" color="#1867b0"
@click="satisfaction(o)">满意度反馈</van-button>-->
</div>
</div>
</van-list>
<div class="footer">
<van-button @click="pageForm.signUpStateId = 1; getData()" :class="pageForm.signUpStateId == 1 ? 'active' : 'no_active'">已报名</van-button>
<van-button @click="pageForm.signUpStateId = 2; getData()" :class="pageForm.signUpStateId == 2 ? 'active' : 'no_active'">已参加</van-button>
<van-button @click="pageForm.signUpStateId = 3; getData()" :class="pageForm.signUpStateId == 3 ? 'active' : 'no_active'">未参加</van-button>
</div>
<van-popup class="popVisible" position="right" v-model="popVisible">
<van-nav-bar @click-left="popVisible = false" fixed left-arrow placeholder title="满意度评分"></van-nav-bar>
<div class="cus_content">
@@ -352,14 +412,45 @@ layout("/mobile/platform.html"){
</div>
</van-popup>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养报名
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的疗休养
</van-tabbar-item>
</van-tabbar>
</div>
<van-action-sheet title="参加体验评价" v-model="evaluatePopup">
<div class="evaluateForm">
<div style="text-align: center;margin: 20px 0;font-size: 20px;color: #f18d8d;font-weight: bold;">
您的评价让我们做的更好
</div>
<div style="display: flex;justify-content: center;flex-direction: column;align-items: center">
<div style="text-align: center;font-size: 13px;color: rgb(139 134 134); margin-bottom: 10px">为本次疗休养打分
</div>
<div class="evaluate_item_content">
<div class="evaluate_item" @click="evaluateClick('满意', 1)">满意</div>
<div class="evaluate_item" @click="evaluateClick('一般', 2)">一般</div>
<div class="evaluate_item" @click="evaluateClick('不满意', 3)">不满意</div>
</div>
</div>
<van-field
autosize
class="evaluateTextField"
label="评价"
label-width="0"
maxlength="100"
placeholder="请输入评价"
rows="5"
type="textarea"
v-model="evaluateFormData.evaluateText"
>
<div slot="label"></div>
</van-field>
</div>
<div style="padding: 10px 16px">
<van-button @click="doSubmitEvaluate"
block
type="primary"
>提交
</van-button>
</div>
</van-action-sheet>
</div>
<script>
@@ -376,23 +467,81 @@ layout("/mobile/platform.html"){
mixins: [mobileMixins],
data() {
return {
evaluateFormData: {},
evaluatePopup: false,
yearArray: [],
popVisible: false,
chooseButton: [],
pageForm: {
theRapyRecuperationType: null,
signUpStateId: 1,
year: null,
year: new Date().getFullYear(),
},
loading: false,
finished: false,
refreshing: false,
satisfactionForm: {},
configData: {},
tarBarActive: 1
}
},
methods: {
async openEvaluate(o) {
if(o.isTakePartIn === false) {
this.$modal.msg("参加后才能评价")
return
}
await this.finOneEvaluate(o.takePartInLineId)
this.evaluatePopup = true
this.$nextTick(() => {
let score = 1
if (this.evaluateFormData.evaluateScore === '满意') {
score = 1
} else if (this.evaluateFormData.evaluateScore === '一般') {
score = 2
} else if (this.evaluateFormData.evaluateScore === '不满意') {
score = 3
}
this.evaluateClick(this.evaluateFormData.evaluateScore, score)
})
},
evaluateClick(value, index) {
this.evaluateFormData.evaluateScore = value
const elements = document.querySelectorAll('.evaluate_item')
for (let i = 0; i < elements.length; i++) {
if(index === (i + 1)) {
elements[i].classList.add('evaluate_active')
} else {
elements[i].classList.remove('evaluate_active')
}
}
},
async finOneEvaluate(lineId) {
const {data, code, msg} = await $.post("/platform/theRapyRecuperation/line/enroll/finOneEvaluate", {
lineId: lineId,
})
if (code === 0) {
if (data) {
this.evaluateFormData = data
} else {
this.evaluateFormData = {lineId: lineId}
}
} else {
this.$message.warning(msg)
}
},
async doSubmitEvaluate() {
if (!this.evaluateFormData.evaluateScore) {
this.$modal.msg("请为本次疗休养评分")
return
}
const {code, data, msg} = await $.post('/platform/theRapyRecuperation/line/enroll/doEvaluate', this.evaluateFormData)
if (code === 0) {
this.$modal.msgSuccess("评价成功")
this.evaluatePopup = false
} else {
this.$modal.msgError(msg)
}
},
getDisabled(o) {
if(o.regionalNature === '省内') {
return this.configData.isSnLine && o.stateId === 2750
@@ -465,11 +614,11 @@ layout("/mobile/platform.html"){
}
vant.Dialog.confirm({
title: '温馨提醒',
message: '您确定要取消此报名吗?',
message: '您确定要撤销此报名吗?',
}).then(async () => {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + o.id)
if(res.code === 0) {
vant.Toast('取消成功')
vant.Toast('撤销成功')
this.getData()
}else {
vant.Toast(res.msg)
@@ -516,8 +665,7 @@ layout("/mobile/platform.html"){
},
async created() {
this.createYear()
this.yearArray.unshift({value: null, text: '全部'})
this.pageForm.year = new Date().getFullYear()
this.yearArray.unshift({value: null, text: '所有年度'})
this.pageForm.theRapyRecuperationType = getQueryString('index') ? getQueryString('index') : await this.getType()
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
@@ -0,0 +1,372 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.top_block {
width: 100%;
padding: 20px 80px;
border-bottom: 10px solid rgb(240, 240, 240);
}
.top_title {
font-size: 18px;
height: 30px;
line-height: 30px;
margin-bottom: 5px;
}
.top_num {
font-size: 26px;
color: #808492;
}
.two_num {
margin-top: 8px;
font-size: 18px;
color: #808492;
}
.cut-off-line {
width: 1px;
height: 70%;
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background-color: rgb(230, 230, 230);
}
.chartTitle {
font-size: 14px;
color: #808492;
margin-bottom: 20px;
}
</style>
<div id="app">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
@change="doSearch"
:clearable="false"
value-format="yyyy"
v-model="pageForm.year"
type="year"
placeholder="选择年">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">线路类型</div>
<div class="search-item-option">
<el-select v-model="pageForm.lineType" placeholder="线路类型" clearable style="width: 100%">
<el-option v-for="item in regionalNatureList" :key="item.value" :label="item.label" :value="item.value">{{item.label}}</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch()">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<div class="top_block">
<el-row :gutter="20">
<el-col :span="4" style="position: relative">
<div class="top_title">总人数</div>
<div class="top_num">{{numData.allNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div class="top_title">省内人数</div>
<div class="top_num">{{numData.provinceNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div class="top_title">省外人数</div>
<div class="top_num">{{numData.outProvinceNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div style="display: flex;justify-content: space-between;">
<div class="top_title">总线路数</div>
<div style="margin-top: 2px;font-size: 18px;color: #1867b0">共{{numData.lineNum || '0'}}条</div>
</div>
<div class="two_num">省内{{numData.inLineNum || '0'}} | 省外{{numData.outLineNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4" style="position: relative">
<div style="display: flex;justify-content: space-between;">
<div class="top_title">校工会组织</div>
<div style="margin-top: 2px;font-size: 18px;color: #1867b0">共{{numData.schoolUnionLineNum || '0'}}条</div>
</div>
<div class="two_num">省内{{numData.schoolInLineNum || '0'}} | 省外{{numData.schoolOutLineNum || '0'}}</div>
<div class="cut-off-line"></div>
</el-col>
<el-col :span="4">
<div style="display: flex;justify-content: space-between;">
<div class="top_title">分工会组织</div>
<div style="margin-top: 2px;font-size: 18px;color: #1867b0">共{{numData.unionLineNum || '0'}}条</div>
</div>
<div class="two_num">省内{{numData.unionInLineNum || '0'}} | 省外{{numData.unionOutLineNum || '0'}}</div>
</el-col>
</el-row>
</div>
<el-row gutter="20" style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
<el-col :span="12" v-loading="lotLoading">
<div class="chartTitle">时间标段统计</div>
<div id="lotChart" style="width: 100%;height: 300px"></div>
</el-col>
<el-col :span="12" v-loading="ageLoading">
<div class="chartTitle">年龄分布统计</div>
<div id="ageChart" style="width: 100%;height: 300px"></div>
</el-col>
</el-row>
<el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">
<el-col :span="24" style="padding: 0 20px" v-loading="lineTravelOrAgeLoading">
<div class="chartTitle">线路人数及年龄统计</div>
<div id="lineTravelChart"></div>
</el-col>
</el-row>
<!-- <el-row style="padding: 30px 0;border-bottom: 10px solid rgb(240, 240, 240)">-->
<!-- <el-col :span="24" style="padding: 0 20px">-->
<!-- <div class="chartTitle">线路出行年龄统计</div>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-card>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return{
pageForm: {
year: moment().format('YYYY') + "",
lineType: ''
},
numData: {
allNum: '',
provinceNum: '',
outProvinceNum: '',
allLineNum: '',
schoolLineNum: '',
branchLineNum: ''
},
regionalNatureList: [{label:'全部线路',name:'provinceAll',ordinal:0,provinceIn:'provinceIn',provinceOut:'provinceOut',value:'全部'}],
lotLoading: false,
ageLoading: false,
lineTravelOrAgeLoading: false,
isLineTravel: false,
lineTravelOrAgeTip: '出行线路年龄统计',
dualAxisChartInstance: null,
chartData: [
{ "lineName": "03-15", "takePartInLineNum": 10, "underThirtyFive": 5, "thirtyFiveToFortyFive": 3, "aboveFortyFive": 2 },
{ "lineName": "04-10", "takePartInLineNum": 15, "underThirtyFive": 7, "thirtyFiveToFortyFive": 6, "aboveFortyFive": 2 }
]
}
},
methods: {
async getNumData(){
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getNumData', this.pageForm)
if (resp.code === 0) {
this.numData = resp.data
}
},
async getLotNumData(){
this.lotLoading = true
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getLotNum', this.pageForm)
if (resp.code === 0) {
let {data} = resp
document.getElementById("lotChart").innerHTML = ''
const config = {
isStack: true,
"legend": {
"position": "top-right",
"flipPage": false
},
autoFit: true,
title: {
visible: true,
text: '出行时间标段统计详情',
},
description: {
visible: true,
text: '人',
},
xField: 'label',
yField: 'value',
stackField: 'type',
color: ["#5B8FF9", "#5AD8A6"],
"xAxis": {
label: {
formatter: (v) => {
if (data.length > 30 && v.length > 3) {
return v.substr(0, 2) + '...'
} else if (data.length > 20 && v.length > 4) {
return v.substr(0, 3) + '...'
} else if (data.length > 10 && v.length > 6) {
return v.substr(0, 5) + '...'
}
return v
}
}
},
"yAxis": {},
meta: {
label: {
alias: '标段时长',
},
value: {
alias: '人数',
}
},
connectedArea: {
visible: true,
triggerOn: false,
},
}
const plot = new G2Plot.Column(document.getElementById("lotChart"), {
data,
...config,
});
plot.render();
this.lotLoading = false
}
},
async getAgeData(){
this.ageLoading = true
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getAgeNum', this.pageForm)
if (resp.code === 0) {
let {data} = resp
document.getElementById("ageChart").innerHTML = ''
const config = {
"legend": {
"flipPage": false
},
"label": {
"type": "spider",
"offset": 50
},
"width": $('#ageChart').width(),
"height": $('#ageChart').height(),
"forceFit": false,
"radius": 1,
"colorField": "label",
"angleField": "value",
meta: {
label: {
alias: '年龄结构',
},
value: {
alias: '人数',
}
},
}
const plot = new G2Plot.Pie(document.getElementById("ageChart"), {
data,
...config,
});
plot.render();
this.ageLoading = false
}
},
async getLineTravelData(){
if (this.dualAxisChartInstance) {
this.dualAxisChartInstance.destroy(); // 如果已有实例,先销毁
}
const resp = await $.post('/platform/theRapyRecuperation/annualAnalysis/getLineTravelAndAgeData', this.pageForm)
if (resp.code === 0) {
let {data} = resp
document.getElementById("lineTravelChart").innerHTML = ''
const dualAxes = new G2Plot.DualAxes('lineTravelChart', {
data: [data.uvData, data.transformData],
xField: 'lineName',
yField: ['value', 'count'],
meta: {
value: {
alias: '出行人数',
},
count: {
alias: '年龄段人数',
}
},
yAxis: [
{
min: 0, // 设置Y轴最小值为0
max: null, // 自动计算最大值
title: {
text: '出行人数',
},
},
{
position: 'right',
min: 0,
max: null,
title: {
text: '年龄段人数',
},
},
],
geometryOptions: [
{
geometry: 'column',
columnWidthRatio: 0.4,
color: '#5B8FF9', // 设置柱状图颜色
},
{
geometry: 'line',
seriesField: 'name',
color: ['#5AD8A6', '#E8684A', '#FF9D4D'], // 设置线的颜色
},
],
tooltip: {
shared: true, // 共享提示框
},
});
dualAxes.render();
}
},
doLineTravelOrAgeSwitch(){
this.isLineTravel = !this.isLineTravel
this.lineTravelOrAgeTip = this.isLineTravel ? '出行线路年龄统计' : '出行线路人数统计'
},
async pageData(){
await this.getNumData()
await this.getLotNumData()
await this.getAgeData()
await this.getLineTravelData()
}
},
async created() {
this.regionalNatureList.push(...await getEnumOptions('TheRapyRecuperationProvinceType'))
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -143,9 +143,9 @@ layout("/layouts/platform.html"){
style="width: 80%"
@change="lineChange(pageForm.takePartInLineId);doSearch()">
<el-option v-for="item in takePartInLines"
:key="item.id"
:key="item.selectId"
:label="item.lineName"
:value="item.id">
:value="item.selectId">
</el-option>
</el-select>
</el-col>
@@ -259,7 +259,7 @@ layout("/layouts/platform.html"){
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='isFamily'">
<el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
@@ -471,22 +471,22 @@ layout("/layouts/platform.html"){
<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="idCard"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
{{ row.bedInfo.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
{{ row.bedInfo.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
{{ row.bedInfo.otherSleepUser ?
row.bedInfo.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
@@ -667,7 +667,6 @@ layout("/layouts/platform.html"){
})
},
async openModify(row) {
this.getUnionSelectLine(row.takePartInLineId)
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
@@ -713,7 +712,7 @@ layout("/layouts/platform.html"){
},
async lineChange(val) {
this.pageForm.selectId = '';
const data = this.takePartInLines.find(v => v.id === val)
const data = this.takePartInLines.find(v => v.selectId === val)
if (!data) {
return
}
@@ -951,11 +950,10 @@ layout("/layouts/platform.html"){
this.modifyConfig = res.data
}
},
async getUnionSelectLine(disPlayUnionSelectId = null) {
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
startYear: this.pageForm.year,
year: this.pageForm.year,
signUpMode: 1,
disPlayUnionSelectId: disPlayUnionSelectId
})
if (resp.code === 0) {
this.unionSelectLines = resp.data
@@ -42,7 +42,7 @@ layout("/layouts/platform.html"){
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 80%" @change="getLineSignNumber(); doSearch()">
style="width: 80%" @change="doSearch">
</el-date-picker>
</el-col>
<el-col :span="12">
@@ -253,7 +253,7 @@ layout("/layouts/platform.html"){
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='isFamily'">
<el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
@@ -361,8 +361,8 @@ layout("/layouts/platform.html"){
<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,true)" type="warning">调整
</el-button>
<el-button @click="doAudit(false,false)" type="danger">拒绝
</el-button>
<el-button @click="doAudit(true,false)" type="primary">通过
@@ -465,22 +465,22 @@ layout("/layouts/platform.html"){
<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="idCard"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
{{ row.bedInfo.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
{{ row.bedInfo.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
{{ row.bedInfo.otherSleepUser ?
row.bedInfo.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
@@ -619,6 +619,10 @@ layout("/layouts/platform.html"){
},
methods: {
async playChange() {
await this.getLineSignNumber()
await this.doSearch()
},
async validateLine() {
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo'
, {enroll: JSON.stringify(this.editFormData)})
@@ -662,7 +666,6 @@ layout("/layouts/platform.html"){
})
},
async openModify(row) {
this.getUnionSelectLine(row.takePartInLineId)
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
@@ -719,10 +722,6 @@ layout("/layouts/platform.html"){
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,
@@ -946,11 +945,10 @@ layout("/layouts/platform.html"){
this.modifyConfig = res.data
}
},
async getUnionSelectLine(disPlayUnionSelectId = null) {
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
startYear: this.pageForm.year,
//signUpMode: 1,
disPlayUnionSelectId: disPlayUnionSelectId
year: this.pageForm.year,
signUpMode: 1,
})
if (resp.code === 0) {
this.unionSelectLines = resp.data
@@ -304,7 +304,7 @@ layout("/layouts/platform.html"){
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<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>
@@ -44,18 +44,9 @@ layout("/layouts/platform.html"){
@change="handleChangeYear"
>
</el-date-picker>
<!--<el-date-picker
style="width: 100%"
@change="doSearch"
placeholder="选择年度"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>-->
</div>
</div>
<!--<div class="search-item">
<div class="search-item">
<div class="search-item-label">旅行社:</div>
<div class="search-item-option">
<el-select @change="doSearch"
@@ -69,7 +60,7 @@ layout("/layouts/platform.html"){
v-for="item in travelAgencyOptions"></el-option>
</el-select>
</div>
</div>-->
</div>
<div class="search-item">
<div class="search-item-label">线路名称:</div>
<div class="search-item-option">
@@ -95,7 +86,7 @@ layout("/layouts/platform.html"){
</div>
</div>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}">
<div class="search-item-label">分工会:</div>
<div class="search-item-option">
<el-select @change="doSearch"
@@ -111,6 +102,22 @@ layout("/layouts/platform.html"){
</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.signUpMode">
<el-option :key="item.value"
:label="item.label"
:value="item.value"
v-for="item in signUpModeList"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
@@ -120,7 +127,7 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="线路列表">
<template #func>
<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>
</template>
</table-tool>
@@ -155,15 +162,12 @@ layout("/layouts/platform.html"){
<template scope="{row:{createMode}}" v-else-if="column.prop==='createMode'">
{{createModeName(createMode)}}
</template>
<template scope="{row}" v-else-if="column.prop==='createUserName'">
{{row.createUserName + '' + row.createUnionName + ''}}
</template>
<template scope="{row}" v-else-if="column.prop==='playTime'">
<el-button @click="viewUnionSelectTimeInfo(row.id)"
type="text">
查看详情
</el-button>
<!-- v-if="row.createMode===2 && row.signUpMode===1"-->
<!-- v-if="row.createMode===2 && row.signUpMode===1"-->
<!--<span v-else>
{{row.playStartTime + '至' + row.playEndTime}}
</span>-->
@@ -187,7 +191,7 @@ layout("/layouts/platform.html"){
<el-form-item label="">
<span class="text-primary">
<i class="el-icon-warning"></i>
温馨提醒:工会组织的线路,可以自行设置出行时间。
温馨提醒:工会可以为基层工会或个人创建线路,基层工会或个人自行选择并设置活动相关时间。
</span>
</el-form-item>
</el-col>
@@ -199,37 +203,29 @@ layout("/layouts/platform.html"){
<el-date-picker style="width: 100%"
@change="yearChange"
type="year"
placeholder="请选择年度"
v-model="formData.year"
value-format="yyyy"></el-date-picker>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="排序号" prop="serialNumber">
<el-input type="number" maxlength="50" v-model="formData.serialNumber"></el-input>
<el-input maxlength="50" v-model="formData.serialNumber"
placeholder="请输入排序号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="线路名称" prop="lineName">
<el-input maxlength="50" v-model="formData.lineName"></el-input>
<el-input maxlength="50" v-model="formData.lineName"
placeholder="请输入线路名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="时间标段" prop="lotId">
<el-select clearable filterable style="width: 100%"
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-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-select clearable filterable style="width: 100%" v-model="formData.travelAgencyId"
placeholder="请选择旅行社" @change="$set(formData,'travelAgencyPlace','')">
<el-option :key="item.id"
:label="item.travelAgencyName+'('+ item.year +'年)'"
:value="item.id"
@@ -237,24 +233,37 @@ layout("/layouts/platform.html"){
></el-option>
</el-select>
</el-form-item>
</el-col>-->
</el-row>
<!--<el-row :gutter="20">
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="旅行社地点" prop="travelAgencyPlace">
<el-select clearable filterable style="width: 100%" v-model="formData.travelAgencyPlace"
placeholder="请选择旅行社地点">
<el-option :key="index"
:label="item"
:value="item"
v-for="(item,index) in (travelAgencyList.find(v => v.id === formData.travelAgencyId) ?? {}).travelAgencyPlaces"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="旅行社联系人">
<el-input
placeholder="请输入旅行社联系人"
:value="(travelAgencyList.find(v => v.id === formData.travelAgencyId) ?? {}).contact"
readonly></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="联系方式">
<el-form-item label="旅行社联系方式">
<el-input
placeholder="请输入旅行社联系方式"
:value="(travelAgencyList.find(v => v.id === formData.travelAgencyId) ?? {}).contactMobileNumber"
readonly></el-input>
</el-form-item>
</el-col>
</el-row>-->
</el-row>
<el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24">
@@ -269,11 +278,25 @@ layout("/layouts/platform.html"){
</el-radio-group>
</el-form-item>
</el-col>
<el-col span="12" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}">
<el-form-item label="开放选择" prop="openChoose">
<el-radio-group class="mr0-radio" size="small" v-model="formData.openChoose">
<el-radio :label="true" border></el-radio>
<el-radio :label="false" border></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="交通工具" prop="trafficTools">
<el-input clearable maxlength="50" v-model="formData.trafficTools"></el-input>
<el-form-item label="组织形式" prop="signUpMode">
<el-radio-group class="mr0-radio" size="small" v-model="formData.signUpMode">
<el-radio :label="item.value" v-if="isShow(item.roles)"
size="small"
border v-for="item in signUpModeList">
{{item.label}}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
@@ -281,7 +304,7 @@ layout("/layouts/platform.html"){
<el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24">
<el-row :gutter="20">
<!--<el-col :span="12">
<el-col :span="12">
<el-form-item label="最少参与教工" prop="minimumGroupSize">
<el-input-number :max="1000"
:min="config.groupNumber"
@@ -289,9 +312,9 @@ layout("/layouts/platform.html"){
style="width: 100%"
v-model="formData.minimumGroupSize"></el-input-number>
</el-form-item>
</el-col>-->
<el-col :span="24">
<el-form-item label="最少成团人数包括家属" prop="estimatedFamilyNumbers">
</el-col>
<el-col :span="12">
<el-form-item label="成团人数包括家属" prop="estimatedFamilyNumbers">
<el-input-number :max="1000"
:min="1"
:precision="0"
@@ -303,32 +326,32 @@ layout("/layouts/platform.html"){
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="预计费用(元/人次)" prop="estimatedCost">
<el-input clearable maxlength="50" v-model="formData.estimatedCost"></el-input>
<el-input clearable maxlength="50" v-model="formData.estimatedCost"
placeholder="请输入预计费用"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="组织形式" prop="signUpMode">
<el-radio-group class="mr0-radio" size="small" v-model="formData.signUpMode">
<el-radio :label="item.value" v-if="isShow(item.roles)"
size="small"
border v-for="item in signUpModeList">
{{item.label}}
</el-radio>
</el-radio-group>
<div class="text-primary">
<i class="el-icon-warning"></i>
温馨提醒:校工会可以为基层工会创建线路,分工会自行选择并设置活动相关时间。
</div>
<el-col :span="12">
<el-form-item label="时间标段" prop="lotId">
<el-select clearable filterable style="width: 100%"
placeholder="请选择时间标段"
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-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="lineContact">
<el-input clearable max="50" v-model="formData.lineContact"></el-input>
<el-input clearable max="50" v-model="formData.lineContact"
placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -336,88 +359,89 @@ layout("/layouts/platform.html"){
{ required: false, message: '手机号码不能为空', trigger: 'blur' },
{ pattern: /^1[34578]\d{9}$/, message: '手机号码格式不正确', trigger: 'blur' }
]" label="联系方式" prop="lineContactPhone">
<el-input clearable v-model="formData.lineContactPhone"></el-input>
<el-input clearable v-model="formData.lineContactPhone"
placeholder="请输入联系方式"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
<!-- <template v-if="formData.signUpMode===2 || formData.createMode===1">-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="报名开始时间" prop="signUpStartTime">-->
<!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"-->
<!-- v-model="formData.signUpStartTime"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="报名截至时间" prop="signUpEndTime">-->
<!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"-->
<!-- v-model="formData.signUpEndTime"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <template v-if="formData.signUpMode===2 || formData.createMode===1">-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="报名开始时间" prop="signUpStartTime">-->
<!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"-->
<!-- v-model="formData.signUpStartTime"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="报名截至时间" prop="signUpEndTime">-->
<!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"-->
<!-- v-model="formData.signUpEndTime"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="变更截至时间" prop="changeEndTime">-->
<!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"-->
<!-- v-model="formData.changeEndTime"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item>-->
<!-- <template #label>-->
<!-- <span class="text-primary">-->
<!-- <i class="el-icon-warning"></i>-->
<!-- 温馨提醒:-->
<!-- </span>-->
<!-- </template>-->
<!-- <span class="text-primary">-->
<!-- 变更时间应该大于报名截至时间,小于出行时间。-->
<!-- </span>-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="变更截至时间" prop="changeEndTime">-->
<!-- <el-date-picker style="width: 100%"-->
<!-- type="datetime"-->
<!-- v-model="formData.changeEndTime"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item>-->
<!-- <template #label>-->
<!-- <span class="text-primary">-->
<!-- <i class="el-icon-warning"></i>-->
<!-- 温馨提醒:-->
<!-- </span>-->
<!-- </template>-->
<!-- <span class="text-primary">-->
<!-- 变更时间应该大于报名截至时间,小于出行时间。-->
<!-- </span>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="出行开始时间" prop="playStartTime">-->
<!-- <el-date-picker-->
<!-- placeholder="出行开始时间"-->
<!-- style="width: 100%"-->
<!-- type="date"-->
<!-- v-model="formData.playStartTime"-->
<!-- value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="出行结束时间" prop="playEndTime">-->
<!-- <el-date-picker-->
<!-- placeholder="出行结束时间"-->
<!-- style="width: 100%"-->
<!-- type="date"-->
<!-- v-model="formData.playEndTime"-->
<!-- value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </template>-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="出行开始时间" prop="playStartTime">-->
<!-- <el-date-picker-->
<!-- placeholder="出行开始时间"-->
<!-- style="width: 100%"-->
<!-- type="date"-->
<!-- v-model="formData.playStartTime"-->
<!-- value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :md="12" :sm="24" :xs="24">-->
<!-- <el-form-item label="出行结束时间" prop="playEndTime">-->
<!-- <el-date-picker-->
<!-- placeholder="出行结束时间"-->
<!-- style="width: 100%"-->
<!-- type="date"-->
<!-- v-model="formData.playEndTime"-->
<!-- value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </template>-->
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
@@ -443,8 +467,11 @@ layout("/layouts/platform.html"){
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="移动端缩略图" prop="files">
<image-Upload :height="100" :width="100" :limit="1" :file-type="['png', 'jpg']" :file-size="1"
v-model="formData.files"></image-Upload>
<file-upload :files.sync="formData.files"
picture_card
:max="1"
:type="['jpg', 'jpeg', 'png']"
></file-upload>
</el-form-item>
</el-col>
</el-row>
@@ -589,7 +616,8 @@ layout("/layouts/platform.html"){
{label: '年度', prop: 'year', sortable: true},
{label: '线路名称', prop: 'lineName', sortable: true, width: '200'},
{label: '时间标段', prop: 'lotName', sortable: true, sortProp: 'lotValue'},
/*{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},*/
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},
{label: '地点', prop: 'travelAgencyPlace', sortable: true},
// {label: '出行时间', prop: 'playTime', sortable: true},
{label: '线路类型', prop: 'regionalNature', sortable: true},
{label: '组织形式', prop: 'signUpMode', sortable: true},
@@ -628,7 +656,9 @@ layout("/layouts/platform.html"){
message: '请输入成团人数包括家属',
trigger: ['change', 'blur']
}],
lotId: [{required: true, message: '请选择标段时间', trigger: ['change', 'blur']}]
lotId: [{required: true, message: '请选择标段时间', trigger: ['change', 'blur']}],
openChoose: [{required: true, message: '请选择开放选择', trigger: ['change', 'blur']}],
travelAgencyPlace: [{required: true, message: '请选择开放选择', trigger: ['change', 'blur']}],
},
viewData: {},
@@ -641,6 +671,7 @@ layout("/layouts/platform.html"){
serialNumber: null,
lineName: null,
travelAgencyId: null,
travelAgencyPlace: null,
regionalNature: null,
minimumGroupSize: 1,
year: null,
@@ -657,10 +688,11 @@ layout("/layouts/platform.html"){
playEndTime: null,
trafficTools: null,
estimatedCost: null,
estimatedFamilyNumbers: null,
estimatedFamilyNumbers: 1,
lotId: null,
lineContact: null,
lineContactPhone: null
lineContactPhone: null,
openChoose: false,
},
pageForm: {
keywords: null,
@@ -681,16 +713,18 @@ layout("/layouts/platform.html"){
importLoading: false,
importData: {},
modifyConfig:{}
modifyConfig: {}
}
},
methods: {
isShow(roles) {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}" === 'true') {
return true
}
if ("${@shiro.hasRole('H04')}" === 'true') {
return roles.some(r => r === 'H04')
} else {
return roles.some(r => r === 'H01')
}
},
async getCreateMode() {
@@ -717,7 +751,6 @@ layout("/layouts/platform.html"){
this.formData.minimumGroupSize = this.config.groupNumber
}
await this.getNumber()
this.formData.estimatedFamilyNumbers = this.modifyConfig.outsideQuota
},
async openEdit(id) {
const resp = await $.post(loc() + '/selectLineInfoById/' + id)
@@ -726,7 +759,6 @@ layout("/layouts/platform.html"){
await this.$nextTick()
const data = resp.data
data.year = data.year.toString()
data.files = JSON.parse(data.files)
this.formData = {...data}
this.initLineContentEditor(data.content)
} else {
@@ -743,30 +775,15 @@ layout("/layouts/platform.html"){
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
delete this.formData.travelAgency
this.formData.files = JSON.stringify(this.formData.files)
const resp = await $.post(loc() + '/doSubmit', this.formData)
const resp = await $.post(loc() + '/doSubmit', {line: JSON.stringify(this.formData)})
loading.close()
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$confirm('需要将该线路设置为出行线路吗?', '提示', {
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()
})*/
this.$refs.guava.index()
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.$message.warning(resp.msg)
this.notifyWarning(resp.msg)
}
},
async lineStatusChange(id) {
@@ -827,9 +844,6 @@ layout("/layouts/platform.html"){
},
async initPageData() {
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.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode')
this.unionOptions = await getUnions(null)
@@ -880,18 +894,18 @@ layout("/layouts/platform.html"){
data.append("file", val.raw, val.raw.name);
});
this.importLoading = true
const resp = await $.post(loc() + "/travelLineImport",data)
if (resp.code === 0){
const resp = await $.post(loc() + "/travelLineImport", data)
if (resp.code === 0) {
this.pageData();
this.importVisible = false
}else {
} else {
this.notifyWarning("导入失败")
this.importLoading = false
}
},
handleChangeYear(){
if (this.pageForm.startYear && this.pageForm.endYear){
if (this.pageForm.startYear > this.pageForm.endYear){
handleChangeYear() {
if (this.pageForm.startYear && this.pageForm.endYear) {
if (this.pageForm.startYear > this.pageForm.endYear) {
this.pageForm.endYear = '';
this.$message.error('起始年份需小于结束年份!');
}
@@ -910,7 +924,7 @@ layout("/layouts/platform.html"){
},
async created() {
await this.getModifyConfig()
this.pageForm.startYear = this.modifyConfig.provinceStartYear+''
this.pageForm.startYear = this.modifyConfig.provinceStartYear + ''
await this.initPageData()
this.pageData()
}
@@ -48,7 +48,7 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="旅行社列表">
<template #func>
<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>
</template>
</table-tool>
@@ -117,11 +117,21 @@ layout("/layouts/platform.html"){
</el-form-item>
</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 label="旅行社地点" prop="travelAgencyPlaces">
<el-select
v-model="formData.travelAgencyPlaces"
multiple
filterable
allow-create
default-first-option
placeholder="请创建旅行社地点" style="width: 100%">
<el-option
v-for="(item,index) in travelAgencyPlaceList"
:key="index"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@@ -178,8 +188,11 @@ layout("/layouts/platform.html"){
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="移动端缩略图" prop="files">
<image-Upload :height="100" :width="100" :limit="1" :file-type="['png', 'jpg']" :file-size="1"
v-model="formData.files"></image-Upload>
<file-upload :files.sync="formData.files"
picture_card
:max="1"
:type="['jpg', 'jpeg', 'png']"
></file-upload>
</el-form-item>
</el-col>
</el-row>
@@ -300,7 +313,7 @@ layout("/layouts/platform.html"){
{type: 'url', message: '请输入正确的官网地址', trigger: ['blur', 'change']}],
note: [{required: false, message: '请输入备注', trigger: ['change', 'blur']}],
year: [{required: true, message: '请选择年度', trigger: ['change', 'blur']}],
signUpTravelAgency: [{required: true, message: '请选择是否自由组团', trigger: ['change', 'blur']}],
travelAgencyPlaces: [{required: true, message: '请选择旅行社地点', trigger: ['change', 'blur']}],
//files: [{required: true, message: '请上传移动端缩略图', trigger: ['change', 'blur']}],
},
viewData: {},
@@ -314,8 +327,7 @@ layout("/layouts/platform.html"){
officialWebsite: null,
note: null,
year: null,
isDisabled: false,
signUpTravelAgency: false
isDisabled: false
},
pageForm: {
keywords: null,
@@ -325,6 +337,10 @@ layout("/layouts/platform.html"){
importVisible: false,
importLoading: false,
importData: {},
travelAgencyPlaceList: ["温州", "金华", "四川", "江苏", "宁波", "舟山", "青海(海西州)"
, "安徽", "丽水", "台州", "吉林", "江西", "绍兴", "衢州", "新疆", "福建", "上海", "杭州", "嘉兴",
"湖州", "重庆(涪陵区)", "重庆(万州区)", "湖北(恩施州)", "湖北(黄冈市)"]
}
},
computed: {
@@ -349,22 +365,20 @@ layout("/layouts/platform.html"){
officialWebsite: null,
note: null,
year: null,
isDisabled: false,
signUpTravelAgency: false,
isDisabled: false
}
})
},
async openEdit(row) {
const cloneData = clone(row)
cloneData.year = cloneData.year.toString()
cloneData.files = JSON.parse(cloneData.files)
cloneData.travelAgencyPlaces = JSON.parse(cloneData.travelAgencyPlaces)
this.formData = {...cloneData}
this.editDialogVisible = true
},
async doSubmit() {
const valid = await this.$refs['form'].validate()
if (!valid) return
this.formData.files=JSON.stringify(this.formData.files)
const resp = await $.post(loc() + '/doSubmit', {travelAgency: JSON.stringify(this.formData)})
if (resp.code === 0) {
this.editDialogVisible = false
@@ -423,28 +437,15 @@ layout("/layouts/platform.html"){
});
this.importLoading = true
$.ajax({
url: loc() + '/travelAgencyImport',
type: "post",
data: data,
processData: false,
contentType: false,
success: (resp) => {
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
}
})
const resp = await $.post(loc() + '/travelAgencyImport', data)
if (resp.code === 0) {
this.pageData();
this.importVisible = false
this.importLoading = false
} else {
this.notifyWarning("导入失败")
this.importLoading = false
}
},
},
async created() {
@@ -0,0 +1,198 @@
const editForm = {
template: /*language=HTML*/ `
<el-dialog title="编辑" :visible.sync="visible" top="50px">
<el-form :model="formData" label-width="120px" :formRules="formRules" ref="formRef"
style="margin-right: 40px">
<el-row>
<el-col span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="formData.loginName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="formData.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="formData.mobile" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="身份证号">
<el-input v-model="formData.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="formData.unionName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="unitName" label="单位">
<el-input v-model="formData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="prop" :label="labelName">
<template v-if="config.familyInfo == 2">
<el-collapse v-model="activeNames">
<el-collapse-item title="点击可展开详细信息" name="1">
<el-card shadow="never">
<el-table :data="formData.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"></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="formData.bedType" readonly></el-input>
</template>
</el-form-item>
<el-form-item prop="travelLine" :label="lineLabelName">
<el-select v-model="formData.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="formData.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>
<template #footer>
<div class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
</div>
</template>
</el-dialog>
`,
data() {
return {
visible: false,
year: null,
config: {},
formData: {},
formRules: {},
labelName: null,
lineLabelName: '线路',
unionSelectLines: [],
activeNames: []
}
},
methods: {
async onOpen(id, year) {
this.year = year
this.visible = true
this.getUnionSelectLine()
await this.getModifyConfig()
const {code, msg, data} = await $.get("/platform/theRapyRecuperation/branchUnionUserQuery/findOne", {id})
if (code === 0) {
this.formData = data
if (this.config.familyInfo === 2) {
this.labelName = "家属信息"
} else {
this.editFormData.bedType = data.familyNumber
this.labelName = "家属数量"
}
} else {
this.$message.error(msg)
}
},
async getModifyConfig() {
const {code, data, msg} = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (code === 0) {
this.config = data
} else {
this.$message.error(msg)
}
},
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
year: this.year,
signUpMode: 1,
})
if (resp.code === 0) {
this.unionSelectLines = 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.formData.takePartInLineId = ''
}
},
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm('您确定要修改报名信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
if (!this.formData.takePartInLineId && !this.formData.takePartInBaseManagementId) {
this.$message.warning('请选择线路')
return
}
const {code,msg} = await $.post('/platform/theRapyRecuperation/user/query/doEdit', this.formData)
if (code === 0) {
this.$message.success(msg)
this.visible = false
this.$emit('refresh')
} else {
this.$message.error(msg)
}
}).catch()
}
})
}
}
};
@@ -0,0 +1,454 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.filter-container {
margin-bottom: 20px;
border-radius: 4px;
}
.filter-container .el-form {
padding: 10px 15px;
}
/* Flex布局样式 */
.form-row {
display: flex;
gap: 20px;
margin-bottom: 22px;
flex-wrap: wrap;
}
.form-row .el-form-item {
flex: 1;
min-width: 240px;
margin-bottom: 0;
}
.flex-grow-1 {
flex: 1;
}
.route-line {
display: flex;
align-items: center;
margin-bottom: 22px;
}
.route-line-title {
width: 90px;
text-align: right;
padding-right: 12px;
color: #606266;
font-size: 14px;
line-height: 40px;
}
.route-line-content {
flex: 1;
}
.route-radio-group {
display: flex;
flex-wrap: wrap;
gap: 15px;
}
.route-radio-group .el-radio {
margin-right: 0;
margin-bottom: 10px;
}
.button-container {
display: flex;
justify-content: center;
padding-top: 15px;
border-top: 1px dashed #ebeef5;
}
.button-container .el-button {
padding-left: 25px;
padding-right: 25px;
margin: 0 15px;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" class="filter-container">
<el-form :model="pageForm" ref="pageFormRef" label-width="90px" size="medium">
<div class="form-row">
<el-form-item label="年度">
<el-date-picker
v-model="pageForm.year"
type="year"
placeholder="选择年度"
value-format="yyyy"
style="width: 100%">
</el-date-picker>
</el-form-item>
<el-form-item label="姓名">
<el-input v-model="pageForm.userName" placeholder="请输入姓名" clearable
prefix-icon="el-icon-user"></el-input>
</el-form-item>
<el-form-item label="工号">
<el-input v-model="pageForm.loginName" placeholder="请输入工号" clearable
prefix-icon="el-icon-postcard"></el-input>
</el-form-item>
</div>
<div class="route-line">
<div class="route-line-title">报名线路</div>
<div class="route-line-content">
<el-radio-group v-model="pageForm.signUpMode" class="route-radio-group" size="small"
@change="signUpModeChange">
<el-radio :label="1" border>校工会线路</el-radio>
<el-radio :label="2" border>本分工会线路本工会人员</el-radio>
<el-radio :label="3" border>其他工会线路本工会人员</el-radio>
<el-radio :label="4" border>个人组织线路</el-radio>
</el-radio-group>
</div>
</div>
<div class="route-line">
<div class="route-line-title">区域</div>
<div class="route-line-content">
<el-radio-group @change="doSearch"
size="small"
v-model="pageForm.regionalNature">
<el-radio label="" border>全部</el-radio>
<el-radio label="省内" border>省内</el-radio>
<el-radio label="省外" border>省外</el-radio>
</el-radio-group>
</div>
</div>
<div class="form-row">
<el-form-item label="线路选择">
<el-select v-model="pageForm.takePartInLineId" placeholder="请选择线路" clearable
style="width: 100%">
<el-option
v-for="item in takePartInLines"
:key="item.takePartInLineId"
:label="item.lineName+''+item.unionName+''"
:value="item.takePartInLineId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="标段">
<el-select v-model="pageForm.lotId" placeholder="请选择标段" clearable style="width: 100%">
<el-option
v-for="item in config.lots"
:key="item.id"
:label="item.lotName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item class="flex-grow-1">
<!-- 占位,保持布局平衡 -->
</el-form-item>
</div>
<div class="button-container">
<el-button type="primary" icon="el-icon-search" round @click="doSearch">查询</el-button>
<el-button icon="el-icon-refresh" round @click="resetQuery">重置</el-button>
</div>
</el-form>
</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" @click="openImport" size="small" type="primary">参加人员导入-->
<!-- </el-button>-->
<el-button icon="el-icon-s-promotion" size="small" type="primary" @click="doExport">
导出
</el-button>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="openSetUpPart"
>设置参加人员
</el-button>
</template>
</table-tool>
<el-table :data="tableData" row-key="id" style="width: 100%" ref="tableRef">
<el-table-column reserve-selection type="selection" width="55"></el-table-column>
<el-table-column align="center" header-align="center" type="index" label="序号" :index="indexMethod"
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=='lineName'">
<el-link type="primary" @click="openLine(row)">{{row.lineName}}
</el-link>
</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=='lineNum'">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.lineNum}}{{row.signUpUserFamilyNum}}
</el-link>
<el-link v-else type="primary">
{{row.lineNum}}{{row.familyNumber}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='signUpMode'">
{{signUpModeName(row.signUpMode)}}
</template>
<template scope="{row}" v-else-if="column.prop=='agencyNum'">
<el-link type="primary" @click="openApplyUser(row)">{{row.agencyNum}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='times'">
<div v-if="row.playStartTime">{{row.playStartTime}}</div>
<div v-else>{{row.playStartTime1}}</div>
</template>
<template scope="{row}" v-else-if="column.prop=='isTakePartIn'">
{{row.isTakePartIn?'已参加':'未参加'}}
</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>
<template scope="{row}" v-else-if="column.prop=='lineOrMaName'">
{{row.lineName?row.lineName:row.baseName?row.baseName:row.travelAgencyName}}
</template>
<template scope="{row:{officialWebsite}}"
v-else-if="column.prop==='officialWebsite'">
<a :href="officialWebsite" class="text-primary" target="_blank">
{{officialWebsite}}
</a>
</template>
</el-table-column>
<el-table-column v-if="pageForm.state=='1'||pageForm.state=='3'" align="center"
prop="lotName"
show-overflow-tooltip
header-align="center"
label="标段"
sortable>
<template scope="{row}">
{{row.lotName}}
</template>
</el-table-column>
<el-table-column label="操作" width="250px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑
</el-button>
<el-button @click="onDelete(row)" size="mini" type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog title="查看报名信息" :visible.sync="viewVisible" top="50px">
<enroll-info ref="viewEnrollInfoRef" :union_id="unionId"></enroll-info>
</el-dialog>
<set-up-part ref="setUpRef"></set-up-part>
<edit-form ref="editRef" @refresh="doSearch"></edit-form>
</div>
<script>
<!--#include('setUpPart.js'){}#-->
<!--#include('editForm.js'){}#-->
new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=' + new Date().getTime()),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue'),
'set-up-part': setUpPart,
'edit-form': editForm
},
data() {
return {
pageForm: {
year: new Date().getFullYear().toString(),
loginName: '',
userName: '',
takePartInLineId: '',
unionId: '',
signUpMode: 1,
lotId: '',
regionalNature: '',
},
takePartInLines: [],
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: '是否参加'}
],
viewVisible: false,
unionId: null,
unionOptions: [],
config: {}
}
},
methods: {
handleQuery() {
console.log('查询参数:', this.pageForm);
// 查询逻辑
},
resetQuery() {
this.pageForm = {
year: new Date().getFullYear().toString(),
loginName: '',
userName: '',
takePartInLineId: '',
unionId: '',
signUpMode: 1,
lotId: '',
regionalNature: '',
pageNumber: 1,
pageSize: 10,
totalCount: 0,
}
this.doSearch()
},
signUpModeName(val) {
return null
},
openApplyUser(row) {
},
openView(row) {
this.viewVisible = true
this.$nextTick(() => {
this.$refs.viewEnrollInfoRef.openView(row.id)
})
},
openEdit(row) {
this.$refs.editRef.onOpen(row.id)
},
onDelete(row) {
this.$confirm("您确定要删除【<span style='color: red'>" + row.userName + "</span>】的信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(async () => {
const {
code,
msg
} = await $.post('/platform/theRapyRecuperation/branchUnionUserQuery/deleteMyEnrollInfoById', {
id: row.id
})
if (code === 0) {
this.doSearch()
this.$message.success(msg)
} else {
this.$message.warning(resp.msg)
}
})
},
openImport() {
},
doExport() {
const {year, userName, loginName, signUpMode, regionalNature, takePartInLineId, lotId} = this.pageForm
debugger
window.open('/platform/theRapyRecuperation/branchUnionUserQuery/exportXlsx?year=' +
year
+ '&userName=' + userName
+ '&loginName=' + loginName
+ '&signUpMode=' + signUpMode
+ '&regionalNature=' + regionalNature
+ '&takePartInLineId=' + takePartInLineId
+ '&lotId=' + lotId)
},
// 打开设置参加人员
openSetUpPart() {
const selection = this.$refs.tableRef.selection
console.log(selection)
if (selection.length === 0) {
this.$message.error('请选择要设置的人员')
return
}
this.$refs.setUpRef.onOpen(selection)
},
getConfig() {
$.post('/platform/theRapyRecuperation/TheRapyConfig/findOne').then((res) => {
if (res.code === 0) {
this.config = res.data
}
})
},
signUpModeChange(val) {
this.pageForm.takePartInLineId = ''
this.getLines()
this.doSearch()
},
getLines() {
$.post('/platform/theRapyRecuperation/branchUnionUserQuery/listLine', {
year: this.pageForm.year,
signUpMode: this.pageForm.signUpMode,
regionalNature: this.pageForm.regionalNature
}).then(res => {
if (res.code === 0) {
this.takePartInLines = res.data
} else {
this.$message.error(res.msg)
}
})
}
},
async created() {
this.getLines()
this.doSearch()
this.getConfig()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,147 @@
const setUpPart = {
template: /*language=HTML*/ `
<el-dialog :visible.sync="visible" title="设置参加人员" top="50px">
<el-row class="text-primary p20">
选择标段/参加时间设置前请先勾选需要设置的用户
</el-row>
<el-row type="flex" style="column-gap: 10px">
<el-select v-model="lotId" filterable clearable
placeholder="请选择标段"
style="width: 100%"
@change="lotChange">
<el-option v-for="item in config.lots"
:key="item.id"
:label="item.lotName"
:value="item.id">
</el-option>
</el-select>
<el-date-picker
v-model="takePartInTime"
type="date"
style="width: 100%"
@change="takePartInTimeChange"
value-format="yyyy-MM-dd"
placeholder="请选择参加时间">
</el-date-picker>
</el-row>
<el-row class="mt10">
<el-table :data="tableData" border ref="tableRef" row-key="id">
<el-table-column type="selection" width="55"></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="userName" 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="signingUptime" label="报名时间"></el-table-column>
<el-table-column prop="takePartInTime" label="参加时间"></el-table-column>
<el-table-column prop="lotName" label="标段"></el-table-column>
</el-table>
</el-row>
<template #footer>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="onSubmit">确定</el-button>
</template>
</el-dialog>
`,
data() {
return {
visible: false,
config: {},
tableData: [],
lotId: null,
takePartInTime: null
}
},
methods: {
onOpen(selection) {
this.visible = true
this.tableData = JSON.parse(JSON.stringify(selection))
this.getModifyConfig()
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.config = res.data
}
},
// 标段改变
lotChange(val) {
const selection = this.$refs.tableRef.selection
if (selection.length === 0) {
this.$message.error('请选择要设置的人员')
this.lotId = null
return
}
if (!val) {
this.$refs.tableRef.clearSelection()
return
}
const lot = this.config.lots.find(v => v.id === val)
this.tableData.map((v, index) => {
this.$set(this.tableData[index], "lotId", val)
this.$set(this.tableData[index], "lotName", lot.lotName)
})
},
// 参加时间改变
takePartInTimeChange(val) {
const selection = this.$refs.tableRef.selection
if (selection.length === 0) {
this.$message.error('请选择要设置的人员')
this.takePartInTime = null
return
}
if (!val) {
this.$refs.tableRef.clearSelection()
return
}
this.tableData.map((v, index) => {
this.$set(this.tableData[index], "takePartInTime", val)
})
},
// 确定提交
onSubmit() {
// 检查哪几条数据填写不完整
this.tableData.forEach((v, index) => {
if (!v.lotId || !v.takePartInTime) {
this.$message.error('第' + (index + 1) + '行数据填写不完整')
return
}
})
const data = this.tableData.map((v, index) => {
return{
lotId: v.lotId,
takePartInTime: v.takePartInTime,
id: v.id
}
})
this.$confirm('确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const {
code,
msg
} = await $.post("/platform/theRapyRecuperation/branchUnionUserQuery/setUpParticipants", {data: JSON.stringify(data)})
if (code === 0) {
this.$message.success(msg)
this.$refs.tableRef.clearSelection()
this.visible = false
} else {
this.$message.error(msg)
}
})
}
}
};
@@ -0,0 +1,393 @@
<!--#
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;
}
.descriptions-form .el-form-item {
margin-bottom: 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="8">
<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="8">
<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="8">
<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="8">
<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-col :span="8">
<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="8">
<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-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="8">
<span>组织形式:</span>
<el-select v-model="pageForm.signUpMode" filterable clearable
placeholder="请选择组织形式"
style="width: 80%" @change="doSearch">
<el-option label="个人组织" value="3"></el-option>
<el-option label="分工会组织" value="1"></el-option>
<el-option label="校工会组织" value="2"></el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="审核列表">
<template #func>
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="mini" class="mr5">
<el-radio-button :label="0">全部</el-radio-button>
<el-radio-button :label="1">已审核</el-radio-button>
<el-radio-button :label="2">未审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData">
<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=='signUpMode'">
<span v-if="row.signUpMode == '1'">分工会组织</span>
<span v-if="row.signUpMode == '2'">校工会组织</span>
<span v-if="row.signUpMode == '3'">个人组织</span>
</template>
<template scope="{row}" v-else-if="column.prop=='lineNum'">
<template v-if="!row.familyNumber" type="primary" >
{{row.lineNum + row.signUpUserFamilyNum}}{{row.signUpUserFamilyNum}}
</template>
<template v-else type="primary">
{{row.lineNum + row.familyNumber}}{{row.familyNumber}}
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template scope="{row}">
<el-button type="primary" size="mini" @click="openView(row)">查看</el-button>
<el-button type="primary" size="mini" @click="openAudit(row)"
:disabled="row.auditState!==7712">审核
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<line-audit-info ref="lineAuditViewInfo"></line-audit-info>
</template>
<template #edit>
<line-audit-info ref="lineAuditInfo" label="校工会审核" handle>
<template #handle>
<el-form :model="formData" ref="form" label-width="120px">
<el-descriptions border class="descriptions-form" :column="2">
<el-descriptions-item label="审核人">
<el-form-item label-width="0">
<el-input value="${@shiro.getPrincipalProperty('username')}" readonly></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="审核时间">
<el-form-item label-width="0">
<el-input :value="moment().format('YYYY-MM-DD')" readonly></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="审核意见" :span="2">
<el-form-item label-width="0" prop="auditOpinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="formData.auditOpinion" maxlength="500"
type="textarea"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
<el-row type="flex" justify="end" align="center" style="padding: 20px">
<el-button @click="doBack" type="info">退回</el-button>
<el-button @click="doPass" type="primary">通过</el-button>
</el-row>
</el-form>
</template>
</line-audit-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
startYear: moment().format('YYYY'),
endYear: moment().format('YYYY'),
regionalNature: '',
signUpMode: '',
lotId: '',
takePartInLineId: '',
selectId: '',
isAudit: 2
},
unions: [],
lineList: [],
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: 'signUpMode', label: '组织形式', sortable: true},
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'username', label: '发起人', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'estimatedFamilyNumbers', label: '最少成团人数', width: 80},
{prop: 'lineNum', label: '报名人数(家属)'},
{prop: 'stateName', label: '审核状态'},
],
userPageForm: {
pageNumber: 1,
pageSize: 10
},
modifyConfig: {}
}
},
components: {
'line-audit-info': httpVueLoader('/components/theRapyRecuperation/LineAuditInfo.vue?v=' + new Date().getTime()),
},
methods: {
validateForm() {
return new Promise(resolve => {
this.$refs.form.validate(valid => {
resolve(valid)
})
})
},
async doPass() {
const valid = await this.validateForm()
if (!valid) return
this.$confirm('您确定通过吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/doPass', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
async doBack() {
const valid = await this.validateForm()
if (!valid) return
this.$confirm('您确定退回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/doBack', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
openAudit(row) {
this.formData = {
id: row.lineUId
}
this.$refs.guava.edit();
this.$refs.lineAuditInfo.init(row)
},
openView(row) {
this.$refs.guava.view();
this.$refs.lineAuditViewInfo.init(row)
},
lineTypeChange() {
this.pageForm.takePartInLineId = ''
this.getUnionSelectLine()
this.doSearch()
},
async getLinePlayTimeByLineId(id) {
const resp = await $.get('/platform/theRapyRecuperation/enrollAudit/commonAudit/getLinePlayTimeByLineId', {
lineId: id,
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear,
flag: true
})
if (resp.code === 0) {
this.linePlayTimes = resp.data
}
},
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/enrollAudit/commonAudit/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 lineChange(val) {
this.pageForm.selectId = ''
await this.getLinePlayTimeByLineId(val);
await this.doSearch()
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
async playChange() {
await this.doSearch()
},
},
async created() {
this.unions = await getUnions()
await this.getModifyConfig();
await this.getUnionSelectLine();
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,379 @@
<!--#
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;
}
.descriptions-form .el-form-item {
margin-bottom: 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.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-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.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-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-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.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-col :span="12">
<span>组织形式:</span>
<el-select v-model="pageForm.signUpMode" filterable clearable
placeholder="请选择组织形式"
style="width: 80%" @change="doSearch">
<el-option label="个人组织" value="3"></el-option>
<el-option label="分工会组织" value="1"></el-option>
<el-option label="校工会组织" value="2"></el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="审核列表">
<template #func>
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="mini" class="mr5">
<el-radio-button :label="0">全部</el-radio-button>
<el-radio-button :label="1">已审核</el-radio-button>
<el-radio-button :label="2">未审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData">
<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=='signUpMode'">
<span v-if="row.signUpMode == '1'">分工会组织</span>
<span v-if="row.signUpMode == '2'">校工会组织</span>
<span v-if="row.signUpMode == '3'">个人组织</span>
</template>
<template scope="{row}" v-else-if="column.prop=='lineNum'">
<template v-if="!row.familyNumber" type="primary" >
{{row.lineNum + row.signUpUserFamilyNum}}{{row.signUpUserFamilyNum}}
</template>
<template v-else type="primary">
{{row.lineNum + row.familyNumber}}{{row.familyNumber}}
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template scope="{row}">
<el-button type="primary" size="mini" @click="openView(row)">查看</el-button>
<el-button type="primary" size="mini" @click="openAudit(row)"
:disabled="row.auditState!==7700">审核
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<line-audit-info ref="lineAuditViewInfo"></line-audit-info>
</template>
<template #edit>
<line-audit-info ref="lineAuditInfo" label="分工会审核" handle>
<template #handle>
<el-form :model="formData" ref="form" label-width="120px">
<el-descriptions border class="descriptions-form" :column="2">
<el-descriptions-item label="审核人">
<el-form-item label-width="0">
<el-input value="${@shiro.getPrincipalProperty('username')}" readonly></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="审核时间">
<el-form-item label-width="0">
<el-input :value="moment().format('YYYY-MM-DD')" readonly></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="审核意见" :span="2">
<el-form-item label-width="0" prop="auditOpinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="formData.auditOpinion" maxlength="500"
type="textarea"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
<el-row type="flex" justify="end" align="center" style="padding: 20px">
<el-button @click="doBack" type="info">退回</el-button>
<el-button @click="doPass" type="primary">通过</el-button>
</el-row>
</el-form>
</template>
</line-audit-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
startYear: moment().format('YYYY'),
endYear: moment().format('YYYY'),
regionalNature: '',
signUpMode: '',
lotId: '',
takePartInLineId: '',
selectId: '',
isAudit: 2
},
unions: [],
lineList: [],
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: 'signUpMode', label: '组织形式', sortable: true},
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'username', label: '发起人', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'estimatedFamilyNumbers', label: '最少成团人数', width: 80},
{prop: 'lineNum', label: '报名人数(家属)'},
{prop: 'stateName', label: '审核状态'},
],
userPageForm: {
pageNumber: 1,
pageSize: 10
},
modifyConfig: {}
}
},
components: {
'line-audit-info': httpVueLoader('/components/theRapyRecuperation/LineAuditInfo.vue?v=' + new Date().getTime()),
},
methods: {
validateForm() {
return new Promise(resolve => {
this.$refs.form.validate(valid => {
resolve(valid)
})
})
},
async doPass() {
const valid = await this.validateForm()
if (!valid) return
this.$confirm('您确定通过吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/doPass', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
async doBack() {
const valid = await this.validateForm()
if (!valid) return
this.$confirm('您确定退回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/doBack', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
openAudit(row) {
this.formData = {
id: row.lineUId
}
this.$refs.guava.edit();
this.$refs.lineAuditInfo.init(row)
},
openView(row) {
this.$refs.guava.view();
this.$refs.lineAuditViewInfo.init(row)
},
lineTypeChange() {
this.pageForm.takePartInLineId = ''
this.getUnionSelectLine()
this.doSearch()
},
async getLinePlayTimeByLineId(id) {
const resp = await $.get('/platform/theRapyRecuperation/enrollAudit/commonAudit/getLinePlayTimeByLineId', {
lineId: id,
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear,
flag: true
})
if (resp.code === 0) {
this.linePlayTimes = resp.data
}
},
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/enrollAudit/commonAudit/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 lineChange(val) {
this.pageForm.selectId = ''
await this.getLinePlayTimeByLineId(val);
await this.doSearch()
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
async playChange() {
await this.doSearch()
},
},
async created() {
await this.getModifyConfig();
await this.getUnionSelectLine();
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,379 @@
<!--#
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;
}
.descriptions-form .el-form-item {
margin-bottom: 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.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-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.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-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-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.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-col :span="12">
<span>组织形式:</span>
<el-select v-model="pageForm.signUpMode" filterable clearable
placeholder="请选择组织形式"
style="width: 80%" @change="doSearch">
<el-option label="个人组织" value="3"></el-option>
<el-option label="分工会组织" value="1"></el-option>
<el-option label="校工会组织" value="2"></el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="审核列表">
<template #func>
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="mini" class="mr5">
<el-radio-button :label="0">全部</el-radio-button>
<el-radio-button :label="1">已审核</el-radio-button>
<el-radio-button :label="2">未审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData">
<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=='signUpMode'">
<span v-if="row.signUpMode == '1'">分工会组织</span>
<span v-if="row.signUpMode == '2'">校工会组织</span>
<span v-if="row.signUpMode == '3'">个人组织</span>
</template>
<template scope="{row}" v-else-if="column.prop=='lineNum'">
<template v-if="!row.familyNumber" type="primary" >
{{row.lineNum + row.signUpUserFamilyNum}}{{row.signUpUserFamilyNum}}
</template>
<template v-else type="primary">
{{row.lineNum + row.familyNumber}}{{row.familyNumber}}
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template scope="{row}">
<el-button type="primary" size="mini" @click="openView(row)">查看</el-button>
<el-button type="primary" size="mini" @click="openAudit(row)"
:disabled="row.auditState!==7707">审核
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<line-audit-info ref="lineAuditViewInfo"></line-audit-info>
</template>
<template #edit>
<line-audit-info ref="lineAuditInfo" label="单位领导审核" handle>
<template #handle>
<el-form :model="formData" ref="form" label-width="120px">
<el-descriptions border class="descriptions-form" :column="2">
<el-descriptions-item label="审核人">
<el-form-item label-width="0">
<el-input value="${@shiro.getPrincipalProperty('username')}" readonly></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="审核时间">
<el-form-item label-width="0">
<el-input :value="moment().format('YYYY-MM-DD')" readonly></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="审核意见" :span="2">
<el-form-item label-width="0" prop="auditOpinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="formData.auditOpinion" maxlength="500"
type="textarea"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
<el-row type="flex" justify="end" align="center" style="padding: 20px">
<el-button @click="doBack" type="info">退回</el-button>
<el-button @click="doPass" type="primary">通过</el-button>
</el-row>
</el-form>
</template>
</line-audit-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
startYear: moment().format('YYYY'),
endYear: moment().format('YYYY'),
regionalNature: '',
signUpMode: '',
lotId: '',
takePartInLineId: '',
selectId: '',
isAudit: 2
},
unions: [],
lineList: [],
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: 'signUpMode', label: '组织形式', sortable: true},
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'username', label: '发起人', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'estimatedFamilyNumbers', label: '最少成团人数', width: 80},
{prop: 'lineNum', label: '报名人数(家属)'},
{prop: 'stateName', label: '审核状态'},
],
userPageForm: {
pageNumber: 1,
pageSize: 10
},
modifyConfig: {}
}
},
components: {
'line-audit-info': httpVueLoader('/components/theRapyRecuperation/LineAuditInfo.vue?v=' + new Date().getTime()),
},
methods: {
validateForm() {
return new Promise(resolve => {
this.$refs.form.validate(valid => {
resolve(valid)
})
})
},
async doPass() {
const valid = await this.validateForm()
if (!valid) return
this.$confirm('您确定通过吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/doPass', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
async doBack() {
const valid = await this.validateForm()
if (!valid) return
this.$confirm('您确定退回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/doBack', this.formData)
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
openAudit(row) {
this.formData = {
id: row.lineUId
}
this.$refs.guava.edit();
this.$refs.lineAuditInfo.init(row)
},
openView(row) {
this.$refs.guava.view();
this.$refs.lineAuditViewInfo.init(row)
},
lineTypeChange() {
this.pageForm.takePartInLineId = ''
this.getUnionSelectLine()
this.doSearch()
},
async getLinePlayTimeByLineId(id) {
const resp = await $.get('/platform/theRapyRecuperation/enrollAudit/commonAudit/getLinePlayTimeByLineId', {
lineId: id,
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear,
flag: true
})
if (resp.code === 0) {
this.linePlayTimes = resp.data
}
},
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/enrollAudit/commonAudit/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 lineChange(val) {
this.pageForm.selectId = ''
await this.getLinePlayTimeByLineId(val);
await this.doSearch()
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
async playChange() {
await this.doSearch()
},
},
async created() {
await this.getModifyConfig();
await this.getUnionSelectLine();
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,332 @@
<!--#
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="8">
<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="8">
<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-col :span="8">
<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-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="8">
<span>线&emsp;&emsp;路:</span>
<el-select v-model="pageForm.takePartInLineId" filterable clearable
placeholder="请选择线路"
style="width: 80%" @change="doSearch">
<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-col :span="8">
<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="8">
<span>&nbsp;&nbsp;&nbsp;&nbsp;人:</span>
<el-input placeholder="请输入发起人姓名/工号" v-model="pageForm.searchKeyword"
style="width: 80%" clearable>
<el-button slot="append" icon="el-icon-search" @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="8">
<span>组织形式:</span>
<el-select v-model="pageForm.signUpMode" filterable
placeholder="请选择组织形式"
style="width: 80%"
@change="doSearch">
<el-option label="校工会组织" value="2"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}"></el-option>
<el-option label="分工会组织" value="1"></el-option>
<el-option label="个人组织" value="3"></el-option>
</el-select>
</el-col>
<el-col :span="8">
<span>&nbsp;&nbsp;&nbsp;&nbsp;社:</span>
<el-select clearable filterable style="width: 80%" v-model="pageForm.travelAgencyId"
placeholder="请选择旅行社" @change="doSearch();$set(pageForm,'travelAgencyPlace','')">
<el-option :key="item.id"
:label="item.travelAgencyName+'('+ item.year +'年)'"
:value="item.id"
v-for="item in travelAgencyList"
></el-option>
</el-select>
</el-col>
<el-col :span="8">
<span>&emsp;&emsp;点:</span>
<el-select clearable filterable style="width: 80%" v-model="pageForm.travelAgencyPlace"
placeholder="请选择旅行社地点" @change="doSearch">
<el-option :key="index"
:label="item"
:value="item"
v-for="(item,index) in (travelAgencyList.find(v => v.id === pageForm.travelAgencyId) ?? {}).travelAgencyPlaces"
></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>
</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=='signUpMode'">
<span v-if="row.signUpMode == '1'">分工会组织</span>
<span v-if="row.signUpMode == '2'">校工会组织</span>
<span v-if="row.signUpMode == '3'">个人组织</span>
</template>
<template scope="{row}" v-else-if="column.prop=='lineNum'">
<template v-if="!row.familyNumber" type="primary">
{{row.lineNum + row.signUpUserFamilyNum}}{{row.signUpUserFamilyNum}}
</template>
<template v-else type="primary">
{{row.lineNum + row.familyNumber}}{{row.familyNumber}}
</template>
</template>
<template scope="{row}" v-else-if="column.prop=='stateName'">
{{row.stateName?row.stateName:'待成团'}}
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<template>
<el-button @click="openLine(row)" size="mini" type="primary">
查看人员
</el-button>
</template>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #public>
<line-audit-info ref="lineAuditViewInfo"></line-audit-info>
</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: '',
},
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: 'travelAgencyPlace', label: '地点', sortable: true},
{prop: 'signUpMode', label: '组织形式', sortable: true},
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'username', label: '发起人', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'estimatedFamilyNumbers', label: '最少成团人数', width: 80},
{prop: 'lineNum', label: '报名人数(家属)'},
{prop: 'stateName', label: '审核状态'},
],
modifyConfig: {},
lineList: [],
unions: [],
signUpModeOptions: [
{label: '校工会组织', value: 2},
{label: '分工会组织', value: 1},
{label: '个人组织', value: 3},
],
travelAgencyList: []
}
},
components: {
'line-audit-info': httpVueLoader('/components/theRapyRecuperation/LineAuditInfo.vue?v=' + new Date().getTime()),
},
methods: {
lineTypeChange() {
this.pageForm.takePartInLineId = ''
this.getUnionSelectLine()
this.doSearch()
},
openLine(row) {
this.$refs.guava.public()
this.$refs.lineAuditViewInfo.init(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 selectTravelAgencyList() {
const {data} = await $.post("/platform/theRapyRecuperation/travelAgency/selectTravelAgencyByYears", {
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear
})
this.travelAgencyList = data
},
},
async created() {
this.unions = await getUnions()
await this.getModifyConfig();
await this.getUnionSelectLine();
await this.selectTravelAgencyList();
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -152,10 +152,10 @@ layout("/layouts/platform.html"){
<span>选择路线:</span>
<el-select v-model="pageForm.takePartInLineId" filterable clearable
placeholder="请选择线路"
style="width: 80%" @change="lineChange(pageForm.takePartInLineId); doSearch()">
style="width: 80%" @change="pageData()">
<el-option v-for="item in takePartInLines"
:key="item.id"
:label="item.lineName"
:label="item.lineName+''+item.unionname+''"
:value="item.id">
</el-option>
</el-select>
@@ -197,8 +197,8 @@ layout("/layouts/platform.html"){
<el-row v-if="!pageForm.state">
<el-col :span="24" style="color: red;margin-top: 10px">
<span>温馨提醒:当前操作查询是【本工会当年参加疗休养的人员(包含校工会线路)】和【其他工会选择本工会线路的疗休养人员】</span>
<!--<span>温馨提醒:当前操作查询是【本工会当年参加疗休养的人员(包含校工会线路)】</span>-->
<!-- <span>温馨提醒:当前操作查询是【本工会当年参加疗休养的人员(包含校工会线路)】和【其他工会选择本工会线路的疗休养人员】</span>-->
<span>温馨提醒:当前操作查询是【本工会当年参加疗休养的人员(包含校工会线路)】</span>
</el-col>
</el-row>
@@ -209,18 +209,6 @@ layout("/layouts/platform.html"){
v-if="pageForm.state=='1'||pageForm.state=='3'">
<el-col class="query-row-title"></el-col>
<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">
<span>选择标段:</span>
<el-select v-model="pageForm.lotId" filterable clearable
@@ -283,29 +271,12 @@ layout("/layouts/platform.html"){
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="userDrawer = true"
:disabled="multipleSelection.length==0"
class="mr5" v-if="pageForm.lb=='ry'||!pageForm.lb">设置参加人员
class="mr10" v-if="pageForm.lb=='ry'||!pageForm.lb">设置参加人员
</el-button>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="doReimbursement"
:disabled="multipleSelection.length==0"
class="mr5" v-if="pageForm.state == '2' && pageForm.lb == 'ry'">一键报销
@click="doExport"
class="mr10" v-if="pageForm.state">导出
</el-button>
<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-if="pageForm.state=='1'">
@@ -328,13 +299,13 @@ layout("/layouts/platform.html"){
width="55">
</el-table-column>
<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"
@@ -349,7 +320,7 @@ layout("/layouts/platform.html"){
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='isFamily'">
<el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
@@ -358,7 +329,7 @@ layout("/layouts/platform.html"){
</template>
<template scope="{row}" v-else-if="column.prop=='lineNum'">
<el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.lineNum}}{{row.signUpUserFamilyNum}}
</el-link>
<el-link v-else type="primary">
@@ -463,15 +434,8 @@ layout("/layouts/platform.html"){
<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>
<el-button @click="doDelete(row)" size="mini" type="danger">删除
</el-button>
</template>
</template>
@@ -521,18 +485,18 @@ layout("/layouts/platform.html"){
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
{{ row.bedInfo.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
{{ row.bedInfo.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
{{ row.bedInfo.otherSleepUser ?
row.bedInfo.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
@@ -557,7 +521,13 @@ layout("/layouts/platform.html"){
>
<template scope="{row}" v-if="column.prop=='isFamily'">
{{row.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>
<!--{{row.isFamily?'携带':'未携带'}}-->
</template>
</el-table-column>
<el-table-column label="操作" width="250px">
@@ -609,7 +579,7 @@ layout("/layouts/platform.html"){
<el-dialog
title="查看个人信息"
:visible.sync="userFindDialogVisible"
width="80%" top="2%">
width="80%">
<enroll-info ref="viewEnrollInfo" :union_id="unionId"></enroll-info>
<span slot="footer" class="dialog-footer">
<el-button @click="userFindDialogVisible = false" type="primary">关闭</el-button>
@@ -815,22 +785,22 @@ layout("/layouts/platform.html"){
<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="idCard"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
{{ row.bedInfo.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
{{ row.bedInfo.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
{{ row.bedInfo.otherSleepUser ?
row.bedInfo.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
@@ -844,7 +814,7 @@ layout("/layouts/platform.html"){
</template>
</el-form-item>
<el-form-item prop="travelName" label="旅行社" v-if="pageForm.state==='2'">
<!--<el-form-item prop="travelName" label="旅行社">
<el-select v-model="editFormData.agencyId" filterable clearable
placeholder="请选择旅行社"
@@ -855,8 +825,8 @@ layout("/layouts/platform.html"){
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="travelLine" :label="lineLabelName" v-if="pageForm.state==='1'">
</el-form-item>-->
<el-form-item prop="travelLine" :label="lineLabelName">
<el-select v-model="editFormData.takePartInLineId" filterable clearable
placeholder="请选择线路"
@change="validateLine"
@@ -901,7 +871,7 @@ layout("/layouts/platform.html"){
options2: [
{label: "本工会人员(自己线路)", value: "1"},
{label: "本工会人员(其他路线)", value: "2"},
{label: "其他工会人员(选我线路)", value: "3"},
// {label: "其他工会人员(选我线路)", value: "3"},
{label: "选择校工会线路人员", value: "4"}
],
jdList: [],
@@ -957,14 +927,13 @@ layout("/layouts/platform.html"){
],
options: [
{label: "线路", value: "1"},
{label: "旅行社", value: "2"},
// {label: "酒店", value: "3"},
// {label: "旅行社", value: "2"},
{label: "酒店", value: "3"},
],
unionDisabled: false,
unitDisabled: false,
modifyConfig: {},
multipleSelection: [],
linePlayTimes: [],
multipleSelection2: [],
//人员导入
importVisible: false,
@@ -995,82 +964,6 @@ layout("/layouts/platform.html"){
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
},
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)})
@@ -1099,12 +992,6 @@ layout("/layouts/platform.html"){
}
})
},
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('您确定要修改这位老师的报名信息吗?', '提示', {
@@ -1284,61 +1171,26 @@ layout("/layouts/platform.html"){
},
doExport() {
const {
searchName,
year,
searchName,
searchKeyword,
unionId,
unitId,
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/doExport?" +
"searchName=" + searchName +
"&searchKeyword=" + searchKeyword +
"&startYear=" + year +
"&endYear=" + year +
window.open(loc() + "/doExport?year=" + year +
"&searchName=" + searchName +
"&searchKeyword" + searchKeyword +
"&unionId=" + unionId +
"&unitId=" + unitId +
"&agencyId=" + agencyId +
"&specificTime=" + specificTime +
"&takePartInLineId=" + takePartInLineId +
"&state=" + state +
"&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)
"&lotId=" + lotId)
},
pageSizeChange(val) {
this.pageForm.pageNumber = val;
@@ -1380,9 +1232,10 @@ layout("/layouts/platform.html"){
},
async openApplyUser(row) {
debugger
sublime.showLoadingbar();
const pageForm = clone(this.pageFormUser)
pageForm.id = row.id
pageForm.id = this.pageForm.state === '1' ? row.selectId : row.id
pageForm.unionId = this.unionId
let url = this.pageForm.state === '1' ? '/platform/theRapyRecuperation/line/selectLineUser' : '/platform/theRapyRecuperation/query/selectAgencyUser'
$.post(url, pageForm, (data) => {
@@ -1449,13 +1302,11 @@ layout("/layouts/platform.html"){
{prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true},
{prop: 'lineOrMaName', label: '线路/旅行社', sortable: true},
//{prop: 'travelAgencyName', label: '旅行社', sortable: true},
{prop: 'lineOrMaName', label: '线路/酒店', sortable: true},
{prop: 'times', label: '出行时间'},
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'isTakePartIn', label: '是否参加'},
//{prop: 'reimbursementStatus', label: '是否报销'},
// {prop: 'stateId', label: '审核状态'},
]
this.getSelfUnionUser()
@@ -1478,11 +1329,11 @@ layout("/layouts/platform.html"){
this.tableColumns = [
{label: '年度', prop: 'year'},
{label: '旅行社名称', prop: 'travelAgencyName', sortable: true},
//{label: '旅行社编号', prop: 'serialNumber', sortable: true},
{label: '旅行社编号', prop: 'serialNumber', sortable: true},
{label: '联系人', prop: 'contact'},
{label: '联系人手机', prop: 'contactMobileNumber'},
{label: '邮箱', prop: 'email'},
//{label: '官网', prop: 'officialWebsite'},
{label: '官网', prop: 'officialWebsite'},
{label: '报名人数', prop: 'agencyNum', sortable: true},
]
this.getLxsData()
@@ -1491,7 +1342,7 @@ layout("/layouts/platform.html"){
this.tableColumns = [
{label: '年度', prop: 'year'},
{label: '酒店名称', prop: 'baseName', sortable: true},
//{label: '酒店编号', prop: 'serialNumber', sortable: true},
// {label: '酒店编号', prop: 'serialNumber', sortable: true},
{label: '联系人', prop: 'baseContactPerson'},
{label: '联系人手机', prop: 'baseContactNumber'},
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},
@@ -1502,33 +1353,17 @@ layout("/layouts/platform.html"){
this.getJdData()
await this.getJdList()
} else {
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: 'isTakePartIn', 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: '审核状态'},
]
}
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: 'stateId', label: '审核状态'},
]
await this.getRyData()
}
await this.getApplyNum()
@@ -1550,6 +1385,11 @@ layout("/layouts/platform.html"){
year: this.pageForm.year,
state: this.pageForm.state2
})
data.forEach(v => {
if (!v.unionname) {
v.unionname = '校工会'
}
})
this.takePartInLines = data
},
async getAgencyList() {
@@ -1637,8 +1477,7 @@ layout("/layouts/platform.html"){
state2: this.pageForm.state2,
regionalNature: this.pageForm.regionalNature,
takePartInLineId: this.pageForm.takePartInLineId,
year: this.pageForm.year,
selectId: this.pageForm.selectId
year: this.pageForm.year
})
this.applyNum = data
},
@@ -1651,9 +1490,10 @@ layout("/layouts/platform.html"){
this.options2 = [
{label: "本工会人员(自己线路)" + data.count1 + "人", value: "1"},
{label: "本工会人员(其他路线)" + data.count2 + "人", value: "2"},
{label: "其他工会人员(选我线路)" + data.count3 + "人", value: "3"},
// {label: "其他工会人员(选我线路)" + data.count3 + "人", value: "3"},
{label: "选择校工会线路人员" + data.count4 + "人", value: "4"}
]
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
@@ -1707,7 +1547,7 @@ layout("/layouts/platform.html"){
this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode')
this.unionOptions = await getUnions()
await this.getApplyNumAudit()
if ("${@shiro.hasRole('H04')}" === 'true' && "${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'false') {
if ("${@shiro.hasRole('H04')}" === 'true' && "${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}" === 'false') {
await this.getBmUserUnion()
if (this.unionOptions && this.unionOptions.length > 0) {
const union = this.unionOptions.find(v => v.id === this.unionId)
@@ -47,7 +47,7 @@ layout("/layouts/platform.html"){
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 38%" @change="getUnionSelectLine(); doSearch()">
style="width: 38%" @change="doSearch">
</el-date-picker>
<span></span>
<el-date-picker
@@ -56,7 +56,7 @@ layout("/layouts/platform.html"){
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 38%" @change="getUnionSelectLine(); doSearch()">
style="width: 38%" @change="doSearch">
</el-date-picker>
</el-col>
<el-col :span="12">
@@ -217,23 +217,18 @@ layout("/layouts/platform.html"){
<table-tool label="人员列表" :app="this">
<template #func>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
<el-button icon="el-icon-s-promotion" size="medium" type="primary"
@click="doExport"
v-if="pageForm.state">导出
class="mr10" v-if="pageForm.state">导出
</el-button>
<el-button @click="openImport" size="small" type="primary">参加人员导入
<el-button style="margin-right: 10px" @click="openImport" size="medium" type="primary">参加人员导入
</el-button>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
<el-button icon="el-icon-s-promotion" size="medium" type="primary"
@click="userDrawer = true"
:disabled="multipleSelection.length==0"
class="mr5">设置参加人员
class="mr10">设置参加人员
</el-button>
<el-button size="small" type="primary"
@click="doReimbursement"
:disabled="multipleSelection.length==0"
class="mr10">一键报销
</el-button>
<el-radio-group @change="doSearch()" size="small"
<el-radio-group @change="doSearch()" size="medium"
v-model="pageForm.regionalNature"
v-if="pageForm.state=='1'">
<el-radio-button label="">全部</el-radio-button>
@@ -273,7 +268,7 @@ layout("/layouts/platform.html"){
</el-link>-->
</template>
<template scope="{row}" v-else-if="column.prop=='isFamily'">
<el-link v-if="!row.familyNumber" type="primary" @click="openView(row)">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.isFamily?'携带':'未携带'}}{{row.isFamily}}
</el-link>
<el-link v-else type="primary">
@@ -294,18 +289,11 @@ layout("/layouts/platform.html"){
<el-button @click="openView(row)" size="mini" type="primary">查看
</el-button>
<el-button
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}"
@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>
<el-button @click="doDelete(row)" size="mini" type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -313,6 +301,7 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<template #view>
<enroll-info ref="viewEnrollInfo"></enroll-info>
@@ -321,6 +310,7 @@ layout("/layouts/platform.html"){
<line-info ref="viewLineInfo"></line-info>
</template>
<el-drawer
size="70%"
title="批量设置参加人员"
@@ -383,6 +373,7 @@ layout("/layouts/platform.html"){
</span>
</el-drawer>
<el-dialog
title="参加人员导入"
:visible.sync="importVisible"
@@ -431,6 +422,7 @@ layout("/layouts/platform.html"){
</span>
</el-dialog>
<el-dialog
title="修改信息"
:visible.sync="editVisible"
@@ -484,22 +476,22 @@ layout("/layouts/platform.html"){
<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="idCard"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
{{ row.bedInfo?.bedType }}
{{ row.bedInfo.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
{{ row.bedInfo?.bedNum }}
{{ row.bedInfo.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
{{ row.bedInfo?.otherSleepUser ?
row.bedInfo?.otherSleepUser : '暂无' }}
{{ row.bedInfo.otherSleepUser ?
row.bedInfo.otherSleepUser : '暂无' }}
</template>
</el-table-column>
<el-table-column label="关系" prop="relation"></el-table-column>
@@ -586,8 +578,8 @@ layout("/layouts/platform.html"){
options: [
{label: "线路", value: "1"},
{label: "旅行社", value: "2"},
// {label: "酒店", value: "3"},
// {label: "旅行社", value: "2"},
{label: "酒店", value: "3"},
],
agencyLists: [],
unionOptions: [],
@@ -606,7 +598,6 @@ layout("/layouts/platform.html"){
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'signingUptime', label: '报名时间', checked: 0},
{prop: 'isTakePartIn', label: '是否参加'},
{prop: 'reimbursementStatus', label: '是否报销'},
{prop: 'takePartInTime', label: '参加时间', checked: 0},
],
pageForm: {
@@ -618,8 +609,8 @@ layout("/layouts/platform.html"){
state: '1',
regionalNature: '',
signUpMode: '',
lotId: '',
takePartInLineId: '',
lotId:'',
takePartInLineId:'',
},
multipleSelection: [],
multipleSelection2: [],
@@ -648,10 +639,7 @@ layout("/layouts/platform.html"){
labelName: '',
unionSelectLines: [],
lineLabelName: '',
activeNames: [],
title:'',
dialogVisible:false,
activeNames:[]
}
},
components: {
@@ -659,67 +647,6 @@ layout("/layouts/platform.html"){
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
},
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,
@@ -736,7 +663,6 @@ layout("/layouts/platform.html"){
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 +
@@ -749,9 +675,8 @@ layout("/layouts/platform.html"){
"&takePartInLineId=" + takePartInLineId +
"&state=" + state +
"&lotId=" + lotId +
"&satisfyPeople=false" +
"&types=" + types +
"&linePlayTime=" + linePlayTime)
},
async validateLine() {
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo'
@@ -785,7 +710,6 @@ layout("/layouts/platform.html"){
})
},
async openEdit(row) {
this.getUnionSelectLine(row.takePartInLineId)
this.editFormData = {};
const resp = await $.get("/platform/theRapyRecuperation/TheRapyAudit/findOne", {id: row.id})
if (resp.code === 0) {
@@ -940,38 +864,6 @@ layout("/layouts/platform.html"){
this.pageData()
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() {
const {data} = await $.post("/platform/theRapyRecuperation/travelAgency/selectLineByAgencyId", {
@@ -1016,7 +908,7 @@ layout("/layouts/platform.html"){
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')||@shiro.hasRole('H03')}" === 'true') {
this.unitOptions = await getUnits(this.pageForm.unionId)
} else {
this.unionOptions = this.unionOptions.filter(v => v.id === "${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -1090,12 +982,8 @@ layout("/layouts/platform.html"){
this.importVisible = false;
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
})
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine')
if (resp.code === 0) {
this.unionSelectLines = resp.data
}
@@ -59,7 +59,7 @@ layout("/layouts/platform.html"){
</div>
</div>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}">
<div class="search-item-label">分工会:</div>
<div class="search-item-option">
<el-select @change="doSearch"
@@ -73,7 +73,7 @@ layout("/layouts/platform.html"){
</div>
</div>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}">
<div class="search-item-label">分工会:</div>
<div class="search-item-option">
<el-select @change="doSearch" clearable filterable style="width: 100%"
@@ -17,6 +17,13 @@ layout("/layouts/platform.html"){
margin-bottom: 0 !important;
}
.el-checkbox {
margin-right: 0;
}
.el-descriptions-item__cell {
text-align: left !important;
}
</style>
@@ -49,7 +56,7 @@ layout("/layouts/platform.html"){
<el-option :key="item.id"
:label="item.travelAgencyName"
:value="item.id"
v-for="item in travelAgencyArray"></el-option>
v-for="item in travelAgencyOptions"></el-option>
</el-select>
</div>
</div>
@@ -59,10 +66,9 @@ layout("/layouts/platform.html"){
<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">
border v-for="item in regionalNatureList">
{{item.label}}
</el-radio-button>
</el-radio-group>
@@ -80,7 +86,7 @@ layout("/layouts/platform.html"){
</div>
</div>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')}">
<div class="search-item-label">分工会:</div>
<div class="search-item-option">
<el-select clearable filterable style="width: 100%" v-model="pageForm.unionId">
@@ -117,13 +123,12 @@ layout("/layouts/platform.html"){
<table-tool :app="this" label="线路列表(温馨提示:如查询条件的年度为空时,已选择默认查询当年选择的线路)">
<template #func>
<el-button @click="showGiveTimes" type="primary"
<!--<el-button @click="showGiveTimes" type="primary"
size="small" style="margin-right: 10px">
一键统赋时间
</el-button>
</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-group>
@@ -135,8 +140,8 @@ layout("/layouts/platform.html"){
row-key="id"
@selection-change="handleSelectionChange"
header-align="center">
<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 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"
width="80px"></el-table-column>
@@ -148,20 +153,10 @@ layout("/layouts/platform.html"){
header-align="center"
:show-overflow-tooltip="column.prop!=='playTime'"
:key="column.prop"
v-if="pageForm.mode != 2 || (pageForm.mode == 2 && column.prop !== 'isOpen')"
v-if="pageForm.mode == 1 || (['2','3'].includes(pageForm.mode) && column.prop !== 'isOpen')"
v-for="column in tableColumns"
:width="column.width"
>
<!--<template scope="{row}" v-if="column.prop==='isDisabled'">
<el-switch
:active-value="false"
:inactive-value="true"
@change="(val)=>{lineStatusChange(row.id)}"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="row.isDisabled">
</el-switch>
</template>-->
<template scope="{row:{signUpMode}}" v-if="column.prop==='signUpMode'">
{{signUpModeName(signUpMode)}}
</template>
@@ -173,14 +168,6 @@ layout("/layouts/platform.html"){
</template>
<template scope="{row}" v-else-if="column.prop==='playTime'">
<template v-if="row.playTimes">
<!--<el-tooltip placement="top">
<div slot="content">
<div v-for="t in row.playTimes.split(',')" :key="t">
{{t}}
</div>
</div>
{{row.playTimes}}
</el-tooltip>-->
<el-tooltip placement="top">
<div slot="content">
<div v-for="(t,ti) in row.playTimes.split(',')" :key="t"
@@ -192,9 +179,6 @@ layout("/layouts/platform.html"){
{{row.playTimes}}
</div>
</el-tooltip>
<!-- <div v-for="t in row.playTimes.split(',')" :key="t">
{{t}}
</div>-->
</template>
<el-button v-else @click="openSetLineTime(row)" type="text">
选择并设置出行时间段
@@ -269,7 +253,7 @@ layout("/layouts/platform.html"){
</template>
<el-dialog :close-on-click-modal="false" :visible.sync="setLineTimeDialog" title="设置出行时间段信息"
width="80%">
width="80%" top="2%">
<el-form :model="formData" :rules="rules" label-width="0" ref="form" size="small">
<h4>{{formData.lineName}}</h4>
@@ -365,24 +349,6 @@ layout("/layouts/platform.html"){
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<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>
@@ -410,7 +376,11 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<!--<el-descriptions-item label="最少参与教工">
<el-descriptions-item label="最少参与教工">
<template slot="label">
<span class="text-danger">*</span>
最少参与教工
</template>
<el-form-item :prop="'times.' + $index + '.minimumGroupSize'"
:rules="[
{ required: true, message: '最少参与教工不能为空', trigger: 'blur' },
@@ -419,7 +389,7 @@ layout("/layouts/platform.html"){
label-width="0">
<el-input clearable v-model="row.minimumGroupSize"></el-input>
</el-form-item>
</el-descriptions-item>-->
</el-descriptions-item>
<el-descriptions-item label="交通工具">
<el-form-item :prop="'times.' + $index + '.trafficTools'"
@@ -438,14 +408,18 @@ layout("/layouts/platform.html"){
</el-descriptions-item>
<el-descriptions-item label="最少成团人数(包括家属)">
<el-descriptions-item label="成团人数包括家属">
<template slot="label">
<span class="text-danger">*</span>
成团人数包括家属
</template>
<el-form-item :prop="'times.' + $index + '.estimatedFamilyNumbers'"
:rules="[
{ required: false, message: '最少成团人数不能为空', trigger: 'blur' },
{ pattern: /^[0-9]*$/, message: '最少成团人数格式不正确', trigger: 'blur' }
{ required: true, message: '成团人数包括家属不能为空', trigger: 'blur' },
{ pattern: /^[0-9]*$/, message: '成团人数包括家属格式不正确', trigger: 'blur' }
]"
label-width="0">
<el-input clearable v-model="row.estimatedFamilyNumbers"></el-input>
<el-input clearable v-model="row.estimatedFamilyNumbers" placeholder="请输入成团人数包括家属"></el-input>
</el-form-item>
</el-descriptions-item>
@@ -461,6 +435,32 @@ layout("/layouts/platform.html"){
</el-switch>
</el-form-item>
</el-descriptions-item>
<template v-if="pageForm.mode == 3">
<el-descriptions-item label="报名范围">
<template slot="label">
<span class="text-danger">*</span>
报名范围
</template>
<el-form-item :prop="'times.' + $index + '.signScope'"
label-width="0"
:rules="[
{ required: true, message: '报名范围不能为空', trigger: 'blur' },
]">
<el-checkbox-group size="mini" v-model="row.signScope">
<el-checkbox :label="1" border>自己选择</el-checkbox>
<el-checkbox :label="2" border>本分工会</el-checkbox>
<el-checkbox :label="3" border>全校</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="人员名单" v-if="row.signScope?.includes(1)">
<el-button @click="openJoinUserVisible(row)" type="primary" size="mini">设置人员名单(您已设置{{ row.chooseUserList?.length || 0 }}人)</el-button>
<el-button v-if="row.chooseUserList?.length > 0" @click="row.chooseUserList = [];selectRow.userTableData = [];$forceUpdate()" type="primary" size="mini">清空名单</el-button>
</el-descriptions-item>
</template>
</el-descriptions>
</el-row>
@@ -469,12 +469,10 @@ layout("/layouts/platform.html"){
<div class="text-right">
<el-button
@click="formData.times.push({enable:true,minimumGroupSize:lineConfig.groupNumber,estimatedCost:lineConfig.cost, estimatedFamilyNumbers: lineConfig.outsideQuota})"
@click="formData.times.push({enable:true,minimumGroupSize:lineConfig.groupNumber,estimatedCost:lineConfig.cost})"
size="mini" type="primary">新增出行时间
</el-button>
</div>
<el-alert closable show-icon style="margin:10px 0"
title="温馨提醒:变更时间应该大于报名截至时间,小于出行时间。"
type="warning"></el-alert>
@@ -515,11 +513,6 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="出行结束时间">
{{row.playEndTime}}
</el-descriptions-item>
<el-descriptions-item label="旅行社">
{{row.travelAgencyName}}
</el-descriptions-item>
<el-descriptions-item label="联系人">
{{row.contact}}
</el-descriptions-item>
@@ -528,9 +521,9 @@ layout("/layouts/platform.html"){
{{row.contactPhone}}
</el-descriptions-item>
<!--<el-descriptions-item label="最少参与教工">
<el-descriptions-item label="最少参与教工">
{{row.minimumGroupSize}}
</el-descriptions-item>-->
</el-descriptions-item>
<el-descriptions-item label="交通工具">
{{row.trafficTools}}
@@ -638,7 +631,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="是否开启">
<!--<el-descriptions-item label="是否开启">
<el-form-item :prop="'times.' + $index + '.enable'"
label-width="0">
<el-switch
@@ -649,7 +642,7 @@ layout("/layouts/platform.html"){
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-descriptions-item>
</el-descriptions-item>-->
</el-descriptions>
</el-row>
</div>
@@ -662,6 +655,54 @@ layout("/layouts/platform.html"){
<el-button @click="doSetGiveLineTimes" type="primary">提交</el-button>
</el-row>
</el-dialog>
<el-dialog :close-on-click-modal="false" :visible.sync="userDialogVisible" title="设置人员名单" width="60%" top="2%">
<vi-title title="筛选人员"></vi-title>
<el-select
v-model="chooseUserMultiple"
value-key="id"
filterable
remote
multiple
reserve-keyword
placeholder="请输入工号或者姓名查询"
:remote-method="queryJoinUser" style="width: 90%">
<el-option
v-for="item in canChooseUserList"
:key="item.id"
:label="item.username+'-'+item.loginname+'-'+item.unitname"
:value="item.id">
</el-option>
</el-select>
<el-button type="primary" @click="joinUserConfirm">确定</el-button>
<vi-title class="mt10" title="已选人员"></vi-title>
<div class="btn-group tool-button">
<el-input placeholder="请输入姓名或工号查询" v-model="userSearchKeyword" clearable></el-input>
</div>
<div class="btn-group tool-button">
<el-button @click="userDoSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<el-table max-height="500" :data="selectRow.userTableData">
<el-table-column label="序号" type="index" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="username" label="姓名" header-align="center" align="center"></el-table-column>
<el-table-column prop="loginname" label="工号" header-align="center" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" header-align="center" align="center"></el-table-column>
<el-table-column prop="unitname" label="所属单位" header-align="center" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="unionname" label="所属工会" header-align="center" align="center" show-overflow-tooltip></el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="{row}">
<el-button @click="selectRow.chooseUserList.splice(row, 1);selectRow.userTableData.splice(row, 1)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-row justify="end" type="flex" class="mt20">
<el-button @click="userDialogVisible=false">取消</el-button>
<el-button @click="selectRow.chooseUserList = [];selectRow.userTableData = [];userDialogVisible=false" type="danger">清空已选</el-button>
<el-button @click="doJoinUser" type="primary">提交</el-button>
</el-row>
</el-dialog>
</guava>
</div>
@@ -687,7 +728,6 @@ layout("/layouts/platform.html"){
}
callback()
}
const validateChangeEndTime = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择变更截至时间'))
@@ -699,7 +739,6 @@ layout("/layouts/platform.html"){
}
callback()
}
const validatePlayEndTime = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择出行结束时间'))
@@ -711,7 +750,6 @@ layout("/layouts/platform.html"){
}
callback()
}
//统赋时间
const validateGiveSignUpEndTime = (rule, value, callback) => {
console.log(value)
@@ -725,7 +763,6 @@ layout("/layouts/platform.html"){
}
callback()
}
const validateGiveChangeEndTime = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择变更截至时间'))
@@ -737,7 +774,6 @@ layout("/layouts/platform.html"){
}
callback()
}
const validateGivePlayEndTime = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择出行结束时间'))
@@ -749,32 +785,22 @@ layout("/layouts/platform.html"){
}
callback()
}
return {
travelAgencyArray: [],
travelAgencyList: [],
canChooseUserList: [],
chooseUserMultiple: [],
userDialogVisible: false,
userSearchKeyword: '',
tableColumns: [
// {label: '年度', prop: 'year', sortable: true},
{label: '线路名称', prop: 'lineName', sortable: true},
{label: '线路类型', prop: 'regionalNature', sortable: true},
{label: '时间标段', prop: 'lotName', sortable: true, sortProp: 'lotValue'},
{label: '出行时间', prop: 'playTime', sortable: 'custom', sortProp: 'playStartTime', width: 230},
//{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},
// {label: '所属分工会', prop: 'belongUnionName', sortable: true},
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},
{label: '组织形式', prop: 'signUpMode', sortable: true},
// {label: '编号', prop: 'serialNumber', sortable: true},
// {label: '创建模式', prop: 'createMode', sortable: true},
//{label: '创建人', prop: 'createUserName', sortable: true},
{label: '选择工会', prop: 'belongUnionName', sortable: true},
{label: '是否开放对外报名', prop: 'isOpen', sortable: true},
// {label: '是否启用', prop: 'isDisabled', sortable: true}
],
rules: {
signUpStartTime: [{
required: true,
message: '请选择报名开始时间',
trigger: ['change', 'blur']
}],
signUpStartTime: [{required: true, message: '请选择报名开始时间', trigger: ['change', 'blur']}],
signUpEndTime: [{required: true, validator: validateSignUpEndTime, trigger: ['change', 'blur']}],
changeEndTime: [{required: true, validator: validateChangeEndTime, trigger: ['change', 'blur']}],
playStartTime: [{required: true, message: '请选择出行开始时间', trigger: ['change', 'blur']}],
@@ -795,7 +821,7 @@ layout("/layouts/platform.html"){
keywords: null,
selectStatus: -1,
unionId: null,
regionalNature: '省内'
regionalNature: '全部'
},
createModeList: [],
signUpModeList: [],
@@ -810,7 +836,6 @@ layout("/layouts/platform.html"){
cost: null
},
regionalNatureList: [{label:'全部线路',name:'provinceAll',ordinal:0,provinceIn:'provinceIn',provinceOut:'provinceOut',value:'全部'}],
multipleSelection: [],
giveLineTimesData: {
times: []
@@ -832,7 +857,7 @@ layout("/layouts/platform.html"){
},
setGiveLineTimeDialog: false,
selectRow: {},
}
},
computed: {
@@ -844,18 +869,57 @@ layout("/layouts/platform.html"){
},
},
methods: {
queryJoinUser(val) {
$.post('/platform/theRapyRecuperation/linePersonalSelect/queryJoinUser', {keyWord: val}).then(res => {
if (res.code === 0) {
this.canChooseUserList = res.data
}
})
},
joinUserConfirm() {
//获取表格数据的id集合
const idList = this.selectRow.chooseUserList.map(o => o.id)
//多选框排除在表格数据里面的
const notList = this.chooseUserMultiple.filter(o => !idList.includes(o))
//通过多选框候选列表查询出可以被加到表格里面的
let list = this.canChooseUserList.filter(o => notList.includes(o.id))
this.selectRow.chooseUserList = this.selectRow.chooseUserList.concat(list)
this.selectRow.userTableData = clone(this.selectRow.chooseUserList)
this.chooseUserMultiple = []
this.$forceUpdate()
},
userDoSearch() {
if(this.userSearchKeyword === '') {
this.selectRow.userTableData = clone(this.selectRow.chooseUserList)
} else {
this.selectRow.userTableData = this.selectRow.chooseUserList.filter(o => o.username.includes(this.userSearchKeyword) || o.loginname.includes(this.userSearchKeyword))
}
},
openJoinUserVisible(row) {
if(!row.chooseUserList) {
row.chooseUserList = []
} else {
row.userTableData = clone(row.chooseUserList)
}
if(!row.userTableData) {
row.userTableData = []
}
this.selectRow = row
this.userDialogVisible = true
},
doJoinUser() {
if(this.selectRow.chooseUserList.length === 0) {
this.$message.warning('请选择人员')
return
}
this.userDialogVisible = false
},
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'
@@ -886,10 +950,8 @@ layout("/layouts/platform.html"){
this.notifyWarning(resp.msg)
}
},
async openSetLineTime({id, lineName, usUnionId, signUpMode}) {
await this.getLineConfig(id)
const resp = await $.post(loc() + '/selectLineInfo', {
lineId: id,
unionId: usUnionId,
@@ -901,9 +963,18 @@ layout("/layouts/platform.html"){
times:[]
}
if(resp.data && resp.data.length > 0){
resp.data.forEach(item => {
item.chooseUserList = JSON.parse(item.chooseUserList)
item.signScope = JSON.parse(item.signScope)
})
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.times.push({
enable:true,
minimumGroupSize:this.lineConfig.groupNumber,
estimatedCost:this.lineConfig.cost,
signScope: [],
})
}
this.formData.lineId = id
this.formData.signUpMode = signUpMode
@@ -917,15 +988,14 @@ layout("/layouts/platform.html"){
async doSelect() {
const valid = await this.$refs['form'].validate()
if (!valid) return
const confirm = await this.$confirm('请再次确认,是否选择此线路为疗休养线路?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') return
const fmtData = this.formData.times.map(v => {
v.chooseUserList = JSON.stringify(v.chooseUserList)
return {
...v,
lineId: this.formData.lineId,
@@ -933,7 +1003,6 @@ layout("/layouts/platform.html"){
mode: GetQueryString('mode')
}
})
const resp = await $.post(loc() + '/selectLineTimes', {lineUnionSelects: JSON.stringify(fmtData)})
if (resp.code === 0) {
this.setLineTimeDialog = false
@@ -970,7 +1039,7 @@ layout("/layouts/platform.html"){
},
async getTravelAgencyOptions() {
const {data} = await $.get(loc() + '/getTravelAgencyOptions')
this.travelAgencyArray = data
this.travelAgencyOptions = data
},
async getLotList() {
const {data} = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
@@ -983,10 +1052,6 @@ layout("/layouts/platform.html"){
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('请在线路列表中勾选您想要统赋时间的线路!');
@@ -1013,9 +1078,7 @@ layout("/layouts/platform.html"){
type: 'warning'
})
if (confirm !== 'confirm') return
const lineIds = this.multipleSelection.map(v => v.usId)
const lineIds = this.multipleSelection.map(v => v.id)
const fmtData = this.giveLineTimesData.times.map(v => {
return {
...v,
@@ -1023,10 +1086,10 @@ layout("/layouts/platform.html"){
mode: GetQueryString('mode')
}
})
const resp = await $.post(loc() + '/setGiveLineTimes', {
lineIds: JSON.stringify(lineIds),
lineUnionSelects: JSON.stringify(fmtData)
lineUnionSelects: JSON.stringify(fmtData),
year:this.pageForm.year
})
if (resp.code === 0) {
this.setGiveLineTimeDialog = false
@@ -1046,21 +1109,25 @@ layout("/layouts/platform.html"){
this.$message.warning(resp.msg)
}
this.pageData()
}
},
async initTableColumns() {
if(this.pageForm.mode == 1) {
this.tableColumns.push({label: '是否开放对外报名', prop: 'isOpen', sortable: true})
} else if(this.pageForm.mode == 3) {
this.tableColumns = this.tableColumns.filter(o => o.prop !== 'belongUnionName')
this.tableColumns.push({label: '选择人', prop: 'selectUserName', sortable: true})
}
},
},
async created() {
this.$set(this.pageForm, 'mode', GetQueryString('mode'))
if(this.pageForm.mode == 2) {
this.$set(this.pageForm, 'regionalNature', '全部')
}
await this.initTableColumns()
this.pageData()
this.createModeList = await getEnumOptions('TheRapyRecuperationLineCreateMode')
this.signUpModeList = await getEnumOptions('TheRapyRecuperationSignUpMode')
this.regionalNatureList.push(...await getEnumOptions('TheRapyRecuperationProvinceType'))
// const result = await getEnumOptions('TheRapyRecuperationProvinceType')
this.unionOptions = await getUnions(null)
this.travelAgencyOptions = this.selectTravelAgencyList()
await this.getTravelAgencyOptions()
this.travelAgencyOptions = this.getTravelAgencyOptions()
this.lotList = this.getLotList()
}
})
@@ -0,0 +1,198 @@
const editForm = {
template: /*language=HTML*/ `
<el-dialog title="编辑" :visible.sync="visible" top="50px">
<el-form :model="formData" label-width="120px" :formRules="formRules" ref="formRef"
style="margin-right: 40px">
<el-row>
<el-col span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="formData.loginName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="formData.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="formData.mobile" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="userName" label="身份证号">
<el-input v-model="formData.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="formData.unionName" readonly></el-input>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="unitName" label="单位">
<el-input v-model="formData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="prop" :label="labelName">
<template v-if="config.familyInfo == 2">
<el-collapse v-model="activeNames">
<el-collapse-item title="点击可展开详细信息" name="1">
<el-card shadow="never">
<el-table :data="formData.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"></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="formData.bedType" readonly></el-input>
</template>
</el-form-item>
<el-form-item prop="travelLine" :label="lineLabelName">
<el-select v-model="formData.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="formData.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>
<template #footer>
<div class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
</div>
</template>
</el-dialog>
`,
data() {
return {
visible: false,
year: null,
config: {},
formData: {},
formRules: {},
labelName: null,
lineLabelName: '线路',
unionSelectLines: [],
activeNames: []
}
},
methods: {
async onOpen(id, year) {
this.year = year
this.visible = true
this.getUnionSelectLine()
await this.getModifyConfig()
const {code, msg, data} = await $.get("/platform/theRapyRecuperation/schoolUnionUserQuery/findOne", {id})
if (code === 0) {
this.formData = data
if (this.config.familyInfo === 2) {
this.labelName = "家属信息"
} else {
this.editFormData.bedType = data.familyNumber
this.labelName = "家属数量"
}
} else {
this.$message.error(msg)
}
},
async getModifyConfig() {
const {code, data, msg} = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (code === 0) {
this.config = data
} else {
this.$message.error(msg)
}
},
async getUnionSelectLine() {
const resp = await $.post('/platform/theRapyRecuperation/user/query/getUnionSelectLine', {
year: this.year,
signUpMode: 1,
})
if (resp.code === 0) {
this.unionSelectLines = 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.formData.takePartInLineId = ''
}
},
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm('您确定要修改报名信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
if (!this.formData.takePartInLineId && !this.formData.takePartInBaseManagementId) {
this.$message.warning('请选择线路')
return
}
const {code,msg} = await $.post('/platform/theRapyRecuperation/user/query/doEdit', this.formData)
if (code === 0) {
this.$message.success(msg)
this.visible = false
this.$emit('refresh')
} else {
this.$message.error(msg)
}
}).catch()
}
})
}
}
};
@@ -0,0 +1,463 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.filter-container {
margin-bottom: 20px;
border-radius: 4px;
}
.filter-container .el-form {
padding: 10px 15px;
}
/* Flex布局样式 */
.form-row {
display: flex;
gap: 20px;
margin-bottom: 22px;
flex-wrap: wrap;
}
.form-row .el-form-item {
flex: 1;
min-width: 240px;
margin-bottom: 0;
}
.flex-grow-1 {
flex: 1;
}
.route-line {
display: flex;
align-items: center;
margin-bottom: 22px;
}
.route-line-title {
width: 90px;
text-align: right;
padding-right: 12px;
color: #606266;
font-size: 14px;
line-height: 40px;
}
.route-line-content {
flex: 1;
}
.route-radio-group {
display: flex;
flex-wrap: wrap;
gap: 15px;
}
.route-radio-group .el-radio {
margin-right: 0;
margin-bottom: 10px;
}
.button-container {
display: flex;
justify-content: center;
padding-top: 15px;
border-top: 1px dashed #ebeef5;
}
.button-container .el-button {
padding-left: 25px;
padding-right: 25px;
margin: 0 15px;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" class="filter-container">
<el-form :model="pageForm" ref="pageFormRef" label-width="90px" size="medium">
<div class="form-row">
<el-form-item label="年度">
<el-date-picker
v-model="pageForm.year"
type="year"
placeholder="选择年度"
value-format="yyyy"
style="width: 100%">
</el-date-picker>
</el-form-item>
<el-form-item label="姓名">
<el-input v-model="pageForm.userName" placeholder="请输入姓名" clearable
prefix-icon="el-icon-user"></el-input>
</el-form-item>
<el-form-item label="工号">
<el-input v-model="pageForm.loginName" placeholder="请输入工号" clearable
prefix-icon="el-icon-postcard"></el-input>
</el-form-item>
</div>
<div class="form-row">
<el-form-item label="分工会">
<el-select v-model="pageForm.unionId"
@change="doSearch"
placeholder="请选择所属工会"
filterable
clearable
style="width: 100%">
<el-option
v-for="item in unionOptions"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</div>
<div class="route-line">
<div class="route-line-title">区域</div>
<div class="route-line-content">
<el-radio-group @change="doSearch"
size="small"
v-model="pageForm.regionalNature">
<el-radio label="" border>全部</el-radio>
<el-radio label="省内" border>省内</el-radio>
<el-radio label="省外" border>省外</el-radio>
</el-radio-group>
</div>
</div>
<div class="form-row">
<el-form-item label="线路选择">
<el-select v-model="pageForm.takePartInLineId" placeholder="请选择线路" clearable
style="width: 100%">
<el-option
v-for="item in takePartInLines"
:key="item.takePartInLineId"
:label="item.lineName+''+item.unionName+''"
:value="item.takePartInLineId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="标段">
<el-select v-model="pageForm.lotId" placeholder="请选择标段" clearable style="width: 100%">
<el-option
v-for="item in config.lots"
:key="item.id"
:label="item.lotName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item class="flex-grow-1">
</el-form-item>
</div>
<div class="button-container">
<el-button type="primary" icon="el-icon-search" round @click="doSearch">查询</el-button>
<el-button icon="el-icon-refresh" round @click="resetQuery">重置</el-button>
</div>
</el-form>
</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" @click="openImport" size="small" type="primary">参加人员导入-->
<!-- </el-button>-->
<el-button icon="el-icon-s-promotion" size="small" type="primary" @click="doExport">
导出
</el-button>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="openSetUpPart"
>设置参加人员
</el-button>
</template>
</table-tool>
<el-table :data="tableData" row-key="id" style="width: 100%" ref="tableRef">
<el-table-column reserve-selection type="selection" width="55"></el-table-column>
<el-table-column align="center" header-align="center" type="index" label="序号" :index="indexMethod"
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=='lineName'">
<el-link type="primary" @click="openLine(row)">{{row.lineName}}
</el-link>
</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=='lineNum'">
<el-link v-if="!row.familyNumber" type="primary" @click="openUser(row)">
{{row.lineNum}}{{row.signUpUserFamilyNum}}
</el-link>
<el-link v-else type="primary">
{{row.lineNum}}{{row.familyNumber}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='signUpMode'">
{{signUpModeName(row.signUpMode)}}
</template>
<template scope="{row}" v-else-if="column.prop=='agencyNum'">
<el-link type="primary" @click="openApplyUser(row)">{{row.agencyNum}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='times'">
<div v-if="row.playStartTime">{{row.playStartTime}}</div>
<div v-else>{{row.playStartTime1}}</div>
</template>
<template scope="{row}" v-else-if="column.prop=='isTakePartIn'">
{{row.isTakePartIn?'已参加':'未参加'}}
</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>
<template scope="{row}" v-else-if="column.prop=='lineOrMaName'">
{{row.lineName?row.lineName:row.baseName?row.baseName:row.travelAgencyName}}
</template>
<template scope="{row:{officialWebsite}}"
v-else-if="column.prop==='officialWebsite'">
<a :href="officialWebsite" class="text-primary" target="_blank">
{{officialWebsite}}
</a>
</template>
</el-table-column>
<el-table-column v-if="pageForm.state=='1'||pageForm.state=='3'" align="center"
prop="lotName"
show-overflow-tooltip
header-align="center"
label="标段"
sortable>
<template scope="{row}">
{{row.lotName}}
</template>
</el-table-column>
<el-table-column label="操作" width="250px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑
</el-button>
<el-button @click="onDelete(row)" size="mini" type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog title="查看报名信息" :visible.sync="viewVisible" top="50px">
<enroll-info ref="viewEnrollInfoRef"></enroll-info>
</el-dialog>
<set-up-part ref="setUpRef"></set-up-part>
<edit-form ref="editRef" @refresh="doSearch"></edit-form>
</div>
<script>
<!--#include('setUpPart.js'){}#-->
<!--#include('editForm.js'){}#-->
new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=' + new Date().getTime()),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue'),
'set-up-part': setUpPart,
'edit-form': editForm
},
data() {
return {
pageForm: {
year: new Date().getFullYear().toString(),
loginName: '',
userName: '',
takePartInLineId: '',
unionId: '',
signUpMode: 1,
lotId: '',
regionalNature: ''
},
takePartInLines: [],
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: '是否参加'}
],
viewVisible: false,
unionOptions: [],
config: {}
}
},
methods: {
handleQuery() {
console.log('查询参数:', this.pageForm);
// 查询逻辑
},
resetQuery() {
this.pageForm = {
year: new Date().getFullYear().toString(),
loginName: '',
userName: '',
takePartInLineId: '',
unionId: '',
signUpMode: 1,
lotId: '',
regionalNature: '',
pageNumber: 1,
pageSize: 10,
totalCount: 0,
}
this.doSearch()
},
signUpModeName(val) {
return null
},
openApplyUser(row) {
},
openView(row) {
this.viewVisible = true
this.$nextTick(() => {
this.$refs.viewEnrollInfoRef.openView(row.id)
})
},
openEdit(row) {
this.$refs.editRef.onOpen(row.id)
},
onDelete(row) {
this.$confirm("您确定要删除【<span style='color: red'>" + row.userName + "</span>】的信息吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(async () => {
const {
code,
msg
} = await $.post('/platform/theRapyRecuperation/schoolUnionUserQuery/deleteMyEnrollInfoById', {
id: row.id
})
if (code === 0) {
this.doSearch()
this.$message.success(msg)
} else {
this.$message.warning(resp.msg)
}
})
},
openImport() {
},
doExport() {
const {year, userName, loginName, unionId, signUpMode, regionalNature, takePartInLineId, lotId} = this.pageForm
debugger
window.open('/platform/theRapyRecuperation/schoolUnionUserQuery/exportXlsx?year=' +
year
+ '&userName=' + userName
+ '&loginName=' + loginName
+ '&unionId=' + unionId
+ '&signUpMode=' + signUpMode
+ '&regionalNature=' + regionalNature
+ '&takePartInLineId=' + takePartInLineId
+ '&lotId=' + lotId)
},
// 打开设置参加人员
openSetUpPart() {
const selection = this.$refs.tableRef.selection
console.log(selection)
if (selection.length === 0) {
this.$message.error('请选择要设置的人员')
return
}
this.$refs.setUpRef.onOpen(selection)
},
getConfig() {
$.post('/platform/theRapyRecuperation/TheRapyConfig/findOne').then((res) => {
if (res.code === 0) {
this.config = res.data
}
})
},
signUpModeChange(val) {
this.pageForm.takePartInLineId = ''
this.getLines()
this.doSearch()
},
getLines() {
$.post('/platform/theRapyRecuperation/schoolUnionUserQuery/listLine', {
year: this.pageForm.year,
unionId: this.pageForm.unionId,
signUpMode: this.pageForm.signUpMode,
regionalNature: this.pageForm.regionalNature
}).then(res => {
if (res.code === 0) {
this.takePartInLines = res.data
} else {
this.$message.error(res.msg)
}
})
},
doSearch(){
this.getLines()
this.tableKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.pageData()
}
},
async created() {
this.doSearch()
this.getConfig()
this.unionOptions = await getUnions()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,147 @@
const setUpPart = {
template: /*language=HTML*/ `
<el-dialog :visible.sync="visible" title="设置参加人员" top="50px">
<el-row class="text-primary p20">
选择标段/参加时间设置前请先勾选需要设置的用户
</el-row>
<el-row type="flex" style="column-gap: 10px">
<el-select v-model="lotId" filterable clearable
placeholder="请选择标段"
style="width: 100%"
@change="lotChange">
<el-option v-for="item in config.lots"
:key="item.id"
:label="item.lotName"
:value="item.id">
</el-option>
</el-select>
<el-date-picker
v-model="takePartInTime"
type="date"
style="width: 100%"
@change="takePartInTimeChange"
value-format="yyyy-MM-dd"
placeholder="请选择参加时间">
</el-date-picker>
</el-row>
<el-row class="mt10">
<el-table :data="tableData" border ref="tableRef" row-key="id">
<el-table-column type="selection" width="55"></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="userName" 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="signingUptime" label="报名时间"></el-table-column>
<el-table-column prop="takePartInTime" label="参加时间"></el-table-column>
<el-table-column prop="lotName" label="标段"></el-table-column>
</el-table>
</el-row>
<template #footer>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="onSubmit">确定</el-button>
</template>
</el-dialog>
`,
data() {
return {
visible: false,
config: {},
tableData: [],
lotId: null,
takePartInTime: null
}
},
methods: {
onOpen(selection) {
this.visible = true
this.tableData = JSON.parse(JSON.stringify(selection))
this.getModifyConfig()
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.config = res.data
}
},
// 标段改变
lotChange(val) {
const selection = this.$refs.tableRef.selection
if (selection.length === 0) {
this.$message.error('请选择要设置的人员')
this.lotId = null
return
}
if (!val) {
this.$refs.tableRef.clearSelection()
return
}
const lot = this.config.lots.find(v => v.id === val)
this.tableData.map((v, index) => {
this.$set(this.tableData[index], "lotId", val)
this.$set(this.tableData[index], "lotName", lot.lotName)
})
},
// 参加时间改变
takePartInTimeChange(val) {
const selection = this.$refs.tableRef.selection
if (selection.length === 0) {
this.$message.error('请选择要设置的人员')
this.takePartInTime = null
return
}
if (!val) {
this.$refs.tableRef.clearSelection()
return
}
this.tableData.map((v, index) => {
this.$set(this.tableData[index], "takePartInTime", val)
})
},
// 确定提交
onSubmit() {
// 检查哪几条数据填写不完整
this.tableData.forEach((v, index) => {
if (!v.lotId || !v.takePartInTime) {
this.$message.error('第' + (index + 1) + '行数据填写不完整')
return
}
})
const data = this.tableData.map((v, index) => {
return{
lotId: v.lotId,
takePartInTime: v.takePartInTime,
id: v.id
}
})
this.$confirm('确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const {
code,
msg
} = await $.post("/platform/theRapyRecuperation/schoolUnionUserQuery/setUpParticipants", {data: JSON.stringify(data)})
if (code === 0) {
this.$message.success(msg)
this.$refs.tableRef.clearSelection()
this.visible = false
} else {
this.$message.error(msg)
}
})
}
}
};
@@ -142,7 +142,8 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10">
<table-tool label="" :app="this" ref="table_tool">
<table-tool label="温馨提醒:成团确认后,将进入审核流程,报名人员不能再进行取消报名的操作" :app="this"
ref="table_tool">
<template #func>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="doExport"
@@ -174,16 +175,21 @@ layout("/layouts/platform.html"){
<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 scope="{row}" v-else-if="column.prop=='signUpMode'">
<span v-if="row.signUpMode == '1'">分工会组织</span>
<span v-if="row.signUpMode == '2'">校工会组织</span>
<span v-if="row.signUpMode == '3'">个人组织</span>
</template>
<template scope="{row}" v-else-if="column.prop=='lineNum'">
<el-link v-if="!row.familyNumber" type="primary" @click="openUserData(row)">
<template v-if="!row.familyNumber" type="primary">
{{row.lineNum + row.signUpUserFamilyNum}}{{row.signUpUserFamilyNum}}
</el-link>
<el-link v-else type="primary">
</template>
<template v-else type="primary">
{{row.lineNum + row.familyNumber}}{{row.familyNumber}}
</el-link>
</template>
</template>
<template scope="{row}" v-else-if="column.prop=='stateName'">
{{row.stateName?row.stateName:'待成团'}}
</template>
</el-table-column>
<el-table-column label="操作" width="380px">
@@ -192,17 +198,32 @@ layout("/layouts/platform.html"){
<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" 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="sendSuccess(row, true)"
:disabled="![null,7703,7710,7715].includes(row.auditState)">
发送通知
</el-dropdown-item>
<el-dropdown-item @click.native="sendSuccess(row, false)"
:disabled="![null,7703,7710,7715].includes(row.auditState)">
不发送通知
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<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-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>
@@ -214,7 +235,8 @@ layout("/layouts/platform.html"){
</template>
<template #public>
<line-info ref="viewLineInfo"></line-info>
<!-- <line-info ref="viewLineInfo"></line-info>-->
<line-audit-info ref="lineAuditViewInfo"></line-audit-info>
</template>
<template #edit>
@@ -223,17 +245,18 @@ layout("/layouts/platform.html"){
<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>
<el-input v-model="userPageForm.searchKeyword" maxlength="10" clearable
placeholder="请输入工号或姓名查询"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('SchoolUnionMemberAdmin')}">
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')||@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%;"
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>
@@ -243,7 +266,7 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select clearable="true" filterable="true" placeholder="所属单位"
<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>
@@ -276,6 +299,18 @@ layout("/layouts/platform.html"){
{{row.familyNumber?'携带':'未携带'}}{{row.familyNumber}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='sign'">
<el-image v-if="row.sign"
style="width: 100px; height: 50px"
:src="'/file_server/fileStreamPreview?id=' +row.sign"
fit="contain"></el-image>
<span v-else>暂无</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button @click="deleteJoinUser(row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
@@ -316,35 +351,37 @@ layout("/layouts/platform.html"){
{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: 'signUpMode', label: '组织形式', sortable: true},
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'contact', label: '联系人', sortable: true, checked: 0},
{prop: 'contactMobileNumber', label: '联系方式', checked: 0},
{prop: 'username', label: '发起人', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'estimatedFamilyNumbers', label: '最少成团人数', width: 80},
{prop: 'lineNum', label: '报名人数(家属)'},
{prop: 'stateName', label: '审核状态'},
],
modifyConfig: {},
lineList: [],
unions: [],
units:[],
units: [],
signUpModeOptions: [
{label: '校工会组织', value: 2},
{label: '分工会组织', value: 1},
],
userPageForm:{
pageNumber:1,
userPageForm: {
pageNumber: 1,
pageSize: 10
},
userData:[],
userDataTableColumns:[
userData: [],
userDataTableColumns: [
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'unionName', label: '所属工会'},
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'linePlayTime', label: '出行时间', sortable: true}
{prop: 'linePlayTime', label: '出行时间', sortable: true},
{prop: 'sign', label: '签字'}
],
lineUId: '',
@@ -356,9 +393,25 @@ layout("/layouts/platform.html"){
},
components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue?v=1.0.1'),
'line-audit-info': httpVueLoader('/components/theRapyRecuperation/LineAuditInfo.vue?v=' + new Date().getTime()),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
},
methods: {
deleteJoinUser(row) {
this.$confirm('您确定要删除' + row.userName + '的报名信息吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/statistics/deleteJoinUser', {id: row.id})
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
})
},
doExport() {
const {
startYear,
@@ -375,6 +428,7 @@ layout("/layouts/platform.html"){
"&unionId=" + unionId +
"&takePartInLineId=" + takePartInLineId +
"&lotId=" + lotId +
"&state=" + 1 +
"&regionalNature=" + regionalNature +
"&satisfyPeople=true" +
"&types=" + JSON.stringify(['line']) +
@@ -404,15 +458,23 @@ layout("/layouts/platform.html"){
this.getUnionSelectLine()
this.doSearch()
},
async sendSuccess(row) {
this.$confirm("确定发送<span style='color: red'>成团通知</span>吗?", '提示', {
async sendSuccess(row, type) {
let message = '确定要成团吗?'
if (type) {
message += "此操作将会<span style='color: red'>发送通知</span>,请再次确认!";
}
this.$confirm(message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/statistics/sendSuccess', {id: row.lineUId})
const resp = await $.post('/platform/theRapyRecuperation/statistics/sendSuccess', {
id: row.lineUId,
type: type
})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
@@ -426,7 +488,10 @@ layout("/layouts/platform.html"){
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/statistics/sendFail', {id: row.lineUId, type: type})
const resp = await $.post('/platform/theRapyRecuperation/statistics/sendFail', {
id: row.lineUId,
type: type
})
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
@@ -436,14 +501,15 @@ layout("/layouts/platform.html"){
},
openLine(row) {
this.$refs.guava.public()
if (row.regionalNature === "省内") {
this.$refs.lineAuditViewInfo.init(row)
/*if (row.regionalNature === "省内") {
this.$refs.viewLineInfo.findOne(row.lineId, null)
} else {
this.$refs.viewLineInfo.findOne(row.lineId, row.usUnionId)
}
}*/
},
openUserData(row){
openUserData(row) {
this.lineUId = row.lineUId
this.$refs.guava.edit();
this.getUserDataByLineId(row)
@@ -468,7 +534,7 @@ layout("/layouts/platform.html"){
},
async flushUnits() {
this.$set(this.userData, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === 'true') {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionAdmin')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === 'true') {
this.units = await getUnits(this.userData.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -482,10 +548,10 @@ layout("/layouts/platform.html"){
this.userPageForm.pageNumber = val;
this.getUserDataByLineId();
},
async getUserDataByLineId(row){
async getUserDataByLineId(row) {
this.userPageForm.takePartLineId = this.lineUId
const resp = await $.post(loc() + '/getUserDateByLine',this.userPageForm)
if (resp.code === 0){
const resp = await $.post(loc() + '/getUserDateByLine', this.userPageForm)
if (resp.code === 0) {
this.userData = resp.data.list
this.userPageForm.totalCount = resp.data.totalCount
}
@@ -0,0 +1,268 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava :edit_scroll="false" ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">线路:</div>
<div class="search-item-option">
<el-select @change="doSearch" filterable="true"
placeholder="请选择线路"
style="width: 100%;" :clearable="true"
v-model="pageForm.lineId">
<el-option :label="item.lineName + '' + item.unionName + ''" :value="item.id"
v-for="item in lineList"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 100%" v-model="pageForm.searchKeyword">
<el-select slot="prepend" style="width: 80px;"
v-model="pageForm.searchName">
<el-option label="姓名" value="we.userName"></el-option>
<el-option label="工号" value="we.loginName"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="flushUnits" @clear="flushUnits"
clearable
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="pageForm.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 filterable placeholder="请选择"
style="width: 100%"
v-model="pageForm.unitId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in units">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">评分:</div>
<div class="search-item-option">
<el-select clearable filterable placeholder="请选择"
style="width: 100%"
v-model="pageForm.evaluateScore">
<el-option
:key="item.code"
:label="item.name"
:value="item.code"
v-for="item in evaluateScores">
</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="评价名单">
<template #func>
<el-button @click="exportEvaluate" size="small" type="primary">导出名单</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
ref="table"
row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
min-width="100px" show-overflow-tooltip
v-for="column in tableColumns">
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
prop="userOnline" width="150px">
<template scope="{row}">
<el-button @click="openEvaluate(row)" size="mini" type="primary">查看评价
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
<el-dialog
:close-on-click-modal="false"
:visible.sync="evaluateDialogVisible"
title="评分内容"
width="30%">
<el-form :model="formData" label-width="60px" ref="form">
<el-form-item :rules="[{ required: true, message: ''}]" label="评分">
<!--<div style="position: absolute; top: 20%;">
<el-rate disabled
show-score text-color="#ff9900"
v-model="viewData.evaluateScore"></el-rate>
</div>-->
<span>{{viewData.evaluateScore}}</span>
</el-form-item>
<el-form-item label="评价">
<!--<el-input disabled
maxlength="100"
placeholder="请输入评价"
rows="5"
show-word-limit
type="textarea"
v-model="viewData.evaluateText"
>
</el-input>-->
<span>{{viewData.evaluateText}}</span>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="evaluateDialogVisible = false" type="primary">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
units: [],
evaluateDialogVisible: false,
lineList: [],
tableColumns: [
{prop: 'lineName', label: '线路'},
{prop: 'playStartTime', label: '出行时间'},
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'unitname', label: '单位'},
{prop: 'unionname', label: '工会'},
{prop: 'userState', label: '在职状态'},
{prop: 'personType', label: '人员类型'},
{prop: 'evaluateScore', label: '评分', sortable: true},
{prop: 'evaluateText', label: '评价'},
],
pageForm: {
searchName: "we.userName",
year: new Date().getFullYear().toString(),
lineId: '',
searchKeyword: '',
unionId: '',
unitId: '',
evaluateScore: '',
},
viewData: {},
evaluateScores: [
{name: "满意", code: "满意"},
{name: "一般", code: "一般"},
{name: "不满意", code: "不满意"},
],
}
},
methods: {
exportEvaluate() {
window.open('/platform/therapyRecuperation/evaluate/statistics/exportEvaluate' +
'?lineId=' + this.pageForm.lineId +
'&searchName=' + this.pageForm.searchName +
'&searchKeyword=' + this.pageForm.searchKeyword +
'&unionId=' + this.pageForm.unionId +
'&unitId=' + this.pageForm.unitId +
'&evaluateScore=' + this.pageForm.evaluateScore)
},
openEvaluate(row) {
this.viewData = {
lineId: row.id,
evaluateText: row.evaluateText,
evaluateScore: row.evaluateScore,
}
this.evaluateDialogVisible = true
},
async getLineList() {
const resp = await $.get('/platform/therapyRecuperation/evaluate/statistics/lineList', {year: this.pageForm.year})
this.lineList = resp.data
},
async yearChange() {
this.$set(this.pageForm, "lineId", null)
await this.getLineList()
this.doSearch()
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
}
},
},
async created() {
await this.getLineList()
this.pageData()
this.unions = await getUnions(null, false)
}
})
</script>
<!--#
}
#-->
@@ -50,17 +50,17 @@ layout("/layouts/platform.html"){
</div>
</el-form-item>
<el-form-item label="省外最成团人数(包括家属)" prop="outsideQuota">
<el-form-item label="省外最成团人数" prop="outsideQuota">
<el-input v-model.number="formData.outsideQuota"
placeholder="请输入省外最少成团人数(包括家属)"></el-input>
placeholder="请输入每条省外线路最多成团人数"></el-input>
</el-form-item>
<!--<el-form-item label="省外名额分配比例" prop="outsideQuotaProportion">
<el-form-item label="省外名额分配比例" prop="outsideQuotaProportion">
<el-input placeholder="请输入省外名额分配比例" v-model="formData.outsideQuotaProportion">
<template slot="append">%</template>
</el-input>
</el-form-item>-->
</el-form-item>
<el-form-item label="省外几年去一次" prop="outsideNumber">
@@ -70,22 +70,22 @@ layout("/layouts/platform.html"){
</el-form-item>
<el-form-item label="每年旅行频率" prop="travelFrequency">
<el-input max="100"
<el-input max="100" disabled
placeholder="请输入每年旅行频率"
v-model.number="formData.travelFrequency"></el-input>
</el-form-item>
<!--<el-form-item label="最少教工人数" prop="groupNumber">
<el-form-item label="最少教工人数" prop="groupNumber">
<el-input max="100"
placeholder="请输入最少教工人数"
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"
placeholder="请输入不可取消修改天数"
v-model.number="formData.modifyDays"></el-input>
</el-form-item>-->
</el-form-item>
<el-form-item label="可以修改几次" prop="modifyNumber">
<el-input max="100"
@@ -107,13 +107,6 @@ layout("/layouts/platform.html"){
</el-radio-group>
</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-input max="100"
placeholder="请输入全批次最多报名人数"
@@ -140,6 +133,13 @@ layout("/layouts/platform.html"){
</el-radio-group>
</el-form-item>
<el-form-item label="承诺书" prop="files">
<file-upload :files.sync="formData.files"
:max="1"
:type="['pdf']"
></file-upload>
</el-form-item>
<vi-title title="标段管理"></vi-title>
<el-form-item label="标段">
<el-button type="primary" @click="formData.lots.push({})"
@@ -238,7 +238,6 @@ layout("/layouts/platform.html"){
<script>
const vue = new Vue({
el: '#app',
data() {
return {
activityGroupList: [],
@@ -246,7 +245,6 @@ layout("/layouts/platform.html"){
formData: {
isSnLine: 0,
isSwLine: 0,
travelAudit: 0,
lots: [],
configName: '智慧工会疗休养配置',
outsideQuota: null,
@@ -266,10 +264,9 @@ layout("/layouts/platform.html"){
configName: [{required: true, message: '请填写配置名称', trigger: ['blur', 'change']}],
isSnLine: [{required: true, message: '请选择省内线路是否需要审核', trigger: ['blur', 'change']}],
isSwLine: [{required: true, message: '请选择省外线路是否需要审核', trigger: ['blur', 'change']}],
travelAudit: [{required: true, message: '请选择旅行社是否需要审核', trigger: ['blur', 'change']}],
outsideQuota: [{
required: true,
message: '省外最少成团人数(包括家属)',
message: '请输入每条省外线路最多成团人数',
trigger: ['blur', 'change']
}],
outsideNumber: [{
@@ -323,7 +320,7 @@ layout("/layouts/platform.html"){
}
},
components: {
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue?v=1.0.1'),
},
methods: {
async deleteLotsRow(scope) {
@@ -368,6 +365,9 @@ layout("/layouts/platform.html"){
})
const cloneData = clone(this.formData)
if (this.formData.files && this.formData.files.length > 0) {
cloneData.files = JSON.stringify(this.formData.files)
}
if (this.lotDeleteList && this.lotDeleteList.length > 0) {
cloneData.lotDeleteList = JSON.stringify(this.lotDeleteList)
}
@@ -396,24 +396,11 @@ layout("/layouts/platform.html"){
data.lots = []
}
this.formData = data
this.initLineContentEditor(data.notice)
},
async getActivityGroup() {
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
this.activityGroupList = data
},
initLineContentEditor(content) {
$("#lineContent").html("")
lineContentEditor = new wangEditor("#lineContent")
lineContentEditor.config.onchange = (html) => {
this.formData.notice = html.replace(/<p\><\/p>/g, '')
}
lineContentEditor.config.uploadImgShowBase64 = true
lineContentEditor.create()
if (content) {
lineContentEditor.txt.html(content)
}
},
async closeDialog() {
this.tableScopeIndex = '';
this.tableScopeId = '';
@@ -441,7 +428,6 @@ layout("/layouts/platform.html"){
},
async created() {
this.findOne();
this.initLineContentEditor();
},
watch: {
'formData.activityGroupId': {