first commit
This commit is contained in:
+165
@@ -0,0 +1,165 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.blessing.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.DateUtil;
|
||||
import com.budwk.app.sys.models.Sys_task;
|
||||
import com.budwk.app.sys.services.SysTaskService;
|
||||
import com.budwk.app.task.services.TaskPlatformService;
|
||||
import com.budwk.app.zhgh.staffbenefit.blessing.models.Blessing;
|
||||
import com.budwk.app.zhgh.staffbenefit.blessing.models.BlessingUser;
|
||||
import com.budwk.app.zhgh.staffbenefit.blessing.service.BlessingService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
import org.quartz.CronExpression;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("职工祝福")
|
||||
@At("/platform/blessing/applyList")
|
||||
public class BlessingController {
|
||||
|
||||
@Inject
|
||||
private BlessingService blessingService;
|
||||
|
||||
@Inject
|
||||
private TaskPlatformService taskPlatformService;
|
||||
|
||||
@Inject
|
||||
private SysTaskService sysTaskService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/blessing/applyList.html")
|
||||
@SaCheckPermission("blessing.applyList")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("blessing.applyList")
|
||||
public Result pageData(PageForm pageForm, String blessingName) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
bl.*,
|
||||
aus.groupName
|
||||
FROM
|
||||
`blessing` bl
|
||||
LEFT JOIN activity_user_scope aus ON aus.groupId = bl.activityGroupId
|
||||
$condition
|
||||
""");
|
||||
if (Strings.isNotBlank(blessingName)) {
|
||||
cnd.where().andLike("bl.blessingName", blessingName);
|
||||
}
|
||||
cnd.groupBy("aus.groupId");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(blessingService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("blessing.applyList")
|
||||
public Result doAdd(@Param("Blessing") Blessing blessing) {
|
||||
blessing.setApplyDate(DateUtil.getDate());
|
||||
blessingService.insert(blessing);
|
||||
if (blessing.getIsSend().equals("1")) {
|
||||
blessingService.addTask(blessing);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("blessing.applyList")
|
||||
public Result doEdit(@Param("Blessing") Blessing blessing) {
|
||||
if (Strings.isNotBlank(blessing.getBlessingCron()) && !blessing.getBlessingCron().equals("* * * * * ? *")) {
|
||||
blessing.setApplyDate(DateUtil.getDate());
|
||||
blessingService.updateIgnoreNull(blessing);
|
||||
if (blessing.getIsSend().equals("1")) {
|
||||
blessingService.editTask(blessing);
|
||||
}
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("blessing.applyList")
|
||||
public Result doDelete(String id) {
|
||||
blessingService.delete(id);
|
||||
Sys_task sysTask = sysTaskService.fetch(Cnd.where("name", "=", id));
|
||||
blessingService.dao().clear(BlessingUser.class, Cnd.where("blessingId", "=", id));
|
||||
if (sysTask != null) {
|
||||
taskPlatformService.delete(sysTask.getId(), sysTask.getId());
|
||||
sysTaskService.delete(sysTask.getId());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("blessing.applyList")
|
||||
public Result findOne(String id) {
|
||||
try {
|
||||
Blessing blessing = blessingService.fetch(id);
|
||||
NutMap nutMap = NutMap.WRAP(JSON.parseObject(JSON.toJSONString(blessing)));
|
||||
List<String> result = new ArrayList<>();
|
||||
try {
|
||||
CronExpression cronExpression = new CronExpression(nutMap.getString("blessingCron"));
|
||||
Date lastTime = new Date();
|
||||
for (int i = 0; i < 5; i++) {
|
||||
lastTime = cronExpression.getNextValidTimeAfter(lastTime);
|
||||
if (lastTime != null) {
|
||||
result.add(DateUtil.formatDateTime(lastTime));
|
||||
} else {
|
||||
String[] newStr = nutMap.getString("blessingCron").split(" ");
|
||||
String second = (newStr[0].equals("?") || newStr[0].equals("*")) ? "00" : newStr[0];
|
||||
String minute = (newStr[1].equals("?") || newStr[1].equals("*")) ? "00" : newStr[1];
|
||||
String hour = (newStr[2].equals("?") || newStr[2].equals("*")) ? "00" : newStr[2];
|
||||
String day = (newStr[3].equals("?") || newStr[3].equals("*")) ? "00" : newStr[3];
|
||||
String month = (newStr[4].equals("?") || newStr[4].equals("*")) ? "00" : newStr[4];
|
||||
String s6 = (newStr[5].equals("?") || newStr[5].equals("*")) ? "00" : newStr[5];
|
||||
String year = (newStr[6].equals("?") || newStr[6].equals("*")) ? "00" : newStr[6];
|
||||
String Time = year + "/" + month + "/" + day + " " + hour + ":" + minute + ":" + second;
|
||||
result.add(Time);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
nutMap.setv("blessingDate", result);
|
||||
return Result.success(nutMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.blessing.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.zhgh.staffbenefit.blessing.service.BlessingService;
|
||||
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.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/blessing/userList")
|
||||
public class BlessingUserController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/blessing/blessingUser.html")
|
||||
@SaCheckPermission("blessing.user")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@Inject
|
||||
private BlessingService blessingService;
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("blessing.user")
|
||||
public Result pageData(PageForm pageForm, String data, String unionId, String unitId, String personType, String userState, String sex, String blessingName) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.personType,
|
||||
u.userState,
|
||||
u.unionname,
|
||||
u.unitname,
|
||||
u.birthday,
|
||||
blu.*,
|
||||
bl.blessingName
|
||||
FROM
|
||||
blessing_user blu
|
||||
LEFT JOIN blessing bl ON bl.id = blu.blessingId
|
||||
LEFT JOIN `vw_user` u ON u.id = blu.userId
|
||||
$condition
|
||||
""");
|
||||
if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) {
|
||||
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||
}
|
||||
if (Strings.isNotBlank(blessingName)) {
|
||||
cnd.where().andLike("bl.blessingName", blessingName);
|
||||
}
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
cnd.andEX("blu.applyDate", "=", data);
|
||||
cnd.desc("blu.blessingId");
|
||||
cnd.desc("blu.applyDate");
|
||||
cnd.desc("u.unitid");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(blessingService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.blessing.models;
|
||||
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Table
|
||||
public class Blessing extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("祝福名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String blessingName;
|
||||
|
||||
@Column
|
||||
@Comment("发送范围")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String activityGroupId;
|
||||
|
||||
@Column
|
||||
@Comment("祝福模式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String blessingMode;
|
||||
|
||||
@Column
|
||||
@Comment("是否发送,0未开启,1 进行中,2,已完成")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 2)
|
||||
private String isSend;
|
||||
|
||||
@Column
|
||||
@Comment("发送方式")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> sendTypes;
|
||||
|
||||
@Column
|
||||
@Comment("祝福内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String blessingContent;
|
||||
|
||||
@Column
|
||||
@Comment("cron表达式")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String blessingCron;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String applyDate;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.blessing.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
@Data
|
||||
@Table
|
||||
public class BlessingUser extends BaseModel {
|
||||
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("接收人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("祝福ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String blessingId;
|
||||
|
||||
@Column
|
||||
@Comment("发送时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String applyDate;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.blessing.service;
|
||||
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.blessing.models.Blessing;
|
||||
|
||||
public interface BlessingService extends BaseService<Blessing> {
|
||||
|
||||
|
||||
/**
|
||||
* 添加任务
|
||||
*
|
||||
* @param blessing
|
||||
*/
|
||||
void addTask(Blessing blessing);
|
||||
|
||||
/**
|
||||
* 修改任务
|
||||
*
|
||||
* @param blessing
|
||||
*/
|
||||
void editTask(Blessing blessing);
|
||||
|
||||
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.blessing.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.sys.models.Sys_task;
|
||||
import com.budwk.app.sys.services.SysTaskService;
|
||||
import com.budwk.app.task.services.TaskPlatformService;
|
||||
import com.budwk.app.zhgh.staffbenefit.blessing.models.Blessing;
|
||||
import com.budwk.app.zhgh.staffbenefit.blessing.service.BlessingService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class BlessingServiceImpl extends BaseServiceImpl<Blessing> implements BlessingService {
|
||||
public BlessingServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
private final String JOB_CLASS = "io.v.nutz.task.job.BlessingJob"; //调用类
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private TaskPlatformService taskPlatformService;
|
||||
|
||||
@Inject
|
||||
private SysTaskService sysTaskService;
|
||||
|
||||
@Override
|
||||
public void addTask(Blessing blessing) {
|
||||
Trans.exec(() -> {
|
||||
Sys_task sys_task = new Sys_task();
|
||||
sys_task.setName(blessing.getId());
|
||||
|
||||
sys_task.setNote(blessing.getBlessingName());
|
||||
sys_task.setJobClass(JOB_CLASS);
|
||||
sys_task.setCron(blessing.getBlessingCron());
|
||||
sys_task.setData(Json.toJson(new HashMap<String, Object>() {{
|
||||
put("blessingId", blessing.getId());
|
||||
}}));
|
||||
sys_task.setDisabled(false);
|
||||
sys_task = sysTaskService.insert(sys_task);
|
||||
taskPlatformService.add(sys_task.getId(), sys_task.getId(), sys_task.getJobClass(), sys_task.getCron(), sys_task.getNote(), sys_task.getData());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editTask(Blessing blessing) {
|
||||
Sys_task sys_task = sysTaskService.fetch(Cnd.where("name", "=", blessing.getId()));
|
||||
sys_task.setCron(blessing.getBlessingCron());
|
||||
sysTaskService.updateIgnoreNull(sys_task);
|
||||
|
||||
taskPlatformService.delete(sys_task.getId(), sys_task.getId());
|
||||
taskPlatformService.add(sys_task.getId(), sys_task.getId(), sys_task.getJobClass(), sys_task.getCron(), sys_task.getNote(), sys_task.getData());
|
||||
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.result.Result;
|
||||
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.flow.service.FlowCommonService;
|
||||
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.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
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.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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceApplyController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/20 15:40
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/condolence/apply")
|
||||
@Api("职工慰问申请")
|
||||
@Ok("json:full")
|
||||
public class CondolenceApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("/")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/apply/index.html")
|
||||
@SaCheckPermission("condolence.apply")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/apply/index.html")
|
||||
@SaCheckPermission("h5.condolence.apply")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission(value = {"condolence.apply", "h5.condolence.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "职工慰问系统-慰问申请", msg = "保存申请")
|
||||
public Result save(@Param("data") Condolence condolence) {
|
||||
if(StrUtil.isBlank(condolence.getId())) condolence.setCreateTime(DateUtil.now());
|
||||
dao.insertOrUpdate(condolence);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("提交申请")
|
||||
@SaCheckPermission(value = {"condolence.apply", "h5.condolence.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "职工慰问系统-慰问申请", msg = "提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result submit(@Param("data") Condolence condolence) {
|
||||
if(StrUtil.isBlank(condolence.getId())) condolence.setCreateTime(DateUtil.now());
|
||||
dao.insertOrUpdate(condolence);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, condolence);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("ZGWW", condolence.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(value = {"condolence.apply", "h5.condolence.apply"}, mode = SaMode.OR)
|
||||
public Result submitAgain(@Param("data") Condolence condolence, @Param("taskId") Long taskId) {
|
||||
dao.insertOrUpdate(condolence);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询用户")
|
||||
@SaCheckPermission(value = {"condolence.apply", "h5.condolence.apply"}, mode = SaMode.OR)
|
||||
public Object listUser(String keyword) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
id,
|
||||
username as userName,
|
||||
loginname as loginName,
|
||||
sex,
|
||||
mobile,
|
||||
technicalTitle,
|
||||
IFNULL(unitname, '暂无') as unitName,
|
||||
unitid as unitId,
|
||||
unionid as unionId,
|
||||
unionname as unionName
|
||||
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);
|
||||
}
|
||||
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if(AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and(View_user::getId, "=", SecurityUtil.getUserId());
|
||||
}
|
||||
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = condolenceService.listPageMap(1, 50, sql);
|
||||
return Result.success(pagination.getList());
|
||||
}
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceBranchUnionApprovalController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/28 11:33
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/condolence/branchUnionApproval")
|
||||
@Api("职工慰问分工会审核")
|
||||
@Ok("json:full")
|
||||
public class CondolenceBranchUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("/")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/branchUnionApproval/index.html")
|
||||
@SaCheckPermission("condolence.branchUnionApproval")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/branchUnionApproval/index.html")
|
||||
@SaCheckPermission("h5.condolence.branchUnionApproval")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"condolence.branchUnionApproval", "h5.condolence.branchUnionApproval"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 condolence info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN condolence_type type ON info.type = type.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();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("info.type", "=", type);
|
||||
cnd.andEX("YEAR(info.createTime)", "=", year);
|
||||
|
||||
cnd.and("t.taskName", "=", "4dad0bef-3cf2-4a7d-bba3-35020b9b216d");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.createTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.sms.SmsService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
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.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
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.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.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceApplyController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/28 11:06
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/condolence/mine")
|
||||
@Api("职工慰问我的")
|
||||
@Ok("json:full")
|
||||
public class CondolenceMineController {
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("/")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/mine/index.html")
|
||||
@SaCheckPermission("condolence.mine")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/mine/index.html")
|
||||
@SaCheckPermission("h5.condolence.mine")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"condolence.mine", "h5.condolence.mine"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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,
|
||||
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') AS startTaskId
|
||||
FROM
|
||||
condolence info
|
||||
LEFT JOIN condolence_type type ON info.type = type.id
|
||||
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();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("year(info.createTime)", "=", year);
|
||||
cnd.andEX("info.type", "=", type);
|
||||
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.desc("info.createTime");
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"condolence.mine", "h5.condolence.mine"}, mode = SaMode.OR)
|
||||
@SLog(tag = "职工慰问系统-我的申请", msg = "删除职工慰问")
|
||||
public Result delete(@Param("id") String id) {
|
||||
condolenceService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个慰问申请信息")
|
||||
@SaCheckPermission("condolence")
|
||||
public Result info(String id) {
|
||||
Condolence condolence = condolenceService.fetch(id);
|
||||
CondolenceType type = condolenceService.dao().fetch(CondolenceType.class, Cnd.where(CondolenceType::getId, "=", condolence.getType()));
|
||||
NutMap nutMap = Lang.obj2nutmap(condolence);
|
||||
nutMap.put("typeName", type.getName());
|
||||
//smsService.send("20182040", "这是一条由智慧工会系统发出的测试消息。");
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
@Inject
|
||||
private SmsService smsService;
|
||||
}
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.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.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.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.param.SysMsgSummaryPageForm;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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 javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceReadController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 16:25
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "职工慰问阅览")
|
||||
@At("/platform/condolence/read")
|
||||
public class CondolenceReadController {
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("condolence.read")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/read/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("condolence.read")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
type.name as typeName,
|
||||
ins.state instanceState,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.displayName taskName
|
||||
FROM
|
||||
condolence info
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
processInstanceId,
|
||||
displayName,
|
||||
createdAt,
|
||||
ROW_NUMBER() OVER (PARTITION BY processInstanceId ORDER BY createdAt DESC) AS rn
|
||||
FROM wf_process_task
|
||||
) t ON t.processInstanceId = ins.id AND t.rn = 1
|
||||
LEFT JOIN condolence_type type ON info.type = type.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.type", "=", type);
|
||||
cnd.andEX("YEAR(info.createTime)", "=", year);
|
||||
cnd.andEX("info.applyUnionId", "=", unionId);
|
||||
cnd.andEX("info.applyUnitId", "=", unitId);
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("info.helpUserName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.helpLoginName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("info.applyUnionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.createTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("condolence.read")
|
||||
@ApiOperation("导出职工慰问汇总表")
|
||||
public void onExport(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
con.*,
|
||||
type.name as typeName
|
||||
from
|
||||
condolence con
|
||||
left join wf_process_instance ins on ins.businessNo = con.id
|
||||
left join condolence_type type on type.id = con.type
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(ProcessInstance::getState, "=", ProcessTaskStateEnum.FINISHED.getCode());
|
||||
cnd.andEX("con.type", "=", type);
|
||||
cnd.andEX("YEAR(info.createTime)", "=", year);
|
||||
cnd.andEX("con.applyUnionId", "=", unionId);
|
||||
cnd.andEX("con.applyUnitId", "=", unitId);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("info.helpUserName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.helpLoginName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("con.applyUnionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = condolenceService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("慰问对象", "helpUserName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("慰问对象工号", "helpLoginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请人", "applyUserName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在工会", "helpUnionName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在单位", "helpUnitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("慰问类型", "typeName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("拟补贴金额", "money", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请理由", "remark", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
|
||||
CommonDownloadUtil.download("申报人汇总.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
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/12/23 14:13
|
||||
* @description 校工会预审
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/condolence/schoolPrincipalApproval")
|
||||
@Api("职工慰问校工会预审")
|
||||
@Ok("json:full")
|
||||
public class CondolenceSchoolPrincipalApprovalController {
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("/")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/schoolPrincipalApproval/index.html")
|
||||
@SaCheckPermission("condolence.schoolPrincipalApproval")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/schoolPrincipalApproval/index.html")
|
||||
@SaCheckPermission("h5.condolence.schoolPrincipalApproval")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"condolence.schoolPrincipalApproval", "h5.condolence.schoolPrincipalApproval"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 condolence info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN condolence_type type ON info.type = type.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();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("info.type", "=", type);
|
||||
cnd.andEX("YEAR(info.createTime)", "=", year);
|
||||
cnd.andEX("info.applyUnionId", "=", unionId);
|
||||
cnd.andEX("info.applyUnitId", "=", unitId);
|
||||
|
||||
cnd.and("t.taskName", "=", "34f7938e-47a3-4b3a-b4e0-92b7a3f47865");
|
||||
// cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.createTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceSchoolUnionApprovalController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 16:23
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/condolence/schoolUnionApproval")
|
||||
@Api("职工慰问校工会审核")
|
||||
@Ok("json:full")
|
||||
public class CondolenceSchoolUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("/")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html")
|
||||
@SaCheckPermission("condolence.schoolUnionApproval")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/schoolUnionApproval/index.html")
|
||||
@SaCheckPermission("h5.condolence.schoolUnionApproval")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"condolence.schoolUnionApproval", "h5.condolence.schoolUnionApproval"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 condolence info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN condolence_type type ON info.type = type.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();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("info.type", "=", type);
|
||||
cnd.andEX("YEAR(info.createTime)", "=", year);
|
||||
cnd.andEX("info.applyUnionId", "=", unionId);
|
||||
cnd.andEX("info.applyUnitId", "=", unitId);
|
||||
|
||||
cnd.and("t.taskName", "=", "ecdaef3b-edf4-4143-9a96-887dd5921711");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.createTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.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.condolence.model.CondolenceType;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceTypeService;
|
||||
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.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceTypeController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 10:00
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "职工慰问类型")
|
||||
@At("/platform/condolence/type")
|
||||
public class CondolenceTypeController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private CondolenceTypeService typeService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("condolence.type")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/type/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("condolence.type")
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(CondolenceType::getName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(CondolenceType::getCode, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.asc("code");
|
||||
Pagination pagination = typeService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改职工慰问类型")
|
||||
@SaCheckPermission("condolence.type")
|
||||
@SLog(tag = "职工慰问系统-慰问类型", msg = "新增/修改职工慰问类型")
|
||||
public Object onSubmit(CondolenceType type) {
|
||||
typeService.insertOrUpdate(type);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除职工慰问类型")
|
||||
@SaCheckPermission("condolence.type")
|
||||
@SLog(tag = "职工慰问系统-慰问类型", msg = "删除职工慰问类型")
|
||||
public Object onDelete(String id) {
|
||||
typeService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询职工慰问类型")
|
||||
@SaCheckLogin
|
||||
public Result queryCondolenceType() {
|
||||
List<CondolenceType> list = typeService.query(Cnd.where(CondolenceType::getEnable, "=", true).asc(CondolenceType::getCode));
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.interceptor;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.dayofficework.article.models.Article;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceSaveInterceptor
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/28 11:01
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CondolenceSaveInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
Condolence condolence = Json.fromJson(Condolence.class, formDataStr);
|
||||
|
||||
if(StrUtil.isBlank(condolence.getId())) condolence.setCreateTime(DateUtil.now());
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
dao.insertOrUpdate(condolence);
|
||||
|
||||
// 设置流程变量
|
||||
execution.getArgs().set("origin", condolence.getOrigin());
|
||||
|
||||
int instanceId = execution.getArgs().getInt(FlowConst.PROCESS_INSTANCE_ID_KEY);
|
||||
dao.update(ProcessInstance.class, Chain.make("businessNo", condolence.getId()), Cnd.where(ProcessInstance::getId, "=", instanceId));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName Condolence
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/28 11:03
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("condolence")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职工慰问")
|
||||
public class Condolence 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 applyUserId;
|
||||
|
||||
@Column
|
||||
@Comment("申请人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String applyUserName;
|
||||
|
||||
@Column
|
||||
@Comment("申请人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String applyLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("申请人分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String applyUnionId;
|
||||
|
||||
@Column
|
||||
@Comment("申请人分工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String applyUnionName;
|
||||
|
||||
@Column
|
||||
@Comment("申请人单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String applyUnitId;
|
||||
|
||||
@Column
|
||||
@Comment("申请人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String applyUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("补助人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String helpUserId;
|
||||
|
||||
@Column
|
||||
@Comment("补助人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String helpUserName;
|
||||
|
||||
@Column
|
||||
@Comment("补助人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String helpLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("补助人分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String helpUnionId;
|
||||
|
||||
@Column
|
||||
@Comment("补助人分工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String helpUnionName;
|
||||
|
||||
@Column
|
||||
@Comment("补助人单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String helpUnitId;
|
||||
|
||||
@Column
|
||||
@Comment("补助人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String helpUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String origin;
|
||||
|
||||
@Column
|
||||
@Comment("收款人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String payUserId;
|
||||
|
||||
@Column
|
||||
@Comment("收款人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String payUserName;
|
||||
|
||||
@Column
|
||||
@Comment("收款人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String payLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("慰问类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String type;
|
||||
|
||||
@Column
|
||||
@Comment("慰问编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String typeCode;
|
||||
|
||||
@Column
|
||||
@Comment("慰问方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String way;
|
||||
|
||||
@Column
|
||||
@Comment("慰问金额")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double money;
|
||||
|
||||
@Column
|
||||
@Comment("发生时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String occurTime;
|
||||
|
||||
@Column
|
||||
@Comment("生育几孩(孩次)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String child;
|
||||
|
||||
@Column
|
||||
@Comment("所在医院")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String hospital;
|
||||
|
||||
@Column
|
||||
@Comment("病房床号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String hospitalHouseNum;
|
||||
|
||||
@Column
|
||||
@Comment("病房床号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String hospitalHouseBedNum;
|
||||
|
||||
@Column
|
||||
@Comment("住院病由")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String hospitalBy;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String remark;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Comment("签字")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
@Column(hump = true)
|
||||
private String signature;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String createTime;
|
||||
|
||||
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("户名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankUserName;
|
||||
|
||||
@Column
|
||||
@Comment("银行账号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankCardNumber;
|
||||
|
||||
@Column
|
||||
@Comment("开户行")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankOfDeposit;
|
||||
|
||||
@Column
|
||||
@Comment("证明人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String certifierUserId;
|
||||
|
||||
@Column
|
||||
@Comment("证明人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String certifierUserName;
|
||||
|
||||
@Column
|
||||
@Comment("证明人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String certifierLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("证明人分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String certifierUnionId;
|
||||
|
||||
@Column
|
||||
@Comment("证明人分工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String certifierUnionName;
|
||||
|
||||
@Column
|
||||
@Comment("证明人单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String certifierUnitId;
|
||||
|
||||
@Column
|
||||
@Comment("证明人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String certifierUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("经办人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String handlerUserId;
|
||||
|
||||
@Column
|
||||
@Comment("经办人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String handlerUserName;
|
||||
|
||||
@Column
|
||||
@Comment("经办人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String handlerLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("经办人分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String handlerUnionId;
|
||||
|
||||
@Column
|
||||
@Comment("经办人分工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String handlerUnionName;
|
||||
|
||||
@Column
|
||||
@Comment("经办人单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String handlerUnitId;
|
||||
|
||||
@Column
|
||||
@Comment("经办人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String handlerUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("入院时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String hospitalizationTime;
|
||||
|
||||
@Column
|
||||
@Comment("出院时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String leaveHospitalTime;
|
||||
|
||||
@Column
|
||||
@Comment("当年第几次住院")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer thisYearHospitalizationNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.DB;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceType
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 9:59
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("condolence_type")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("职工慰问类型")
|
||||
public class CondolenceType extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String code;
|
||||
|
||||
@Column
|
||||
@Comment("名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("费用")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double money;
|
||||
|
||||
@Column
|
||||
@Comment("慰问方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String way;
|
||||
|
||||
@Column
|
||||
@Comment("是否启用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean enable;
|
||||
|
||||
@Column
|
||||
@Comment("是否上传附件")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isUploadFile;
|
||||
|
||||
@Column
|
||||
@Comment("上传附件说明")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
private String uploadFileDesc;
|
||||
|
||||
@Column
|
||||
@Comment("排序字段")
|
||||
@Prev({
|
||||
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Condolence_Type"),
|
||||
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM Condolence_Type")
|
||||
})
|
||||
private Integer location;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private int sortNum;
|
||||
|
||||
@Column
|
||||
@Comment("上传会议纪要")
|
||||
@Default("0")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean uploadMeetingRecord;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 11:21
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface CondolenceService extends BaseService<Condolence> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceTypeService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 10:03
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface CondolenceTypeService extends BaseService<CondolenceType> {
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 11:22
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class CondolenceServiceImpl extends BaseServiceImpl<Condolence> implements CondolenceService {
|
||||
|
||||
public CondolenceServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.condolence.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName CondolenceTypeServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/29 10:03
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class CondolenceTypeServiceImpl extends BaseServiceImpl<CondolenceType> implements CondolenceTypeService {
|
||||
|
||||
public CondolenceTypeServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.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.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.service.ContributionApplyService;
|
||||
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.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionDetailedController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 14:58
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "慈善捐助明细")
|
||||
@At("/platform/contribution/detailed")
|
||||
public class ContributionDetailedController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ContributionApplyService applyService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("contribution.detailed")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/contribution/detailed/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("contribution.detailed")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "payMode") String payMode,
|
||||
@Param(value = "contributionName") String contributionName) {
|
||||
Sql sql = applyService.generateSql(unionId, unitId, payMode, contributionName);
|
||||
Pagination pagination = applyService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("contribution.detailed")
|
||||
public void doExport(@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "payMode") String payMode,
|
||||
@Param(value = "contributionName") String contributionName,
|
||||
HttpServletResponse response) throws IOException {
|
||||
Sql sql = applyService.generateSql(unionId, unitId, payMode, contributionName);
|
||||
List<NutMap> listMap = applyService.listMap(sql);
|
||||
for (int i = 0; i < listMap.size(); i++) {
|
||||
listMap.get(i).put("index", i + 1);
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("序号", "index", 10));
|
||||
entityList.add(new ExcelExportEntity("捐助项目", "contributionName", 20));
|
||||
entityList.add(new ExcelExportEntity("捐助人工号", "loginName", 20));
|
||||
entityList.add(new ExcelExportEntity("捐助人姓名", "userName", 20));
|
||||
entityList.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("善款金额", "money", 20));
|
||||
entityList.add(new ExcelExportEntity("捐赠方式", "payModeName", 20));
|
||||
entityList.add(new ExcelExportEntity("捐赠时间", "contributionTime", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, listMap);
|
||||
CommonDownloadUtil.download("捐助明细.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.contribution.model.ContributionProject;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionType;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.service.ContributionTypeService;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionProjectController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 10:51
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "慈善捐助项目")
|
||||
@At("/platform/contribution/list")
|
||||
public class ContributionProjectController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ContributionTypeService typeService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("contribution.list")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/contribution/list/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("contribution.list")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param("contributionName") String contributionName) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
con.*,
|
||||
type.typeName
|
||||
FROM
|
||||
`contribution_project` con
|
||||
LEFT JOIN contribution_type type ON type.typeCode = con.contributionTypeCode
|
||||
$condition
|
||||
""");
|
||||
if (Strings.isNotBlank(contributionName)) {
|
||||
cnd.where().andLike("con.contributionName", contributionName);
|
||||
}
|
||||
cnd.asc("con.contributionTypeCode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = typeService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改慈善捐助项目")
|
||||
@SaCheckPermission("contribution.list")
|
||||
@SLog(type = "contribution", tag = "新增/修改慈善捐助项目", msg = "新增/修改慈善捐助项目")
|
||||
public Object onSubmit(ContributionProject project) {
|
||||
if(StrUtil.isBlank(project.getId())) {
|
||||
project.setContributionCreationDate(DateUtil.now());
|
||||
}
|
||||
typeService.dao().insertOrUpdate(project);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除慈善捐助项目")
|
||||
@SaCheckPermission("contribution.list")
|
||||
@SLog(type = "contribution", tag = "删除慈善捐助项目", msg = "删除慈善捐助项目")
|
||||
public Object onDelete(String id) {
|
||||
typeService.dao().delete(ContributionProject.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询慈善捐助项目")
|
||||
@SaCheckPermission("contribution.list")
|
||||
public Result queryContributionList() {
|
||||
List<ContributionProject> list = typeService.dao().query(
|
||||
ContributionProject.class,
|
||||
Cnd.where(ContributionProject::getIsContributionEnable, "=", true)
|
||||
.desc(ContributionProject::getContributionCreationDate)
|
||||
);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.service.ContributionApplyService;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionStatisticsController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 15:42
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "慈善捐助分工会统计")
|
||||
@At("/platform/contribution/statistics")
|
||||
public class ContributionStatisticsController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ContributionApplyService applyService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("contribution.statistics")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/contribution/statistics/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("contribution.statistics")
|
||||
public Result pageData(@Param(value = "unionId") String unionId,
|
||||
@Param(value = "contributionId") String contributionId) {
|
||||
List<Sys_union> unionList = dao.query(Sys_union.class, Cnd.NEW().andEX("id", "=", unionId).asc(Sys_union::getUnionCode));
|
||||
List<ContributionApply> applyList = applyService.query(Cnd.NEW().andEX(ContributionApply::getContributionId, "=", contributionId));
|
||||
|
||||
List<NutMap> resultList = new ArrayList<>();
|
||||
for (Sys_union union : unionList) {
|
||||
NutMap map = Lang.obj2nutmap(union);
|
||||
//找这个项目的人,去重
|
||||
List<ContributionApply> userList = applyList.stream()
|
||||
.collect(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ContributionApply::getUserId))))
|
||||
.stream()
|
||||
.toList();
|
||||
|
||||
//这个项目每个分工会有多少个人捐助
|
||||
List<ContributionApply> list = userList.stream()
|
||||
.filter(n -> n.getUnionId().equals(union.getId()) && n.getContributionId().equals(contributionId))
|
||||
.toList();
|
||||
map.setv("contributionUserNum", list.size());
|
||||
|
||||
//捐助多少笔
|
||||
long conCount = applyList.stream()
|
||||
.filter(n -> n.getUnionId().equals(union.getId()) && n.getContributionId().equals(contributionId))
|
||||
.count();
|
||||
map.setv("contributionNum", conCount);
|
||||
|
||||
//一共捐了多少钱
|
||||
double money = list.stream().mapToDouble(ContributionApply::getMoney).sum();
|
||||
map.setv("money", money);
|
||||
|
||||
resultList.add(map);
|
||||
}
|
||||
return Result.success(resultList);
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.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.contribution.model.ContributionApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionProject;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionType;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.service.ContributionTypeService;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName contributionTypeController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 10:06
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "慈善捐助专题")
|
||||
@At("/platform/contribution/type")
|
||||
public class ContributionTypeController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ContributionTypeService typeService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("contribution.type")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/contribution/type/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("contribution.type")
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(ContributionType::getTypeName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(ContributionType::getTypeCode, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.asc("typeCode");
|
||||
Pagination pagination = typeService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改慈善捐助专题")
|
||||
@SaCheckPermission("contribution.type")
|
||||
@SLog(type = "contribution", tag = "新增/修改慈善捐助专题", msg = "新增/修改慈善捐助专题")
|
||||
public Object onSubmit(ContributionType type) {
|
||||
typeService.insertOrUpdate(type);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除慈善捐助专题")
|
||||
@SaCheckPermission("contribution.type")
|
||||
@SLog(type = "contribution", tag = "删除慈善捐助专题", msg = "删除慈善捐助专题")
|
||||
public Object onDelete(String id) {
|
||||
typeService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询慈善捐助专题")
|
||||
@SaCheckLogin
|
||||
public Result queryContributionType() {
|
||||
List<ContributionType> list = typeService.query(Cnd.NEW().desc(ContributionType::getTypeCode));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个慈善捐助专题")
|
||||
@SaCheckLogin
|
||||
public Result fetchOne(String id) {
|
||||
ContributionType type = typeService.fetch(id);
|
||||
List<ContributionProject> list = dao.query(ContributionProject.class, Cnd.where(ContributionProject::getContributionTypeCode, "=", type.getTypeCode()).and(ContributionProject::getIsContributionEnable, "=", true));
|
||||
|
||||
List<String> projects = list.stream().map(ContributionProject::getId).toList();
|
||||
|
||||
List<ContributionApply> applyList = dao.query(ContributionApply.class, Cnd.where(ContributionApply::getContributionId, "in", projects));
|
||||
double sum = applyList.stream().mapToDouble(ContributionApply::getMoney).sum();
|
||||
|
||||
NutMap nutMap = Lang.obj2nutmap(type);
|
||||
nutMap.put("projectCount", list.size());
|
||||
nutMap.put("totalMoney", sum);
|
||||
nutMap.put("peopleCount", applyList.size());
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.h5Controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
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.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.List;
|
||||
|
||||
/**
|
||||
* @ClassName H5ContributionListController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/18 11:12
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "移动端-慈善捐助项目")
|
||||
@At("/platform/contribution/list/h5")
|
||||
public class H5ContributionListController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("h5.contribution.list")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/contribution/list/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("h5.contribution.list")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
con.*,
|
||||
con.id as contributionId,
|
||||
type.id as typeId,
|
||||
type.typeName
|
||||
FROM
|
||||
`contribution_project` con
|
||||
LEFT JOIN contribution_type type ON type.typeCode = con.contributionTypeCode
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("con.contributionTypeCode", "=", type);
|
||||
cnd.andEX("year(contributionCreationDate)", "=", year);
|
||||
cnd.and("isContributionEnable", "=", true);
|
||||
cnd.desc("contributionCreationDate");
|
||||
cnd.asc("contributionMode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
@At
|
||||
@ApiOperation("移动端-慈善捐助")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("h5.contribution.list")
|
||||
@SLog(tag = "慈善捐助-捐助", msg = "慈善捐助")
|
||||
public Object submit(ContributionApply apply) {
|
||||
if(StrUtil.isBlank(apply.getId())) {
|
||||
apply.setContributionTime(DateUtil.now());
|
||||
}
|
||||
dao.insertOrUpdate(apply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个慈善捐助专题")
|
||||
@SaCheckLogin
|
||||
public Result fetchOne(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
con.*,
|
||||
( SELECT SUM( money ) FROM contribution_apply apply WHERE apply.contributionId = con.id ) totalMoney,
|
||||
( SELECT COUNT( 1 ) FROM contribution_apply apply WHERE apply.contributionId = con.id ) peopleCount
|
||||
FROM
|
||||
`contribution_project` con
|
||||
WHERE con.id = @id
|
||||
""");
|
||||
sql.setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap nutMap = (NutMap) sql.getResult();
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.h5Controller;
|
||||
|
||||
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.dayofficework.meeting.model.MeetingTimePeriod;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingTimePeriodUser;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @ClassName H5ContributionMineController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/18 15:17
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "移动端-我的慈善捐助")
|
||||
@At("/platform/contribution/mine/h5")
|
||||
public class H5ContributionMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("h5.contribution.mine")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/contribution/mine/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("h5.contribution.mine")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ca.*,
|
||||
ca.id as applyId,
|
||||
cp.contributionName AS projectName,
|
||||
cp.contributionTypeCode,
|
||||
cp.contributionStartTime,
|
||||
cp.contributionEndTime,
|
||||
ct.id as typeId
|
||||
FROM
|
||||
contribution_apply ca
|
||||
LEFT JOIN contribution_project cp ON ca.contributionId = cp.id
|
||||
LEFT JOIN contribution_type ct ON cp.contributionTypeCode = ct.typeCode
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year(ca.contributionTime)", "=", year);
|
||||
cnd.andEX("cp.contributionTypeCode", "=", type);
|
||||
cnd.desc("ca.contributionTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除慈善捐助")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("h5.contribution.mine")
|
||||
@SLog(tag = "慈善捐助-删除慈善捐助", msg = "删除慈善捐助")
|
||||
public Object delete(String id) {
|
||||
dao.delete(ContributionApply.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionApply
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 10:03
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("慈善捐助明细")
|
||||
@Accessors(chain = true)
|
||||
@Table("contribution_apply")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ContributionApply 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 contributionId;
|
||||
|
||||
@Column
|
||||
@Comment("项目")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String contributionName;
|
||||
|
||||
@Column
|
||||
@Comment("支付人Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("支付人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("支付人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String userName;
|
||||
|
||||
@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("支付人工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("支付人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("捐助金额")
|
||||
@ColDefine(type = ColType.DOUBLE)
|
||||
private double money;
|
||||
|
||||
@Column
|
||||
@Comment("支付方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String payMode;
|
||||
|
||||
@Column
|
||||
@Comment("捐助时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String contributionTime;
|
||||
|
||||
@Column
|
||||
@Comment("捐助图片")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> contributionFiles;
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName Contribution
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 9:59
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("慈善捐助")
|
||||
@Accessors(chain = true)
|
||||
@Table("contribution_project")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ContributionProject extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("项目名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String contributionName;
|
||||
|
||||
@Column
|
||||
@Comment("项目介绍")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String contributionIntroduce;
|
||||
|
||||
@Column
|
||||
@Comment("所属捐助专题")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String contributionTypeCode;
|
||||
|
||||
@Column
|
||||
@Comment("项目图片")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String contributionFiles;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String contributionCreationDate;
|
||||
|
||||
@Column
|
||||
@Comment("是否启用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isContributionEnable;
|
||||
|
||||
@Column
|
||||
@Comment("捐助模式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private Integer contributionMode;
|
||||
|
||||
@Column
|
||||
@Comment("捐助链接")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String contributionUrl;
|
||||
|
||||
@Column
|
||||
@Comment("捐助开启时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 40)
|
||||
private String contributionStartTime;
|
||||
|
||||
@Column
|
||||
@Comment("捐助结束时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 40)
|
||||
private String contributionEndTime;
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionType
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 10:01
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("慈善捐助专题")
|
||||
@Accessors(chain = true)
|
||||
@Table("contribution_type")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ContributionType extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("专题名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String typeName;
|
||||
|
||||
@Column
|
||||
@Comment("专题编号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String typeCode;
|
||||
|
||||
@Column
|
||||
@Comment("专题介绍")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String contributionTypeIntroduce;
|
||||
|
||||
@Column
|
||||
@Comment("专题图片")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String contributionTypeFiles;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionApplyService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 15:00
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface ContributionApplyService extends BaseService<ContributionApply> {
|
||||
|
||||
/**
|
||||
* 生成查询捐助明细的sql
|
||||
* @return
|
||||
*/
|
||||
Sql generateSql(String unionId, String unitId, String payMode, String contributionName);
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionType;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionTypeService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 10:07
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface ContributionTypeService extends BaseService<ContributionType> {
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.service.ContributionApplyService;
|
||||
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 org.nutz.lang.Strings;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionApplyServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 15:00
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ContributionApplyServiceImpl extends BaseServiceImpl<ContributionApply> implements ContributionApplyService {
|
||||
|
||||
public ContributionApplyServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql generateSql(String unionId, String unitId, String payMode, String contributionName) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
ca.*,
|
||||
CASE WHEN ca.payMode = 'WeChat' THEN '微信' ELSE '支付宝' END AS payModeName
|
||||
from
|
||||
contribution_apply ca
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX(ContributionApply::getUnionId, "=", unionId);
|
||||
cnd.andEX(ContributionApply::getUnitId, "=", unitId);
|
||||
cnd.andEX(ContributionApply::getPayMode, "=", payMode);
|
||||
if (Strings.isNotBlank(contributionName)) {
|
||||
cnd.where().andLike(ContributionApply::getContributionName, contributionName);
|
||||
}
|
||||
cnd.desc(ContributionApply::getContributionTime);
|
||||
cnd.asc(ContributionApply::getUnitId);
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.model.ContributionType;
|
||||
import com.budwk.app.zhgh.staffbenefit.contribution.service.ContributionTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName ContributionTypeServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 10:08
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ContributionTypeServiceImpl extends BaseServiceImpl<ContributionType> implements ContributionTypeService {
|
||||
|
||||
public ContributionTypeServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.result.Result;
|
||||
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.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
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.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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpApplyController
|
||||
* @Date 2025/7/31 8:41
|
||||
* @注释 困难补助申请
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助申请")
|
||||
@At("/platform/difficultHelp/apply")
|
||||
public class DifficultHelpApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/apply/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/apply/form.html")
|
||||
public void form() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("h5.difficultHelp.apply")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/apply/index.html")
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@SLog(tag = "困难补助申请", msg = "保存申请,填写人: ${args[0].proxyUserName}")
|
||||
public Result save(@Param("data") DifficultHelpInfo difficultHelpInfo) {
|
||||
difficultHelpInfo.setApplyTime(ObjectUtil.defaultIfNull(difficultHelpInfo.getApplyTime(), new Date()));
|
||||
dao.insertOrUpdate(difficultHelpInfo);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@SLog(tag = "困难补助申请", msg = "提交申请,填写人: ${args[0].proxyUserName}")
|
||||
public Result submit(@Param("data") DifficultHelpInfo difficultHelpInfo){
|
||||
difficultHelpInfo.setApplyTime(new Date());
|
||||
dao.insertOrUpdate(difficultHelpInfo);
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, difficultHelpInfo);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("KNBF", difficultHelpInfo.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("member.apply.submit")
|
||||
@SLog(tag = "困难补助申请", msg = "重新提交申请,填写人: ${args[0].proxyUserName}")
|
||||
public Result submitAgain(@Param("data") DifficultHelpInfo difficultHelpInfo, @Param("taskId") Long taskId) {
|
||||
difficultHelpInfo.setApplyTime(ObjectUtil.defaultIfNull(difficultHelpInfo.getApplyTime(), new Date()));
|
||||
dao.insertOrUpdate(difficultHelpInfo);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取受助人")
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
public Result queryRecipients(String key){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
birthday,
|
||||
mobile,
|
||||
sex,
|
||||
unitName,
|
||||
unionName,
|
||||
unionId,
|
||||
unitId
|
||||
FROM
|
||||
`vw_user`
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("id", "<>", SecurityUtil.getUserId());
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) {
|
||||
cnd.and("unionid", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and("id", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(key)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("username", key);
|
||||
group.orLike("loginname", key);
|
||||
cnd.and(group);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = difficultHelpCommonService.listPageMap(1, 10, sql);
|
||||
return Result.success().addData(pagination.getList());
|
||||
}
|
||||
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.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.result.Result;
|
||||
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.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
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.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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpBranchUnionApprovalController
|
||||
* @Date 2025/7/31 11:47
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助分工会审核")
|
||||
@At("/platform/difficultHelp/branchUnionApproval")
|
||||
public class DifficultHelpBranchUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.branchUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.branchUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/form.html")
|
||||
public void form() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("h5.difficultHelp.branchUnionApproval")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/branchunionapproval/index.html")
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助分工会审核列表")
|
||||
@SaCheckPermission("difficultHelp.branchUnionApproval")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 difficult_help_info 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();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
|
||||
cnd.and("t.taskName", "=", "9d11798e-a0e4-4ff5-939b-e6c5519e0eb6");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (pageParam.getAudit()) {
|
||||
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.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
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.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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.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 javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpViewController
|
||||
* @Date 2025/7/31 11:50
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助查看")
|
||||
@At("/platform/difficultHelp/mine")
|
||||
public class DifficultHelpMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.mine")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/mine/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("h5.difficultHelp.mine")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/mine/index.html")
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助申请,我的申请列表")
|
||||
@SaCheckPermission("difficultHelp.mine")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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,
|
||||
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
|
||||
difficult_help_info 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();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||
if (StrUtil.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("删除困难补助申请")
|
||||
@SaCheckPermission("difficultHelp.mine")
|
||||
@SLog(tag = "困难补助申请", msg = "删除困难补助申请,id: ${args[0]}")
|
||||
public Result onDelete(@Valid String id){
|
||||
dao.clear(DifficultHelpInfo.class, Cnd.where("id", "=", id));
|
||||
// 删除流程相关操作
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiModelProperty("获取困难补助申请")
|
||||
@SaCheckPermission("difficultHelp.mine")
|
||||
public Result findOne(String id) {
|
||||
DifficultHelpInfo helpInfo = dao.fetch(DifficultHelpInfo.class, id);
|
||||
return Result.success().addData(helpInfo);
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpReadingController
|
||||
* @Date 2025/7/31 15:07
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助汇总阅览")
|
||||
@At("/platform/difficultHelp/reading")
|
||||
public class DifficultHelpReadingController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.reading")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/reading/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助汇总阅览列表")
|
||||
@SaCheckPermission("difficultHelp.reading")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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,
|
||||
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
|
||||
difficult_help_info 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();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("删除")
|
||||
public Result delete(@Param("id") String id) {
|
||||
difficultHelpCommonService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.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.result.Result;
|
||||
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.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
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.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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpSchoolUnionApprovalController
|
||||
* @Date 2025/7/31 11:47
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助校工会审核")
|
||||
@At("/platform/difficultHelp/schoolUnionApproval")
|
||||
public class DifficultHelpSchoolUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/form.html")
|
||||
public void form() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("h5.difficultHelp.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/schoolunionapproval/index.html")
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助校工会审核列表")
|
||||
@SaCheckPermission("difficultHelp.schoolUnionApproval")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 difficult_help_info 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();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
|
||||
cnd.and("t.taskName", "=", "715ece82-4ae3-433c-ad18-ed875f45d1e3");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (pageParam.getAudit()) {
|
||||
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.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.h5controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:H5DifficultHelpController
|
||||
* @Date 2025/9/6 14:21
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api("h5困难帮扶")
|
||||
@At("/platform/h5/difficultHelp")
|
||||
public class H5DifficultHelpController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.h5.apply")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/apply/index.html")
|
||||
public void apply() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.h5.mine")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/mine/index.html")
|
||||
public void mine() {
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.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.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpSaveInterceptor
|
||||
* @Date 2025/7/31 11:04
|
||||
* @注释
|
||||
*/
|
||||
public class DifficultHelpSaveInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
System.out.println("difficult help apply ..................");
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
DifficultHelpInfo difficultHelpInfo = Json.fromJson(DifficultHelpInfo.class, formDataStr);
|
||||
difficultHelpInfo.setApplyTime(new Date());
|
||||
dao.insertOrUpdate(difficultHelpInfo);
|
||||
|
||||
execution.getArgs().set(FlowConst.FORM_DATA, Json.toJson(difficultHelpInfo));
|
||||
|
||||
int instanceId = execution.getArgs().getInt(FlowConst.PROCESS_INSTANCE_ID_KEY);
|
||||
dao.update(ProcessInstance.class, Chain.make("businessNo", difficultHelpInfo.getId()), Cnd.where(ProcessInstance::getId, "=", instanceId));
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.models;
|
||||
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficulHelpInfo
|
||||
* @Date 2025/7/30 17:33
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DifficultHelpInfo extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date applyTime;
|
||||
|
||||
@Column
|
||||
@Comment("申请模式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mode;
|
||||
|
||||
@Column
|
||||
@Comment("填写人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String proxyUserId;
|
||||
|
||||
@Column
|
||||
@Comment("填写人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String proxyUserName;
|
||||
|
||||
@Column
|
||||
@Comment("填写人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String proxyLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("申请人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("申请人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("申请人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("分工会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("月收入")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String monthlyIncome;
|
||||
|
||||
@Column
|
||||
@Comment("出生日期")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@Comment("联系电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("身份证号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String idCard;
|
||||
|
||||
@Column
|
||||
@Comment("职务职称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String officialCapacity;
|
||||
|
||||
@Column
|
||||
@Comment("银行卡号(华夏银行工资卡卡号)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String bankCardNum;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("户名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String bankUserName;
|
||||
|
||||
@Column
|
||||
@Comment("开户行")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String bankOfDeposit;
|
||||
|
||||
@Column
|
||||
@Comment("家庭住址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String homeAddress;
|
||||
|
||||
@Column
|
||||
@Comment("补助标准")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String subsidyStandards;
|
||||
|
||||
@Column
|
||||
@Comment("家庭成员")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> familyList;
|
||||
|
||||
@Column
|
||||
@Comment("申请理由")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String reason;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String remarks;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("申请人签字")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String sign;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpCommonService
|
||||
* @Date 2025/7/31 9:16
|
||||
* @注释
|
||||
*/
|
||||
public interface DifficultHelpCommonService extends BaseService<DifficultHelpInfo> {
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpCommonServiceImpl
|
||||
* @Date 2025/7/31 9:16
|
||||
* @注释
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHelpInfo> implements DifficultHelpCommonService {
|
||||
|
||||
public DifficultHelpCommonServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpPageParam
|
||||
* @Date 2025/7/31 9:50
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DifficultHelpPageParam extends PageForm {
|
||||
|
||||
private String year;
|
||||
|
||||
private String unionId;
|
||||
|
||||
private String unitId;
|
||||
|
||||
private List<String> dateRange;
|
||||
|
||||
public void buildSearch(Cnd cnd, String prefix){
|
||||
if (cnd == null) {
|
||||
cnd = Cnd.NEW();
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(this.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike(prefix + "userName", this.getSearchKeyword());
|
||||
seg.orLike(prefix + "loginName", this.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
cnd.andEX("YEAR(" + prefix + "applyTime)", "=", this.getYear());
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) {
|
||||
cnd.and(prefix + "unionid", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and(prefix + "userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
} else {
|
||||
cnd.andEX(prefix + "unionId", "=", this.getUnionId());
|
||||
}
|
||||
|
||||
cnd.andEX(prefix + "unitId", "=", this.getUnitId());
|
||||
|
||||
if (Lang.isNotEmpty(this.getDateRange())) {
|
||||
cnd.andEX("DATE(" + prefix + "applyTime)", ">=", this.getDateRange().get(0));
|
||||
cnd.andEX("DATE(" + prefix + "applyTime)", "<=", this.getDateRange().get(1));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
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.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.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.models.Dsznfmtx;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.DsznfmtxService;
|
||||
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 javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/16 20:51
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/dsznfmtx/apply")
|
||||
@Api("独生子女父母退休奖励申请")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class DsznfmtxApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private DsznfmtxService dsznfmtxService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/dsznfmtx/apply/index.html")
|
||||
@SaCheckPermission("dsznfmtx.apply")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/dsznfmtx/apply/index.html")
|
||||
@SaCheckPermission("h5.dsznfmtx.apply")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission(value = {"dsznfmtx.apply", "h5.dsznfmtx.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "生育休假-休假申请", msg = "保存休假申请")
|
||||
public Result save(@Param("data") Dsznfmtx dsznfmtx) {
|
||||
if (StrUtil.isBlank(dsznfmtx.getId())) dsznfmtx.setApplyTime(new Date());
|
||||
dao.insertOrUpdate(dsznfmtx);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("提交申请")
|
||||
@SaCheckPermission(value = {"dsznfmtx.apply", "h5.dsznfmtx.apply"}, mode = SaMode.OR)
|
||||
public Result submit(@Param("data") Dsznfmtx dsznfmtx) {
|
||||
if (StrUtil.isBlank(dsznfmtx.getId())) dsznfmtx.setApplyTime(new Date());
|
||||
|
||||
dao.insertOrUpdate(dsznfmtx);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, dsznfmtx);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("DSZNFMTX", dsznfmtx.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(value = {"dsznfmtx.apply", "h5.dsznfmtx.apply"}, mode = SaMode.OR)
|
||||
public Result submitAgain(@Param("data") Dsznfmtx dsznfmtx, @Param("taskId") Long taskId) {
|
||||
if (StrUtil.isBlank(dsznfmtx.getId())) dsznfmtx.setApplyTime(new Date());
|
||||
|
||||
dao.insertOrUpdate(dsznfmtx);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@ApiOperation("是否为退休、离休、离退休人员")
|
||||
@SaCheckPermission(value = {"dsznfmtx.apply", "h5.dsznfmtx.apply"}, mode = SaMode.OR)
|
||||
public Object checkRetirementStatus(HttpServletRequest req) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.userState
|
||||
FROM
|
||||
sys_user info
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.id", "=", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> map = dsznfmtxService.listMap(sql);
|
||||
|
||||
if (!map.isEmpty()) {
|
||||
NutMap user = map.get(0);
|
||||
String userState = user.getString("userState");
|
||||
// 检查用户状态是否为退休相关状态
|
||||
if ("退休".equals(userState) || "离休".equals(userState) || "离退休".equals(userState)) {
|
||||
return Result.success(true);
|
||||
}
|
||||
}
|
||||
|
||||
return Result.success(false);
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("json")
|
||||
@ApiOperation("是否已经申请过")
|
||||
@SaCheckPermission(value = {"dsznfmtx.apply", "h5.dsznfmtx.apply"}, mode = SaMode.OR)
|
||||
public Object checkUserApplied(HttpServletRequest req) {
|
||||
try {
|
||||
// 查询该用户是否已有申请记录
|
||||
long count = dao.count(Dsznfmtx.class, Cnd.where("userId", "=", SecurityUtil.getUserId()));
|
||||
// 返回true表示已申请,false表示未申请
|
||||
return Result.success(count > 0);
|
||||
} catch (Exception e) {
|
||||
log.error("检查用户申请状态失败", e);
|
||||
return Result.error("检查用户申请状态失败");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result findOne(String id) {
|
||||
return Result.success(baseService.dao().fetch(Dsznfmtx.class, id));
|
||||
}
|
||||
}
|
||||
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.DsznfmtxService;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.vo.DsznfmtxCollectExcelVO;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.vo.MaternityLeaveCollectExcelVO;
|
||||
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.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 javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/16 20:53
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/dsznfmtx/collect")
|
||||
@Api("查询统计")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class DsznfmtxCollectController {
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private DsznfmtxService dsznfmtxService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/dsznfmtx/collect/index.html")
|
||||
@SaCheckPermission("dsznfmtx.collect")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/dsznfmtx/collect/index.html")
|
||||
@SaCheckPermission("h5.dsznfmtx.collect")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"dsznfmtx.collect", "h5.dsznfmtx.collect"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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,
|
||||
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
|
||||
dsznfmtx 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.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
// 只查询流程实例状态为20的数据(已完成状态)
|
||||
cnd.and("ins.state", "=", 20);
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = dsznfmtxService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"dsznfmtx.mine", "h5.dsznfmtx.mine"}, mode = SaMode.OR)
|
||||
@SLog( tag = "删除工会报销", msg = "删除工会报销")
|
||||
public Result delete(@Param("id") String id) {
|
||||
dsznfmtxService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission(value = {"dsznfmtx.collect", "h5.dsznfmtx.collect"}, mode = SaMode.OR)
|
||||
@ApiOperation("导出独生子女父母退休领取奖励表")
|
||||
public void onExport(@Param(value = "year") Integer year,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "userName") String userName,
|
||||
@Param(value = "sex") String sex,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.state instanceState
|
||||
FROM
|
||||
dsznfmtx info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and("info.userName", "like", "%" + userName + "%");
|
||||
}
|
||||
cnd.andEX("year(info.applyTime)", "=", year);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
cnd.and("ins.state", "=", 20);
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
List<DsznfmtxCollectExcelVO> list = dsznfmtxService.listVO(sql, DsznfmtxCollectExcelVO.class);
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, DsznfmtxCollectExcelVO.class, list);
|
||||
CommonDownloadUtil.download("独生子女父母退休领取奖励表.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.DsznfmtxService;
|
||||
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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/16 20:52
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/dsznfmtx/mine")
|
||||
@Api("我的申请")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class DsznfmtxMineController {
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private DsznfmtxService dsznfmtxService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/dsznfmtx/mine/index.html")
|
||||
@SaCheckPermission("dsznfmtx.mine")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/dsznfmtx/mine/index.html")
|
||||
@SaCheckPermission("h5.dsznfmtx.mine")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"dsznfmtx.mine", "h5.dsznfmtx.mine"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm, @Param(value = "year") Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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,
|
||||
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') AS startTaskId
|
||||
FROM
|
||||
dsznfmtx 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.desc("info.applyTime");
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = dsznfmtxService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"dsznfmtx.mine", "h5.dsznfmtx.mine"}, mode = SaMode.OR)
|
||||
@SLog( tag = "删除工会报销", msg = "删除工会报销")
|
||||
public Result delete(@Param("id") String id) {
|
||||
dsznfmtxService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.DsznfmtxService;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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 : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/16 20:52
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/dsznfmtx/schoolAudit")
|
||||
@Api("校工会审核")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class DsznfmtxSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private DsznfmtxService dsznfmtxService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/dsznfmtx/schoolAudit/index.html")
|
||||
@SaCheckPermission("dsznfmtx.schoolAudit")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/dsznfmtx/schoolAudit/index.html")
|
||||
@SaCheckPermission("h5.dsznfmtx.schoolAudit")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"dsznfmtx.schoolAudit", "h5.dsznfmtx.schoolAudit"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
boolean approval,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 dsznfmtx 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", "=", "47a91fa5-4ade-4c15-9a2c-2706465d3c8d");
|
||||
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());
|
||||
}
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(info.applyTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = dsznfmtxService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.DsznfmtxService;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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 : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/16 20:52
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/dsznfmtx/unionAudit")
|
||||
@Api("分工会审核")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class DsznfmtxUnionAuditController {
|
||||
|
||||
@Inject
|
||||
private DsznfmtxService dsznfmtxService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/dsznfmtx/unionAudit/index.html")
|
||||
@SaCheckPermission("dsznfmtx.unionAudit")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/dsznfmtx/unionAudit/index.html")
|
||||
@SaCheckPermission("h5.dsznfmtx.unionAudit")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"dsznfmtx.unionAudit", "h5.dsznfmtx.unionAudit"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
boolean approval,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 dsznfmtx 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", "=", "0558e187-d3e5-4c1f-b0e0-1502eb7ac136");
|
||||
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());
|
||||
}
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(info.applyTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = dsznfmtxService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.models;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
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.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/16 20:32
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("dsznfmtx")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("独生子女父母退休")
|
||||
public class Dsznfmtx extends BaseModel implements Serializable {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("userId")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("姓名")
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("性别")
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("出生年月")
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("工号")
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("所在工会Id")
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("所在工会")
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("所在单位Id")
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("所在单位")
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("退休时间")
|
||||
private Date retireTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("爱人姓名")
|
||||
private String loverName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("性别")
|
||||
private String loverSex;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("工作单位")
|
||||
private String loverUnitName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("结婚日期")
|
||||
private Date marryTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("子女出生日期")
|
||||
private Date childrenBirthday;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("领独生子女证时间")
|
||||
private Date getCertificateTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("奖励金额")
|
||||
private String bonus;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("申请时间")
|
||||
private Date applyTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("独生子女父母光荣证")
|
||||
private List<JSONObject> honorFiles;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("退休证")
|
||||
private List<JSONObject> retireFiles;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 500)
|
||||
@Comment("签字")
|
||||
private String sign;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("独生子女光荣证号")
|
||||
private String childrenGraceNumber;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("办证机关")
|
||||
private String office;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.models.Dsznfmtx;
|
||||
|
||||
|
||||
public interface DsznfmtxService extends BaseService<Dsznfmtx> {
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.models.Dsznfmtx;
|
||||
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.DsznfmtxService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/17 8:48
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class DsznfmtxServiceImpl extends BaseServiceImpl<Dsznfmtx> implements DsznfmtxService {
|
||||
public DsznfmtxServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.dsznfmtx.vo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/17 16:03
|
||||
*/
|
||||
|
||||
//独生子女父母退休导出
|
||||
@Data
|
||||
public class DsznfmtxCollectExcelVO {
|
||||
|
||||
@Excel(name = "办理时间", width = 20, format = "yyyy-MM-dd")
|
||||
private Date applyTime;
|
||||
|
||||
@Excel(name = "职工姓名", width = 20)
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "性别", width = 20)
|
||||
private String sex;
|
||||
|
||||
@Excel(name = "出生年月", width = 20, format = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
@Excel(name = "原工作单位", width = 20)
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "退休时间", width = 20, format = "yyyy-MM-dd")
|
||||
private Date retireTime;
|
||||
|
||||
@Excel(name = "子女出生年月", width = 20, format = "yyyy-MM-dd")
|
||||
private Date childrenBirthday;
|
||||
|
||||
@Excel(name = "领取独生子女证时间", width = 20, format = "yyyy-MM-dd")
|
||||
private Date getCertificateTime;
|
||||
|
||||
@Excel(name = "独生子女光荣证号", width = 20)
|
||||
private String childrenGraceNumber;
|
||||
|
||||
@Excel(name = "办证机关", width = 20)
|
||||
private String office;
|
||||
|
||||
@Excel(name = "奖励金额", width = 20)
|
||||
private String bonus;
|
||||
}
|
||||
|
||||
+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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+307
@@ -0,0 +1,307 @@
|
||||
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.ProcessInstanceStateEnum;
|
||||
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.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.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("excellentRecuperation.activitySignUp")
|
||||
@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"));
|
||||
activityList.forEach(activity -> {
|
||||
activity.setUnionQuotaAllocationList(dao.query(ExcellentRecuperationQuotaAllocation.class, Cnd.where("activityId", "=", activity.getId())));
|
||||
});
|
||||
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));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询报名人员")
|
||||
@SaCheckLogin
|
||||
public Result getSIgnUpUserList(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);
|
||||
cnd.and("ins.state", "!=", ProcessInstanceStateEnum.REJECT.getCode());
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> map = baseService.listMap(sql);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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.getSearchKeyword())){
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
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.result.Result;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.zhgh.dayofficework.enrollmentRegistration.model.EnrollmentRegistration;
|
||||
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.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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+268
@@ -0,0 +1,268 @@
|
||||
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 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<ExcellentRecuperationTravelAgency> travelAgencyList = dao.query(ExcellentRecuperationTravelAgency.class, Cnd.NEW().desc("id"));
|
||||
Map<String, String> map = travelAgencyList.stream().collect(Collectors.toMap(ExcellentRecuperationTravelAgency::getTravelAgencyName, ExcellentRecuperationTravelAgency::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;
|
||||
}
|
||||
ExcellentRecuperationTravelAgency agency = new ExcellentRecuperationTravelAgency();
|
||||
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;
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
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: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 = 500)
|
||||
@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;
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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.getSearchKeyword())){
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
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;
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.huimin.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.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
|
||||
import com.budwk.app.zhgh.staffbenefit.huimin.models.Huimin;
|
||||
import com.budwk.app.zhgh.staffbenefit.huimin.service.HuiminService;
|
||||
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;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/huimin/manage")
|
||||
@Api(("惠民服务管理"))
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
public class HuiminManageController {
|
||||
|
||||
@Inject
|
||||
private HuiminService huiminService;
|
||||
|
||||
@Inject
|
||||
private GlobalMessageSendService globalMessageSendService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("huimin.manage")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/huimin/manage/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("huimin.manage")
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
huimin t1
|
||||
LEFT JOIN activity_user_scope aus ON t1.groupId = aus.groupId
|
||||
AND aus.userId = @userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and("t1.title", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
}
|
||||
//cnd.and(Cnd.exps("t1.groupId", "is", null).or("aus.groupId", "is not", null));
|
||||
//sql.params().set("userId", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = huiminService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
|
||||
String title = "审批待办";
|
||||
String content = "您有一个新的审批任务需要处理,请及时登录系统查看。";
|
||||
List<String> receiverIds = Arrays.asList("00198c31ee094466845979ab8dabf83b", "00266dbf9e014376ab76072851b1a8ac");
|
||||
|
||||
// 自动发送到所有启用的渠道
|
||||
globalMessageSendService.sendMessage(title, content, 2, receiverIds, null);
|
||||
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("huimin.manage")
|
||||
@ApiOperation("新增惠民服务")
|
||||
public Result insert(@Param("data") Huimin huimin) {
|
||||
huiminService.insert(huimin);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("修改惠民服务")
|
||||
public Result update(@Param("data") Huimin huimin) {
|
||||
huiminService.updateIgnoreNull(huimin);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("huimin.manage")
|
||||
@ApiOperation("删除惠民服务")
|
||||
public Result delete(String id) {
|
||||
huiminService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.huimin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.huimin.models.Huimin;
|
||||
import com.budwk.app.zhgh.staffbenefit.huimin.service.HuiminService;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/huimin/mine")
|
||||
@Api(tags = "惠民服务-我的")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
public class HuiminMineController {
|
||||
|
||||
@Inject
|
||||
private HuiminService huiminService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("huimin.mine")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/huimin/mine/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.huimin.mine")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/huimin/mine/index.html")
|
||||
public void h5Index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"huimin.mine", "h5.huimin.mine"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
huimin t1
|
||||
LEFT JOIN activity_user_scope aus ON t1.groupId = aus.groupId
|
||||
AND aus.userId = @userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 添加搜索关键字过滤
|
||||
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
cnd.and("t1.title", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
}
|
||||
// 添加启用状态过滤(只显示启用的记录)
|
||||
cnd.and("t1.enable", "=", true);
|
||||
// 添加权限过滤
|
||||
cnd.and(Cnd.exps("t1.groupId", "is", null).or("aus.groupId", "is not", null));
|
||||
sql.params().set("userId", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = huiminService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.huimin.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;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("huimin")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("惠民服务")
|
||||
public class Huimin extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Comment("标题")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Column
|
||||
private String title;
|
||||
|
||||
@Comment("封面")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
@Column
|
||||
private String cover;
|
||||
|
||||
@Comment("内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
@Column
|
||||
private String content;
|
||||
|
||||
@Comment("是否启用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Column
|
||||
@Default("1")
|
||||
private Boolean enable;
|
||||
|
||||
@Comment("外部链接")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
@Column
|
||||
private String link;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("分组id")
|
||||
private Integer groupId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.huimin.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.huimin.models.Huimin;
|
||||
|
||||
public interface HuiminService extends BaseService<Huimin> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.huimin.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.huimin.models.Huimin;
|
||||
import com.budwk.app.zhgh.staffbenefit.huimin.service.HuiminService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class HuiminServiceImpl extends BaseServiceImpl<Huimin> implements HuiminService {
|
||||
public HuiminServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.service.LegalApplyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.psychology.model.PsychologyApply;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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 LegalApplyController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 15:08
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助预约")
|
||||
@At("/platform/legal/apply")
|
||||
public class LegalApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private LegalApplyService applyService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("legal.apply")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/apply/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.legal.apply")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/legal/apply/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改法律援助预约")
|
||||
@SaCheckPermission(value = {"legal.apply", "h5.legal.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "法律援助系统-援助申请", msg = "新增/修改法律援助预约")
|
||||
public Object submit(LegalApply apply) {
|
||||
LegalApply legalApply = applyService.fetch(apply.getId());
|
||||
if(StrUtil.isNotBlank(legalApply.getUserId())) {
|
||||
return Result.error("该时段已被预约");
|
||||
}
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where(View_user::getId, "=", SecurityUtil.getUserId()));
|
||||
apply.setUserId(user.getId());
|
||||
apply.setLoginName(user.getLoginname());
|
||||
apply.setUserName(user.getUsername());
|
||||
apply.setUnitId(user.getUnitId());
|
||||
apply.setUnitName(user.getUnitName());
|
||||
apply.setUnionId(user.getUnionId());
|
||||
apply.setUnionName(user.getUnionName());
|
||||
/*apply.setMobile(apply.getMobile());
|
||||
apply.setRemark(apply.getRemark());
|
||||
apply.setAskTypeValue(apply.getAskTypeValue());*/
|
||||
applyService.updateIgnoreNull(apply);
|
||||
|
||||
//TODO:这里后面要加发短信
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("移动端预约查询咨询师")
|
||||
@SaCheckPermission(value = {"legal.apply", "h5.legal.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "法律援助系统-移动端预约查询咨询师", msg = "移动端预约查询咨询师")
|
||||
public Object h5PageData(PageForm pageForm, String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pd.*
|
||||
FROM
|
||||
legal_doctor pd
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(Cnd.likeEX("pd.sex", sex));
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("pd.userName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("pd.loginName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = applyService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList(NutMap.class);
|
||||
for (NutMap nutMap : list) {
|
||||
List<LegalApply> applyList = dao.query(
|
||||
LegalApply.class,
|
||||
Cnd.where(LegalApply::getDoctorUser, "=", nutMap.getString("userId"))
|
||||
.and(LegalApply::getStartTime, ">=", DateUtil.now())
|
||||
.and(LegalApply::getUserId, "is", null)
|
||||
);
|
||||
nutMap.put("times", applyList);
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.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.result.Result;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.service.LegalApplyService;
|
||||
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.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName LegalAppointmentSetController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 10:04
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助预约安排")
|
||||
@At("/platform/legal/appointmentSet")
|
||||
public class LegalAppointmentSetController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private LegalApplyService applyService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("legal.appointmentSet")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/appointmentSet/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询时间段内的预约信息")
|
||||
@SaCheckLogin
|
||||
public Result queryAppointmentInfo(Long startTimeTs, Long endTimeTs) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pa.*,
|
||||
pa.userId as appointmentUser,
|
||||
pa.userName AS appointmentUserName,
|
||||
pa.loginName AS appointmentLoginName,
|
||||
pa.unitName AS appointmentUnitName,
|
||||
pa.mobile AS appointmentMobile,
|
||||
pd.specialty AS doctorSpecialty,
|
||||
pd.introduce AS doctorIntroduce,
|
||||
pd.sex AS doctorSex,
|
||||
pd.technicalTitle AS doctorJobTitle,
|
||||
pd.unitName AS doctorUnitName,
|
||||
pd.avatar AS doctorAvatar,
|
||||
pd.mobile AS doctorMobile,
|
||||
pd.userName AS doctorUserName
|
||||
FROM
|
||||
`legal_apply` pa
|
||||
LEFT JOIN legal_doctor pd ON pd.userId = pa.doctorUser
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("startTimeTs", ">=", startTimeTs);
|
||||
cnd.and("endTimeTs", "<=", endTimeTs);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = applyService.listMap(sql);
|
||||
return Result.success(listMap);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改法律援助安排")
|
||||
@SaCheckPermission("legal.appointmentSet")
|
||||
@SLog(tag = "法律援助系统-预约安排", msg = "新增/修改法律援助安排")
|
||||
public Object onSubmit(LegalApply apply) {
|
||||
long startTimeTs = com.budwk.app.base.utils.DateUtil.formatDate(apply.getStartTime());
|
||||
long endTimeTs = com.budwk.app.base.utils.DateUtil.formatDate(apply.getEndTime());
|
||||
List<LegalApply> list = new ArrayList<>();
|
||||
for (long i = startTimeTs; i < endTimeTs; i = i + 3600000) {
|
||||
LegalApply app = new LegalApply();
|
||||
LegalApply legalAppointmentInfo = Lang.copyProperties(apply, app);
|
||||
String start = com.budwk.app.base.utils.DateUtil.getDate(i / 1000);
|
||||
long e = i + 3600000;
|
||||
if ((endTimeTs - e) <= 0) {
|
||||
e = i + (endTimeTs - i);
|
||||
}
|
||||
String end = com.budwk.app.base.utils.DateUtil.getDate(e / 1000);
|
||||
legalAppointmentInfo.setStartTimeTs(i);
|
||||
legalAppointmentInfo.setEndTimeTs(e);
|
||||
legalAppointmentInfo.setStartTime(start);
|
||||
legalAppointmentInfo.setEndTime(end);
|
||||
list.add(legalAppointmentInfo);
|
||||
}
|
||||
dao.insert(list);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("修改法律援助安排")
|
||||
@SaCheckPermission("legal.appointmentSet")
|
||||
@SLog(tag = "法律援助系统-预约安排", msg = "修改法律援助安排")
|
||||
public Object onEdit(String id, String[] askType) {
|
||||
LegalApply apply = applyService.fetch(id);
|
||||
apply.setAskType(Lang.isNotEmpty(askType) ? Arrays.asList(askType) : new ArrayList<>());
|
||||
apply.setAskTypeValue(null);
|
||||
applyService.update(apply);
|
||||
//TODO:以后这里加个发短信
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除法律援助安排")
|
||||
@SaCheckPermission("legal.appointmentSet")
|
||||
@SLog(tag = "法律援助系统-预约安排", msg = "删除法律援助安排")
|
||||
public Object onDelete(String id) {
|
||||
applyService.delete(id);
|
||||
//TODO:以后这里加个发短信
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询咨询师")
|
||||
@SaCheckPermission("legal.appointmentSet")
|
||||
public Result queryDoctorUser(String keyWord, long startTimeTs, long endTimeTs) {
|
||||
if(StrUtil.isBlank(keyWord)) {
|
||||
keyWord = "";
|
||||
}
|
||||
//先查询该时间段没时间的咨询师
|
||||
Sql doctorSql = Sqls.create("""
|
||||
SELECT
|
||||
pd.userId AS id,
|
||||
pd.userName AS doctorUserName,
|
||||
replace(pd.mobile,' ','') as mobile
|
||||
FROM
|
||||
legal_doctor pd
|
||||
WHERE
|
||||
pd.userId NOT IN
|
||||
(
|
||||
SELECT doctorUser FROM legal_apply
|
||||
WHERE startTimeTs >= @startTimeTs AND endTimeTs <= @endTimeTs
|
||||
AND doctorUser IS NOT NULL
|
||||
)
|
||||
and (pd.userName like @keyWord or pd.loginName like @keyWord)
|
||||
""");
|
||||
doctorSql.setParam("startTimeTs", startTimeTs);
|
||||
doctorSql.setParam("endTimeTs", endTimeTs);
|
||||
doctorSql.setParam("keyWord", "%" + keyWord + "%");
|
||||
Pagination pagination = applyService.listPageMap(1, 10, doctorSql);
|
||||
return Result.success(pagination.getList());
|
||||
}
|
||||
}
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalDoctor;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.service.LegalDoctorService;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName LegalDoctorController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 18:18
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助咨询师")
|
||||
@At("/platform/legal/doctorManage")
|
||||
public class LegalDoctorController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private LegalDoctorService doctorService;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("legal.doctorManage")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/doctorManage/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("legal.doctorManage")
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(LegalDoctor::getLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(LegalDoctor::getUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
Pagination pagination = doctorService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("提交法律援助预约")
|
||||
@SaCheckPermission("legal.doctorManage")
|
||||
@SLog(tag = "法律援助系统-援助申请", msg = "提交法律援助预约")
|
||||
public Object onSubmit(LegalDoctor doctor) {
|
||||
Sys_role role = sysRoleService.getByCode(RoleConstant.LEGAL_DOCTOR);
|
||||
if(StrUtil.isBlank(doctor.getId())) {
|
||||
int count = doctorService.count(Cnd.where(LegalDoctor::getUserId, "=", doctor.getUserId()));
|
||||
if(count > 0) {
|
||||
return Result.error("此咨询师信息已录入");
|
||||
}
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where(View_user::getId, "=", doctor.getUserId()));
|
||||
doctor.setLoginName(user.getLoginname());
|
||||
doctor.setUserName(user.getUsername());
|
||||
doctor.setUnitId(user.getUnitId());
|
||||
doctor.setUnitName(user.getUnitName());
|
||||
doctor.setUnionId(user.getUnionId());
|
||||
doctor.setUnionName(user.getUnionName());
|
||||
//插入角色
|
||||
Sys_user_role userRole = new Sys_user_role();
|
||||
userRole.setUserId(doctor.getUserId());
|
||||
userRole.setRoleId(role.getId());
|
||||
dao.insert(userRole);
|
||||
}
|
||||
doctorService.insertOrUpdate(doctor);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除法律援助师")
|
||||
@SaCheckPermission("legal.doctorManage")
|
||||
@SLog(tag = "法律援助系统-援助师管理", msg = "删除法律援助师")
|
||||
public Object onDelete(String id) {
|
||||
doctorService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询用户")
|
||||
@SaCheckPermission("legal.doctorManage")
|
||||
public Object listUser(String keyword) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
id,
|
||||
username as userName,
|
||||
loginname as loginName,
|
||||
sex,
|
||||
mobile,
|
||||
technicalTitle,
|
||||
unitname as unitName
|
||||
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);
|
||||
}
|
||||
List<LegalDoctor> list = doctorService.query(Cnd.NEW());
|
||||
List<String> idList = list.stream().map(LegalDoctor::getUserId).toList();
|
||||
cnd.andEX(View_user::getId, "not in", idList);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = doctorService.listPageMap(1, 50, sql);
|
||||
return Result.success(pagination.getList());
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.service.LegalApplyService;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @ClassName LegalListController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 16:00
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助我的预约")
|
||||
@At("/platform/legal/list")
|
||||
public class LegalListController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private LegalApplyService applyService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("legal.list")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/list/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.legal.list")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/legal/list/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"legal.list", "h5.legal.list"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pa.*,
|
||||
pa.userName AS appointmentUserName,
|
||||
pa.loginName AS appointmentLoginName,
|
||||
pa.unitName AS appointmentUnitName,
|
||||
pa.mobile AS appointmentMobile,
|
||||
pd.specialty AS doctorSpecialty,
|
||||
pd.introduce AS doctorIntroduce,
|
||||
pd.sex AS doctorSex,
|
||||
pd.technicalTitle AS doctorJobTitle,
|
||||
pd.unitName AS doctorUnitName,
|
||||
pd.avatar AS doctorAvatar,
|
||||
pd.mobile AS doctorMobile,
|
||||
pd.userName AS doctorUserName
|
||||
FROM
|
||||
`legal_apply` pa
|
||||
LEFT JOIN legal_doctor pd ON pd.userId = pa.doctorUser
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("pa.userId", "IS NOT", null);
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("pa.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.andEX("YEAR(pa.startTime)", "=", year);
|
||||
cnd.desc("pa.startTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = applyService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除法律援助预约")
|
||||
@SaCheckPermission(value = {"legal.list", "h5.legal.list"}, mode = SaMode.OR)
|
||||
@SLog(tag = "法律援助系统-法律援助预约", msg = "删除法律援助预约")
|
||||
public Object delete(String id) {
|
||||
LegalApply apply = applyService.fetch(id);
|
||||
apply.setUserId(null);
|
||||
apply.setLoginName(null);
|
||||
apply.setUserName(null);
|
||||
apply.setUnitId(null);
|
||||
apply.setUnitName(null);
|
||||
apply.setUnionId(null);
|
||||
apply.setUnionName(null);
|
||||
apply.setRemark(null);
|
||||
apply.setMobile(null);
|
||||
applyService.update(apply);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.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.staffbenefit.legal.model.LegalOnlinePost;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalOnlineReply;
|
||||
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.Lang;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName LegalOnlinePostController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 16:37
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助线上发帖")
|
||||
@At("/platform/legal/onlinePost")
|
||||
public class LegalOnlinePostController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("legal.onlinePost")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/onlinePost/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.legal.onlinePost")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/legal/onlinePost/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"legal.onlinePost", "h5.legal.onlinePost"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "isReply") Boolean isReply) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pop.*,
|
||||
IF( count( por.id ) = 0, false, true ) AS isReply
|
||||
FROM
|
||||
legal_online_post pop
|
||||
LEFT JOIN legal_online_reply por on por.postId = pop.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("poster", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.andEX("YEAR(pop.postingTime)", "=", year);
|
||||
cnd.groupBy("pop.id");
|
||||
cnd.having(Cnd.where("count(por.id)", isReply == null ? ">=" : isReply ? ">" : "=", 0));
|
||||
cnd.desc("pop.postingTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改法律援助线上发帖")
|
||||
@SaCheckPermission(value = {"legal.onlinePost", "h5.legal.onlinePost"}, mode = SaMode.OR)
|
||||
@SLog(tag = "法律援助系统-线上发帖", msg = "新增/修改法律援助线上发帖")
|
||||
public Object submit(LegalOnlinePost post) {
|
||||
if(StrUtil.isBlank(post.getId())) {
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
post.setPoster(user.getId());
|
||||
post.setLoginName(user.getLoginname());
|
||||
post.setUserName(user.getUsername());
|
||||
post.setUnitId(user.getUnitId());
|
||||
post.setUnitName(user.getUnitName());
|
||||
post.setUnionId(user.getUnionId());
|
||||
post.setUnionName(user.getUnionName());
|
||||
post.setMobile(user.getMobile());
|
||||
post.setPostingTime(DateUtil.now());
|
||||
}
|
||||
dao.insertOrUpdate(post);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除法律援助线上发帖")
|
||||
@SaCheckPermission(value = {"legal.onlinePost", "h5.legal.onlinePost"}, mode = SaMode.OR)
|
||||
@SLog(tag = "法律援助系统-线上发帖", msg = "删除法律援助线上发帖")
|
||||
public Object delete(String id) {
|
||||
dao.delete(LegalOnlinePost.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询法律援助线上发帖")
|
||||
@SaCheckPermission(value = {"legal.onlinePost", "h5.legal.onlinePost"}, mode = SaMode.OR)
|
||||
public Result fetchOne(String id) {
|
||||
LegalOnlinePost onlinePost = dao.fetch(LegalOnlinePost.class, id);
|
||||
List<LegalOnlineReply> replyList = dao.query(
|
||||
LegalOnlineReply.class,
|
||||
Cnd.where(LegalOnlineReply::getPostId, "=", id).desc(LegalOnlineReply::getReplyTime)
|
||||
);
|
||||
NutMap nutMap = Lang.obj2nutmap(onlinePost);
|
||||
nutMap.put("replyList", replyList);
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.base.service.BaseService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalOnlinePost;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalOnlineReply;
|
||||
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.Lang;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName LegalOnlineReplyController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 17:35
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助线上回复")
|
||||
@At("/platform/legal/onlineReply")
|
||||
public class LegalOnlineReplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("legal.onlineReply")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/onlineReply/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.legal.onlineReply")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/legal/onlineReply/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"legal.onlineReply", "h5.legal.onlineReply"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "isReply") Boolean isReply) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pop.id,
|
||||
pop.poster,
|
||||
pop.loginName,
|
||||
pop.postingTime,
|
||||
pop.postTitle,
|
||||
pop.postContent,
|
||||
CONCAT( LEFT( pop.userName, 1 ), '**' ) AS posterUserName,
|
||||
count( por.id ) AS replyCount
|
||||
FROM
|
||||
legal_online_post pop
|
||||
LEFT JOIN legal_online_reply por ON por.postId = pop.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(pop.postingTime)", "=", year);
|
||||
cnd.groupBy("pop.id");
|
||||
cnd.having(Cnd.where("count(por.id)", isReply == null ? ">=" : isReply ? ">" : "=", 0));
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改法律援助线上回复")
|
||||
@SaCheckPermission(value = {"legal.onlineReply", "h5.legal.onlineReply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "法律援助系统-线上回复", msg = "新增/修改法律援助线上回复")
|
||||
public Object submit(LegalOnlineReply reply) {
|
||||
if (StrUtil.isBlank(reply.getId())) {
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
reply.setReplyUserId(user.getId());
|
||||
reply.setLoginName(user.getLoginname());
|
||||
reply.setUserName(user.getUsername());
|
||||
reply.setUnitId(user.getUnitId());
|
||||
reply.setUnitName(user.getUnitName());
|
||||
reply.setUnionId(user.getUnionId());
|
||||
reply.setUnionName(user.getUnionName());
|
||||
reply.setMobile(user.getMobile());
|
||||
reply.setReplyTime(DateUtil.now());
|
||||
}
|
||||
dao.insertOrUpdate(reply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询法律援助线上回复")
|
||||
@SaCheckPermission(value = {"legal.onlineReply", "h5.legal.onlineReply"}, mode = SaMode.OR)
|
||||
public Result fetchOne(String id) {
|
||||
LegalOnlinePost onlinePost = dao.fetch(LegalOnlinePost.class, id);
|
||||
List<LegalOnlineReply> replyList = dao.query(
|
||||
LegalOnlineReply.class,
|
||||
Cnd.where(LegalOnlineReply::getPostId, "=", id).desc(LegalOnlineReply::getReplyTime)
|
||||
);
|
||||
replyList.forEach(item -> item.setUserName(item.getUserName().charAt(0) + "**"));
|
||||
NutMap nutMap = Lang.obj2nutmap(onlinePost);
|
||||
nutMap.put("userName", onlinePost.getUserName().charAt(0) + "**");
|
||||
nutMap.put("replyList", replyList);
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalDoctor;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.service.LegalApplyService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName LegalStatisticsController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 16:16
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助统计分析")
|
||||
@At("/platform/legal/statistics")
|
||||
public class LegalStatisticsController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private LegalApplyService applyService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("legal.statistics")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/statistics/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("legal.statistics")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "tableIndex") Integer tableIndex,
|
||||
@Param(value = "doctorUser") String doctorUser) {
|
||||
Sql sql = null;
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (tableIndex == 1) {
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
pd.userId,
|
||||
pd.userName AS doctorUserName,
|
||||
pd.sex,
|
||||
pd.technicalTitle as jobTitle,
|
||||
(select count(*) from legal_apply pa where pa.doctorUser = pd.userId and pa.userId is not null) AS serviceNum
|
||||
FROM
|
||||
legal_doctor pd
|
||||
LEFT JOIN legal_apply pa ON pa.doctorUser = pd.userId
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("YEAR(pa.startTime)", "=", year);
|
||||
cnd.groupBy("pd.userId");
|
||||
cnd.desc("serviceNum");
|
||||
} else if (tableIndex == 2) {
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
pa.*,
|
||||
u.username AS doctorUserName
|
||||
FROM
|
||||
legal_apply pa
|
||||
left join vw_user u on u.id = pa.doctorUser
|
||||
$condition
|
||||
""");
|
||||
cnd.and("pa.userId", "is not", null);
|
||||
cnd.andEX("pa.doctorUser", "=", doctorUser);
|
||||
cnd.andEX("YEAR(pa.startTime)", "=", year);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = applyService.listMap(sql);
|
||||
return Result.success(listMap);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("统计数量")
|
||||
@SaCheckPermission("legal.statistics")
|
||||
public Result queryCount(@Param(value = "year") Integer year) {
|
||||
NutMap resultMap = new NutMap();
|
||||
List<LegalApply> list = applyService.query(Cnd.NEW().andEX("YEAR(startTime)", "=", year));
|
||||
resultMap.put("total", list.size());
|
||||
|
||||
long serviceTeacherCount = list.stream().map(LegalApply::getUserId).filter(StrUtil::isNotBlank).distinct().count();
|
||||
resultMap.put("successNum", serviceTeacherCount);
|
||||
resultMap.put("serviceTeacherCount", serviceTeacherCount);
|
||||
|
||||
int doctorCount = applyService.dao().count(LegalDoctor.class, Cnd.NEW());
|
||||
resultMap.put("doctorCount", doctorCount);
|
||||
|
||||
return Result.success(resultMap);
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.controller;
|
||||
|
||||
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.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalStudy;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @ClassName LegalStudyController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 16:19
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "法律援助资料学习")
|
||||
@At("/platform/legal/study")
|
||||
public class LegalStudyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("legal.study")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/legal/study/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("legal.study")
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
s.*,
|
||||
u.username
|
||||
from
|
||||
legal_study s
|
||||
left join `vw_user` u on u.id = s.createdBy
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("s.title", pageForm.getSearchKeyword());
|
||||
seg.orLike("s.url", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改法律援助资料")
|
||||
@SaCheckPermission("legal.study")
|
||||
@SLog(tag = "法律援助系统-援助资料", msg = "新增/修改法律援助资料")
|
||||
public Object onSubmit(LegalStudy study) {
|
||||
dao.insertOrUpdate(study);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除法律援助资料")
|
||||
@SaCheckPermission("legal.study")
|
||||
@SLog(tag = "法律援助系统-援助资料", msg = "删除法律援助资料")
|
||||
public Object onDelete(String id) {
|
||||
dao.delete(LegalStudy.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName LegalApply
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 16:12
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("法律援助预约")
|
||||
@Accessors(chain = true)
|
||||
@Table("legal_apply")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LegalApply extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("日期")
|
||||
private String date;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Column
|
||||
@Comment("开始时间")
|
||||
private Long startTimeTs;
|
||||
|
||||
@Column
|
||||
@Comment("结束时间")
|
||||
private Long endTimeTs;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("预约人")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("预约人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("预约人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String userName;
|
||||
|
||||
@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("预约人工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("预约人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("预约人备注")
|
||||
private String remark;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("咨询师")
|
||||
private String doctorUser;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("咨询方式")
|
||||
private List<String> askType;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("预约人选择的咨询方式")
|
||||
private String askTypeValue;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName LegalDoctor
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 16:16
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("法律援助咨询师")
|
||||
@Accessors(chain = true)
|
||||
@Table("legal_doctor")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LegalDoctor extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("用户id")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String userName;
|
||||
|
||||
@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("工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1)
|
||||
@Comment("性别")
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("职称")
|
||||
private String technicalTitle;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@Comment("特长")
|
||||
private String specialty;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@Comment("简介")
|
||||
private String introduce;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@Comment("头像")
|
||||
private String avatar;
|
||||
|
||||
@Column
|
||||
@Comment("是否禁用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private boolean disabled;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName LegalOnlinePost
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 16:17
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("法律援助线上发帖")
|
||||
@Accessors(chain = true)
|
||||
@Table("legal_online_post")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LegalOnlinePost extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("发帖人")
|
||||
private String poster;
|
||||
|
||||
@Column
|
||||
@Comment("发帖人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("发帖人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String userName;
|
||||
|
||||
@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("发帖人工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("发帖人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("发帖时间")
|
||||
private String postingTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("发帖标题")
|
||||
private String postTitle;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
@Comment("发帖内容")
|
||||
private String postContent;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName LegalOnlineReply
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 16:18
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("法律援助线上答复")
|
||||
@Accessors(chain = true)
|
||||
@Table("legal_online_reply")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LegalOnlineReply extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("帖子Id")
|
||||
private String postId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("答复人")
|
||||
private String replyUserId;
|
||||
|
||||
@Column
|
||||
@Comment("答复人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("答复人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String userName;
|
||||
|
||||
@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("答复人工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("答复人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("答复时间")
|
||||
private String replyTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
@Comment("答复内容")
|
||||
private String replyContent;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName LegalStudy
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/24 16:11
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("法律援助资料学习")
|
||||
@Accessors(chain = true)
|
||||
@Table("legal_study")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LegalStudy extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("标题")
|
||||
private String title;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("跳转链接")
|
||||
private String url;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
@Comment("备注")
|
||||
private String bz;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalApply;
|
||||
|
||||
/**
|
||||
* @ClassName LegalApplyService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 10:07
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface LegalApplyService extends BaseService<LegalApply> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalDoctor;
|
||||
|
||||
/**
|
||||
* @ClassName LegalDoctorService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 9:13
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface LegalDoctorService extends BaseService<LegalDoctor> {
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.service.LegalApplyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName LegalApplyServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 10:07
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class LegalApplyServiceImpl extends BaseServiceImpl<LegalApply> implements LegalApplyService {
|
||||
|
||||
public LegalApplyServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.legal.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.model.LegalDoctor;
|
||||
import com.budwk.app.zhgh.staffbenefit.legal.service.LegalDoctorService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName LegalDoctorServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/25 9:14
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class LegalDoctorServiceImpl extends BaseServiceImpl<LegalDoctor> implements LegalDoctorService {
|
||||
|
||||
public LegalDoctorServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.models.MaternityLeave;
|
||||
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.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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/15 17:52
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/maternityLeave/apply")
|
||||
@Api("生育休假申请")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MaternityLeaveApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/apply/index.html")
|
||||
@SaCheckPermission("maternityLeave.apply")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/apply/index.html")
|
||||
@SaCheckPermission("h5.maternityLeave.apply")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission(value = {"maternityLeave.apply", "h5.maternityLeave.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "生育休假-休假申请", msg = "保存休假申请")
|
||||
public Result save(@Param("data") MaternityLeave maternityLeave) {
|
||||
if (StrUtil.isBlank(maternityLeave.getId())) maternityLeave.setApplyTime(new Date());
|
||||
dao.insertOrUpdate(maternityLeave);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("提交申请")
|
||||
@SaCheckPermission(value = {"maternityLeave.apply", "h5.maternityLeave.apply"}, mode = SaMode.OR)
|
||||
public Result submit(@Param("data") MaternityLeave maternityLeave) {
|
||||
if (StrUtil.isBlank(maternityLeave.getId())) maternityLeave.setApplyTime(new Date());
|
||||
|
||||
dao.insertOrUpdate(maternityLeave);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, maternityLeave);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("SYXJ", maternityLeave.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(value = {"maternityLeave.apply", "h5.maternityLeave.apply"}, mode = SaMode.OR)
|
||||
public Result submitAgain(@Param("data") MaternityLeave maternityLeave, @Param("taskId") Long taskId) {
|
||||
if (StrUtil.isBlank(maternityLeave.getId())) maternityLeave.setApplyTime(new Date());
|
||||
|
||||
dao.insertOrUpdate(maternityLeave);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result findOne(String id) {
|
||||
return Result.success(baseService.dao().fetch(MaternityLeave.class, id));
|
||||
}
|
||||
}
|
||||
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.zhgh.dayofficework.unionReimburse.vo.UnionReimburseCollectExcelVO;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.vo.MaternityLeaveCollectExcelVO;
|
||||
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.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 javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/16 16:38
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/maternityLeave/collect")
|
||||
@Api("查询统计")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MaternityLeaveCollectController {
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private MaternityLeaveService maternityLeaveService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/collect/index.html")
|
||||
@SaCheckPermission("maternityLeave.collect")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/collect/index.html")
|
||||
@SaCheckPermission("h5.maternityLeave.collect")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"maternityLeave.collect", "h5.maternityLeave.collect"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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,
|
||||
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
|
||||
maternity_leave 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.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
// 只查询流程实例状态为20的数据(已完成状态)
|
||||
cnd.and("ins.state", "=", 20);
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"maternityLeave.collect", "h5.maternityLeave.collect"}, mode = SaMode.OR)
|
||||
@SLog( tag = "删除工会报销", msg = "删除工会报销")
|
||||
public Result delete(@Param("id") String id) {
|
||||
maternityLeaveService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission(value = {"maternityLeave.collect", "h5.maternityLeave.collect"}, mode = SaMode.OR)
|
||||
@ApiOperation("导出生育休假表")
|
||||
public void onExport(@Param(value = "year") Integer year,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "userName") String userName,
|
||||
@Param(value = "sex") String sex,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.state instanceState
|
||||
FROM
|
||||
maternity_leave info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and("info.userName", "like", "%" + userName + "%");
|
||||
}
|
||||
cnd.andEX("year(info.applyTime)", "=", year);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
cnd.and("ins.state", "=", 20);
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
List<MaternityLeaveCollectExcelVO> list = maternityLeaveService.listVO(sql, MaternityLeaveCollectExcelVO.class);
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, MaternityLeaveCollectExcelVO.class, list);
|
||||
CommonDownloadUtil.download("生育休假表.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.vo.ProcessTaskVO;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import com.budwk.app.zhgh.activity.declarereimbursement.vo.ActivityBudgetVO;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.dev33.satoken.SaManager.config;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/15 17:52
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/maternityLeave/mine")
|
||||
@Api("我的休假申请")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MaternityLeaveMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private MaternityLeaveService maternityLeaveService;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/mine/index.html")
|
||||
@SaCheckPermission("maternityLeave.mine")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/mine/index.html")
|
||||
@SaCheckPermission("h5.maternityLeave.mine")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"maternityLeave.mine", "h5.maternityLeave.mine"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm, @Param(value = "year") Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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,
|
||||
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') AS startTaskId
|
||||
FROM
|
||||
maternity_leave 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.desc("info.applyTime");
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"maternityLeave.mine", "h5.maternityLeave.mine"}, mode = SaMode.OR)
|
||||
@SLog( tag = "删除工会报销", msg = "删除工会报销")
|
||||
public Result delete(@Param("id") String id) {
|
||||
maternityLeaveService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("maternityLeave.mine")
|
||||
@SLog(tag = "生育休假审批表", msg = "导出生育休假审批表")
|
||||
public void doExportApply(@Valid String id, HttpServletResponse response) {
|
||||
HashMap<String, Object> docData = new HashMap<>();
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId
|
||||
FROM
|
||||
`maternity_leave` info
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
WHERE
|
||||
info.id = @id
|
||||
""").setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap info = (NutMap) sql.getResult();
|
||||
|
||||
// 根据性别选择不同的模板和文件名
|
||||
String sex = info.getString("sex");
|
||||
String templateName;
|
||||
String fileName;
|
||||
|
||||
if ("女性".equals(sex) || "女".equals(sex)) {
|
||||
templateName = "maternity_leave_woman";
|
||||
fileName = "女职工生育休假审批表_" + info.getString("userName") + ".docx";
|
||||
} else {
|
||||
templateName = "maternity_leave_man";
|
||||
fileName = "男职工陪护假育儿假审批表_" + info.getString("userName") + ".docx";
|
||||
}
|
||||
|
||||
// 添加日期格式化处理
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
// 格式化日期字段
|
||||
if (info.get("birthday") != null) {
|
||||
if (info.get("birthday") instanceof Date) {
|
||||
info.put("birthday", sdf.format((Date) info.get("birthday")));
|
||||
}
|
||||
}
|
||||
|
||||
if (info.get("loverBirthday") != null) {
|
||||
if (info.get("loverBirthday") instanceof Date) {
|
||||
info.put("loverBirthday", sdf.format((Date) info.get("loverBirthday")));
|
||||
}
|
||||
}
|
||||
|
||||
if (info.get("childrenBirthday") != null) {
|
||||
if (info.get("childrenBirthday") instanceof Date) {
|
||||
info.put("childrenBirthday", sdf.format((Date) info.get("childrenBirthday")));
|
||||
}
|
||||
}
|
||||
|
||||
if (info.get("startTime") != null) {
|
||||
if (info.get("startTime") instanceof Date) {
|
||||
info.put("startTime", sdf.format((Date) info.get("startTime")));
|
||||
}
|
||||
}
|
||||
|
||||
if (info.get("endTime") != null) {
|
||||
if (info.get("endTime") instanceof Date) {
|
||||
info.put("endTime", sdf.format((Date) info.get("endTime")));
|
||||
}
|
||||
}
|
||||
|
||||
docData.put("schoolName", Globals.AppName);
|
||||
docData.put("info", info);
|
||||
|
||||
List<ProcessTaskVO> doneTaskVos = new ArrayList<>();
|
||||
List<ProcessTask> doneTaskList = flowEngine.processTaskService().getDoneTaskList(info.getLong("instanceId"), null);
|
||||
for (ProcessTask doneTask : doneTaskList) {
|
||||
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(doneTask.getId());
|
||||
doneTaskVos.add(taskVO);
|
||||
}
|
||||
|
||||
// 各审批节点处理
|
||||
doneTaskVos.stream().filter(task -> "分工会审核".equals(task.getDisplayName()))
|
||||
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||
.ifPresent(v -> {
|
||||
Dict taskFormData = v.getTaskFormData();
|
||||
HashMap<String, Object> approval = new HashMap<>();
|
||||
|
||||
approval.put("date", DateUtil.format(v.getFinishTime(), "yyyy年MM月dd日"));
|
||||
approval.put("user", taskFormData.getStr("tf_userName"));
|
||||
if (StrUtil.isNotBlank(taskFormData.getStr("tf_sign"))) {
|
||||
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_sign")));
|
||||
}
|
||||
approval.put("opinion", taskFormData.getStr("tf_opinion"));
|
||||
docData.put("fgh", approval);
|
||||
});
|
||||
|
||||
doneTaskVos.stream().filter(task -> "校工会审核".equals(task.getDisplayName()))
|
||||
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||
.ifPresent(v -> {
|
||||
Dict taskFormData = v.getTaskFormData();
|
||||
HashMap<String, Object> approval = new HashMap<>();
|
||||
|
||||
approval.put("date", DateUtil.format(v.getFinishTime(), "yyyy年MM月dd日"));
|
||||
approval.put("user", taskFormData.getStr("tf_userName"));
|
||||
if (StrUtil.isNotBlank(taskFormData.getStr("tf_sign"))) {
|
||||
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_sign")));
|
||||
}
|
||||
approval.put("opinion", taskFormData.getStr("tf_opinion"));
|
||||
docData.put("xgh", approval);
|
||||
});
|
||||
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(templateName)).render(docData).writeAndClose(byteArrayOutputStream);
|
||||
CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (IOException e) {
|
||||
log.error("生育休假审批表导出失败,id:{},错误信息:{}", id, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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 : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/15 17:54
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/maternityLeave/schoolAudit")
|
||||
@Api("校工会审核")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MaternityLeaveSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private MaternityLeaveService maternityLeaveService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/schoolAudit/index.html")
|
||||
@SaCheckPermission("maternityLeave.schoolAudit")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/schoolAudit/index.html")
|
||||
@SaCheckPermission("h5.maternityLeave.schoolAudit")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"maternityLeave.schoolAudit", "h5.maternityLeave.schoolAudit"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
boolean approval,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 maternity_leave 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", "=", "abf59f7b-dc50-4d5d-8e61-a442ce3f1e8a");
|
||||
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());
|
||||
}
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(info.applyTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
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 : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/15 17:53
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/maternityLeave/unionAudit")
|
||||
@Api("分工会审核")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MaternityLeaveUnionAuditController {
|
||||
|
||||
@Inject
|
||||
private MaternityLeaveService maternityLeaveService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/unionAudit/index.html")
|
||||
@SaCheckPermission("maternityLeave.unionAudit")
|
||||
public void index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/unionAudit/index.html")
|
||||
@SaCheckPermission("h5.maternityLeave.unionAudit")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"maternityLeave.unionAudit", "h5.maternityLeave.unionAudit"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
boolean approval,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 maternity_leave 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", "=", "c28f910f-b888-4404-a6a8-9350cc501241");
|
||||
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());
|
||||
}
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(info.applyTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
|
||||
+180
@@ -0,0 +1,180 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.maternityLeave.models;
|
||||
|
||||
import com.aspose.slides.internal.og.all;
|
||||
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;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author : hongqiwei
|
||||
* @description :
|
||||
* @createDate : 2025/9/15 16:09
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("maternity_leave")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("生育休假")
|
||||
public class MaternityLeave extends BaseModel implements Serializable {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("userId")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("姓名")
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("性别")
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("民族")
|
||||
private String nation;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("出生年月")
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("工号")
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("所在工会Id")
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("所在工会")
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("所在单位Id")
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("所在单位")
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("电话")
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("爱人姓名")
|
||||
private String loverName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("性别")
|
||||
private String loverSex;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
@Comment("民族")
|
||||
private String loverNation;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("出生年月")
|
||||
private Date loverBirthday;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("所在单位")
|
||||
private String loverUnitName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("陪护假")
|
||||
private String withLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("育儿假")
|
||||
private String parentalLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("产假")
|
||||
private String maternityLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("延长假")
|
||||
private String extendLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("多胞胎")
|
||||
private String birthsLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("难产假")
|
||||
private String difficultLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("寒假")
|
||||
private String winterLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("暑假")
|
||||
private String summerLeave;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
@Comment("假期天数")
|
||||
private String leaveDays;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("子女出生日期")
|
||||
private Date childrenBirthday;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("休假开始时间")
|
||||
private Date startTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATE)
|
||||
@Comment("休假结束时间")
|
||||
private Date endTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("填写时间")
|
||||
private Date applyTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.maternityLeave.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.models.MaternityLeave;
|
||||
|
||||
public interface MaternityLeaveService extends BaseService<MaternityLeave> {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user