소스 검색

代码提交

cxd 7 달 전
부모
커밋
219d3cf94f

+ 4 - 7
gqy-admin/src/main/java/com/gqy/web/controller/document/DcSpecController.java

@@ -37,7 +37,6 @@ public class DcSpecController  extends BaseController {
     /**
      * 获取产品规格详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:spec:query')")
     @GetMapping(value = "/{psId}")
     public AjaxResult getInfo(@PathVariable("psId") Integer psId) {
         return success(iDcSpecService.selectDcSpecById(psId));
@@ -46,18 +45,16 @@ public class DcSpecController  extends BaseController {
     /**
      * 新增产品规格
      */
-//    @PreAuthorize("@ss.hasPermi('system:spec:add')")
-//    @Log(title = "产品规格", businessType = BusinessType.INSERT)
     @PostMapping(value = "/add")
-    public AjaxResult add(@RequestBody DcSpec dcSpec) {
-        return toAjax(iDcSpecService.insertDcSpec(dcSpec));
+    public AjaxResult add(@RequestBody Map dcSpec) {
+        //return toAjax(iDcSpecService.insertDcSpec(dcSpec));
+
+        return null;
     }
 
     /**
      * 修改产品规格
      */
-//    @PreAuthorize("@ss.hasPermi('system:spec:edit')")
-//    @Log(title = "产品规格", businessType = BusinessType.UPDATE)
     @PostMapping("/update")
     public AjaxResult update(@RequestBody DcSpec dcSpec) {
         return toAjax(iDcSpecService.updateDcSpec(dcSpec));

+ 9 - 14
gqy-system/src/main/java/com/gqy/document/domain/DcParam.java → gqy-system/src/main/java/com/gqy/document/domain/DcPsParam.java

@@ -4,29 +4,25 @@ import com.gqy.common.annotation.Excel;
 import com.gqy.common.core.domain.BaseEntity;
 
 /**
- * 产品参数对象 ps_param
+ * 产品参数对象 dc_ps_param
  */
-public class DcParam  extends BaseEntity {
+public class DcPsParam extends BaseEntity {
+
     /** 参数主键 */
     private Integer psp_id;
 
-    /** 参数编码 */
-    @Excel(name = "参数编码")
+    /** 参数编码(代码) */
     private String psp_mode;
 
     /** 参数名 */
-    @Excel(name = "参数名")
     private String psp_name;
 
     /** 参数值 */
-    @Excel(name = "参数值")
     private String psp_value;
 
     /** 文档块id */
-    @Excel(name = "文档块id")
-    private Integer psp_dck_id;
+    private Integer dcb_id;
 
-    // getter和setter方法
     public Integer getPsp_id() {
         return psp_id;
     }
@@ -59,12 +55,11 @@ public class DcParam  extends BaseEntity {
         this.psp_value = psp_value;
     }
 
-    public Integer getPsp_dck_id() {
-        return psp_dck_id;
+    public Integer getDcb_id() {
+        return dcb_id;
     }
 
-    public void setPsp_dck_id(Integer psp_dck_id) {
-        this.psp_dck_id = psp_dck_id;
+    public void setDcb_id(Integer dcb_id) {
+        this.dcb_id = dcb_id;
     }
-
 }

+ 5 - 7
gqy-system/src/main/java/com/gqy/document/domain/DcSpec.java

@@ -19,7 +19,7 @@ public class DcSpec extends BaseEntity {
 
     /** 规格编号 */
     @Excel(name = "规格编号")
-    private String pa_no;
+    private String ps_no;
 
     /** 规格名 */
     @Excel(name = "规格名")
@@ -55,14 +55,12 @@ public class DcSpec extends BaseEntity {
         this.ps_p_id = ps_p_id;
     }
 
-    public String getPa_no() {
-        return pa_no;
+    public String getPs_no() {
+        return ps_no;
     }
-
-    public void setPa_no(String pa_no) {
-        this.pa_no = pa_no;
+    public void setPs_no(String ps_no) {
+        this.ps_no = ps_no;
     }
-
     public String getPs_name() {
         return ps_name;
     }

+ 25 - 2
gqy-system/src/main/java/com/gqy/document/service/impl/DcSpecServiceImpl.java

@@ -1,6 +1,8 @@
 package com.gqy.document.service.impl;
 
 import com.gqy.common.annotation.Log;
+import com.gqy.common.enums.UserStatus;
+
 import com.gqy.document.domain.DcSpec;
 import com.gqy.document.mapper.DcSpecMapper;
 import com.gqy.document.service.IDcSpecService;
@@ -44,8 +46,27 @@ public class DcSpecServiceImpl implements IDcSpecService {
         return dcSpecMapper.insertDcSpec(dcSpec);
     }
 
-    @Override
-    public int insertDcSpec(Map maps) {
+    /**
+     * 保存规格参数 包括 规格参数值
+     * @param maps
+     * @return
+     */
+    public int insertDcSpecParam(Map maps) {
+        try {
+            DcSpec dcSpec = new DcSpec();
+            String ps_no = maps.get("ps_no").toString();
+            dcSpec.setPs_no(ps_no);
+            dcSpec.setPs_no(maps.get("ps_name").toString());
+            dcSpec.setPs_status(Integer.valueOf(UserStatus.OK.getCode()));
+            int psId =  dcSpecMapper.insertDcSpec(dcSpec);
+
+
+
+
+            return  1;
+        }catch (Exception e){
+            e.printStackTrace();
+        }
         return 0;
     }
 
@@ -54,4 +75,6 @@ public class DcSpecServiceImpl implements IDcSpecService {
     }
 
 
+
+
 }

+ 71 - 0
gqy-system/src/main/resources/mapper/document/DcPsParamMapper.xml

@@ -0,0 +1,71 @@
+<?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.system.mapper.DcPsParamMapper">
+
+    <resultMap type="DcPsParam" id="DcPsParamResult">
+        <result property="psp_id"    column="psp_id"    />
+        <result property="psp_mode"  column="psp_mode"  />
+        <result property="psp_name"  column="psp_name"  />
+        <result property="psp_value" column="psp_value" />
+        <result property="dcb_id"    column="dcb_id"    />
+    </resultMap>
+
+    <sql id="selectDcPsParamVo">
+        select psp_id, psp_mode, psp_name, psp_value, dcb_id        from dc_ps_param
+    </sql>
+
+    <select id="selectDcPsParamList" parameterType="DcPsParam" resultMap="DcPsParamResult">
+        <include refid="selectDcPsParamVo"/>
+        <where>
+            <if test="psp_mode != null  and psp_mode != ''"> and psp_mode = #{psp_mode}</if>
+            <if test="psp_name != null  and psp_name != ''"> and psp_name like concat('%', #{psp_name}, '%')</if>
+            <if test="psp_value != null  and psp_value != ''"> and psp_value = #{psp_value}</if>
+            <if test="dcb_id != null "> and dcb_id = #{dcb_id}</if>
+        </where>
+    </select>
+
+    <select id="selectDcPsParamByPspId" parameterType="Integer" resultMap="DcPsParamResult">
+        <include refid="selectDcPsParamVo"/>
+        where psp_id = #{psp_id}
+    </select>
+
+    <insert id="insertDcPsParam" parameterType="DcPsParam" useGeneratedKeys="true" keyProperty="psp_id">
+        insert into dc_ps_param
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="psp_mode != null">psp_mode,</if>
+            <if test="psp_name != null">psp_name,</if>
+            <if test="psp_value != null">psp_value,</if>
+            <if test="dcb_id != null">dcb_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="psp_mode != null">#{psp_mode},</if>
+            <if test="psp_name != null">#{psp_name},</if>
+            <if test="psp_value != null">#{psp_value},</if>
+            <if test="dcb_id != null">#{dcb_id},</if>
+        </trim>
+    </insert>
+
+    <update id="updateDcPsParam" parameterType="DcPsParam">
+        update dc_ps_param
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="psp_mode != null">psp_mode = #{psp_mode},</if>
+            <if test="psp_name != null">psp_name = #{psp_name},</if>
+            <if test="psp_value != null">psp_value = #{psp_value},</if>
+            <if test="dcb_id != null">dcb_id = #{dcb_id},</if>
+        </trim>
+        where psp_id = #{psp_id}
+    </update>
+
+    <delete id="deleteDcPsParamByPspId" parameterType="Integer">
+        delete from dc_ps_param where psp_id = #{psp_id}
+    </delete>
+
+    <delete id="deleteDcPsParamByPspIds" parameterType="String">
+        delete from dc_ps_param where psp_id in
+        <foreach item="psp_id" collection="array" open="(" separator="," close=")">
+            #{psp_id}
+        </foreach>
+    </delete>
+</mapper>

+ 1 - 2
gqy-system/src/main/resources/mapper/document/DcSpecMapper.xml

@@ -5,7 +5,7 @@
     <resultMap type="DcSpec" id="DcSpecResult">
         <result property="ps_id"     column="ps_id"     />
         <result property="ps_p_id"   column="ps_p_id"   />
-        <result property="pa_no"     column="pa_no"     />
+        <result property="ps_no"     column="pa_no"     />
         <result property="ps_name"   column="ps_name"   />
         <result property="ps_status"   column="ps_status"   />
         <result property="ps_dck_id" column="ps_dck_id" />
@@ -44,7 +44,6 @@
         </trim>
     </insert>
 
-
     <update id="updateDcSpec" parameterType="DcSpec">
         update dc_spec
         <trim prefix="SET" suffixOverrides=",">

+ 12 - 0
创建表语句.txt

@@ -354,3 +354,15 @@ CREATE TABLE `dc_system` (
   `update_time` datetime DEFAULT NULL COMMENT '更新时间',
   PRIMARY KEY (`sys_id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='系统表';
+
+
+===========规格管理
+
+CREATE TABLE `dc_ps_param` (
+  `psp_id` int NOT NULL AUTO_INCREMENT COMMENT '参数主键',
+  `psp_mode` varchar(50) DEFAULT NULL COMMENT '参数编码(代码)',
+  `psp_name` varchar(100) DEFAULT NULL COMMENT '参数名',
+  `psp_value` varchar(200) DEFAULT NULL COMMENT '参数值',
+  `dcb_id` int DEFAULT '0' COMMENT '文档块id',
+  PRIMARY KEY (`psp_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='产品参数表';