申诉管理模块: 页面优化;
This commit is contained in:
+39
@@ -30,6 +30,45 @@ public class AppealCommonController {
|
||||
return Result.success(appealTypeService.query(Cnd.where("enabled", "=", true).asc("sort").desc("createdAt")));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result queryTypeOptions() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
type_data.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
atype.id,
|
||||
atype.`name`,
|
||||
atype.enabled,
|
||||
atype.sort
|
||||
FROM
|
||||
appeal_type atype
|
||||
WHERE
|
||||
atype.enabled = 1
|
||||
UNION
|
||||
SELECT
|
||||
info.appealTypeId AS id,
|
||||
COALESCE(MAX(atype.`name`), MAX(info.appealTypeName)) AS `name`,
|
||||
COALESCE(MAX(atype.enabled), 0) AS enabled,
|
||||
COALESCE(MAX(atype.sort), 999999) AS sort
|
||||
FROM
|
||||
appeal_info info
|
||||
LEFT JOIN appeal_type atype ON atype.id = info.appealTypeId
|
||||
WHERE
|
||||
info.appealTypeId IS NOT NULL
|
||||
AND info.appealTypeId != ''
|
||||
GROUP BY
|
||||
info.appealTypeId
|
||||
) type_data
|
||||
ORDER BY
|
||||
type_data.sort ASC,
|
||||
type_data.`name` ASC
|
||||
""");
|
||||
return Result.success(appealTypeService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result unitOptions(String unionId) {
|
||||
|
||||
-16
@@ -4,21 +4,17 @@ 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.flow.engine.FlowEngine;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealInfoService;
|
||||
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.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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/appeal/query")
|
||||
@@ -26,8 +22,6 @@ import org.nutz.mvc.annotation.Param;
|
||||
@Api("申诉管理-查询统计")
|
||||
public class AppealQueryController {
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private AppealInfoService appealInfoService;
|
||||
|
||||
@@ -80,16 +74,6 @@ public class AppealQueryController {
|
||||
return Result.success(data);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.query")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("删除申诉")
|
||||
public Result delete(@Param("id") String id) {
|
||||
appealInfoService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
private Cnd buildCondition(String searchKeyword, String appealTypeId, String state, String unitId,
|
||||
String defendantUnitId, Integer year) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
+15
@@ -6,10 +6,12 @@ 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.democratic.appeal.models.AppealInfo;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealType;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -59,11 +61,24 @@ public class AppealTypeController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.type")
|
||||
@ApiOperation("修改申诉类型启用状态")
|
||||
@SLog(tag = "申诉管理-类型维护", msg = "修改申诉类型启用状态")
|
||||
public Result statusChange(String id, Boolean enabled) {
|
||||
appealTypeService.update(Chain.make("enabled", enabled), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.type")
|
||||
@ApiOperation("删除申诉类型")
|
||||
@SLog(tag = "申诉管理-类型维护", msg = "删除申诉类型")
|
||||
public Result delete(@Param("id") String id) {
|
||||
int count = appealTypeService.dao().count(AppealInfo.class, Cnd.where("appealTypeId", "=", id));
|
||||
if (count > 0) {
|
||||
return Result.error("该类型有关联的申诉,无法删除!");
|
||||
}
|
||||
appealTypeService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user