commit
This commit is contained in:
+81
@@ -0,0 +1,81 @@
|
|||||||
|
package io.v.nutz.zhgh.activityBudget.conteoller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import io.v.nutz.base.annontation.ViReturn;
|
||||||
|
import io.v.nutz.base.query.PageForm;
|
||||||
|
import io.v.nutz.base.service.BaseService;
|
||||||
|
import io.v.nutz.zhgh.activityBudget.models.ActivityBudgetType;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.Sqls;
|
||||||
|
import org.nutz.dao.sql.Sql;
|
||||||
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.mvc.annotation.At;
|
||||||
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ActivityBudgetTypeController
|
||||||
|
* @Description 预算类型
|
||||||
|
* @Author zhf
|
||||||
|
* @Date 2024/12/3 14:59
|
||||||
|
*/
|
||||||
|
@IocBean
|
||||||
|
@Ok("json:full")
|
||||||
|
@At("/platform/activity/budget/type")
|
||||||
|
public class ActivityBudgetTypeController {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private BaseService baseService;
|
||||||
|
|
||||||
|
@At("")
|
||||||
|
@Ok("beetl:platform/activityBudget/type.html")
|
||||||
|
@RequiresPermissions("activity.budget.type")
|
||||||
|
public void index() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("activity.budget.type")
|
||||||
|
public Object pageData(PageForm pageForm, Integer year) {
|
||||||
|
|
||||||
|
Sql sql = Sqls.create("select * from activity_budget_type $condition");
|
||||||
|
sql.setCondition(Cnd.NEW().andEX("year", "=", year).asc("location"));
|
||||||
|
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object queryType(Integer year) {
|
||||||
|
|
||||||
|
Sql sql = Sqls.create("select id,budgetTypeName,year,location from activity_budget_type $condition");
|
||||||
|
sql.setCondition(Cnd.NEW().andEX("year", "=", year).asc("location"));
|
||||||
|
return baseService.listMap(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("activity.budget.type")
|
||||||
|
public Object doAdd(ActivityBudgetType activityBudgetType) {
|
||||||
|
activityBudgetType.setYear(DateUtil.thisYear());
|
||||||
|
baseService.insert(activityBudgetType);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("activity.budget.type")
|
||||||
|
public Object doEdit(ActivityBudgetType activityBudgetType) {
|
||||||
|
baseService.updateIgnoreNull(activityBudgetType);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("activity.budget.type")
|
||||||
|
public Object doDelete(String id) {
|
||||||
|
baseService.dao().delete(ActivityBudgetType.class, id);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user