Преглед изворни кода

代码提交,修改映射的值

cxd пре 7 месеци
родитељ
комит
1e51321901

+ 1 - 3
gqy-admin/src/main/java/com/gqy/web/controller/document/DcSpecController.java

@@ -47,9 +47,7 @@ public class DcSpecController  extends BaseController {
      */
     @PostMapping(value = "/add")
     public AjaxResult add(@RequestBody Map dcSpec) {
-        //return toAjax(iDcSpecService.insertDcSpec(dcSpec));
-
-        return null;
+        return toAjax(iDcSpecService.insertDcSpecParam(dcSpec));
     }
 
     /**

+ 17 - 5
gqy-system/src/main/java/com/gqy/document/service/impl/DcSpecServiceImpl.java

@@ -3,9 +3,11 @@ package com.gqy.document.service.impl;
 import com.gqy.common.annotation.Log;
 import com.gqy.common.enums.UserStatus;
 
+import com.gqy.document.domain.DcPsParam;
 import com.gqy.document.domain.DcSpec;
 import com.gqy.document.mapper.DcSpecMapper;
 import com.gqy.document.service.IDcSpecService;
+import com.gqy.system.mapper.DcPsParamMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -21,6 +23,9 @@ public class DcSpecServiceImpl implements IDcSpecService {
     @Autowired
     private DcSpecMapper dcSpecMapper;
 
+    @Autowired
+    private DcPsParamMapper dcPsParamMapper;
+
 
     /**
      * 查询产品规格
@@ -53,15 +58,22 @@ public class DcSpecServiceImpl implements IDcSpecService {
      */
     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_name(maps.get("ps_name").toString());
             dcSpec.setPs_status(Integer.valueOf(UserStatus.OK.getCode()));
-            int psId =  dcSpecMapper.insertDcSpec(dcSpec);
-
-
-
+            dcSpecMapper.insertDcSpec(dcSpec);
+
+            //规格参数
+            DcPsParam dcPsParam = new DcPsParam();
+            dcPsParam.setPsp_mode(ps_no);
+            String psp_name = maps.get("psp_name").toString();
+            dcPsParam.setPsp_name(psp_name);
+            String psp_value = maps.get("psp_value").toString();
+            dcPsParam.setPsp_value(psp_value);
+            dcPsParamMapper.insertDcPsParam(dcPsParam);
 
             return  1;
         }catch (Exception e){

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

@@ -27,7 +27,6 @@ public class DcSystemServiceImpl implements IDcSystemService {
      */
     public AjaxResult insertDcSystem(DcSystem dcSystem) {
         try{
-          //  dcSystem.setUserId(SecurityUtils.getUserId());
             dcSystemMapper.insertDcSystem(dcSystem);
         }catch (Exception e){
             log.info("error===insertDcSystem",e);
@@ -41,7 +40,6 @@ public class DcSystemServiceImpl implements IDcSystemService {
      */
     public AjaxResult updateDcSystem(DcSystem dcSystem) {
         try{
-            //  dcSystem.setUserId(SecurityUtils.getUserId());
             dcSystemMapper.updateDcSystem(dcSystem);
         }catch (Exception e){
             log.info("error===updateDcSystem",e);

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

@@ -5,21 +5,21 @@
     <resultMap type="DcSpec" id="DcSpecResult">
         <result property="ps_id"     column="ps_id"     />
         <result property="ps_p_id"   column="ps_p_id"   />
-        <result property="ps_no"     column="pa_no"     />
+        <result property="ps_no"     column="ps_no"     />
         <result property="ps_name"   column="ps_name"   />
         <result property="ps_status"   column="ps_status"   />
         <result property="ps_dck_id" column="ps_dck_id" />
     </resultMap>
 
     <sql id="selectDcSpecVo">
-        select ps_id, ps_p_id, pa_no, ps_name, ps_dck_id from dc_spec
+        select ps_id, ps_p_id, ps_no, ps_name, ps_dck_id from dc_spec
     </sql>
 
     <select id="selectDcSpecList" parameterType="DcSpec" resultMap="DcSpecResult">
         <include refid="selectDcSpecVo"/>
         <where>
             <if test="ps_p_id != null  and ps_p_id != ''"> and ps_p_id = #{ps_p_id}</if>
-            <if test="pa_no != null  and pa_no != ''"> and pa_no = #{pa_no}</if>
+            <if test="ps_no != null  and ps_no != ''"> and ps_no = #{pa_no}</if>
             <if test="ps_name != null  and ps_name != ''"> and ps_name like concat('%', #{ps_name}, '%')</if>
             <if test="ps_dck_id != null "> and ps_dck_id = #{ps_dck_id}</if>
         </where>
@@ -32,13 +32,13 @@
         insert into dc_spec
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="ps_p_id != null and ps_p_id != ''">ps_p_id,</if>
-            <if test="pa_no != null and pa_no != ''">pa_no,</if>
+            <if test="ps_no != null and ps_no != ''">ps_no,</if>
             <if test="ps_name != null and ps_name != ''">ps_name,</if>
             <if test="ps_dck_id != null">ps_dck_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="ps_p_id != null and ps_p_id != ''">#{ps_p_id},</if>
-            <if test="pa_no != null and pa_no != ''">#{pa_no},</if>
+            <if test="ps_no != null and ps_no != ''">#{ps_no},</if>
             <if test="ps_name != null and ps_name != ''">#{ps_name},</if>
             <if test="ps_dck_id != null">#{ps_dck_id},</if>
         </trim>
@@ -48,7 +48,7 @@
         update dc_spec
         <trim prefix="SET" suffixOverrides=",">
             <if test="ps_p_id != null">ps_p_id = #{ps_p_id},</if>
-            <if test="pa_no != null">pa_no = #{pa_no},</if>
+            <if test="ps_no != null">ps_no = #{ps_no},</if>
             <if test="ps_name != null">ps_name = #{ps_name},</if>
             <if test="ps_dck_id != null">ps_dck_id = #{ps_dck_id},</if>
         </trim>