commit
This commit is contained in:
+83
@@ -0,0 +1,83 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.service.ExecutiveCommitteeConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ExecutiveCommitteeConfigController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/6/20 15:30
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/executiveCommittee/executiveCommitteeConfig")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "执委会成员推选配置")
|
||||
public class ExecutiveCommitteeConfigController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ExecutiveCommitteeConfigService committeeConfigService;
|
||||
|
||||
|
||||
@At("/index")
|
||||
@SaCheckPermission("executiveCommittee.executiveCommitteeConfig")
|
||||
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/executiveCommitteeConfig/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("executiveCommittee.executiveCommitteeConfig")
|
||||
public Result fetchConfig(String sessionId) {
|
||||
ExecutiveCommitteeConfig config = committeeConfigService.fetch(Cnd.where("teacherMeetId", "=", sessionId));
|
||||
if(config == null) {
|
||||
config = new ExecutiveCommitteeConfig();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
dbt.id as delegationId,
|
||||
dbt.name as delegationName,
|
||||
dbt.code as delegationCode,
|
||||
(SELECT count( 1 ) FROM vw_user where unitId IN ( SELECT unitId FROM teacher_congress_delegation_unit unit WHERE unit.delegationId = dbt.id ) and member = 1) as memberCount,
|
||||
0 as quotaCount
|
||||
FROM
|
||||
teacher_congress_delegation dbt
|
||||
WHERE dbt.sessionId = @sessionId
|
||||
ORDER BY CODE ASC
|
||||
""").setParam("sessionId", sessionId);
|
||||
List<NutMap> listMap = committeeConfigService.listMap(sql);
|
||||
config.setDelegationQuotaList(listMap);
|
||||
}
|
||||
return Result.success(config);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增、修改预选名额分配")
|
||||
@SaCheckPermission("executiveCommittee.executiveCommitteeConfig")
|
||||
@SLog(type = "executiveCommitteeConfig", tag = "执委会推选-预选名额分配", msg ="新增、修改预选名额分配" )
|
||||
public Result onHandle(ExecutiveCommitteeConfig config) {
|
||||
committeeConfigService.insertOrUpdate(config);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+258
@@ -0,0 +1,258 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/25 15:18
|
||||
* @description 团长一次推选
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/executiveCommittee/delegationOnePush")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "执委会推选-团长一次推选")
|
||||
public class ExecutiveCommitteeDelegationOnePushController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/index")
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/delegationOnePush/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询某个代表团的团长一次推选的委员")
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
public Result pageData(PageForm pageForm,
|
||||
String teacherMeetId,
|
||||
String unionId) {
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.name AS unitName,
|
||||
t3.name unionName,
|
||||
t4.sex,
|
||||
TIMESTAMPDIFF(
|
||||
YEAR,
|
||||
t4.birthday,
|
||||
CURDATE()) AS age
|
||||
FROM
|
||||
`executive_committee_one_push` t1
|
||||
LEFT JOIN sys_unit t2 ON t1.unitId = t2.id
|
||||
LEFT JOIN `sys_union` t3 ON t3.id = t2.unionid
|
||||
LEFT JOIN `vw_user` t4 ON t4.id = t1.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.delegationId", "=", db.getDelegationId());
|
||||
cnd.andEX("t3.id", "=", unionId);
|
||||
cnd.andEX("t1.addType", "=", 1);
|
||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(pageForm.getSearchName(), "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||
}
|
||||
cnd.asc("t1.firstLetter");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询可以推选委员和已经推选的人员")
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
public Result getDelegationUser(String teacherMeetId) {
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待一次预选开始时间");
|
||||
}
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束");
|
||||
}
|
||||
List<ExecutiveCommitteeOnePush> userValue = dao.query(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId)
|
||||
.and("addType", "=", 1));
|
||||
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
|
||||
List<String> userIds = onePushList.stream().map(v -> v.getUserId()).collect(Collectors.toList());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("db.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("db.userId", "not in", userIds);
|
||||
cnd.andEX("db.userId", "!=", SecurityUtil.getUserId());
|
||||
cnd.and("db.delegationId", "=", db.getDelegationId());
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
db.*,
|
||||
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
|
||||
FROM
|
||||
teacher_congress_delegate db
|
||||
LEFT JOIN `vw_user` u ON db.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> userData = baseService.listMap(sql);
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
@SLog(tag = "执委会推选-团长推选委员", msg = "推选委员")
|
||||
public Result addOnePush(@Param("userValue") String[] userValue,
|
||||
String teacherMeetId) {
|
||||
try {
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待一次预选开始时间");
|
||||
}
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束");
|
||||
}
|
||||
List<NutMap> delegationQuotaList = config.getDelegationQuotaList();
|
||||
|
||||
NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.getString("delegationId").equals(db.getDelegationId())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(delegationQuota)) {
|
||||
return Result.error("请先配置代表团人数");
|
||||
}
|
||||
|
||||
int dbCount = dao.count(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("delegationId", "=", db.getDelegationId())
|
||||
.and("teacherMeetId", "=", teacherMeetId)
|
||||
.and("addType", "=", 1));
|
||||
if (dbCount + userValue.length > delegationQuota.getInt("quotaCount")) {
|
||||
return Result.error("代表团人数限报" + delegationQuota.getInt("quotaCount") + "人");
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
teacher_congress_delegate t1
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t1.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.userId", "in", userValue);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> dbList = baseService.listMap(sql);
|
||||
|
||||
|
||||
List<ExecutiveCommitteeOnePush> list = new ArrayList<>();
|
||||
for (String id : userValue) {
|
||||
NutMap jdhDb = dbList.stream().filter(v -> v.getString("userId").equals(id)).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(jdhDb)) {
|
||||
return Result.error("请选择正确的代表!");
|
||||
}
|
||||
ExecutiveCommitteeOnePush onePush = new ExecutiveCommitteeOnePush();
|
||||
onePush.setPushDate(DateUtil.date());
|
||||
onePush.setUserId(jdhDb.getString("userId"));
|
||||
onePush.setUserName(jdhDb.getString("userName"));
|
||||
onePush.setLoginName(jdhDb.getString("loginName"));
|
||||
onePush.setDelegationId(jdhDb.getString("delegationId"));
|
||||
onePush.setUnitId(jdhDb.getString("unitId"));
|
||||
onePush.setTeacherMeetId(teacherMeetId);
|
||||
String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName")));
|
||||
onePush.setFirstLetter(firstLetter);
|
||||
onePush.setAddType(1);
|
||||
list.add(onePush);
|
||||
}
|
||||
dao.insert(list);
|
||||
return Result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("添加失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
@SLog( tag = "执委会推选-团长推选委员", msg = "删除推选的人")
|
||||
public Result doDelete(String id) {
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.NEW());
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束不能删除!");
|
||||
}
|
||||
int num = dao.clear(ExecutiveCommitteeOnePush.class, Cnd.where("id", "=", id));
|
||||
return num >= 0 ? Result.success() : Result.error();
|
||||
}
|
||||
|
||||
|
||||
public static char getFirstLetter(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
throw new IllegalArgumentException("字符串不能为空");
|
||||
}
|
||||
char firstChar = str.charAt(0);
|
||||
if (Validator.isChinese(String.valueOf(firstChar))) {
|
||||
return Character.toUpperCase(PinyinUtil.getPinyin(firstChar).charAt(0));
|
||||
} else if (Character.isLetter(firstChar)) {
|
||||
return Character.toUpperCase(firstChar);
|
||||
} else {
|
||||
return firstChar;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeTwoPush;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/6/23 15:25
|
||||
* @description 团长二次推选
|
||||
*/
|
||||
@At("/platform/executiveCommittee/delegationTwoPush")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/index")
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/delegationTwoPush/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("executiveCommittee.delegationTwoPush")
|
||||
public Result pageData(PageForm pageForm,
|
||||
String teacherMeetId,
|
||||
String delegationId,
|
||||
String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.loginName,
|
||||
t2.userName,
|
||||
t3.name AS unitName,
|
||||
t4.name unionName,
|
||||
t5.sex,
|
||||
TIMESTAMPDIFF(
|
||||
YEAR,
|
||||
t5.birthday,
|
||||
CURDATE()) AS age,
|
||||
t6.name AS delegationName
|
||||
FROM
|
||||
`executive_committee_two_push` t1
|
||||
LEFT JOIN executive_committee_one_push t2 on t2.userId=t1.userId and t2.teacherMeetId=t1.teacherMeetId
|
||||
LEFT JOIN sys_unit t3 ON t2.unitId = t3.id
|
||||
LEFT JOIN `sys_union` t4 ON t4.id = t3.unionid
|
||||
LEFT JOIN `vw_user` t5 ON t5.id = t1.userId
|
||||
LEFT JOIN teacher_congress_delegation t6 ON t6.id = t2.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.pushUserId", "=", SecurityUtil.getUserId());
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("t2.delegationId", "=", delegationId);
|
||||
cnd.andEX("t4.id", "=", unionId);
|
||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(pageForm.getSearchName(), "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||
}
|
||||
cnd.asc("t6.code").asc("t2.firstLetter");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationTwoPush")
|
||||
@SLog(type = "执委会推选-团长二次推选", tag = "查询可以二次推选的名单", param = true, result = true)
|
||||
public Result getDelegationUser(String teacherMeetId) {
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getSecondStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待二次预选开始时间");
|
||||
}
|
||||
if (config.getSecondEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("二次预选已结束");
|
||||
}
|
||||
List<ExecutiveCommitteeTwoPush> userValue = dao.query(ExecutiveCommitteeTwoPush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId)
|
||||
.and("pushUserId", "=", SecurityUtil.getUserId()));
|
||||
List<String> userIds = userValue.stream().map(v -> v.getUserId()).collect(Collectors.toList());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.userId", "not in", userIds);
|
||||
cnd.andEX("t1.userId", "!=", SecurityUtil.getUserId());
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.sex,
|
||||
TIMESTAMPDIFF(
|
||||
YEAR,
|
||||
t2.birthday,
|
||||
CURDATE()) age
|
||||
FROM
|
||||
executive_committee_one_push t1
|
||||
LEFT JOIN `vw_user` t2 ON t1.userId = t2.id
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> userData = baseService.listMap(sql);
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationTwoPush")
|
||||
@ApiOperation("推选委员")
|
||||
@SLog(type = "executiveCommitteePreparatoryGroupPush", tag = "执委会推选-团长二次推选", msg = "推选委员")
|
||||
public Result addOnePush(@Param("userValue") String[] userValue,
|
||||
String teacherMeetId) {
|
||||
try {
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getSecondStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待二次预选开始时间");
|
||||
}
|
||||
if (config.getSecondEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("二次预选已结束");
|
||||
}
|
||||
int dbCount = dao.count(ExecutiveCommitteeTwoPush.class,
|
||||
Cnd.where("pushUserId", "=", SecurityUtil.getUserId())
|
||||
.and("teacherMeetId", "=", teacherMeetId));
|
||||
if (dbCount + userValue.length > config.getCommitteeQuotaCount()) {
|
||||
return Result.error("人数限报" + config.getCommitteeQuotaCount() + "人");
|
||||
}
|
||||
|
||||
List<Teacher_congress_delegate> dbList = dao.query(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.andEX(Teacher_congress_delegate::getUserId, "in", userValue));
|
||||
List<ExecutiveCommitteeTwoPush> list = new ArrayList<>();
|
||||
for (String id : userValue) {
|
||||
Teacher_congress_delegate jdhDb = dbList.stream().filter(v -> v.getUserId().equals(id)).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(jdhDb)) {
|
||||
return Result.error("请选择正确的代表!");
|
||||
}
|
||||
ExecutiveCommitteeTwoPush twoPush = new ExecutiveCommitteeTwoPush();
|
||||
twoPush.setPushDate(DateUtil.date());
|
||||
twoPush.setUserId(id);
|
||||
twoPush.setPushDelegationId(db.getDelegationId());
|
||||
twoPush.setPushUserId(SecurityUtil.getUserId());
|
||||
twoPush.setPushUserName(SecurityUtil.getUserUsername());
|
||||
twoPush.setPushLoginName(SecurityUtil.getUserLoginname());
|
||||
twoPush.setTeacherMeetId(teacherMeetId);
|
||||
list.add(twoPush);
|
||||
}
|
||||
dao.insert(list);
|
||||
return Result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("添加失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除推选人员")
|
||||
@SaCheckPermission("executiveCommittee.delegationTwoPush")
|
||||
@SLog(type = "executiveCommitteePreparatoryGroupPush", tag = "执委会推选-团长二次推选", msg = "删除推选人员")
|
||||
public Result doDelete( String id) {
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.NEW());
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getSecondEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("二次预选已结束不能删除!");
|
||||
}
|
||||
int num = dao.clear(ExecutiveCommitteeTwoPush.class, Cnd.where("id", "=", id));
|
||||
return num >= 0 ? Result.success() : Result.error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
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.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.param.ExecutiveCommitteePageForm;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.service.ExecutiveCommitteeConfigService;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.service.ExecutiveCommitteeMemberService;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.vo.EnrollmentRegistrationPageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 08:40
|
||||
* @description 委员会名单
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/executiveCommittee/executiveCommitteeMember")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "两委会推选-委员会名单")
|
||||
public class ExecutiveCommitteeMemberController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ExecutiveCommitteeMemberService committeeMemberService;
|
||||
|
||||
|
||||
@At("/index")
|
||||
@SaCheckPermission("executiveCommittee.executiveCommitteeMember")
|
||||
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/executiveCommitteeMember/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("executiveCommittee.executiveCommitteeMember")
|
||||
public Result pageData(ExecutiveCommitteePageForm pageForm) {
|
||||
Sql sql = committeeMemberService.getSql(pageForm);
|
||||
Pagination pagination = committeeMemberService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询每个人的推选人")
|
||||
@SaCheckPermission("executiveCommittee.executiveCommitteeMember")
|
||||
public Result onView(String teacherMeetId,
|
||||
String userId) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
tp.*,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
dbt.name as delegationName
|
||||
from
|
||||
executive_committee_two_push tp
|
||||
left join vw_user u on u.id = tp.pushUserId
|
||||
left join teacher_congress_delegation dbt on dbt.id = tp.pushDelegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("tp.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.and("tp.userId", "=", userId);
|
||||
cnd.desc("tp.pushDate");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = committeeMemberService.listMap(sql);
|
||||
return Result.success(listMap);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("executiveCommittee.executiveCommitteeMember")
|
||||
public void doExportExcel(@Param("data") ExecutiveCommitteePageForm pageForm, HttpServletResponse response) {
|
||||
|
||||
Sql sql = committeeMemberService.getSql(pageForm);
|
||||
|
||||
List<NutMap> map = committeeMemberService.listMap(sql);
|
||||
|
||||
try {
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
entityList.add(no);
|
||||
|
||||
entityList.add(new ExcelExportEntity("姓名", "userName", 10));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginName", 10));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 10));
|
||||
entityList.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属代表团", "delegationName", 20));
|
||||
entityList.add(new ExcelExportEntity("票数", "pushCount", 20));
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("委员会预选名单.xlsx", "UTF-8"));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, map);
|
||||
workbook.write(response.getOutputStream());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/25 16:49
|
||||
* @description
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/executiveCommittee/preparatoryGroupPush")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "执委会推选-筹备组推选")
|
||||
public class ExecutiveCommitteePushController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/index")
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/preparatoryGroupPush/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
public Result pageData(PageForm pageForm,
|
||||
String teacherMeetId,
|
||||
String delegationId,
|
||||
String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.name AS unitName,
|
||||
t3.name unionName,
|
||||
t4.sex,
|
||||
TIMESTAMPDIFF(
|
||||
YEAR,
|
||||
t4.birthday,
|
||||
CURDATE()) AS age,
|
||||
t5.name AS delegationName
|
||||
FROM
|
||||
`executive_committee_one_push` t1
|
||||
LEFT JOIN sys_unit t2 ON t1.unitId = t2.id
|
||||
LEFT JOIN `sys_union` t3 ON t3.id = t2.unionid
|
||||
LEFT JOIN `vw_user` t4 ON t4.id = t1.userId
|
||||
LEFT JOIN teacher_congress_delegation t5 ON t5.id = t1.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.delegationId", "=", delegationId);
|
||||
cnd.andEX("t3.id", "=", unionId);
|
||||
cnd.andEX("t1.addType", "=", 2);
|
||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(pageForm.getSearchName(), "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||
}
|
||||
cnd.asc("t5.code").asc("t1.firstLetter");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
@ApiOperation("查询可以推选委员和已经推选的人员")
|
||||
public Result getDelegationUser(String teacherMeetId) {
|
||||
List<ExecutiveCommitteeOnePush> userValue = dao.query(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId)
|
||||
.and("addType", "=", 2));
|
||||
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
|
||||
List<String> userIds = onePushList.stream().map(ExecutiveCommitteeOnePush::getUserId).collect(Collectors.toList());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("db.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("db.userId", "not in", userIds);
|
||||
cnd.andEX("db.userId", "!=", SecurityUtil.getUserId());
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
db.*,
|
||||
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
|
||||
FROM
|
||||
teacher_congress_delegate db
|
||||
LEFT JOIN `vw_user` u ON db.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> userData = baseService.listMap(sql);
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
@SLog(type = "executiveCommitteePreparatoryGroupPush", tag = "执委会推选-筹备组推选", msg = "推选委员")
|
||||
public Result addOnePush(@Param("userValue") String[] userValue,
|
||||
String teacherMeetId) {
|
||||
try {
|
||||
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待一次预选开始时间");
|
||||
}
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束");
|
||||
}
|
||||
|
||||
int dbCount = dao.count(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId)
|
||||
.and("addType", "=", 2));
|
||||
if (dbCount + userValue.length > config.getPrepareGroupQuotaCount()) {
|
||||
return Result.error("人数限报" + config.getPrepareGroupQuotaCount() + "人");
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
teacher_congress_delegate t1
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t1.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.userId", "in", userValue);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> dbList = baseService.listMap(sql);
|
||||
|
||||
List<ExecutiveCommitteeOnePush> list = new ArrayList<>();
|
||||
for (String id : userValue) {
|
||||
NutMap jdhDb = dbList.stream().filter(v -> v.getString("userId").equals(id)).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(jdhDb)) {
|
||||
return Result.error("请选择正确的代表!");
|
||||
}
|
||||
ExecutiveCommitteeOnePush onePush = new ExecutiveCommitteeOnePush();
|
||||
onePush.setPushDate(DateUtil.date());
|
||||
onePush.setUserId(jdhDb.getString("userId"));
|
||||
onePush.setUserName(jdhDb.getString("userName"));
|
||||
onePush.setLoginName(jdhDb.getString("loginName"));
|
||||
onePush.setDelegationId(jdhDb.getString("delegationId"));
|
||||
onePush.setUnitId(jdhDb.getString("unitId"));
|
||||
onePush.setTeacherMeetId(teacherMeetId);
|
||||
String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName")));
|
||||
onePush.setFirstLetter(firstLetter);
|
||||
onePush.setAddType(2);
|
||||
list.add(onePush);
|
||||
}
|
||||
dao.insert(list);
|
||||
return Result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("添加失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
@SLog(type = "executiveCommitteePreparatoryGroupPush", tag = "执委会推选-筹备组推选", msg = "删除推选的人")
|
||||
public Result doDelete(String id) {
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.NEW());
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
int num = dao.clear(ExecutiveCommitteeOnePush.class, Cnd.where("id", "=", id));
|
||||
return num >= 0 ? Result.success() : Result.error();
|
||||
}
|
||||
|
||||
|
||||
public static char getFirstLetter(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
throw new IllegalArgumentException("字符串不能为空");
|
||||
}
|
||||
char firstChar = str.charAt(0);
|
||||
if (Validator.isChinese(String.valueOf(firstChar))) {
|
||||
return Character.toUpperCase(PinyinUtil.getPinyin(firstChar).charAt(0));
|
||||
} else if (Character.isLetter(firstChar)) {
|
||||
return Character.toUpperCase(firstChar);
|
||||
} else {
|
||||
return firstChar;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.models;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ExecutiveCommitteeConfig
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/6/20 15:30
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("executive_committee_config")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("执委会成员推选配置表")
|
||||
public class ExecutiveCommitteeConfig extends BaseModel implements Serializable {
|
||||
|
||||
@Name
|
||||
@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 teacherMeetId;
|
||||
|
||||
@Column
|
||||
@Comment("筹备组推荐名额数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer prepareGroupQuotaCount;
|
||||
|
||||
@Column
|
||||
@Comment("委员会预选人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer committeeQuotaCount;
|
||||
|
||||
@Column
|
||||
@Comment("代表团推荐名额总数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer delegationQuotaCount;
|
||||
|
||||
@Column
|
||||
@Comment("一次预选开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime firstStartTime;
|
||||
|
||||
@Column
|
||||
@Comment("一次预选结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime firstEndTime;
|
||||
|
||||
@Column
|
||||
@Comment("二次预选开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime secondStartTime;
|
||||
|
||||
@Column
|
||||
@Comment("二次预选结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime secondEndTime;
|
||||
|
||||
@Column
|
||||
@Comment("各代表团名额数")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<NutMap> delegationQuotaList;
|
||||
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.models;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.budwk.app.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;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/6/20 16:16
|
||||
* @description 执委会成员推选表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("executive_committee_one_push")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("执委会成员推选表")
|
||||
public class ExecutiveCommitteeOnePush extends BaseModel implements Serializable {
|
||||
|
||||
@Name
|
||||
@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 userId;
|
||||
|
||||
@Column
|
||||
@Comment("所属教代会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String teacherMeetId;
|
||||
|
||||
@Column
|
||||
@Comment("所属代表团")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("职称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String jobTitle;
|
||||
|
||||
@Column
|
||||
@Comment("职称级别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String jobTitleLevel;
|
||||
|
||||
@Column
|
||||
@Comment("单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("推选时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime pushDate;
|
||||
|
||||
@Column
|
||||
@Comment("姓氏排序")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String firstLetter;
|
||||
|
||||
@Column
|
||||
@Comment("设置类型(1.团长2.筹备组加的)")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer addType;
|
||||
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.models;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.budwk.app.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;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/6/20 17:10
|
||||
* @description 二次推选
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("executive_committee_two_push")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("执委会成员推选表")
|
||||
public class ExecutiveCommitteeTwoPush extends BaseModel implements Serializable {
|
||||
|
||||
@Name
|
||||
@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 userId;
|
||||
|
||||
@Column
|
||||
@Comment("所属教代会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String teacherMeetId;
|
||||
|
||||
@Column
|
||||
@Comment("推选的代表团")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String pushDelegationId;
|
||||
|
||||
@Column
|
||||
@Comment("推选人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String pushUserId;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String pushUserName;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String pushLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("推选时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime pushDate;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.param;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 09:27
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
public class ExecutiveCommitteePageForm extends PageForm {
|
||||
|
||||
private String teacherMeetId;
|
||||
private String delegationId;
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.service;
|
||||
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
|
||||
/**
|
||||
* @ClassName ExecutiveCommitteeConfigService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/6/20 15:31
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface ExecutiveCommitteeConfigService extends BaseService<ExecutiveCommitteeConfig> {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.param.ExecutiveCommitteePageForm;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface ExecutiveCommitteeMemberService extends BaseService {
|
||||
|
||||
|
||||
|
||||
Sql getSql(ExecutiveCommitteePageForm pageForm);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.service.ExecutiveCommitteeConfigService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName ExecutiveCommitteeConfigServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/6/20 15:31
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ExecutiveCommitteeConfigServiceImpl extends BaseServiceImpl<ExecutiveCommitteeConfig> implements ExecutiveCommitteeConfigService {
|
||||
|
||||
public ExecutiveCommitteeConfigServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.param.ExecutiveCommitteePageForm;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.service.ExecutiveCommitteeMemberService;
|
||||
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.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 09:22
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ExecutiveCommitteeMemberServiceImpl extends BaseServiceImpl implements ExecutiveCommitteeMemberService {
|
||||
public ExecutiveCommitteeMemberServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql getSql(ExecutiveCommitteePageForm pageForm) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
op.*,
|
||||
u.sex,
|
||||
it.name unitName,
|
||||
un.name unionName,
|
||||
u.mobile,
|
||||
dbt.name as delegationName,
|
||||
TIMESTAMPDIFF(
|
||||
YEAR,
|
||||
u.birthday,
|
||||
CURDATE()) AS age,
|
||||
( SELECT count( 1 ) FROM executive_committee_two_push tp WHERE tp.userId = op.userId ) as pushCount
|
||||
FROM
|
||||
executive_committee_one_push op
|
||||
LEFT JOIN sys_unit it ON op.unitId = it.id
|
||||
LEFT JOIN `sys_union` un ON it.unionid = un.id
|
||||
left join vw_user u on op.userId = u.id
|
||||
left join teacher_congress_delegation dbt on dbt.id = op.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("op.teacherMeetId", "=", pageForm.getTeacherMeetId());
|
||||
cnd.andEX("op.unitId", "=", pageForm.getUnitId());
|
||||
cnd.andEX("it.unionid", "=", pageForm.getUnionId());
|
||||
cnd.andEX("op.delegationId", "=", pageForm.getDelegationId());
|
||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(pageForm.getSearchName(), "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||
}
|
||||
cnd.desc("pushCount");
|
||||
cnd.asc("op.firstLetter");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.prepare.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_quota_allocation;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 14:11
|
||||
* @description 代表名额分配
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/teacherCongress/prepare/quotaAllocation")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "教代会届次管理")
|
||||
public class TeacherCongressQuotaAllocationController {
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/index.html")
|
||||
@SaCheckPermission("tc.prepare.quotaAllocation")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("tc.prepare.quotaAllocation")
|
||||
@ApiOperation(value = "分工会列表")
|
||||
public Result pageData(String unionId, String sessionId) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
un.NAME AS unionName,
|
||||
tcqa.allocationNum,
|
||||
tcqa.ratio,
|
||||
tcqa.seniorTeaNum,
|
||||
tcqa.ordinaryTeaNum,
|
||||
tcqa.femaleNum,
|
||||
tcqa.less45Num,
|
||||
COALESCE(u_count, 0) AS memberCount,
|
||||
COALESCE(db_count, 0) AS dbCount
|
||||
FROM
|
||||
sys_union un
|
||||
LEFT JOIN teacher_congress_quota_allocation tcqa ON tcqa.sessionId = @sessionId
|
||||
AND tcqa.unionId = un.id
|
||||
LEFT JOIN (SELECT unionId, COUNT(id) AS u_count FROM vw_user WHERE member = 1 GROUP BY unionId) u ON u.unionId = un.id
|
||||
LEFT JOIN (SELECT unionId, COUNT(id) AS db_count FROM teacher_congress_delegate WHERE sessionId = @sessionId GROUP BY unionId) db ON db.unionId = un.id
|
||||
$condition
|
||||
""").setParam("sessionId", sessionId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("un.id", "=", unionId);
|
||||
cnd.groupBy("un.id");
|
||||
cnd.asc("un.unionCode");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("tc.prepare.quotaAllocation")
|
||||
@ApiOperation(value = "分工会列表")
|
||||
public Result getUnionLimit(String sessionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
un.id AS unionId,
|
||||
un.`name` AS unionName,
|
||||
un.unionCode,
|
||||
COALESCE(u_count, 0) AS memberCount,
|
||||
t2.sessionId,
|
||||
t2.allocationNum,
|
||||
t2.ratio,
|
||||
t2.seniorTeaNum,
|
||||
t2.ordinaryTeaNum,
|
||||
t2.femaleNum,
|
||||
t2.less45Num
|
||||
FROM
|
||||
`sys_union` un
|
||||
LEFT JOIN (SELECT unionId, COUNT(id) AS u_count FROM vw_user WHERE member = 1 GROUP BY unionId) u ON u.unionId = un.id
|
||||
LEFT JOIN teacher_congress_quota_allocation t2 ON t2.unionId = un.id
|
||||
AND t2.sessionId = @sessionId
|
||||
ORDER BY
|
||||
un.unionCode
|
||||
""");
|
||||
sql.setParam("sessionId", sessionId);
|
||||
List<NutMap> nutMaps = baseService.listMap(sql);
|
||||
return Result.success(nutMaps);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("tc.prepare.quotaAllocation")
|
||||
@ApiOperation("添加分配")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result doQuotaAllocation(@Param("list")Teacher_congress_quota_allocation[] list,String sessionId){
|
||||
|
||||
dao.clear(Teacher_congress_quota_allocation.class,
|
||||
Cnd.where(Teacher_congress_quota_allocation::getSessionId, "=", sessionId));
|
||||
for (Teacher_congress_quota_allocation quotaAllocation : list) {
|
||||
quotaAllocation.setSessionId(sessionId);
|
||||
}
|
||||
dao.insert(list);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.prepare.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 14:35
|
||||
* @description 名额分配
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("teacher_congress_quota_allocation")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("名额分配")
|
||||
public class Teacher_congress_quota_allocation extends BaseModel {
|
||||
|
||||
|
||||
@Name
|
||||
@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 sessionId;
|
||||
|
||||
@Column
|
||||
@Comment("分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("名额分配数")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Default("0")
|
||||
private Integer allocationNum;
|
||||
|
||||
@Column
|
||||
@Comment("名额分配比例")
|
||||
@ColDefine(type = ColType.DOUBLE, width = 4)
|
||||
@Default("0")
|
||||
private Double ratio;
|
||||
|
||||
@Column
|
||||
@Comment("高级职称专任教师代表数")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Default("0")
|
||||
private Integer seniorTeaNum;
|
||||
|
||||
@Column
|
||||
@Comment("专任教师代表数")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Default("0")
|
||||
private Integer ordinaryTeaNum;
|
||||
|
||||
@Column
|
||||
@Comment("女代表数")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Default("0")
|
||||
private Integer femaleNum;
|
||||
|
||||
@Column
|
||||
@Comment("45岁以下代表数")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Default("0")
|
||||
private Integer less45Num;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistration;
|
||||
import com.budwk.app.zhgh.outlay.activityBudget.models.ActivityBudget;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/21 16:16
|
||||
* @description 子女入学登记
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/enrollmentRegistration/apply")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "子女入学登记填写")
|
||||
public class EnrollmentRegistrationApplyController {
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/enrollmentRegistration/apply/index.html")
|
||||
@SaCheckPermission("enrollmentRegistration.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询可以登记的计划")
|
||||
@SaCheckPermission("enrollmentRegistration.apply")
|
||||
public Result getEnrollmentRegistrationPlan() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
plan.*,
|
||||
dict.`name` registrationTypeName
|
||||
FROM
|
||||
`enrollment_registration_plan` plan
|
||||
LEFT JOIN sys_dict dict ON dict.`code` = plan.registrationType
|
||||
WHERE
|
||||
NOW() BETWEEN plan.startTime
|
||||
AND plan.endTime
|
||||
""");
|
||||
List<NutMap> map = baseService.listMap(sql);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("enrollmentRegistration.apply")
|
||||
@ApiOperation("保存申请")
|
||||
@SLog(type = "enrollmentRegistrationApply", tag = "子女入学管理-子女入学登记", msg = "保存子女入学登记")
|
||||
public Result save(@Param("data") EnrollmentRegistration enrollmentRegistration) {
|
||||
View_user user = baseService.dao().fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
enrollmentRegistration.setUserId(SecurityUtil.getUserId());
|
||||
enrollmentRegistration.setLoginName(SecurityUtil.getUserLoginname());
|
||||
enrollmentRegistration.setUserName(SecurityUtil.getUserUsername());
|
||||
enrollmentRegistration.setUnitId(SecurityUtil.getUnitId());
|
||||
enrollmentRegistration.setUnitName(user.getUnitName());
|
||||
enrollmentRegistration.setUnionId(SecurityUtil.getUnionId());
|
||||
enrollmentRegistration.setUnionName(user.getUnionName());
|
||||
enrollmentRegistration.setApplyTime(DateUtil.now());
|
||||
baseService.insertOrUpdate(enrollmentRegistration);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("enrollmentRegistration.apply")
|
||||
@ApiOperation("提交申请")
|
||||
@SLog(type = "enrollmentRegistrationApply", tag = "子女入学管理-子女入学登记", msg = "提交子女入学登记")
|
||||
public Result submit(@Param("data") EnrollmentRegistration enrollmentRegistration) {
|
||||
if (StrUtil.isBlank(enrollmentRegistration.getId())) {
|
||||
View_user user = baseService.dao().fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
enrollmentRegistration.setUserId(SecurityUtil.getUserId());
|
||||
enrollmentRegistration.setLoginName(SecurityUtil.getUserLoginname());
|
||||
enrollmentRegistration.setUserName(SecurityUtil.getUserUsername());
|
||||
enrollmentRegistration.setUnitId(SecurityUtil.getUnitId());
|
||||
enrollmentRegistration.setUnitName(user.getUnitName());
|
||||
enrollmentRegistration.setUnionId(SecurityUtil.getUnionId());
|
||||
enrollmentRegistration.setUnionName(user.getUnionName());
|
||||
enrollmentRegistration.setApplyTime(DateUtil.now());
|
||||
}
|
||||
baseService.insertOrUpdate(enrollmentRegistration);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, enrollmentRegistration);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("ZNRXDJ", enrollmentRegistration.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("查询身份证是否重复")
|
||||
public Result getIsRepeatByIdCard(String idCard, String id) {
|
||||
int count = baseService.dao().count(EnrollmentRegistration.class,
|
||||
Cnd.where(EnrollmentRegistration::getChildrenIdCard, "=", idCard)
|
||||
.and("YEAR(applyTime)", "=", DateUtil.thisYear())
|
||||
.andEX(EnrollmentRegistration::getId, "!=", id));
|
||||
|
||||
|
||||
return Result.success(count);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result findOne(String id) {
|
||||
return Result.success(baseService.dao().fetch(EnrollmentRegistration.class, id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/22 15:13
|
||||
* @description 子女入学我的登记
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/enrollmentRegistration/applyList")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "子女入学我的登记")
|
||||
public class EnrollmentRegistrationApplyListController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/enrollmentRegistration/applyList/index.html")
|
||||
@SaCheckPermission("enrollmentRegistration.applyList")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("enrollmentRegistration.applyList")
|
||||
public Result pageData(PageForm pageForm, Integer year) {
|
||||
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariale,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
|
||||
FROM
|
||||
enrollment_registration info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistrationPlan;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/21 10:38
|
||||
* @description 子女入学登记计划
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/enrollmentRegistration/plan")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "子女入学登记计划")
|
||||
public class EnrollmentRegistrationPlanController {
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/enrollmentRegistration/plan/index.html")
|
||||
@SaCheckPermission("enrollmentRegistration.plan")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("enrollmentRegistration.plan")
|
||||
public Result pageData(PageForm pageForm, String year) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT * FROM `enrollment_registration_plan` $condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(EnrollmentRegistrationPlan::getYear, "=", year);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("提交登记计划")
|
||||
@SaCheckPermission("enrollmentRegistration.plan")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(type = "outlayReimburseApply", tag = "子女入学管理-登记计划", msg = "提交登记计划")
|
||||
public Result onSubmit(@Param("data") EnrollmentRegistrationPlan enrollmentRegistrationPlan) {
|
||||
baseService.insertOrUpdate(enrollmentRegistrationPlan);
|
||||
|
||||
return Result.success();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/22 16:27
|
||||
* @description 校工会审核
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "子女入学管理-校工会审核")
|
||||
@At("/platform/enrollmentRegistration/schoolAudit")
|
||||
public class EnrollmentRegistrationSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/enrollmentRegistration/schoolAudit/index.html")
|
||||
@SaCheckPermission("enrollmentRegistration.schoolAudit")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("enrollmentRegistration.schoolAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String registrationType,
|
||||
Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
YEAR(info.applyTime) year,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN enrollment_registration info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "fcdea609-e3e9-41bc-94c0-61d09ab03dcc");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("info.unionId","=",unionId);
|
||||
cnd.andEX("info.unitId","=",unitId);
|
||||
cnd.andEX("info.registrationType","=",registrationType);
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.controller;
|
||||
|
||||
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.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.sys.services.SysFileService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistration;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.service.EnrollmentRegistrationSummaryService;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.vo.EnrollmentRegistrationPageForm;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.vo.OutlayReimbursePageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
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.json.Json;
|
||||
import org.nutz.lang.util.ByteInputStream;
|
||||
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.io.BufferedOutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/22 15:13
|
||||
* @description 子女入学我的登记
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/enrollmentRegistration/summary")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "子女入学查询统计")
|
||||
public class EnrollmentRegistrationSummaryController {
|
||||
|
||||
@Inject
|
||||
private EnrollmentRegistrationSummaryService enrollmentRegistrationSummaryService;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
@Inject
|
||||
private SysFileService sysFileService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
|
||||
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/enrollmentRegistration/summary/index.html")
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
public Result pageData(EnrollmentRegistrationPageForm pageForm) {
|
||||
Sql sql = enrollmentRegistrationSummaryService.getSql(pageForm);
|
||||
Pagination pagination = enrollmentRegistrationSummaryService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("删除子女入学信息")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
@SLog(tag = "子女入学-查询统计", type = "enrollmentRegistration", msg = "删除id: ${args[0]}")
|
||||
public Result doDelete(String id){
|
||||
enrollmentRegistrationSummaryService.dao().delete(EnrollmentRegistration.class,id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
public void doExportExcel(@Param("data") EnrollmentRegistrationPageForm pageForm, HttpServletResponse response) {
|
||||
try {
|
||||
Sql sql = enrollmentRegistrationSummaryService.getSql(pageForm);
|
||||
List<NutMap> map = enrollmentRegistrationSummaryService.listMap(sql);
|
||||
|
||||
List<Sys_dict> dictList = sysDictService.getSubListByCode("ENROLLMENT_REGISTRATION_TYPE");
|
||||
|
||||
map.forEach(item -> {
|
||||
Sys_dict dict = dictList.stream().filter(sys_dict -> sys_dict.getCode().equals(item.getString("registrationType"))).findFirst().orElse(null);
|
||||
item.put("registrationTypeName", dict.getName());
|
||||
});
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
entityList.add(no);
|
||||
|
||||
entityList.add(new ExcelExportEntity("子女姓名", "childrenName", 20));
|
||||
entityList.add(new ExcelExportEntity("教职工姓名", "userName", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("手机号码", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("登记类型", "registrationTypeName", 20));
|
||||
entityList.add(new ExcelExportEntity("填报时间", "applyTime", 20));
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("子女信息登记汇总.xlsx", "UTF-8"));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, map);
|
||||
workbook.write(response.getOutputStream());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
public void doExportZip(@Param("data") EnrollmentRegistrationPageForm pageForm, HttpServletResponse response) {
|
||||
|
||||
|
||||
try {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("子女入学.zip"));
|
||||
Sql sql = enrollmentRegistrationSummaryService.getSql(pageForm);
|
||||
List<NutMap> map = enrollmentRegistrationSummaryService.listMap(sql);
|
||||
List<Sys_dict> dictList = sysDictService.getSubListByCode("ENROLLMENT_REGISTRATION_TYPE");
|
||||
|
||||
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
|
||||
|
||||
map.forEach(item -> {
|
||||
try {
|
||||
String childrenName = item.getString("childrenName");
|
||||
String userName = item.getString("userName");
|
||||
Sys_dict dict = dictList.stream().filter(sys_dict -> sys_dict.getCode().equals(item.getString("registrationType"))).findFirst().orElse(null);
|
||||
|
||||
List<JSONObject> huKouFiles = Json.fromJsonAsList(JSONObject.class, item.getString("huKouFiles"));
|
||||
List<JSONObject> birthCertificateFiles = item.getList("birthCertificateFiles", JSONObject.class);
|
||||
List<JSONObject> mergedList = new ArrayList<>();
|
||||
mergedList.addAll(huKouFiles);
|
||||
mergedList.addAll(birthCertificateFiles);
|
||||
for (JSONObject file : mergedList) {
|
||||
|
||||
String fileName = file.getStr("name");
|
||||
|
||||
JSONObject entries = file.getJSONObject("response");
|
||||
String filepath = entries.getStr("data");
|
||||
|
||||
if (StrUtil.isNotBlank(filepath)) {
|
||||
int indexOf = filepath.lastIndexOf("?");
|
||||
String fileId = filepath.substring(indexOf + 4);
|
||||
zipOutputStream.putNextEntry(new ZipEntry(dict.getName() + userName + "【" + childrenName + "】" + item.getString("createdAt") + "/" + fileName));
|
||||
byte[] bytes = sysFileService.download(fileId);
|
||||
ByteInputStream byteIs = new ByteInputStream(bytes);
|
||||
IOUtils.copy(byteIs, zipOutputStream);
|
||||
byteIs.close();
|
||||
}
|
||||
}
|
||||
zipOutputStream.closeEntry();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
});
|
||||
zipOutputStream.flush();
|
||||
zipOutputStream.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/22 16:27
|
||||
* @description 分工会审核
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "子女入学管理-分工会审核")
|
||||
@At("/platform/enrollmentRegistration/unionAudit")
|
||||
public class EnrollmentRegistrationUnionAuditController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/enrollmentRegistration/unionAudit/index.html")
|
||||
@SaCheckPermission("enrollmentRegistration.unionAudit")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("enrollmentRegistration.unionAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String registrationType,
|
||||
Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
YEAR(info.applyTime) year,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN enrollment_registration info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "4a824460-80cf-4596-9b4b-1cf667296bb1");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("info.registrationType","=",registrationType);
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
}
|
||||
+114
-3
@@ -1,13 +1,13 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Table;
|
||||
import org.nutz.dao.entity.annotation.TableMeta;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -20,4 +20,115 @@ import java.io.Serializable;
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("入学登记表")
|
||||
public class EnrollmentRegistration extends BaseModel implements Serializable {
|
||||
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("登记类型(字典)")
|
||||
private String registrationType;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("监护人(教工)姓名")
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("工号")
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("userId")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("手机号码")
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("所在单位")
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("所在单位Id")
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("所在工会")
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("所在工会Id")
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("监护人与学生关系")
|
||||
private String childRelationship;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("子女姓名")
|
||||
private String childrenName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("性别")
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("身份证号")
|
||||
private String childrenIdCard;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("现就读学校")
|
||||
private String childrenCurrentSchool;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("拟报就读学校")
|
||||
private String childrenPlanSchool;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("子女户口所在地")
|
||||
private String childrenHuKouAddress;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("备注")
|
||||
private String note;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("填写时间")
|
||||
private String applyTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("户口簿照片")
|
||||
private List<JSONObject> huKouFiles;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("子女出生证照片")
|
||||
private List<JSONObject> birthCertificateFiles;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/21 10:29
|
||||
* @description 子女入学登记计划
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("enrollment_registration_plan")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("入学登记表")
|
||||
public class EnrollmentRegistrationPlan extends BaseModel implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 4)
|
||||
@Comment("年份")
|
||||
private String year;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("登记类型(字典)")
|
||||
private String registrationType;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("大于某个出生日期能选")
|
||||
private String greaterThanBirthday;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("小于某个出生日期能选")
|
||||
private String lessThanBirthday;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.service;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.vo.EnrollmentRegistrationPageForm;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface EnrollmentRegistrationSummaryService extends BaseService {
|
||||
|
||||
|
||||
|
||||
Sql getSql(EnrollmentRegistrationPageForm pageForm);
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.service.EnrollmentRegistrationSummaryService;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.vo.EnrollmentRegistrationPageForm;
|
||||
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.IocBean;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/22 17:30
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class EnrollmentRegistrationSummaryServiceImpl extends BaseServiceImpl implements EnrollmentRegistrationSummaryService {
|
||||
public EnrollmentRegistrationSummaryServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql getSql(EnrollmentRegistrationPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariale,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
|
||||
FROM
|
||||
enrollment_registration info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.and("ins.state", "=", ProcessTaskStateEnum.FINISHED.getCode());
|
||||
cnd.andEX("info.unionId","=",pageForm.getUnionId());
|
||||
cnd.andEX("info.unitId","=",pageForm.getUnitId());
|
||||
cnd.andEX("info.registrationType","=",pageForm.getRegistrationType());
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.budwk.app.zhgh.enrollmentRegistration.vo;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/25 08:40
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
public class EnrollmentRegistrationPageForm extends PageForm {
|
||||
|
||||
|
||||
private Integer year;
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
private String registrationType;
|
||||
}
|
||||
@@ -275,7 +275,7 @@ public class IntegralManageController {
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entities.add(new ExcelExportEntity("增加积分", "integral", 20));
|
||||
entities.add(new ExcelExportEntity("积分", "integral", 20));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList());
|
||||
CommonDownloadUtil.download("积分增加导入模板.xlsx", workbook, response);
|
||||
|
||||
+2
-1
@@ -196,8 +196,9 @@ public class IntegralManageServiceImpl extends BaseServiceImpl<IntegralDetail> i
|
||||
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
}
|
||||
cnd.andEX("ind.year", "=", year);
|
||||
cnd.andEX("u.unionId", "=", unionId);
|
||||
cnd.andEX("u.unionId", "=", unitId);
|
||||
cnd.andEX("u.unitId", "=", unitId);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("DATE(ind.integralTime)", "=", integralTime);
|
||||
|
||||
+30
-5
@@ -5,9 +5,16 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.integral.controller.IntegralManageController;
|
||||
import com.budwk.app.zhgh.outlay.activityBudget.models.ActivityBudget;
|
||||
@@ -52,6 +59,11 @@ public class ActivityBudgetApplyController {
|
||||
@Inject
|
||||
private ActivityBudgetService activityBudgetService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/outlay/activityBudget/apply/index.html")
|
||||
@@ -59,11 +71,6 @@ public class ActivityBudgetApplyController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/form")
|
||||
@Ok("beetl:/platform/zhgh/outlay/activityBudget/apply/form.html")
|
||||
@SaCheckPermission("activity.budget.apply")
|
||||
public void form() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@@ -72,6 +79,7 @@ public class ActivityBudgetApplyController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(type = "activityBudgetApply", tag = "年度预算申报-预算申报", msg = "提交年度预算申报")
|
||||
public Result submit(@Param("data") ActivityBudget activityBudget) {
|
||||
activityBudget.setApplyDate(DateUtil.now());
|
||||
return activityBudgetService.submit(activityBudget);
|
||||
}
|
||||
|
||||
@@ -84,6 +92,7 @@ public class ActivityBudgetApplyController {
|
||||
activityBudget.setUserId(SecurityUtil.getUserId());
|
||||
activityBudget.setLoginName(SecurityUtil.getUserLoginname());
|
||||
activityBudget.setUserName(SecurityUtil.getUserUsername());
|
||||
activityBudget.setApplyDate(DateUtil.now());
|
||||
activityBudgetService.insertOrUpdate(activityBudget);
|
||||
return Result.success();
|
||||
}
|
||||
@@ -125,6 +134,22 @@ public class ActivityBudgetApplyController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询协会,超级管理员查全部的")
|
||||
@SaCheckLogin
|
||||
public Result listClub(){
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT);
|
||||
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
|
||||
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
|
||||
cnd.and("id", "in", myClubId);
|
||||
}
|
||||
List<SysClub> list = sysClubService.query(cnd);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.zhgh.outlay.activityBudget.conteoller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -133,7 +134,7 @@ public class ActivityBudgetApplyListController {
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个预算详细信息")
|
||||
@SaCheckPermission("activity.budget.applyList")
|
||||
@SaCheckLogin
|
||||
public Result findOne(String id) {
|
||||
return Result.success(activityBudgetService.findOne(id));
|
||||
}
|
||||
|
||||
+8
@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
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.lang.util.NutMap;
|
||||
@@ -97,6 +98,13 @@ public class ActivityBudgetSchoolAuditController {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
group.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
|
||||
|
||||
cnd.andEX("YEAR(info.applyDate)", "=", year);
|
||||
cnd.and(Cnd.likeEX("info.activityMatter", activityMatter));
|
||||
|
||||
-130
@@ -1,130 +0,0 @@
|
||||
package com.budwk.app.zhgh.outlay.activityBudget.interceptor;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.outlay.activityBudget.models.ActivityBudget;
|
||||
import com.budwk.app.zhgh.outlay.activityBudget.models.ActivityBudgetDetails;
|
||||
import com.budwk.app.zhgh.outlay.activityBudget.service.ActivityBudgetService;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.school.model.OutlayManageSchool;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.union.model.OutlayManageUnion;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/7/28 17:01
|
||||
* @description 活动预算申报提交后置拦截器
|
||||
*/
|
||||
public class OutlayActBudgetApplyPostInterceptor implements FlowInterceptor {
|
||||
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
ActivityBudget activityBudget = Json.fromJson(ActivityBudget.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
|
||||
if (StrUtil.isEmpty(activityBudget.getId())) {
|
||||
activityBudget.setUserId(SecurityUtil.getUserId());
|
||||
activityBudget.setLoginName(SecurityUtil.getUserLoginname());
|
||||
activityBudget.setUserName(SecurityUtil.getUserUsername());
|
||||
//查询分工会这个项目有没有申报过
|
||||
// if (List.of("ACTIVITY_BUDGET_TYPE_TWO").contains(activityBudget.getBudgetTypeCode())) {
|
||||
// int activityMatterCount = dao.count(ActivityBudget.class, Cnd.where("activityMatter", "=",
|
||||
// activityBudget.getActivityMatter()).and("unionId", "=", SecurityUtil.getUnionId()));
|
||||
// if (activityMatterCount > 0) {
|
||||
// return Result.error(activityBudget.getActivityMatter() + "已填写申请!");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
//删除预算详情表
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
dao.clear(ActivityBudgetDetails.class, Cnd.where("budgetId", "=", activityBudget.getId()));
|
||||
}
|
||||
|
||||
if (List.of("superadmin").contains(SecurityUtil.getUserLoginname())) {
|
||||
//如果是超级管理员就可以直接提交不用审核
|
||||
activityBudget.setTotalBudgetMoney(activityBudget.getDeclareTotalBudgetMoney());
|
||||
ActivityBudget budget = null;
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
budget = dao.fetch(ActivityBudget.class, activityBudget.getId());
|
||||
}
|
||||
//如果申报的是校工会预算
|
||||
if (activityBudget.getOutlayManageSource().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
OutlayManageSchool outlayManageSchool = dao.fetch(OutlayManageSchool.class, Cnd.where("year", "=", DateUtil.thisYear()));
|
||||
if (ObjectUtil.isNotEmpty(outlayManageSchool)) {
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
//如果传过来有预算Id,代表是修改的,那么就减去原来的金额
|
||||
outlayManageSchool.setTotalQuota(outlayManageSchool.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
//直接修改为现在传过来的金额
|
||||
outlayManageSchool.setTotalQuota(outlayManageSchool.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
dao.updateIgnoreNull(outlayManageSchool);
|
||||
}
|
||||
} else if (activityBudget.getOutlayManageSource().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
//如果申报的是分工会预算
|
||||
OutlayManageUnion outlayManageUnion = dao.fetch(OutlayManageUnion.class,
|
||||
Cnd.where("year", "=", DateUtil.thisYear())
|
||||
.and("unionId", "=", activityBudget.getUnionId()));
|
||||
if (ObjectUtil.isNotEmpty(outlayManageUnion)) {
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
outlayManageUnion.setTotalQuota(outlayManageUnion.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
outlayManageUnion.setTotalQuota(outlayManageUnion.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
dao.updateIgnoreNull(outlayManageUnion);
|
||||
}
|
||||
} else if (activityBudget.getOutlayManageSource().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
//如果不等于校工会预算才往表里面加预算
|
||||
//代表协会可能用的是校工会的预算
|
||||
// if (!activityBudget.getIsSchoolBudget()) {
|
||||
// jf_club jfClub = dao.fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
// .and("club_id", "=", activityBudget.getClubId()));
|
||||
// if (ObjectUtil.isNotEmpty(jfClub)) {
|
||||
// if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
// jfClub.setTotalQuota(jfClub.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
// }
|
||||
// jfClub.setTotalQuota(jfClub.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
// dao.updateIgnoreNull(jfClub);
|
||||
// }
|
||||
// }
|
||||
} else if (activityBudget.getOutlayManageSource().equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
// 更新其他经费表
|
||||
// JfOther jfOther = dao.fetch(JfOther.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
// if (ObjectUtil.isNotEmpty(jfOther)) {
|
||||
// if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
// jfOther.setTotalQuota(jfOther.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
// }
|
||||
// jfOther.setTotalQuota(jfOther.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
// dao.updateIgnoreNull(jfOther);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dao.insertOrUpdate(activityBudget);
|
||||
// for (ActivityBudgetDetails details : activityBudget.getBudgetDetails()) {
|
||||
// details.setBudgetId(activityBudget.getId());
|
||||
// }
|
||||
// //添加预算详情表
|
||||
// dao.insert(activityBudget.getBudgetDetails());
|
||||
|
||||
execution.getArgs().set(FlowConst.FORM_DATA,Json.toJson(activityBudget));
|
||||
|
||||
int instanceId = execution.getArgs().getInt(FlowConst.PROCESS_INSTANCE_ID_KEY);
|
||||
dao.update(ProcessInstance.class, Chain.make("businessNo", activityBudget.getId()), Cnd.where(ProcessInstance::getId, "=", instanceId));
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -6,6 +6,7 @@ import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.outlay.activityBudget.models.ActivityBudget;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -20,7 +21,7 @@ public interface ActivityBudgetService extends BaseService<ActivityBudget> {
|
||||
*/
|
||||
Result submit(ActivityBudget activityBudget);
|
||||
|
||||
ActivityBudget findOne(String id);
|
||||
NutMap findOne(String id);
|
||||
|
||||
|
||||
void doExport(Integer year, String activityMatter, HttpServletResponse response);
|
||||
|
||||
+11
-10
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||
@@ -15,6 +16,7 @@ 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 java.util.List;
|
||||
@@ -31,6 +33,11 @@ public class ActivityBudgetApplyStatisticsServiceImpl extends BaseServiceImpl im
|
||||
super(dao);
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
|
||||
@Override
|
||||
public Sql getsql(Integer year, String unionId, String clubId, String outlayManageSource, String activityMatter) {
|
||||
Sql sql = Sqls.create("""
|
||||
@@ -38,9 +45,11 @@ public class ActivityBudgetApplyStatisticsServiceImpl extends BaseServiceImpl im
|
||||
YEAR(ab.applyDate) year,
|
||||
ab.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo
|
||||
ins.businessNo,
|
||||
abb.activityMatter activityMatterTwo
|
||||
FROM
|
||||
activity_budget ab
|
||||
LEFT JOIN activity_budget abb ON abb.id = ab.schoolBudgetId
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = ab.id
|
||||
$condition
|
||||
""");
|
||||
@@ -82,17 +91,9 @@ public class ActivityBudgetApplyStatisticsServiceImpl extends BaseServiceImpl im
|
||||
//查出流程实例
|
||||
ProcessInstance instance = dao().fetch(ProcessInstance.class, Cnd.where("businessNo", "=", id));
|
||||
if (ObjectUtil.isNotEmpty(instance)) {
|
||||
//查询流程任务
|
||||
List<ProcessTask> taskList = dao().query(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", instance.getId()));
|
||||
List<Long> taskIds = taskList.stream().map(ProcessTask::getId).toList();
|
||||
//删除流程任务下面所有的人员
|
||||
dao().clear(ProcessTask.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "in", taskIds));
|
||||
//删除流程任务
|
||||
dao().clear(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", instance.getId()));
|
||||
//删除流程实例
|
||||
dao().delete(ProcessInstance.class, instance.getId());
|
||||
//删除预算
|
||||
dao().delete(ActivityBudget.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
-14
@@ -64,26 +64,30 @@ public class ActivityBudgetQueryStatisticsServiceImpl extends BaseServiceImpl im
|
||||
return listMap(sql);
|
||||
|
||||
} else if (outlayManageSource.equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
/* Sql sql = Sqls.create("""
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@year `year`,
|
||||
sc.`code` AS clubCode,
|
||||
sc.`name` AS clubName,
|
||||
COALESCE ( SUM( ab.totalBudgetMoney ), 0 ) AS totalBudgetMoney
|
||||
@YEAR `year`,
|
||||
sc.clubCode,
|
||||
sc.clubName,
|
||||
ab.clubId,
|
||||
COALESCE(SUM(ab.totalBudgetMoney), 0) AS totalBudgetMoney
|
||||
FROM
|
||||
sys_club sc
|
||||
LEFT JOIN activity_budget ab ON ab.clubId = sc.id
|
||||
AND ab.outlayManageSource = 'ACTIVITY_BUDGET_TYPE_THREE'
|
||||
AND ab.auditState = 4
|
||||
AND YEAR(ab.applyDate)=@year
|
||||
activity_budget ab
|
||||
LEFT JOIN sys_club sc ON ab.clubId = sc.id
|
||||
LEFT JOIN wf_process_instance wpi ON wpi.businessNo = ab.id
|
||||
$condition
|
||||
""").setParam("year", year);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("sc.id", "=", clubId);
|
||||
cnd.groupBy("sc.id");
|
||||
cnd.asc("sc.`code`");
|
||||
cnd.andEX("ab.clubId", "=", clubId);
|
||||
cnd.andEX("ab.isSchoolBudget", "=", 0);
|
||||
cnd.andEX("ab.outlayManageSource", "=", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
cnd.andEX("wpi.state", "=", 20);
|
||||
cnd.andEX("YEAR(ab.applyDate)", "=", year);
|
||||
cnd.groupBy("ab.clubId");
|
||||
cnd.asc("sc.clubCode");
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);*/
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
+16
-5
@@ -88,7 +88,6 @@ public class ActivityBudgetServiceImpl extends BaseServiceImpl<ActivityBudget> i
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(activityMatter)) {
|
||||
@@ -136,7 +135,7 @@ public class ActivityBudgetServiceImpl extends BaseServiceImpl<ActivityBudget> i
|
||||
int activityMatterCount = count(Cnd.where("activityMatter", "=",
|
||||
activityBudget.getActivityMatter()).and("unionId", "=", SecurityUtil.getUnionId()));
|
||||
if (activityMatterCount > 0) {
|
||||
return Result.error(activityBudget.getActivityMatter() + "已填写申请!");
|
||||
// return Result.error(activityBudget.getActivityMatter() + "已填写申请!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,9 +227,21 @@ public class ActivityBudgetServiceImpl extends BaseServiceImpl<ActivityBudget> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivityBudget findOne(String id) {
|
||||
ActivityBudget activityBudget = fetchLinks(fetch(id), "budgetDetails", Cnd.NEW().asc("detailsOrder"));
|
||||
// activityBudget.setAllocationEditAuditList(dao().query(Audit.class, Cnd.where("parentId", "=", activityBudget.getId())));
|
||||
public NutMap findOne(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ab.*,
|
||||
abb.activityMatter activityMatterTwo
|
||||
FROM
|
||||
activity_budget ab
|
||||
LEFT JOIN activity_budget abb ON abb.id = ab.schoolBudgetId
|
||||
WHERE
|
||||
ab.id = @id
|
||||
""").setParam("id",id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
execute(sql);
|
||||
NutMap activityBudget = (NutMap) sql.getResult();
|
||||
activityBudget.put("budgetDetails", dao().query(ActivityBudgetDetails.class, Cnd.where("budgetId", "=", id)));
|
||||
return activityBudget;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ public class OutlayUseDetail extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String activityNumber;
|
||||
|
||||
@Column
|
||||
@Comment("业务Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String outlayReimburseId;
|
||||
|
||||
@Column
|
||||
@Comment("活动时间")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
|
||||
+1
@@ -115,6 +115,7 @@ public class OutlayManageUnionController {
|
||||
WHERE
|
||||
YEAR(ab.applyDate) = @year
|
||||
AND ab.outlayManageSource = 'ACTIVITY_BUDGET_TYPE_TWO'
|
||||
AND ab.isSchoolBudget =0
|
||||
AND wpi.state = 20
|
||||
""").setParam("year", DateUtil.thisYear());
|
||||
List<NutMap> budgetList = baseService.listMap(sql);
|
||||
|
||||
+3
-3
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.zhgh.outlay.outlayReimburse.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
@@ -71,7 +72,7 @@ public class OutlayReimburseApplyController {
|
||||
@ApiOperation("查询这个预算已经报销了的金额")
|
||||
@SaCheckPermission("outlay.reimburse.apply")
|
||||
public Result getBxMoneyByBudgetId(String budgetId) {
|
||||
return Result.success(outlayReimburseApplyService.getBxMoneyByActivityId(budgetId));
|
||||
return Result.success(outlayReimburseApplyService.getBxMoneyByActivityId(budgetId,null));
|
||||
}
|
||||
|
||||
|
||||
@@ -136,8 +137,7 @@ public class OutlayReimburseApplyController {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("outlay.reimburse.apply")
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckLogin
|
||||
public Result findOne(String id){
|
||||
return Result.success(outlayReimburseApplyService.fetch(id));
|
||||
}
|
||||
|
||||
+3
-1
@@ -70,10 +70,12 @@ public class OutlayReimburseApplyListController {
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
+10
-12
@@ -9,6 +9,7 @@ import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.vo.OutlayReimbursePageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -49,13 +50,7 @@ public class OutlayReimburseSchoolCnAuditController {
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("outlay.reimburse.schoolCnAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String clubId,
|
||||
Boolean approval,
|
||||
String outlayManageSource,
|
||||
String activityMatter) {
|
||||
public Result pageData(OutlayReimbursePageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
@@ -88,16 +83,19 @@ public class OutlayReimburseSchoolCnAuditController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "714574d6-29c3-4a2c-bc63-ecef38a0d6d0");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.outlayManageSource", "=", outlayManageSource);
|
||||
|
||||
if (approval) {
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.outlayManageSource", "=", pageForm.getOutlayManageSource());
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", pageForm.getYear());
|
||||
if (pageForm.getApproval()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt").desc("info.applyTime");
|
||||
|
||||
+12
-11
@@ -13,6 +13,7 @@ import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.vo.OutlayReimbursePageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -56,13 +57,7 @@ public class OutlayReimburseSchoolKjAuditController {
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("outlay.reimburse.schoolKjAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String clubId,
|
||||
Boolean approval,
|
||||
String outlayManageSource,
|
||||
String activityMatter) {
|
||||
public Result pageData(OutlayReimbursePageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
@@ -95,16 +90,22 @@ public class OutlayReimburseSchoolKjAuditController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "930aed03-677b-41d7-8920-7d9b45a7abc9");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.outlayManageSource", "=", outlayManageSource);
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.outlayManageSource", "=", pageForm.getOutlayManageSource());
|
||||
cnd.andEX("info.detailsTypeId", "=", pageForm.getDetailsTypeId());
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", pageForm.getYear());
|
||||
|
||||
if (approval) {
|
||||
if (pageForm.getApproval()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt").desc("info.applyTime");
|
||||
|
||||
+12
-11
@@ -13,6 +13,7 @@ import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.vo.OutlayReimbursePageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -56,13 +57,7 @@ public class OutlayReimburseSchoolZxAuditController {
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("outlay.reimburse.schoolZxAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String clubId,
|
||||
Boolean approval,
|
||||
String outlayManageSource,
|
||||
String activityMatter) {
|
||||
public Result pageData(OutlayReimbursePageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
@@ -95,16 +90,22 @@ public class OutlayReimburseSchoolZxAuditController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "c433d966-05f4-45b4-b845-755b600d852a");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.outlayManageSource", "=", outlayManageSource);
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.outlayManageSource", "=", pageForm.getOutlayManageSource());
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.detailsTypeId", "=", pageForm.getDetailsTypeId());
|
||||
|
||||
if (approval) {
|
||||
if (pageForm.getApproval()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt").desc("info.applyTime");
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package com.budwk.app.zhgh.outlay.outlayReimburse.controller;
|
||||
|
||||
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.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.service.OutlayReimburseSummaryService;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.vo.OutlayReimbursePageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/20 17:43
|
||||
* @description 报销汇总
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/outlay/reimburse/summary")
|
||||
@Ok("json:full")
|
||||
@Api("我的报销")
|
||||
public class OutlayReimburseSummaryController {
|
||||
|
||||
@Inject
|
||||
private OutlayReimburseSummaryService outlayReimburseSummaryService;
|
||||
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/outlay/outlayReimburse/summary/index.html")
|
||||
@SaCheckPermission("outlay.reimburse.summary")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("outlay.reimburse.summary")
|
||||
public Result pageData(OutlayReimbursePageForm pageForm) {
|
||||
Sql sql = outlayReimburseSummaryService.getSql(pageForm);
|
||||
Pagination pagination = outlayReimburseSummaryService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("outlay.reimburse.summary")
|
||||
public void doExportUserExcel(@Param("data") OutlayReimbursePageForm pageForm, HttpServletResponse response) {
|
||||
try {
|
||||
Sql sql = outlayReimburseSummaryService.getSql(pageForm);
|
||||
List<NutMap> map = outlayReimburseSummaryService.listMap(sql);
|
||||
|
||||
List<Sys_dict> dictList = sysDictService.getSubListByCode("ACTIVITY_BUDGET_TYPE");
|
||||
List<Sys_dict> dictList2 = sysDictService.getSubListByCode("ACTIVITY_BUDGET_DETAILS_TYPE");
|
||||
|
||||
map.forEach(item -> {
|
||||
Sys_dict dict = dictList.stream().filter(sys_dict -> sys_dict.getCode().equals(item.getString("outlayManageSource"))).findFirst().orElse(null);
|
||||
item.put("outlayManageSourceName", dict.getName());
|
||||
Sys_dict dict2 = dictList2.stream().filter(sys_dict -> sys_dict.getCode().equals(item.getString("detailsTypeId"))).findFirst().orElse(null);
|
||||
item.put("detailsTypeName", dict2.getName());
|
||||
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_ONE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(item.getString("outlayManageSource"))) {
|
||||
item.put("helpUnitName", dict.getName());
|
||||
}else if (item.getString("outlayManageSource").equals("ACTIVITY_BUDGET_TYPE_TWO")){
|
||||
item.put("helpUnitName", item.getString("unionName"));
|
||||
}else if (item.getString("outlayManageSource").equals("ACTIVITY_BUDGET_TYPE_THREE")){
|
||||
item.put("helpUnitName", item.getString("clubName"));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
entityList.add(no);
|
||||
|
||||
entityList.add(new ExcelExportEntity("经办人工号", "loginName", 20));
|
||||
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entityList.add(new ExcelExportEntity("活动类型", "outlayManageSourceName", 20));
|
||||
entityList.add(new ExcelExportEntity("申报单位", "helpUnitName", 20));
|
||||
entityList.add(new ExcelExportEntity("金额", "money", 20));
|
||||
entityList.add(new ExcelExportEntity("明细类", "detailsTypeName", 50));
|
||||
entityList.add(new ExcelExportEntity("申报时间", "applyTime", 20));
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报销汇总名单.xlsx", "UTF-8"));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, map);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.budwk.app.zhgh.outlay.outlayReimburse.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/19 16:50
|
||||
* @description 分工会主席审核
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "费用报销管理-分工会主席审核")
|
||||
@At("/platform/outlay/reimburse/unionAudit")
|
||||
public class OutlayReimburseUnionAuditController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/outlay/outlayReimburse/unionAudit/index.html")
|
||||
@SaCheckPermission("outlay.reimburse.unionAudit")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("outlay.reimburse.unionAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String clubId,
|
||||
Boolean approval,
|
||||
String outlayManageSource) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
YEAR(info.applyTime) year,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN outlay_reimburse info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "d818a045-14c9-4668-993c-e18a1f4fc0c7");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("info.outlayManageSource", "=", outlayManageSource);
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", year);
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt").desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
package com.budwk.app.zhgh.outlay.outlayReimburse.interceptor;
|
||||
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.model.OutlayReimburse;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/7/30 15:58
|
||||
* @description
|
||||
*/
|
||||
public class OutlayReimburseApplyPostInterceptor implements FlowInterceptor {
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
OutlayReimburse outlayReimburse = Json.fromJson(OutlayReimburse.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
dao.insertOrUpdate(outlayReimburse);
|
||||
execution.getArgs().set("outlayManageSource", outlayReimburse.getOutlayManageSource());
|
||||
execution.getArgs().set(FlowConst.FORM_DATA, Json.toJson(outlayReimburse));
|
||||
|
||||
int instanceId = execution.getArgs().getInt(FlowConst.PROCESS_INSTANCE_ID_KEY);
|
||||
dao.update(ProcessInstance.class, Chain.make("businessNo", outlayReimburse.getId()), Cnd.where(ProcessInstance::getId, "=", instanceId));
|
||||
}
|
||||
}
|
||||
+78
@@ -1,7 +1,25 @@
|
||||
package com.budwk.app.zhgh.outlay.outlayReimburse.interceptor;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.outlay.activityBudget.models.ActivityBudget;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.model.OutlayUseDetail;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.school.model.OutlayManageSchool;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.union.model.OutlayManageUnion;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.model.OutlayReimburse;
|
||||
import lombok.SneakyThrows;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -11,6 +29,66 @@ import com.budwk.app.flow.engine.core.Execution;
|
||||
public class OutlayReimburseSchoolZxAuditPostInterceptor implements FlowInterceptor {
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
OutlayReimburse outlayReimburse = Json.fromJson(OutlayReimburse.class, formDataStr);
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
OutlayUseDetail detail = new OutlayUseDetail();
|
||||
|
||||
detail.setProjectName(outlayReimburse.getActivityMatter());
|
||||
detail.setAdjustMoney(outlayReimburse.getMoney());
|
||||
detail.setAdjustMoney(outlayReimburse.getMoney());
|
||||
detail.setAdjustReason(outlayReimburse.getPaymentContent());
|
||||
detail.setAdjustUserId(SecurityUtil.getUserId());
|
||||
detail.setAdjustUserName(SecurityUtil.getUserUsername());
|
||||
detail.setAdjustLoginName(SecurityUtil.getUserLoginname());
|
||||
detail.setOutlayReimburseId(outlayReimburse.getId());
|
||||
detail.setActivityTime(outlayReimburse.getActivityTime());
|
||||
// 更新校工会经费表
|
||||
if (outlayReimburse.getOutlayManageSource().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
OutlayManageSchool school = dao.fetch(OutlayManageSchool.class, Cnd.where("year", "=", DateUtil.thisYear()));
|
||||
if (ObjectUtil.isEmpty(school)) {
|
||||
throw new BaseException("该年份没有设置金额!");
|
||||
}
|
||||
school.setUsedQuota(school.getUsedQuota().add(outlayReimburse.getMoney()));
|
||||
dao.updateIgnoreNull(school);
|
||||
|
||||
//添加使用记录到经费管理表
|
||||
detail.setOutlayManageId(school.getId());
|
||||
dao.insert(detail);
|
||||
} else if (outlayReimburse.getOutlayManageSource().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
|
||||
ActivityBudget budget = dao.fetch(ActivityBudget.class, Cnd.where("id", "=", outlayReimburse.getBudgetId()));
|
||||
if (ObjectUtil.isNotEmpty(budget)&&budget.getIsSchoolBudget()){
|
||||
//如果分工会报销了校工会的余额
|
||||
OutlayManageSchool school = dao.fetch(OutlayManageSchool.class, Cnd.where("year", "=", DateUtil.thisYear()));
|
||||
if (ObjectUtil.isEmpty(school)) {
|
||||
throw new BaseException("该年份没有设置金额!");
|
||||
}
|
||||
school.setUsedQuota(school.getUsedQuota().add(outlayReimburse.getMoney()));
|
||||
dao.updateIgnoreNull(school);
|
||||
|
||||
//添加使用记录到经费管理表
|
||||
detail.setOutlayManageId(school.getId());
|
||||
dao.insert(detail);
|
||||
}else{
|
||||
// 更新分工会活动经费表
|
||||
OutlayManageUnion manageUnion = dao.fetch(OutlayManageUnion.class,
|
||||
Cnd.where("year", "=", DateUtil.thisYear())
|
||||
.and("unionId", "=", outlayReimburse.getUnionId()));
|
||||
if (ObjectUtil.isEmpty(manageUnion)) {
|
||||
throw new BaseException("该年份没有设置金额!");
|
||||
}
|
||||
if (manageUnion.getTotalQuota().subtract(manageUnion.getUsedQuota()).compareTo(outlayReimburse.getMoney()) < 0) {
|
||||
throw new BaseException("剩余配额不足!剩余:" + manageUnion.getTotalQuota().subtract(manageUnion.getUsedQuota()));
|
||||
}
|
||||
manageUnion.setUsedQuota(manageUnion.getUsedQuota().add(outlayReimburse.getMoney()));
|
||||
dao.updateIgnoreNull(manageUnion);
|
||||
|
||||
//添加使用记录到经费管理表
|
||||
detail.setOutlayManageId(manageUnion.getId());
|
||||
dao.insert(detail);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,12 @@ public class OutlayReimburse extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String activityTime;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动人数")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String activityNumber;
|
||||
|
||||
@Column
|
||||
@Comment("支付内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
|
||||
+2
-1
@@ -24,9 +24,10 @@ public interface OutlayReimburseApplyService extends BaseService<OutlayReimburse
|
||||
/**
|
||||
* 查询这个预算已经报销了的金额
|
||||
* @param budgetId
|
||||
* @param isSchoolBudget 是否是校会预算
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getBxMoneyByActivityId(String budgetId);
|
||||
BigDecimal getBxMoneyByActivityId(String budgetId,Boolean isSchoolBudget);
|
||||
|
||||
/**
|
||||
* 判断这个报销的记录预算是否充足
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.budwk.app.zhgh.outlay.outlayReimburse.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.vo.OutlayReimbursePageForm;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface OutlayReimburseSummaryService extends BaseService {
|
||||
|
||||
|
||||
Sql getSql(OutlayReimbursePageForm outlayReimbursePageForm);
|
||||
}
|
||||
+10
-3
@@ -40,6 +40,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
String sqlStr = """
|
||||
SELECT
|
||||
ab.id,
|
||||
ab.isSchoolBudget,
|
||||
ab.schoolBudgetId,
|
||||
ab.totalBudgetMoney,
|
||||
ab.isRepeatReimburse,
|
||||
@@ -120,7 +121,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getBxMoneyByActivityId(String budgetId) {
|
||||
public BigDecimal getBxMoneyByActivityId(String budgetId,Boolean isSchoolBudget) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.money
|
||||
@@ -131,6 +132,11 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
rei.budgetId = @budgetId
|
||||
AND ins.state = 20
|
||||
""").setParam("budgetId", budgetId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (isSchoolBudget!=null){
|
||||
cnd.and("isSchoolBudget", "=", isSchoolBudget);
|
||||
}
|
||||
|
||||
List<NutMap> reiList = listMap(sql);
|
||||
|
||||
BigDecimal totalMoney = reiList.stream()
|
||||
@@ -152,8 +158,8 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
//判断是否可以重复报
|
||||
if (budget.getIsRepeatReimburse()) {
|
||||
//1.查询已经报销了的总金额
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId);
|
||||
if (budget.getIsSchoolBudget()) {
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId,budget.getIsSchoolBudget());
|
||||
//如果是分工会进来并且报销的活动是校会预算
|
||||
// 1. 计算本次加上之前的报销总金额
|
||||
BigDecimal totalReimbursement = bXMoney.add(moneyBig);
|
||||
@@ -164,6 +170,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
return Result.success();
|
||||
}
|
||||
} else {
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId,budget.getIsSchoolBudget());
|
||||
//如果是自己的项目就能超20%
|
||||
//1.算出现在还能报销多少钱
|
||||
BigDecimal twentyPercent = budget.getTotalBudgetMoney().multiply(new BigDecimal("20")).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
|
||||
@@ -196,7 +203,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
//如果报销的项目是可以重复报销的
|
||||
if (budget.getIsRepeatReimburse()) {
|
||||
//这个预算已经报销了多少钱
|
||||
BigDecimal totalMoney = getBxMoneyByActivityId(budgetId);
|
||||
BigDecimal totalMoney = getBxMoneyByActivityId(budgetId,null);
|
||||
//查出这个活动有没有跟其他预算关联,如果跟其他预算关联了,代表当前这条预算是分工会也能报校工会也能报,
|
||||
// schoolBudgetId字段不为空就代表这条预算是使用的校工会的金额
|
||||
List<ActivityBudget> budgetList = dao().query(ActivityBudget.class,
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.budwk.app.zhgh.outlay.outlayReimburse.vo;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/21 09:19
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
public class OutlayReimbursePageForm extends PageForm {
|
||||
private Integer year;
|
||||
private String unionId;
|
||||
private String outlayManageSource;
|
||||
private String detailsTypeId;
|
||||
|
||||
private Boolean approval;
|
||||
private String clubId;
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationQuotaAllocation;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationLineService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 20:13
|
||||
* @description 活动管理
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@At("/platform/excellentRecuperation/activityList")
|
||||
@Api("优秀教职工疗休养管理")
|
||||
@Ok("json:full")
|
||||
public class ExcellentRecuperationActivityListController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ExcellentRecuperationLineService excellentRecuperationLineService;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/activityList/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页")
|
||||
@SaCheckPermission("excellentRecuperation.activityList")
|
||||
public Result pageData(PageForm pageForm, String year) {
|
||||
Sql sql = Sqls.create("""
|
||||
select * from excellent_recuperation_activity $condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(signUpStartTime)", "=", year);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = excellentRecuperationLineService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取线路列表")
|
||||
@SaCheckPermission("excellentRecuperation.activityList")
|
||||
public Result onSubmit(@Param("data") ExcellentRecuperationActivity excellentRecuperationActivity) {
|
||||
if (StrUtil.isNotBlank(excellentRecuperationActivity.getId())) {
|
||||
dao.clear(ExcellentRecuperationQuotaAllocation.class, Cnd.where("activityId", "=", excellentRecuperationActivity.getId()));
|
||||
excellentRecuperationActivity.getUnionQuotaAllocationList().stream().forEach(v->{
|
||||
v.setActivityId(excellentRecuperationActivity.getId());
|
||||
});
|
||||
dao.insert(excellentRecuperationActivity.getUnionQuotaAllocationList());
|
||||
dao.update(excellentRecuperationActivity);
|
||||
}else{
|
||||
dao.insertWith(excellentRecuperationActivity, "unionQuotaAllocationList");
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取线路列表")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.activityList")
|
||||
@SLog(type = "excellentRecuperation", tag = "优秀教职工疗休养-活动管理", msg = "删除线路")
|
||||
public Result onDelete(@Param("id") String id) {
|
||||
dao.delete(ExcellentRecuperationActivity.class, id);
|
||||
dao.clear(ExcellentRecuperationQuotaAllocation.class, Cnd.where("activityId", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取活动详细信息")
|
||||
@SaCheckLogin
|
||||
public Result findOne(String id) {
|
||||
ExcellentRecuperationActivity recuperationActivity = dao.fetchLinks(dao.fetch(ExcellentRecuperationActivity.class, id), "unionQuotaAllocationList", Cnd.NEW().asc("unionCode"));
|
||||
List<ExcellentRecuperationLine> lineList = excellentRecuperationLineService.query(Cnd.where("id", "in", recuperationActivity.getLinIds()));
|
||||
List<String> lingNames = lineList.stream().map(ExcellentRecuperationLine::getLineName).toList();
|
||||
recuperationActivity.setLinNames(StrUtil.join(",", lingNames));
|
||||
return Result.success(recuperationActivity);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取线路列表")
|
||||
@SaCheckPermission("excellentRecuperation.activityList")
|
||||
public Result listLineListByThisYear() {
|
||||
List<ExcellentRecuperationLine> excellentRecuperationLines = excellentRecuperationLineService.listLineListByThisYear();
|
||||
return Result.success(excellentRecuperationLines);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取分工会以及分工会的会员数")
|
||||
@SaCheckPermission("excellentRecuperation.activityList")
|
||||
public Result listUnion() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
un.id unionId,
|
||||
un.`name` unionName,
|
||||
un.unionCode,
|
||||
COUNT(u.id) memberNum
|
||||
FROM
|
||||
`sys_union` un
|
||||
LEFT JOIN vw_user u ON u.unionId = un.id
|
||||
AND u.member = 1
|
||||
GROUP BY
|
||||
un.id
|
||||
ORDER BY
|
||||
un.unionCode
|
||||
""");
|
||||
List<NutMap> list = excellentRecuperationLineService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+262
@@ -0,0 +1,262 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistration;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationSignUpUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/27 11:12
|
||||
* @description 活动报名
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@At("/platform/excellentRecuperation/activitySignUp")
|
||||
@Api("优秀教职工疗休养报名")
|
||||
@Ok("json:full")
|
||||
public class ExcellentRecuperationActivitySignUpController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/activitySignUp/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页")
|
||||
@SaCheckPermission("excellentRecuperation.activitySignUp")
|
||||
public Result pageData(PageForm pageForm, String year, String unionId, String activityId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
erqa.*,
|
||||
era.activityName,
|
||||
era.signUpStartTime,
|
||||
era.signUpEndTIme
|
||||
FROM
|
||||
`excellent_recuperation_quota_allocation` erqa
|
||||
LEFT JOIN excellent_recuperation_activity era ON era.id = erqa.activityId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("erqa.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.andEX("YEAR(era.signUpStartTime)", "=", year);
|
||||
cnd.andEX("erqa.unionId", "=", unionId);
|
||||
cnd.and("erqa.activityId", "=", activityId);
|
||||
cnd.asc("erqa.unionCode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("保存")
|
||||
@SaCheckPermission("excellentRecuperation.activitySignUp")
|
||||
@SLog(type = "excellentRecuperationActivitySignUp", tag = "优秀教职工疗休养-活动报名", msg = "保存疗休养报名")
|
||||
public Result save(@Param("data") ExcellentRecuperationSignUpUser signUpUser) {
|
||||
List<ExcellentRecuperationSignUpUser> userList = dao.query(ExcellentRecuperationSignUpUser.class, Cnd.where("activityId", "=", signUpUser.getActivityId()));
|
||||
List<String> userIds = userList.stream().map(ExcellentRecuperationSignUpUser::getUserId).toList();
|
||||
if (StrUtil.isBlank(signUpUser.getId()) && userIds.contains(signUpUser.getUserId())) {
|
||||
return Result.error("该用户已报名");
|
||||
}
|
||||
signUpUser.setSignUpTime(DateUtil.now());
|
||||
baseService.insertOrUpdate(signUpUser);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("enrollmentRegistration.apply")
|
||||
@ApiOperation("提交")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(type = "excellentRecuperationActivitySignUp", tag = "优秀教职工疗休养-活动报名", msg = "提交疗休养报名")
|
||||
public Result submit(@Param("data") ExcellentRecuperationSignUpUser signUpUser) {
|
||||
List<ExcellentRecuperationSignUpUser> userList = dao.query(ExcellentRecuperationSignUpUser.class, Cnd.where("activityId", "=", signUpUser.getActivityId()));
|
||||
List<String> userIds = userList.stream().map(ExcellentRecuperationSignUpUser::getUserId).toList();
|
||||
if (StrUtil.isBlank(signUpUser.getId()) && userIds.contains(signUpUser.getUserId())) {
|
||||
return Result.error("该用户已报名");
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(signUpUser.getId())) {
|
||||
signUpUser.setSignUpTime(DateUtil.now());
|
||||
}
|
||||
baseService.insertOrUpdate(signUpUser);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.FORM_DATA, signUpUser);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("YXJZGLXY", signUpUser.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("删除报名信息")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
@SLog(tag = "优秀教职工疗休养-活动报名", type = "excellentRecuperationActivitySignUp", msg = "删除id: ${args[0]}")
|
||||
public Result doDelete(String id) {
|
||||
dao.delete(ExcellentRecuperationSignUpUser.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询当前工会当前活动报名的人员")
|
||||
@SaCheckPermission("excellentRecuperation.activitySignUp")
|
||||
public Result listQuotaAllocation(String unionId, String activityId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
line.lineName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariale,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
|
||||
FROM
|
||||
excellent_recuperation_sign_user info
|
||||
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.activityId", "=", activityId);
|
||||
cnd.and("info.unionId", "=", unionId);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> map = baseService.listMap(sql);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("根据年份获取疗休养活动")
|
||||
@SaCheckPermission("excellentRecuperation.activitySignUp")
|
||||
public Result listActivityByYear(String year) {
|
||||
List<ExcellentRecuperationActivity> activityList = dao.query(ExcellentRecuperationActivity.class,
|
||||
Cnd.where("YEAR(signUpStartTime)", "=", year).desc("signUpStartTime"));
|
||||
return Result.success(activityList);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("根据活动id获取线路")
|
||||
@SaCheckPermission("excellentRecuperation.activitySignUp")
|
||||
public Result listLineByActivityId(String id) {
|
||||
ExcellentRecuperationActivity activity = dao.fetch(ExcellentRecuperationActivity.class, id);
|
||||
List<ExcellentRecuperationLine> lineList = dao.query(ExcellentRecuperationLine.class, Cnd.where("id", "in", activity.getLinIds()));
|
||||
return Result.success(lineList);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询用户")
|
||||
@SaCheckPermission("excellentRecuperation.activitySignUp")
|
||||
public Object listUser(String keyword, String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
id,
|
||||
username userName,
|
||||
loginname loginName,
|
||||
sex,
|
||||
mobile,
|
||||
IFNULL(unitname, '暂无') as unitName,
|
||||
unitId,
|
||||
unionId,
|
||||
unionName,
|
||||
idCard
|
||||
from
|
||||
vw_user
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(View_user::getLoginname, "like", "%" + keyword + "%");
|
||||
seg.or(View_user::getUsername, "like", "%" + keyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.and(View_user::getUnionId, "=", unionId);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(1, 50, sql);
|
||||
return Result.success(pagination.getList());
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个报名信息")
|
||||
@SaCheckLogin
|
||||
public Result findUserSignUp(String id){
|
||||
return Result.success(dao.fetch(ExcellentRecuperationSignUpUser.class, id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationLineService;
|
||||
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationLine;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.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.Objects;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 18:59
|
||||
* @description 线路管理
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@At("/platform/excellentRecuperation/line")
|
||||
@Api("疗休养线路管理")
|
||||
@Ok("json:full")
|
||||
public class ExcellentRecuperationLineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ExcellentRecuperationLineService lineService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/line/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("excellentRecuperation.line")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "startYear") Integer startYear,
|
||||
@Param(value = "endYear") Integer endYear,
|
||||
@Param(value = "travelAgencyId") String travelAgencyId,
|
||||
@Param(value = "lineName") String lineName,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "lotId") 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.and(Cnd.likeEX("line.lineName", lineName));
|
||||
|
||||
cnd.desc("year").asc("serialNumber").asc("line.createdAt");
|
||||
Pagination pagination = lineService.pageData(pageForm, cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取编号")
|
||||
@SaCheckPermission("excellentRecuperation.line")
|
||||
public Result getNo() {
|
||||
Object serialNumber = dao.func2(ExcellentRecuperationLine.class, "max", "serialNumber");
|
||||
serialNumber = Objects.requireNonNullElse(serialNumber, 0);
|
||||
return Result.success(Integer.parseInt(serialNumber.toString()) + 1);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/编辑疗休养线路")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.line")
|
||||
@SLog(type = "excellentRecuperation", tag = "新增/编辑疗休养线路", msg = "新增/编辑疗休养线路")
|
||||
public Result onSubmit(ExcellentRecuperationLine line) {
|
||||
if (StrUtil.isBlank(line.getId())) {
|
||||
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber())) > 0) {
|
||||
return Result.error("编号已存在");
|
||||
}
|
||||
lineService.insert( line);
|
||||
} else {
|
||||
if (lineService.count(Cnd.where("serialNumber", "=", line.getSerialNumber()).and("id", "!=", line.getId())) > 0) {
|
||||
return Result.error("编号已存在");
|
||||
}
|
||||
lineService.update( line);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At("/openClosedLine/?")
|
||||
@ApiOperation("开启或关闭线路")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.line")
|
||||
@SLog(type = "excellentRecuperation", tag = "开启或关闭线路", msg = "开启或关闭线路")
|
||||
public Result openClosedLine(String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
lineService.update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除线路")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.line")
|
||||
@SLog(type = "excellentRecuperation", tag = "删除线路", msg = "删除线路")
|
||||
public Result onDelete(String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
lineService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At("/selectLineInfoById/?")
|
||||
@ApiOperation("查询线路")
|
||||
@SaCheckPermission("excellentRecuperation.line")
|
||||
public Result selectLineInfoById(String id) {
|
||||
Assert.notBlank(id);
|
||||
ExcellentRecuperationLine line = lineService.fetchLinks(lineService.fetch(id), "travelAgency");
|
||||
return Result.success(line);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/28 08:42
|
||||
* @description 校工会审核
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@At("/platform/excellentRecuperation/schoolAudit")
|
||||
@Api("疗休养校工会审核报名人员")
|
||||
@Ok("json:full")
|
||||
public class ExcellentRecuperationSchoolAuditController {
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/schoolAudit/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("excellentRecuperation.schoolAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "activityId") String activityId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
line.lineName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN excellent_recuperation_sign_user info ON info.id = ins.businessNo
|
||||
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(info.signUpTime)", "=", year);
|
||||
cnd.andEX("info.activityId", "=", activityId);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
cnd.and("t.taskName", "=", "0a8a7e2f-bc0d-4849-8c97-5ef61ac0478b");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchName())&& StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.signUpTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("根据年份获取疗休养活动")
|
||||
@SaCheckPermission("excellentRecuperation.schoolAudit")
|
||||
public Result listActivityByYear(String year) {
|
||||
List<ExcellentRecuperationActivity> activityList = dao.query(ExcellentRecuperationActivity.class,
|
||||
Cnd.where("YEAR(signUpStartTime)", "=", year).desc("signUpStartTime"));
|
||||
return Result.success(activityList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
|
||||
|
||||
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.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.model.EnrollmentRegistration;
|
||||
import com.budwk.app.zhgh.enrollmentRegistration.vo.EnrollmentRegistrationPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationActivity;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationSummaryService;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo.ExcellentRecuperationPageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/28 10:11
|
||||
* @description 查询统计
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@At("/platform/excellentRecuperation/summary")
|
||||
@Api("疗休养查询统计")
|
||||
@Ok("json:full")
|
||||
public class ExcellentRecuperationSummaryController {
|
||||
|
||||
@Inject
|
||||
private ExcellentRecuperationSummaryService excellentRecuperationSummaryService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/summary/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
public Result pageData(ExcellentRecuperationPageForm pageForm) {
|
||||
Sql sql = excellentRecuperationSummaryService.getsql(pageForm);
|
||||
Pagination pagination = excellentRecuperationSummaryService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除疗休养报名人员")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
@SLog(tag = "优秀教职工疗休养", msg = "删除疗休养报名人员id: ${args[0]}")
|
||||
public Result doDelete(String id) {
|
||||
excellentRecuperationSummaryService.dao().delete(EnrollmentRegistration.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("enrollmentRegistration.summary")
|
||||
public void doExportExcel(@Param("data") ExcellentRecuperationPageForm pageForm, HttpServletResponse response) {
|
||||
try {
|
||||
ExcellentRecuperationActivity activity = excellentRecuperationSummaryService.dao().fetch(ExcellentRecuperationActivity.class, pageForm.getActivityId());
|
||||
Sql sql = excellentRecuperationSummaryService.getsql(pageForm);
|
||||
List<NutMap> map = excellentRecuperationSummaryService.listMap(sql);
|
||||
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
entityList.add(no);
|
||||
|
||||
entityList.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entityList.add(new ExcelExportEntity("手机号码", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("身份证号", "idCard", 20));
|
||||
entityList.add(new ExcelExportEntity("线路", "lineName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("报名时间", "signUpTime", 20));
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(activity.getActivityName() + "疗休养报名人员汇总.xlsx", "UTF-8"));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, map);
|
||||
workbook.write(response.getOutputStream());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+269
@@ -0,0 +1,269 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.model.ExcelImportRes;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationTravelAgencyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.recuperation.mode.TravelAgencyExcelMode;
|
||||
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.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.lang.Strings;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 18:10
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@At("/platform/excellentRecuperation/travelAgency")
|
||||
@Api("疗休养旅行社管理")
|
||||
@Ok("json:full")
|
||||
public class ExcellentRecuperationTravelAgencyController {
|
||||
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ExcellentRecuperationTravelAgencyService travelAgencyService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/excellentRecuperation/travelAgency/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", "=", year);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("contact", pageForm.getSearchKeyword());
|
||||
seg.orLike("travelAgencyName", pageForm.getSearchKeyword());
|
||||
seg.orLike("serialNumber", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.asc("serialNumber");
|
||||
}
|
||||
Pagination pagination = travelAgencyService.pageData(pageForm, cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/编辑疗休养旅行社")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
@SLog(type = "excellentRecuperation", tag = "新增/编辑疗休养旅行社", msg = "新增/编辑疗休养旅行社")
|
||||
public Result onSubmit(ExcellentRecuperationTravelAgency travelAgency) {
|
||||
if (StrUtil.isBlank(travelAgency.getId())) {
|
||||
if (travelAgencyService.count(Cnd.where("serialNumber", "=", travelAgency.getSerialNumber())) > 0) {
|
||||
return Result.error("编号已存在");
|
||||
}
|
||||
travelAgencyService.addTravelAgency(travelAgency);
|
||||
} else {
|
||||
if (travelAgencyService.count(Cnd.where("serialNumber", "=", travelAgency.getSerialNumber()).and("id", "!=", travelAgency.getId())) > 0) {
|
||||
return Result.error("编号已存在");
|
||||
}
|
||||
travelAgencyService.editTravelAgency(travelAgency);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At("/openClosedTravelAgency/?")
|
||||
@ApiOperation("开启或关闭旅行社")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
@SLog(type = "excellentRecuperation", tag = "开启或关闭旅行社", msg = "开启或关闭旅行社")
|
||||
public Result openClosedTravelAgency(String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
travelAgencyService.openTravelAgency(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除旅行社")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
@SLog(type = "excellentRecuperation", tag = "删除旅行社", msg = "删除旅行社")
|
||||
public Result onDelete(String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
travelAgencyService.deleteTravelAgency(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询旅行社")
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
public Result selectTravelAgency(Integer year) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", "=", year);
|
||||
List<ExcellentRecuperationTravelAgency> list = travelAgencyService.selectAllTravelAgencyByYear(cnd);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("年度区间查询旅行社")
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
public Result selectTravelAgencyByYears(Integer startYear, Integer endYear) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", ">=", startYear);
|
||||
cnd.andEX("year", "<=", endYear);
|
||||
List<ExcellentRecuperationTravelAgency> list = travelAgencyService.selectAllTravelAgencyByYear(cnd);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("根据旅行社id查线路")
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
public Result selectLineByAgencyId(String agencyId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT id,lineName FROM `the_rapy_recuperation_line` WHERE travelAgencyId=@travelAgencyId
|
||||
""").setParam("travelAgencyId", agencyId);
|
||||
List<NutMap> listMap = travelAgencyService.listMap(sql);
|
||||
return Result.success(listMap);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
public void downloadTemplate(HttpServletResponse response) {
|
||||
|
||||
List<NutMap> list = new ArrayList<>();
|
||||
NutMap map = new NutMap();
|
||||
map.put("year", 2025);
|
||||
map.put("serialNumber", 1);
|
||||
map.put("travelAgencyName", "杭州海外旅游有限公司");
|
||||
map.put("contact", "张三");
|
||||
map.put("contactMobileNumber", "17867895678");
|
||||
map.put("email", "123@qq.com");
|
||||
map.put("isDisabled", "是");
|
||||
list.add(map);
|
||||
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("年度", "year", 20));
|
||||
entities.add(new ExcelExportEntity("排序编号", "serialNumber", 20));
|
||||
entities.add(new ExcelExportEntity("旅行社名称", "travelAgencyName", 20));
|
||||
entities.add(new ExcelExportEntity("旅行社联系人", "contact", 20));
|
||||
entities.add(new ExcelExportEntity("联系电话", "contactMobileNumber", 20));
|
||||
entities.add(new ExcelExportEntity("邮箱", "email", 20));
|
||||
entities.add(new ExcelExportEntity("官网", "officialWebsite", 20));
|
||||
entities.add(new ExcelExportEntity("备注", "note", 20));
|
||||
ExcelExportEntity excelExport = new ExcelExportEntity("是否启用(是/否)", "isDisabled", 20);
|
||||
String[] options = {"是_1", "否_0"};
|
||||
excelExport.setReplace(options);
|
||||
excelExport.setAddressList(true);
|
||||
entities.add(excelExport);
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
|
||||
CommonDownloadUtil.download("旅行社导入模板.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("旅行社导入")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("excellentRecuperation.travelAgency")
|
||||
@SLog(type = "excellentRecuperation", tag = "旅行社导入", msg = "旅行社导入")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result travelAgencyImport(@Param("file") TempFile file) {
|
||||
List<TravelAgencyExcelMode> travelAgency = ExcelImportUtil.importExcel(file.getFile(), TravelAgencyExcelMode.class, new ImportParams());
|
||||
// 创建结果集
|
||||
ExcelImportRes<TravelAgencyExcelMode> excelImportRes = new ExcelImportRes<>();
|
||||
excelImportRes.setTotalRecords(travelAgency.size());
|
||||
|
||||
List<RecuperationTravelAgency> travelAgencyList = dao.query(RecuperationTravelAgency.class, Cnd.NEW().desc("id"));
|
||||
Map<String, String> map = travelAgencyList.stream().collect(Collectors.toMap(RecuperationTravelAgency::getTravelAgencyName, RecuperationTravelAgency::getId));
|
||||
|
||||
for (int i = 0; i < travelAgency.size(); i++) {
|
||||
TravelAgencyExcelMode travel = travelAgency.get(i);
|
||||
if(travel.getYear() == null) {
|
||||
travel.setErrInfo("年度为空", i + 1);
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.isBlank(travel.getTravelAgencyName())) {
|
||||
travel.setErrInfo("旅行社名称为空", i + 1);
|
||||
continue;
|
||||
}
|
||||
RecuperationTravelAgency agency = new RecuperationTravelAgency();
|
||||
if (Strings.isNotBlank(map.get(travel.getTravelAgencyName()))){
|
||||
agency.setId(map.get(travel.getTravelAgencyName()));
|
||||
}
|
||||
if ("是".equals(travel.getIsDisabled())) {
|
||||
agency.setDisabled(false);
|
||||
} else if ("否".equals(travel.getIsDisabled())) {
|
||||
agency.setDisabled(true);
|
||||
}
|
||||
agency.setContact(travel.getContact());
|
||||
agency.setTravelAgencyName(travel.getTravelAgencyName());
|
||||
agency.setSerialNumber(travel.getSerialNumber());
|
||||
agency.setEmail(travel.getEmail());
|
||||
agency.setContactMobileNumber(travel.getContactMobileNumber());
|
||||
agency.setNote(travel.getNote());
|
||||
agency.setYear(travel.getYear());
|
||||
agency.setOfficialWebsite(travel.getOfficialWebsite());
|
||||
try {
|
||||
dao.insertOrUpdate(agency);
|
||||
} catch (Exception e) {
|
||||
log.error("导入旅行社失败:{}", e.getMessage());
|
||||
travel.setErrInfo("添加失败", i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加错误记录
|
||||
excelImportRes.setErrorDetails(travelAgency.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).collect(Collectors.toList()));
|
||||
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
|
||||
excelImportRes.setSuccessCount(Math.max(travelAgency.size() - excelImportRes.getFailedCount(), 0));
|
||||
return Result.success(excelImportRes);
|
||||
}
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 21:26
|
||||
* @description 疗休养活动
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("excellent_recuperation_activity")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("疗休养活动")
|
||||
public class ExcellentRecuperationActivity extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String activityName;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("报名开始时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String signUpStartTime;
|
||||
|
||||
@Column
|
||||
@Comment("报名截止时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String signUpEndTIme;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String activityContent;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("活动线路")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> linIds;
|
||||
|
||||
private String linNames;
|
||||
|
||||
@Many(field = "activityId")
|
||||
private List<ExcellentRecuperationQuotaAllocation> unionQuotaAllocationList;
|
||||
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 18:36
|
||||
* @description 线路管理
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("excellent_recuperation_line")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("疗休养旅行社")
|
||||
public class ExcellentRecuperationLine extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("编号")
|
||||
private String serialNumber;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("线路名称")
|
||||
private String lineName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("旅行社Id")
|
||||
private String travelAgencyId;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "text")
|
||||
@Comment("疗休养内容")
|
||||
private String content;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("年度")
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否禁用")
|
||||
private boolean isDisabled;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("缩略图")
|
||||
private String file;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
@Comment("联系人")
|
||||
private String lineContact;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
@Comment("联系电话")
|
||||
private String lineContactPhone;
|
||||
|
||||
@One(field = "travelAgencyId")
|
||||
private ExcellentRecuperationTravelAgency travelAgency;
|
||||
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/27 08:49
|
||||
* @description 疗休养分配名额
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("excellent_recuperation_quota_allocation")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("疗休养活动")
|
||||
public class ExcellentRecuperationQuotaAllocation extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@Comment("工会Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("工会编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionCode;
|
||||
|
||||
@Column
|
||||
@Comment("名额分配数")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Default("0")
|
||||
private Integer allocationNum;
|
||||
|
||||
@Column
|
||||
@Comment("会员数量")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Default("0")
|
||||
private Integer memberNum;
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/27 16:13
|
||||
* @description 疗休养报名人员
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("excellent_recuperation_sign_user")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("疗休养报名人员")
|
||||
public class ExcellentRecuperationSignUpUser extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("姓名Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("活动Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@Comment("线路Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String lineId;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("联系电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("身份证号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String idCard;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("工会Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("单位Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("报名时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String signUpTime;
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 18:06
|
||||
* @description 旅行社管理
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("excellent_recuperation_travel_agency")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("疗休养旅行社")
|
||||
public class ExcellentRecuperationTravelAgency extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("旅行社编号")
|
||||
private String serialNumber;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("旅行社名称")
|
||||
private String travelAgencyName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("旅行社联系人")
|
||||
private String contact;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 11)
|
||||
@Comment("旅行社联系人手机")
|
||||
private String contactMobileNumber;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("旅行社邮箱")
|
||||
private String email;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("旅行社官网")
|
||||
private String officialWebsite;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("备注")
|
||||
private String note;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("年度")
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否禁用")
|
||||
private boolean isDisabled;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("缩略图")
|
||||
private String file;
|
||||
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ExcellentRecuperationLineService extends BaseService<ExcellentRecuperationLine> {
|
||||
|
||||
|
||||
Pagination pageData(PageForm pageForm, Cnd cnd);
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前年度的线路列表
|
||||
* @return
|
||||
*/
|
||||
List<ExcellentRecuperationLine> listLineListByThisYear();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo.ExcellentRecuperationPageForm;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface ExcellentRecuperationSummaryService extends BaseService {
|
||||
|
||||
Sql getsql(ExcellentRecuperationPageForm pageForm);
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency;
|
||||
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface ExcellentRecuperationTravelAgencyService extends BaseService<ExcellentRecuperationTravelAgency> {
|
||||
|
||||
/**
|
||||
* 删除旅行社
|
||||
*
|
||||
* @param travelAgencyId 旅行社 ID
|
||||
*/
|
||||
void deleteTravelAgency(String travelAgencyId);
|
||||
|
||||
|
||||
/**
|
||||
* 添加旅行社
|
||||
*
|
||||
* @param travelAgency 旅行社
|
||||
*/
|
||||
void addTravelAgency(ExcellentRecuperationTravelAgency travelAgency);
|
||||
|
||||
/**
|
||||
* 编辑旅行社
|
||||
*
|
||||
* @param travelAgency 旅行社
|
||||
*/
|
||||
void editTravelAgency(ExcellentRecuperationTravelAgency travelAgency);
|
||||
|
||||
|
||||
/**
|
||||
* 开启或关闭旅行社
|
||||
*
|
||||
* @param travelAgencyId 旅行社id
|
||||
*/
|
||||
void openTravelAgency(String travelAgencyId);
|
||||
|
||||
|
||||
/**
|
||||
* 页面数据
|
||||
*
|
||||
* @param pageForm 分页参数
|
||||
* @param cnd cnd
|
||||
* @return {@link Pagination}
|
||||
*/
|
||||
Pagination pageData(PageForm pageForm, Cnd cnd);
|
||||
|
||||
|
||||
/**
|
||||
* 查询旅行社
|
||||
*
|
||||
* @param cnd cnd
|
||||
* @return {@link List}<{@link RecuperationTravelAgency}>
|
||||
*/
|
||||
List<ExcellentRecuperationTravelAgency> selectAllTravelAgencyByYear(Cnd cnd);
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationLine;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationLineService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.IocBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/26 19:09
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ExcellentRecuperationLineServiceImpl extends BaseServiceImpl<ExcellentRecuperationLine> implements ExcellentRecuperationLineService {
|
||||
public ExcellentRecuperationLineServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination pageData(PageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
line.id,
|
||||
line.serialNumber,
|
||||
line.lineName,
|
||||
line.year,
|
||||
line.isDisabled,
|
||||
line.file AS fileId,
|
||||
u.username AS createUserName,
|
||||
ta.travelAgencyName,
|
||||
ta.contact,
|
||||
ta.contactMobileNumber,
|
||||
ta.officialWebsite
|
||||
FROM
|
||||
excellent_recuperation_line line
|
||||
LEFT JOIN excellent_recuperation_travel_agency ta ON ta.id = line.travelAgencyId
|
||||
LEFT JOIN sys_user u ON u.id = line.createdBy
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExcellentRecuperationLine> listLineListByThisYear() {
|
||||
|
||||
List<ExcellentRecuperationLine> lineList = query(Cnd.where("isDisabled", "=", true).and("year", "=", DateUtil.thisYear()));
|
||||
return lineList;
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationSummaryService;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo.ExcellentRecuperationPageForm;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.IocBean;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/28 10:24
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ExcellentRecuperationSummaryServiceImpl extends BaseServiceImpl implements ExcellentRecuperationSummaryService {
|
||||
public ExcellentRecuperationSummaryServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql getsql(ExcellentRecuperationPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
line.lineName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariale,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
|
||||
FROM
|
||||
excellent_recuperation_sign_user info
|
||||
LEFT JOIN excellent_recuperation_line line ON line.id = info.lineId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(info.signUpTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.activityId", "=", pageForm.getActivityId());
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.unitId", "=", pageForm.getUnitId());
|
||||
cnd.and("ins.state", "=", ProcessTaskStateEnum.FINISHED.getCode());
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchName())&& StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.impl;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.model.ExcellentRecuperationTravelAgency;
|
||||
import com.budwk.app.zhgh.staffbenefit.excellentRecuperation.service.ExcellentRecuperationTravelAgencyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.recuperation.model.RecuperationTravelAgency;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ExcellentRecuperationTravelAgencyServiceImpl extends BaseServiceImpl<ExcellentRecuperationTravelAgency> implements ExcellentRecuperationTravelAgencyService {
|
||||
|
||||
public ExcellentRecuperationTravelAgencyServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTravelAgency(String travelAgencyId) {
|
||||
delete(travelAgencyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTravelAgency(ExcellentRecuperationTravelAgency travelAgency) {
|
||||
insert(travelAgency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editTravelAgency(ExcellentRecuperationTravelAgency travelAgency) {
|
||||
update(travelAgency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openTravelAgency(String travelAgencyId) {
|
||||
update(Chain.makeSpecial("isDisabled", "isDisabled ^ 1"), Cnd.where("id", "=", travelAgencyId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination pageData(PageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
*,
|
||||
file as fileId
|
||||
from
|
||||
excellent_recuperation_travel_agency
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExcellentRecuperationTravelAgency> selectAllTravelAgencyByYear(Cnd cnd) {
|
||||
return dao().query(ExcellentRecuperationTravelAgency.class, cnd);
|
||||
}
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.excellentRecuperation.vo;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/28 10:23
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
public class ExcellentRecuperationPageForm extends PageForm {
|
||||
|
||||
private String year;
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
private String activityId;
|
||||
}
|
||||
Reference in New Issue
Block a user