浏览代码

代码提交

cxd 6 月之前
父节点
当前提交
d058901113

+ 19 - 1
gqy-common/src/main/java/com/gqy/common/constant/Constants.java

@@ -5,7 +5,7 @@ import io.jsonwebtoken.Claims;
 
 /**
  * 通用常量信息
- * 
+ *
  * @author raycos
  */
 public class Constants
@@ -170,4 +170,22 @@ public class Constants
      */
     public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
             "org.springframework", "org.apache", "com.gqy.common.utils.file", "com.gqy.common.config", "com.gqy.generator" };
+
+
+    /**
+     * 5,使用中
+      */
+    public static int status_5=5;
+
+    /**
+     *   6,已停用
+     */
+    public static int status_6=6;
+
+    /**
+     * 4,已删除
+     */
+    public static int status_4=4;
+
+
 }

+ 55 - 55
gqy-system/src/main/java/com/gqy/document/domain/DcbBlock.java

@@ -8,123 +8,123 @@ package com.gqy.document.domain;
 public class DcbBlock {
 
     /** 主键ID */
-    private Long dcbId;
+    private Long dcb_id;
 
     /** 数据块名称 */
-    private String dcbName;
+    private String dcb_name;
 
     /** 布局ID,用于页面布局定位 */
-    private String dcbLayId;
+    private String dcb_lay_id;
 
     /** 数据块类型,用于区分不同用途的数据块 */
-    private String dcbType;
+    private String dcb_type;
 
     /** 数据块内容,存储具体的数据内容 */
-    private String dcbNr;
+    private String dcb_nr;
 
     /** 共享标志(0:私有 1:共享) */
-    private Integer dcbShare;
+    private Integer dcb_share;
 
     /** 数据块属性,JSON格式存储额外配置 */
-    private String dcbAttrs;
+    private String dcb_attrs;
 
     /** 所有者ID,关联用户表 */
-    private Integer dcbOwner;
+    private Integer dcb_owner;
 
     /** 数据块编号,用于业务识别 */
-    private String dcbNo;
+    private String dcb_no;
 
     /** 状态(0:禁用 1:正常) */
-    private Integer dcbStatus;
+    private Integer dcb_status;
 
     /** 关联业务ID */
-    private Integer dcbReId;
+    private Integer dcb_re_id;
 
-    public Long getDcbId() {
-        return dcbId;
+    public Long getDcb_id() {
+        return dcb_id;
     }
 
-    public void setDcbId(Long dcbId) {
-        this.dcbId = dcbId;
+    public void setDcb_id(Long dcb_id) {
+        this.dcb_id = dcb_id;
     }
 
-    public String getDcbName() {
-        return dcbName;
+    public String getDcb_name() {
+        return dcb_name;
     }
 
-    public void setDcbName(String dcbName) {
-        this.dcbName = dcbName;
+    public void setDcb_name(String dcb_name) {
+        this.dcb_name = dcb_name;
     }
 
-    public String getDcbLayId() {
-        return dcbLayId;
+    public String getDcb_lay_id() {
+        return dcb_lay_id;
     }
 
-    public void setDcbLayId(String dcbLayId) {
-        this.dcbLayId = dcbLayId;
+    public void setDcb_lay_id(String dcb_lay_id) {
+        this.dcb_lay_id = dcb_lay_id;
     }
 
-    public String getDcbType() {
-        return dcbType;
+    public String getDcb_type() {
+        return dcb_type;
     }
 
-    public void setDcbType(String dcbType) {
-        this.dcbType = dcbType;
+    public void setDcb_type(String dcb_type) {
+        this.dcb_type = dcb_type;
     }
 
-    public String getDcbNr() {
-        return dcbNr;
+    public String getDcb_nr() {
+        return dcb_nr;
     }
 
-    public void setDcbNr(String dcbNr) {
-        this.dcbNr = dcbNr;
+    public void setDcb_nr(String dcb_nr) {
+        this.dcb_nr = dcb_nr;
     }
 
-    public Integer getDcbShare() {
-        return dcbShare;
+    public Integer getDcb_share() {
+        return dcb_share;
     }
 
-    public void setDcbShare(Integer dcbShare) {
-        this.dcbShare = dcbShare;
+    public void setDcb_share(Integer dcb_share) {
+        this.dcb_share = dcb_share;
     }
 
-    public String getDcbAttrs() {
-        return dcbAttrs;
+    public String getDcb_attrs() {
+        return dcb_attrs;
     }
 
-    public void setDcbAttrs(String dcbAttrs) {
-        this.dcbAttrs = dcbAttrs;
+    public void setDcb_attrs(String dcb_attrs) {
+        this.dcb_attrs = dcb_attrs;
     }
 
-    public Integer getDcbOwner() {
-        return dcbOwner;
+    public Integer getDcb_owner() {
+        return dcb_owner;
     }
 
-    public void setDcbOwner(Integer dcbOwner) {
-        this.dcbOwner = dcbOwner;
+    public void setDcb_owner(Integer dcb_owner) {
+        this.dcb_owner = dcb_owner;
     }
 
-    public String getDcbNo() {
-        return dcbNo;
+    public String getDcb_no() {
+        return dcb_no;
     }
 
-    public void setDcbNo(String dcbNo) {
-        this.dcbNo = dcbNo;
+    public void setDcb_no(String dcb_no) {
+        this.dcb_no = dcb_no;
     }
 
-    public Integer getDcbStatus() {
-        return dcbStatus;
+    public Integer getDcb_status() {
+        return dcb_status;
     }
 
-    public void setDcbStatus(Integer dcbStatus) {
-        this.dcbStatus = dcbStatus;
+    public void setDcb_status(Integer dcb_status) {
+        this.dcb_status = dcb_status;
     }
 
-    public Integer getDcbReId() {
-        return dcbReId;
+    public Integer getDcb_re_id() {
+        return dcb_re_id;
     }
 
-    public void setDcbReId(Integer dcbReId) {
-        this.dcbReId = dcbReId;
+    public void setDcb_re_id(Integer dcb_re_id) {
+        this.dcb_re_id = dcb_re_id;
     }
 }

+ 6 - 0
gqy-system/src/main/java/com/gqy/document/service/IDcbBlockService.java

@@ -71,4 +71,10 @@ public interface IDcbBlockService {
      */
     int deleteDcbBlockByIds(Long[] dcbIds);
 
+
+    /**
+     * 根据文档ID删除数据块
+     */
+    public int deleteDcbBlockByDocId(Long docId);
+
 }

+ 26 - 1
gqy-system/src/main/java/com/gqy/document/service/impl/DcbBlockServiceImpl.java

@@ -3,6 +3,7 @@ package com.gqy.document.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.gqy.common.constant.Constants;
 import com.gqy.document.domain.DcbBlock;
 import com.gqy.document.domain.vo.PageResult;
 import com.gqy.document.mapper.DcbBlockMapper;
@@ -77,6 +78,7 @@ public class DcbBlockServiceImpl implements IDcbBlockService {
      */
     @Override
     public int insertDcbBlock(DcbBlock dcbBlock) {
+        dcbBlock.setDcb_status(Constants.status_5);
         return dcbBlockMapper.insertDcbBlock(dcbBlock);
     }
 
@@ -102,15 +104,38 @@ public class DcbBlockServiceImpl implements IDcbBlockService {
         return dcbBlockMapper.deleteDcbBlockById(dcbId);
     }
 
+
+
     /**
      * 批量删除数据块
      *
      * @param dcbIds 需要删除的数据ID数组
      * @return 结果
      */
-    @Override
+
     public int deleteDcbBlockByIds(Long[] dcbIds) {
         return dcbBlockMapper.deleteDcbBlockByIds(dcbIds);
     }
 
+    /**
+     * 5,使用中
+     * 6,已停用
+     * 4,已删除
+     *
+     * 删除块信息
+     * @param docId
+     * @return
+     */
+    public int deleteDcbBlockByDocId(Long docId){
+//        dcbBlock.setDcb_status();
+        try{
+            DcbBlock dcbBlock = selectDcbBlockById(docId);
+            dcbBlock.setDcb_status(Constants.status_4);
+            updateDcbBlock(dcbBlock);
+        }catch (Exception e){
+            return 0;
+        }
+        return 1;
+    }
+
 }

+ 65 - 73
gqy-system/src/main/resources/mapper/document/DcbBlockMapper.xml

@@ -6,17 +6,17 @@
 
     <!-- 数据块表结果映射 -->
     <resultMap type="DcbBlock" id="DcbBlockResult">
-        <id     property="dcbId"       column="dcb_id"        />
-        <result property="dcbName"     column="dcb_name"      />
-        <result property="dcbLayId"    column="dcb_lay_id"    />
-        <result property="dcbType"     column="dcb_type"      />
-        <result property="dcbNr"       column="dcb_nr"        />
-        <result property="dcbShare"    column="dcb_share"     />
-        <result property="dcbAttrs"    column="dcb_attrs"     />
-        <result property="dcbOwner"    column="dcb_owner"     />
-        <result property="dcbNo"       column="dcb_no"        />
-        <result property="dcbStatus"   column="dcb_status"    />
-        <result property="dcbReId"     column="dcb_re_id"     />
+        <id     property="dcb_id"       column="dcb_id"        />
+        <result property="dcb_name"     column="dcb_name"      />
+        <result property="dcb_lay_id"   column="dcb_lay_id"    />
+        <result property="dcb_type"     column="dcb_type"      />
+        <result property="dcb_nr"       column="dcb_nr"        />
+        <result property="dcb_share"    column="dcb_share"     />
+        <result property="dcb_attrs"    column="dcb_attrs"     />
+        <result property="dcb_owner"    column="dcb_owner"     />
+        <result property="dcb_no"       column="dcb_no"        />
+        <result property="dcb_status"   column="dcb_status"    />
+        <result property="dcb_re_id"    column="dcb_re_id"     />
     </resultMap>
 
     <!-- 数据块表字段 -->
@@ -30,75 +30,67 @@
     <select id="selectDcbBlockList" parameterType="DcbBlock" resultMap="DcbBlockResult">
         <include refid="selectDcbBlockVo"/>
         <where>
-            <!-- 根据名称模糊查询 -->
-            <if test="dcbName != null and dcbName != ''">
-                AND dcb_name like concat('%', #{dcbName}, '%')
+            <if test="dcb_name != null and dcb_name != ''">
+                AND dcb_name like concat('%', #{dcb_name}, '%')
             </if>
-            <!-- 根据布局ID精确查询 -->
-            <if test="dcbLayId != null and dcbLayId != ''">
-                AND dcb_lay_id = #{dcbLayId}
+            <if test="dcb_lay_id != null and dcb_lay_id != ''">
+                AND dcb_lay_id = #{dcb_lay_id}
             </if>
-            <!-- 根据类型精确查询 -->
-            <if test="dcbType != null and dcbType != ''">
-                AND dcb_type = #{dcbType}
+            <if test="dcb_type != null and dcb_type != ''">
+                AND dcb_type = #{dcb_type}
             </if>
-            <!-- 根据共享标志查询 -->
-            <if test="dcbShare != null">
-                AND dcb_share = #{dcbShare}
+            <if test="dcb_share != null">
+                AND dcb_share = #{dcb_share}
             </if>
-            <!-- 根据所有者查询 -->
-            <if test="dcbOwner != null">
-                AND dcb_owner = #{dcbOwner}
+            <if test="dcb_owner != null">
+                AND dcb_owner = #{dcb_owner}
             </if>
-            <!-- 根据编号精确查询 -->
-            <if test="dcbNo != null and dcbNo != ''">
-                AND dcb_no = #{dcbNo}
+            <if test="dcb_no != null and dcb_no != ''">
+                AND dcb_no = #{dcb_no}
             </if>
-            <!-- 根据状态查询 -->
-            <if test="dcbStatus != null">
-                AND dcb_status = #{dcbStatus}
+            <if test="dcb_status != null">
+                AND dcb_status = #{dcb_status}
             </if>
-            <!-- 根据关联ID查询 -->
-            <if test="dcbReId != null">
-                AND dcb_re_id = #{dcbReId}
+            <if test="dcb_re_id != null">
+                AND dcb_re_id = #{dcb_re_id}
             </if>
         </where>
+        and dcb_status in (5,6)
+        order by dcb_id desc
     </select>
 
     <!-- 查询单个数据块 -->
     <select id="selectDcbBlockById" parameterType="Long" resultMap="DcbBlockResult">
         <include refid="selectDcbBlockVo"/>
-        where dcb_id = #{dcbId}
+        where dcb_id = #{dcb_id}
     </select>
 
     <!-- 新增数据块 -->
-    <insert id="insertDcbBlock" parameterType="DcbBlock">
+    <insert id="insertDcbBlock" parameterType="DcbBlock" useGeneratedKeys="true" keyProperty="dcb_id">
         insert into dcb_block
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="dcbId != null">dcb_id,</if>
-            <if test="dcbName != null">dcb_name,</if>
-            <if test="dcbLayId != null">dcb_lay_id,</if>
-            <if test="dcbType != null">dcb_type,</if>
-            <if test="dcbNr != null">dcb_nr,</if>
-            <if test="dcbShare != null">dcb_share,</if>
-            <if test="dcbAttrs != null">dcb_attrs,</if>
-            <if test="dcbOwner != null">dcb_owner,</if>
-            <if test="dcbNo != null">dcb_no,</if>
-            <if test="dcbStatus != null">dcb_status,</if>
-            <if test="dcbReId != null">dcb_re_id,</if>
+            <if test="dcb_name != null">dcb_name,</if>
+            <if test="dcb_lay_id != null">dcb_lay_id,</if>
+            <if test="dcb_type != null">dcb_type,</if>
+            <if test="dcb_nr != null">dcb_nr,</if>
+            <if test="dcb_share != null">dcb_share,</if>
+            <if test="dcb_attrs != null">dcb_attrs,</if>
+            <if test="dcb_owner != null">dcb_owner,</if>
+            <if test="dcb_no != null">dcb_no,</if>
+            <if test="dcb_status != null">dcb_status,</if>
+            <if test="dcb_re_id != null">dcb_re_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="dcbId != null">#{dcbId},</if>
-            <if test="dcbName != null">#{dcbName},</if>
-            <if test="dcbLayId != null">#{dcbLayId},</if>
-            <if test="dcbType != null">#{dcbType},</if>
-            <if test="dcbNr != null">#{dcbNr},</if>
-            <if test="dcbShare != null">#{dcbShare},</if>
-            <if test="dcbAttrs != null">#{dcbAttrs},</if>
-            <if test="dcbOwner != null">#{dcbOwner},</if>
-            <if test="dcbNo != null">#{dcbNo},</if>
-            <if test="dcbStatus != null">#{dcbStatus},</if>
-            <if test="dcbReId != null">#{dcbReId},</if>
+            <if test="dcb_name != null">#{dcb_name},</if>
+            <if test="dcb_lay_id != null">#{dcb_lay_id},</if>
+            <if test="dcb_type != null">#{dcb_type},</if>
+            <if test="dcb_nr != null">#{dcb_nr},</if>
+            <if test="dcb_share != null">#{dcb_share},</if>
+            <if test="dcb_attrs != null">#{dcb_attrs},</if>
+            <if test="dcb_owner != null">#{dcb_owner},</if>
+            <if test="dcb_no != null">#{dcb_no},</if>
+            <if test="dcb_status != null">#{dcb_status},</if>
+            <if test="dcb_re_id != null">#{dcb_re_id},</if>
         </trim>
     </insert>
 
@@ -106,30 +98,30 @@
     <update id="updateDcbBlock" parameterType="DcbBlock">
         update dcb_block
         <trim prefix="SET" suffixOverrides=",">
-            <if test="dcbName != null">dcb_name = #{dcbName},</if>
-            <if test="dcbLayId != null">dcb_lay_id = #{dcbLayId},</if>
-            <if test="dcbType != null">dcb_type = #{dcbType},</if>
-            <if test="dcbNr != null">dcb_nr = #{dcbNr},</if>
-            <if test="dcbShare != null">dcb_share = #{dcbShare},</if>
-            <if test="dcbAttrs != null">dcb_attrs = #{dcbAttrs},</if>
-            <if test="dcbOwner != null">dcb_owner = #{dcbOwner},</if>
-            <if test="dcbNo != null">dcb_no = #{dcbNo},</if>
-            <if test="dcbStatus != null">dcb_status = #{dcbStatus},</if>
-            <if test="dcbReId != null">dcb_re_id = #{dcbReId},</if>
+            <if test="dcb_name != null">dcb_name = #{dcb_name},</if>
+            <if test="dcb_lay_id != null">dcb_lay_id = #{dcb_lay_id},</if>
+            <if test="dcb_type != null">dcb_type = #{dcb_type},</if>
+            <if test="dcb_nr != null">dcb_nr = #{dcb_nr},</if>
+            <if test="dcb_share != null">dcb_share = #{dcb_share},</if>
+            <if test="dcb_attrs != null">dcb_attrs = #{dcb_attrs},</if>
+            <if test="dcb_owner != null">dcb_owner = #{dcb_owner},</if>
+            <if test="dcb_no != null">dcb_no = #{dcb_no},</if>
+            <if test="dcb_status != null">dcb_status = #{dcb_status},</if>
+            <if test="dcb_re_id != null">dcb_re_id = #{dcb_re_id},</if>
         </trim>
-        where dcb_id = #{dcbId}
+        where dcb_id = #{dcb_id}
     </update>
 
     <!-- 删除单个数据块 -->
     <delete id="deleteDcbBlockById" parameterType="Long">
-        delete from dcb_block where dcb_id = #{dcbId}
+        delete from dcb_block where dcb_id = #{dcb_id}
     </delete>
 
     <!-- 批量删除数据块 -->
     <delete id="deleteDcbBlockByIds" parameterType="String">
         delete from dcb_block where dcb_id in
-        <foreach item="dcbId" collection="array" open="(" separator="," close=")">
-            #{dcbId}
+        <foreach item="dcb_id" collection="array" open="(" separator="," close=")">
+            #{dcb_id}
         </foreach>
     </delete>
 

+ 13 - 1
创建表语句.txt

@@ -470,7 +470,7 @@ CREATE TABLE `dc_system_product`  (
 DROP TABLE IF EXISTS `dcb_block`;
 CREATE TABLE dcb_block (
     -- 主键ID
-    dcb_id bigint(19) NOT NULL,
+    dcb_id bigint(19) NOT NULL AUTO_INCREMENT,
     -- 名称
     dcb_name varchar(255) COMMENT '名称',
     -- 布局ID
@@ -493,3 +493,15 @@ CREATE TABLE dcb_block (
     dcb_re_id int(10) COMMENT '关联ID',
     PRIMARY KEY (dcb_id)
 ) COMMENT '数据块表';
+
+
+DROP TABLE IF EXISTS `dc_document`;
+CREATE TABLE dc_document (
+    dcm_id BIGINT(19) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+    dcm_status INT(10) NOT NULL DEFAULT 0,
+    dcm_title VARCHAR(100),
+    dcm_owner BIGINT(19) NOT NULL DEFAULT 0,
+    dcm_type INT(10) NOT NULL DEFAULT 0,
+    dcm_xbj INT,
+    dcm_data text
+) COMMENT='文档信息表';