..
This commit is contained in:
+68
@@ -0,0 +1,68 @@
|
||||
package com.budwk.app.zhgh.dayofficework.huimin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
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.dayofficework.huimin.models.Huimin;
|
||||
import com.budwk.app.zhgh.dayofficework.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.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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/huimin/manage")
|
||||
@Api(("惠民服务管理"))
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
public class HuiminManageController {
|
||||
|
||||
@Inject
|
||||
private HuiminService huiminService;
|
||||
|
||||
@At("")
|
||||
@SaCheckLogin
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/huimin/manage/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Pagination pagination = huiminService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@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
|
||||
@SaCheckLogin
|
||||
@ApiOperation("删除惠民服务")
|
||||
public Result delete(String id) {
|
||||
huiminService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.zhgh.dayofficework.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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.dayofficework.huimin.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.huimin.models.Huimin;
|
||||
|
||||
public interface HuiminService extends BaseService<Huimin> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.huimin.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.huimin.models.Huimin;
|
||||
import com.budwk.app.zhgh.dayofficework.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);
|
||||
}
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.budwk.app.zhgh.democratic.suggestionBox.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.service.SuggestionBoxService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/suggestionBox2/apply")
|
||||
@Ok("json:full")
|
||||
@Api("意见箱")
|
||||
public class SuggestionApplyController {
|
||||
|
||||
@Inject
|
||||
private SuggestionBoxService suggestionBoxService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/suggestionBox/apply/index.html")
|
||||
@SaCheckLogin
|
||||
public void index(){
|
||||
|
||||
}
|
||||
|
||||
@At("/form")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/suggestionBox/apply/form.html")
|
||||
@SaCheckLogin
|
||||
public void form() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result pageData(Integer pageNumber, Integer pageSize) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.title,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.submitTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariale
|
||||
FROM
|
||||
suggestion_box 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.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||
cnd.desc("info.submitTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = suggestionBoxService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+28
-28
@@ -36,34 +36,34 @@ public class SuggestionBoxController {
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@Ok("beetl:/platform/zhghh5/democratic/suggestionBox/index.html")
|
||||
public void apply() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/suggestionBox/index.html")
|
||||
@SaCheckLogin
|
||||
public void h5Index() {
|
||||
|
||||
}
|
||||
|
||||
@At("/h5/write")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/suggestionBox/write.html")
|
||||
@SaCheckLogin
|
||||
public void h5Write() {
|
||||
|
||||
}
|
||||
|
||||
@At("/h5/mine")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/suggestionBox/mine.html")
|
||||
@SaCheckLogin
|
||||
public void h5Mine() {
|
||||
|
||||
}
|
||||
// @At
|
||||
// @SaCheckLogin
|
||||
// @Ok("beetl:/platform/zhghh5/democratic/suggestionBox/index.html")
|
||||
// public void apply() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @At("/h5")
|
||||
// @Ok("beetl:/platform/zhghh5/democratic/suggestionBox/index.html")
|
||||
// @SaCheckLogin
|
||||
// public void h5Index() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @At("/h5/write")
|
||||
// @Ok("beetl:/platform/zhghh5/democratic/suggestionBox/write.html")
|
||||
// @SaCheckLogin
|
||||
// public void h5Write() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @At("/h5/mine")
|
||||
// @Ok("beetl:/platform/zhghh5/democratic/suggestionBox/mine.html")
|
||||
// @SaCheckLogin
|
||||
// public void h5Mine() {
|
||||
//
|
||||
// }
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.budwk.app.zhgh.democratic.suggestionBox.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Dao;
|
||||
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/suggestionBox/view")
|
||||
@Ok("json:full")
|
||||
@Api("意见箱")
|
||||
public class SuggestionViewController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/suggestionBox/view/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At("/info")
|
||||
@SaCheckLogin
|
||||
public Result info(String id) {
|
||||
SuggestionBox box = dao.fetch(SuggestionBox.class, id);
|
||||
return Result.success(box);
|
||||
}
|
||||
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.budwk.app.zhgh.democratic.suggestionBox.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
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.democratic.suggestionBox.service.SuggestionBoxService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/suggestionBox2/xgh")
|
||||
@Ok("json:full")
|
||||
@Api("意见箱")
|
||||
public class SuggestionXghController {
|
||||
|
||||
@Inject
|
||||
private SuggestionBoxService suggestionBoxService;
|
||||
|
||||
@At("/index")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/suggestionBox/xgh/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At("/form")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/suggestionBox/xgh/form.html")
|
||||
@SaCheckLogin
|
||||
public void form() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result pageData(PageForm pageForm, String title, Integer year, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.title,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.submitTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariale
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN suggestion_box info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "c6331519-031c-4ec5-92b0-bc7d9647bff4");
|
||||
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.desc("t.createdAt");
|
||||
|
||||
cnd.andEX("YEAR(info.submitTime)", "=", year);
|
||||
cnd.and(Cnd.likeEX("info.title", title));
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.submitTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = suggestionBoxService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+2
-3
@@ -11,18 +11,17 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
public class SuggestionBoxInterceptor implements FlowInterceptor {
|
||||
public class SuggestionBoxApplyInterceptor implements FlowInterceptor {
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
System.out.println("..................");
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
SuggestionBox suggestionBox = Json.fromJson(SuggestionBox.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
dao.insertOrUpdate(suggestionBox);
|
||||
execution.getArgs().set(FlowConst.FORM_DATA, Json.toJson(suggestionBox));
|
||||
|
||||
int instanceId = execution.getArgs().getInt(FlowConst.PROCESS_INSTANCE_ID_KEY);
|
||||
dao.update(ProcessInstance.class, Chain.make("businessNo", suggestionBox.getId()), Cnd.where(ProcessInstance::getId, "=", instanceId));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,37 +26,37 @@ public class SuggestionBox extends BaseModel {
|
||||
@Column
|
||||
@Comment("提交人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String submitterId;
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("提交人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String submitterName;
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("提交人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String submitterLoginName;
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("提交人单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String submitterUnitId;
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("提交人单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String submitterUnitName;
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("提交人分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String submitterUnionId;
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("提交人分工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String submitterUnionName;
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("提交时间")
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.democratic.suggestionBox.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
|
||||
public interface SuggestionBoxService extends BaseService<SuggestionBox> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.democratic.suggestionBox.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.service.SuggestionBoxService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SuggestionBoxServiceImpl extends BaseServiceImpl<SuggestionBox> implements SuggestionBoxService {
|
||||
public SuggestionBoxServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user