管道基础大数据平台系统开发-【后端】-Server
13693261870
2022-12-24 ed3cbd55e3e55ca8ce1bd5c3da22831ba6198002
15:24
已修改3个文件
118 ■■■■■ 文件已修改
data/db_tab.sql 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/ts.sql 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/ApplyController.java 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_tab.sql
@@ -1061,7 +1061,7 @@
comment on column lf.sys_apply.entities is '实体名';
comment on column lf.sys_apply.wkt is 'WKT';
comment on column lf.sys_apply.pwd is '密码';
comment on column lf.sys_apply.status is '状态:-10-作废,-1-打回,0-申请中,1~9,审核中,10-通过';
comment on column lf.sys_apply.status is '状态:-10-作废,-1-打回,0-待审核,1~9,审核中,10-通过';
comment on column lf.sys_apply.count is '审核总数';
comment on column lf.sys_apply.descr is '描述';
comment on column lf.sys_apply.create_user is '创建人id';
@@ -1089,7 +1089,7 @@
comment on column lf.sys_flow.applyid is '申请ID';
comment on column lf.sys_flow.depid is '单位ID';
comment on column lf.sys_flow.userid is '用户ID';
comment on column lf.sys_flow.status is '状态:-1-打回,0-申请中,1-通过';
comment on column lf.sys_flow.status is '状态:-1-打回,0-待审核,1-通过';
comment on column lf.sys_flow.descr is '描述';
comment on column lf.sys_flow.create_user is '创建人id';
comment on column lf.sys_flow.create_time is '创建时间';
data/ts.sql
@@ -67,9 +67,6 @@
insert into lf.sys_role_user (id, roleid, userid, create_user) values (4, 14, 5, 1);
insert into lf.sys_role_user (id, roleid, userid, create_user) values (5, 15, 4, 1);
-----------------------------------------------------------------------
select * from lf.sys_dep;
select fn_rec_array(38, 'dep');
select depid from bd.dlg_25w_boul where depid > 0 and depid != ALL(fn_rec_array(38, 'dep'))
and ST_Intersects(geom, ST_PolygonFromText('POLYGON ((115.94927385452 32.3754479115071 0,121.989371092554 32.2766788010181 0,121.850621222894 29.6874200067864 0,115.9727267226 29.7835368627922 0,115.94927385452 32.3754479115071 0))', 4490))
group by depid;
@@ -80,9 +77,29 @@
select c.* from lf.sys_role a inner join lf.sys_role_user b on a.id = b.roleid inner join lf.sys_user c on b.userid = c.id
where a.is_admin = 2 and a.depid = 55 order by c.id limit 1
select * from lf.sys_role; -- 12>20 13>21 14>55 15>22
select * from lf.sys_role_user;
select * from lf.sys_user order by id;
select * from lf.sys_apply;
select * from lf.sys_flow;
src/main/java/com/lf/server/controller/show/ApplyController.java
@@ -19,6 +19,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.sql.Timestamp;
import java.util.List;
/**
@@ -74,25 +75,28 @@
    }
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiOperation(value = "分页查询申请")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userid", value = "用户ID", dataType = "Integer", paramType = "query", example = ""),
            @ApiImplicitParam(name = "uname", value = "用户名", dataType = "String", paramType = "query", example = "员"),
            @ApiImplicitParam(name = "type", value = "类型", dataType = "Integer", paramType = "query", example = "3"),
            @ApiImplicitParam(name = "start", value = "开始时间", dataType = "Timestamp", paramType = "query", example = "2022-12-09 09:00:00"),
            @ApiImplicitParam(name = "end", value = "结束时间", dataType = "Timestamp", paramType = "query", example = "2022-12-25 17:00:00"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<List<ApplyEntity>> selectByPageAndCount(Integer userid, Integer pageSize, Integer pageIndex) {
    @GetMapping(value = "/selectByPage")
    public ResponseMsg<Object> selectByPage(String uname, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            int count = applyService.selectCount(userid);
            int count = applyService.selectCount(0);
            if (count == 0) {
                return success(0, null);
            }
            List<ApplyEntity> rs = applyService.selectByPage(userid, pageSize, pageSize * (pageIndex - 1));
            List<ApplyEntity> rs = applyService.selectByPage(0, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {
@@ -101,65 +105,62 @@
    }
    @SysLog()
    @ApiOperation(value = "插入一条")
    @ApiOperation(value = "查询流程")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "ApplyEntity", paramType = "body")
            @ApiImplicitParam(name = "applyId", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insert(@RequestBody ApplyEntity entity, HttpServletRequest req) {
    @GetMapping(value = "/selectFlows")
    public ResponseMsg<Object> selectFlows(Integer applyId) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                entity.setCreateUser(ue.getId());
            }
            //
            int count = applyService.insert(entity);
            return success(count);
            return success(null);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "删除多条")
    @ApiOperation(value = "废弃申请")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "1,2")
            @ApiImplicitParam(name = "applyId", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/deletes")
    public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) {
    @GetMapping(value = "/deleteForDiscard")
    public ResponseMsg<Object> deleteForDiscard(Integer applyId) {
        try {
            if (ids == null || ids.isEmpty()) {
                return fail("id数组不能为空", -1);
            }
            //
            int count = applyService.deletes(ids);
            return success(count);
            return success(null);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "更新一条")
    @ApiOperation(value = "提交流程")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "ApplyEntity", paramType = "body")
            @ApiImplicitParam(name = "flowId", value = "申请流程ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @ResponseBody
    @PostMapping(value = "/update", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> update(@RequestBody ApplyEntity entity, HttpServletRequest req) {
    public ResponseMsg<Object> updateForSubmit(Integer flowId) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                entity.setUpdateUser(ue.getId());
            }
            int count = applyService.update(entity);
            return success(count);
            return success(null);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "打回流程")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "flowId", value = "申请流程ID", dataType = "Integer", paramType = "query", example = "1")
    })
    public ResponseMsg<Object> updateForReject(Integer flowId) {
        try {
            return success(null);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
}