cxd пре 7 месеци
родитељ
комит
82a62e526d

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

@@ -28,9 +28,9 @@ public class DcSpecController  extends BaseController {
      * 查询产品规格列表
      */
     @GetMapping("/list")
-    public TableDataInfo list(DcSpec dcSpec) {
+    public TableDataInfo list(Map maps) {
         startPage();
-        List<DcSpec> list =  iDcSpecService.selectDcSpecList(dcSpec);
+        List<Map<String, Object>> list =  iDcSpecService.selectDcPsParamAndSpec(maps);
         return getDataTable(list);
     }
 
@@ -54,8 +54,12 @@ public class DcSpecController  extends BaseController {
      * 修改产品规格
      */
     @PostMapping("/update")
-    public AjaxResult update(@RequestBody DcSpec dcSpec) {
-        return toAjax(iDcSpecService.updateDcSpec(dcSpec));
+    public AjaxResult update(@RequestBody Map maps) {
+        logger.info("============DcSpecController=========maps========");
+        logger.info("============DcSpecController=========maps========");
+        logger.info("============DcSpecController=========maps========");
+
+        return toAjax(1);
     }
 
 

+ 9 - 0
gqy-system/src/main/java/com/gqy/document/domain/DcPsParam.java

@@ -25,6 +25,15 @@ public class DcPsParam extends BaseEntity {
     private Integer dcb_id;
 
 
+    /** 状态 */
+    private Integer psp_status;
+
+    public Integer getPsp_status() {
+        return psp_status;
+    }
+    public void setPsp_status(Integer psp_status) {
+        this.psp_status = psp_status;
+    }
 
     public Integer getPsp_id() {
         return psp_id;

+ 14 - 0
gqy-system/src/main/java/com/gqy/document/service/IDcSpecService.java

@@ -10,6 +10,14 @@ import java.util.Map;
  */
 public interface IDcSpecService {
 
+
+    /**
+     * 查询产品规格列表
+     * @param params
+     * @return
+     */
+    List<Map<String, Object>> selectDcPsParamAndSpec(Map<String, Object> params);
+
     /**
      * 查询产品规格
      */
@@ -37,5 +45,11 @@ public interface IDcSpecService {
      */
     public int updateDcSpec(DcSpec dcSpec);
 
+    /**
+     * 修改规格 包括 规格参数
+     * @param 更新参数
+     * @return
+     */
+    public int updateDcSpecMaps(Map maps);
 
 }

+ 15 - 0
gqy-system/src/main/java/com/gqy/document/service/impl/DcSpecServiceImpl.java

@@ -26,6 +26,16 @@ public class DcSpecServiceImpl implements IDcSpecService {
     @Autowired
     private DcPsParamMapper dcPsParamMapper;
 
+    /**
+     * 查询列表
+     * @param params
+     * @return
+     */
+    public List<Map<String, Object>> selectDcPsParamAndSpec(Map<String, Object> params){
+        return  dcPsParamMapper.selectDcPsParamAndSpec(params);
+    }
+
+
 
     /**
      * 查询产品规格
@@ -88,6 +98,11 @@ public class DcSpecServiceImpl implements IDcSpecService {
     }
 
 
+    public int updateDcSpecMaps(Map maps){
+        String ps_id = maps.get("ps_id").toString();
+        DcSpec dcSpecQuery = dcSpecMapper.selectDcSpecById(Integer.valueOf(ps_id));
+        return 0;
+    }
 
 
 }

+ 1 - 0
gqy-system/src/main/java/com/gqy/document/service/impl/DcSystemServiceImpl.java

@@ -27,6 +27,7 @@ public class DcSystemServiceImpl implements IDcSystemService {
      */
     public AjaxResult insertDcSystem(DcSystem dcSystem) {
         try{
+            dcSystem.setSysStatus(Integer.valueOf(UserStatus.OK.getCode()));
             dcSystemMapper.insertDcSystem(dcSystem);
         }catch (Exception e){
             log.info("error===insertDcSystem",e);

+ 9 - 0
gqy-system/src/main/java/com/gqy/system/mapper/DcPsParamMapper.java

@@ -3,9 +3,18 @@ package com.gqy.system.mapper;
 import com.gqy.document.domain.DcPsParam;
 
 import java.util.List;
+import java.util.Map;
 
 public interface DcPsParamMapper {
 
+    /**
+     * 查询产品参数列表
+     * @param
+     * @return
+     */
+    public List<Map<String, Object>> selectDcPsParamAndSpec(Map<String, Object> params);
+
+
     /**
      * 查询产品参数列表
      */

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

@@ -10,8 +10,43 @@
         <result property="psp_name"  column="psp_name"  />
         <result property="psp_value" column="psp_value" />
         <result property="dcb_id"    column="dcb_id"    />
+        <result property="psp_status" column="psp_status"/>
     </resultMap>
 
+
+
+
+
+    <select id="selectDcPsParamAndSpec" resultType="map" parameterType="java.util.Map">
+        SELECT
+        p.psp_name,
+        p.psp_value,
+        s.ps_id,
+        s.ps_p_id,
+        s.ps_no,
+        s.ps_name,
+        s.ps_dck_id,
+        s.ps_category
+        FROM dc_ps_param p
+        LEFT JOIN dc_spec s ON p.psp_mode = s.ps_no
+        <where>
+            <if test="psp_name != null and psp_name != ''">
+                AND p.psp_name like concat('%', #{psp_name}, '%')
+            </if>
+            <if test="ps_no != null and ps_no != ''">
+                AND s.ps_no like concat('%', #{ps_no}, '%')
+            </if>
+            <if test="ps_category != null and ps_category != ''">
+                AND s.ps_category = #{ps_category}
+            </if>
+            <if test="psp_name != null and psp_name != ''">
+                AND p.psp_name like concat('%', #{psp_name}, '%')
+            </if>
+        </where>
+    </select>
+
+
+
     <sql id="selectDcPsParamVo">
         select psp_id, psp_mode, psp_name, psp_value, dcb_id        from dc_ps_param
     </sql>
@@ -38,12 +73,16 @@
             <if test="psp_name != null">psp_name,</if>
             <if test="psp_value != null">psp_value,</if>
             <if test="dcb_id != null">dcb_id,</if>
+            <if test="psp_status != null">psp_status,</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>
+            <if test="psp_status != null">#{psp_status},</if>
+
         </trim>
     </insert>
 

+ 8 - 2
gqy-system/src/main/resources/mapper/document/DcSystemMapper.xml

@@ -32,6 +32,7 @@
                 AND sys_status = #{sysStatus}
             </if>
         </where>
+        order by  sys_id desc
     </select>
 
     <select id="selectDcSystemById" parameterType="Long" resultMap="DcSystemResult">
@@ -45,13 +46,18 @@
                 <if test="sysName != null">sys_name,</if>
                 <if test="sysNo != null">sys_no,</if>
                 <if test="sysRemark != null">sys_remark,</if>
-                <if test="sysProducts != null">sys_products</if>
+                <if test="sysProducts != null">sys_products,</if>
+                <if test="sysStatus != null">sys_status,</if>
+
+
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sysName != null">#{sysName},</if>
             <if test="sysNo != null">#{sysNo},</if>
             <if test="sysRemark != null">#{sysRemark},</if>
-            <if test="sysProducts != null">#{sysProducts}</if>
+            <if test="sysProducts != null">#{sysProducts},</if>
+            <if test="sysStatus != null">#{sysStatus}</if>
+
         </trim>
     </insert>
 

+ 5 - 0
创建表语句.txt

@@ -366,3 +366,8 @@ CREATE TABLE `dc_ps_param` (
   `dcb_id` int DEFAULT '0' COMMENT '文档块id',
   PRIMARY KEY (`psp_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='产品参数表';
+
+
+
+ALTER TABLE dc_ps_param CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
+ALTER TABLE dc_spec CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;