瀏覽代碼

提交代码

cxd 7 月之前
父節點
當前提交
becffd42bf

+ 31 - 0
gqy-admin/src/main/java/com/gqy/web/controller/document/DcSystemController.java

@@ -0,0 +1,31 @@
+package com.gqy.web.controller.document;
+
+import com.gqy.common.annotation.Log;
+import com.gqy.common.core.controller.BaseController;
+import com.gqy.common.core.domain.AjaxResult;
+import com.gqy.common.enums.BusinessType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+
+
+@RestController
+@RequestMapping("/dcsystem")
+public class DcSystemController extends BaseController {
+
+    /**
+     * 创建系统信息
+     */
+    @PostMapping("/create")
+    public AjaxResult create() {
+        //return documentService.create(request, file);
+        return  null;
+    }
+
+
+}

+ 36 - 0
gqy-common/src/main/java/com/gqy/common/config/CustomDateDeserializer.java

@@ -0,0 +1,36 @@
+package com.gqy.common.config;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+
+public class CustomDateDeserializer extends JsonDeserializer<Date> {
+    private static final String[] DATE_FORMATS = {
+            "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
+            "yyyy-MM-dd'T'HH:mm:ss.SSS+08:00",
+            "yyyy-MM-dd HH:mm:ss"
+    };
+
+
+    public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
+        String dateStr = p.getText();
+
+        for (String format : DATE_FORMATS) {
+            try {
+                SimpleDateFormat dateFormat = new SimpleDateFormat(format);
+                return dateFormat.parse(dateStr);
+            } catch (ParseException ignored) {
+                ignored.printStackTrace();
+                // Try next format
+            }
+        }
+        throw new IOException("Unable to parse date '" + dateStr + "' with any of the supported formats");
+    }
+
+}

+ 69 - 0
gqy-system/src/main/java/com/gqy/document/domain/DcSystem.java

@@ -0,0 +1,69 @@
+package com.gqy.document.domain;
+
+import com.gqy.common.annotation.Excel;
+import com.gqy.common.core.domain.BaseEntity;
+
+/**
+ * 系统信息实体类
+ */
+public class DcSystem extends BaseEntity {
+
+    @Excel(name = "系统id")
+    private Long sys_id;
+
+    /** 系统名称 */
+    @Excel(name = "系统名称")
+    private String sys_name;
+
+    /** 系统备注 */
+    @Excel(name = "系统备注")
+    private String sys_remark;
+
+    /** 产品级 */
+    @Excel(name = "产品级")
+    private String sys_products;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long user_id;
+
+    public Long getSys_id() {
+        return sys_id;
+    }
+
+    public void setSys_id(Long sys_id) {
+        this.sys_id = sys_id;
+    }
+
+    public String getSys_name() {
+        return sys_name;
+    }
+
+    public void setSys_name(String sys_name) {
+        this.sys_name = sys_name;
+    }
+
+    public String getSys_remark() {
+        return sys_remark;
+    }
+
+    public void setSys_remark(String sys_remark) {
+        this.sys_remark = sys_remark;
+    }
+
+    public String getSys_products() {
+        return sys_products;
+    }
+
+    public void setSys_products(String sys_products) {
+        this.sys_products = sys_products;
+    }
+
+    public Long getUser_id() {
+        return user_id;
+    }
+
+    public void setUser_id(Long user_id) {
+        this.user_id = user_id;
+    }
+}

+ 72 - 0
gqy-system/src/main/java/com/gqy/document/domain/ProductDocument.java

