生育休假、独生子女父母退休移动端
This commit is contained in:
+56
@@ -6,6 +6,7 @@ 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;
|
||||
@@ -16,18 +17,24 @@ 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;
|
||||
|
||||
@@ -49,6 +56,8 @@ public class DsznfmtxApplyController {
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private DsznfmtxService dsznfmtxService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@@ -111,6 +120,53 @@ public class DsznfmtxApplyController {
|
||||
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) {
|
||||
|
||||
@@ -146,5 +146,6 @@ public class Dsznfmtx extends BaseModel implements Serializable {
|
||||
@Comment("办证机关")
|
||||
private String office;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ public class MaternityLeaveCollectController {
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"maternityLeave.mine", "h5.maternityLeave.mine"}, mode = SaMode.OR)
|
||||
@SaCheckPermission(value = {"maternityLeave.collect", "h5.maternityLeave.collect"}, mode = SaMode.OR)
|
||||
@SLog( tag = "删除工会报销", msg = "删除工会报销")
|
||||
public Result delete(@Param("id") String id) {
|
||||
maternityLeaveService.delete(id);
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class MaternityLeaveSchoolAuditController {
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"maternityLeave.unionAudit", "h5.maternityLeave.unionAudit"}, mode = SaMode.OR)
|
||||
@SaCheckPermission(value = {"maternityLeave.schoolAudit", "h5.maternityLeave.schoolAudit"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
boolean approval,
|
||||
Integer year,
|
||||
|
||||
Reference in New Issue
Block a user