管道基础大数据平台系统开发-【后端】-Server
13693261870
2022-12-25 035d6d22f53b0d5e84262df7c88da9d58b119e8b
12.25.1
已修改7个文件
106 ■■■■ 文件已修改
data/db_tab.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/ts.sql 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/ApplyController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/show/FlowEntity.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/show/ApplyMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/ApplyService.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/show/ApplyMapper.xml 19 ●●●● 补丁 | 查看 | 原始文档 | 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~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';
data/ts.sql
@@ -80,13 +80,14 @@
select * from lf.sys_apply;
select * from lf.sys_flow;
select a.*, b.uname, (select count(*) from lf.sys_flow c where c.applyid = a.id and c.status = 0 and c.userid = 2) isVerify
from lf.sys_apply a inner join lf.sys_user b on a.userid = b.id
where 1 = 1 and b.uname like '%员%' and a.status between 1 and 9
select * from lf.sys_apply a inner join lf.sys_flow b on a.id = b.applyid
where a.status between 0 and 9 and b.status = 0 and b.userid = 2
select a.*, b.uname, fn_rec_query(a.depid, 'dep') depName from lf.sys_flow a inner join lf.sys_user b on a.userid = b.id
src/main/java/com/lf/server/controller/show/ApplyController.java
@@ -5,6 +5,7 @@
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.ctrl.DownloadReqEntity;
import com.lf.server.entity.show.ApplyEntity;
import com.lf.server.entity.show.FlowEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.AesHelper;
import com.lf.server.helper.StringHelper;
@@ -106,6 +107,20 @@
    }
    @SysLog()
    @ApiOperation(value = "查询待审核数")
    @GetMapping(value = "/selectSubmits")
    public ResponseMsg<Object> selectSubmits(HttpServletRequest req) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            int rows = applyService.selectSubmits(ue.getId());
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询流程")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "applyId", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
@@ -113,9 +128,9 @@
    @GetMapping(value = "/selectFlows")
    public ResponseMsg<Object> selectFlows(Integer applyId) {
        try {
            //
            List<FlowEntity> rs = applyService.selectFlows(applyId);
            return success(null);
            return success(rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
src/main/java/com/lf/server/entity/show/FlowEntity.java
@@ -30,6 +30,10 @@
    private Timestamp updateTime;
    private String uname;
    private String depName;
    public FlowEntity() {
    }
@@ -112,4 +116,20 @@
    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }
    public String getUname() {
        return uname;
    }
    public void setUname(String uname) {
        this.uname = uname;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
}
src/main/java/com/lf/server/mapper/show/ApplyMapper.java
@@ -1,6 +1,7 @@
package com.lf.server.mapper.show;
import com.lf.server.entity.show.ApplyEntity;
import com.lf.server.entity.show.FlowEntity;
import com.lf.server.entity.sys.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@@ -64,6 +65,22 @@
    public UserEntity selectUserByDepid(Integer depid);
    /**
     * 查询待审核数
     *
     * @param userid 用户ID
     * @return 待审核数
     */
    public Integer selectSubmits(Integer userid);
    /**
     * 查询流程
     *
     * @param applyid 数据申请ID
     * @return 数据流程
     */
    public List<FlowEntity> selectFlows(Integer applyid);
    /**
     * 插入一条
     *
     * @param entity
src/main/java/com/lf/server/service/show/ApplyService.java
@@ -28,12 +28,16 @@
    @Override
    public Integer selectCount(String uname, Integer status, Timestamp start, Timestamp end) {
        return null;
        uname = StringHelper.getLikeStr(uname);
        return applyMapper.selectCount(uname, status, start, end);
    }
    @Override
    public List<ApplyEntity> selectByPage(Integer userid, String uname, Integer status, Timestamp start, Timestamp end, Integer limit, Integer offset) {
        return null;
        uname = StringHelper.getLikeStr(uname);
        return applyMapper.selectByPage(userid, uname, status, start, end, limit, offset);
    }
    @Override
@@ -52,6 +56,16 @@
    }
    @Override
    public Integer selectSubmits(Integer userid) {
        return applyMapper.selectSubmits(userid);
    }
    @Override
    public List<FlowEntity> selectFlows(Integer applyid) {
        return applyMapper.selectFlows(applyid);
    }
    @Override
    public Integer insert(ApplyEntity entity) {
        return applyMapper.insert(entity);
    }
src/main/resources/mapper/show/ApplyMapper.xml
@@ -9,8 +9,8 @@
                and b.uname like #{uname}
            </if>
            <choose>
                <when test="status == 1">
                    and a.status between 1 and 9
                <when test="status == 0">
                    and a.status between 0 and 9
                </when>
                <otherwise>
                    and a.status = #{status}
@@ -34,8 +34,8 @@
                and b.uname like #{uname}
            </if>
            <choose>
                <when test="status == 1">
                    and a.status between 1 and 9
                <when test="status == 0">
                    and a.status between 0 and 9
                </when>
                <otherwise>
                    and a.status = #{status}
@@ -66,6 +66,17 @@
        where a.is_admin = 2 and a.depid = #{depid}
        order by c.id limit 1
    </select>
    <select id="selectSubmits">
        select count(*) from lf.sys_apply a inner join lf.sys_flow b on a.id = b.applyid
        where a.status between 0 and 9 and b.status = 0 and b.userid = #{userid}
    </select>
    <select id="selectFlows" resultType="com.lf.server.entity.show.FlowEntity">
        select a.*, b.uname, fn_rec_query(a.depid, 'dep') depName
        from lf.sys_flow a inner join lf.sys_user b on a.userid = b.id
        where applyid = #{applyid}
    </select>
    <insert id="insert" parameterType="com.lf.server.entity.show.ApplyEntity">
        <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">