@@ -0,0 +1,72 @@
+package com.gqy.document.domain;
+
+import com.gqy.common.core.domain.BaseEntity;
+
+import java.util.Date;
+
+
+/**
+ * 文档产品关联对象 dc_product_document
+ *
+ * @author mzhu
+ */
+public class ProductDocument extends BaseEntity {
+
+
+    private static final long serialVersionUID = 1L;
+
+    /** 关联ID */
+    private Long id;
+
+    /** 文档ID */
+    private Long document_id;
+
+    /** 产品ID */
+    private Long product_id;
+
+    /** 创建时间 */
+    private Date create_time;
+
+    /** 状态(5-使用中 6-已停用 4-已删除) */
+    private Integer status;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getDocument_id() {
+        return document_id;
+    }
+
+    public void setDocument_id(Long document_id) {
+        this.document_id = document_id;
+    }
+
+    public Long getProduct_id() {
+        return product_id;
+    }
+
+    public void setProduct_id(Long product_id) {
+        this.product_id = product_id;
+    }
+
+    public Date getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(Date create_time) {
+        this.create_time = create_time;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+}

+ 15 - 0
gqy-system/src/main/java/com/gqy/document/mapper/DcSystemMapper.java

@@ -0,0 +1,15 @@
+package com.gqy.document.mapper;
+
+import com.gqy.document.domain.DcSystem;
+
+/**
+ * 系统信息Mapper
+ */
+public interface DcSystemMapper {
+
+    /**
+     * 新增系统配置
+     */
+    public int insertDcSystem(DcSystem dcSystem);
+
+}

+ 70 - 0
gqy-system/src/main/resources/mapper/document/DcSystemMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gqy.document.mapper.DcSystemMapper">
+
+    <resultMap type="DcSystem" id="DcSystemResult">
+        <id     property="sys_id"      column="sys_id"      />
+        <result property="sys_name"    column="sys_name"    />
+        <result property="sys_remark"  column="sys_remark"  />
+        <result property="sys_products"  column="sys_products"  />
+        <result property="user_id"  column="user_id"  />
+    </resultMap>
+
+    <sql id="selectDcSystemVo">
+        select sys_id, sys_name, sys_remark, sys_products, user_id
+        from dc_system
+    </sql>
+
+    <select id="selectDcSystemList" parameterType="DcSystem" resultMap="DcSystemResult">
+        <include refid="selectDcSystemVo"/>
+        <where>
+            <if test="sys_name != null and sys_name != ''">
+                AND sys_name like concat('%', #{sys_name}, '%')
+            </if>
+            <if test="user_id != null">
+                AND user_id = #{user_id}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectDcSystemById" parameterType="Long" resultMap="DcSystemResult">
+        <include refid="selectDcSystemVo"/>
+        where sys_id = #{sys_id}
+    </select>
+
+    <insert id="insertDcSystem" parameterType="DcSystem" useGeneratedKeys="true" keyProperty="sys_id">
+        insert into dc_system (
+        <if test="sys_name != null">sys_name,</if>
+        <if test="sys_remark != null">sys_remark,</if>
+        <if test="sys_products != null">sys_products,</if>
+        <if test="user_id != null">user_id</if>
+        )values(
+        <if test="sys_name != null">#{sys_name},</if>
+        <if test="sys_remark != null">#{sys_remark},</if>
+        <if test="sys_products != null">#{sys_products},</if>
+        <if test="user_id != null">#{user_id}</if>
+        )
+    </insert>
+
+    <update id="updateDcSystem" parameterType="DcSystem">
+        update dc_system
+        <set>
+            <if test="sys_name != null">sys_name = #{sys_name},</if>
+            <if test="sys_remark != null">sys_remark = #{sys_remark},</if>
+            <if test="sys_products != null">sys_products = #{sys_products},</if>
+            <if test="user_id != null">user_id = #{user_id},</if>
+        </set>
+        where sys_id = #{sys_id}
+    </update>
+
+    <delete id="deleteDcSystemById" parameterType="Long">
+        delete from dc_system where sys_id = #{sys_id}
+    </delete>
+
+    <delete id="deleteDcSystemByIds" parameterType="String">
+        delete from dc_system where sys_id in
+        <foreach item="sys_id" collection="array" open="(" separator="," close=")">
+            #{sys_id}
+        </foreach>
+    </delete>
+</mapper>