5 年之前
父节点
当前提交
30e7e7a87d

+ 21 - 0
pcbms/src/main/java/com/hssx/pcbms/controller/ParameterController.java

@@ -0,0 +1,21 @@
+package com.hssx.pcbms.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-02
+ */
+@RestController
+@RequestMapping("/parameter")
+public class ParameterController {
+
+}
+

+ 92 - 0
pcbms/src/main/java/com/hssx/pcbms/entity/Parameter.java

@@ -0,0 +1,92 @@
+package com.hssx.pcbms.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-02
+ */
+public class Parameter extends Model<Parameter> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 参数键
+     */
+    @TableField("param_key")
+    private String paramKey;
+
+    /**
+     * 参数值
+     */
+    @TableField("param_value")
+    private String paramValue;
+
+    /**
+     * 注释
+     */
+    @TableField("note")
+    private String note;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getParamKey() {
+        return paramKey;
+    }
+
+    public void setParamKey(String paramKey) {
+        this.paramKey = paramKey;
+    }
+
+    public String getParamValue() {
+        return paramValue;
+    }
+
+    public void setParamValue(String paramValue) {
+        this.paramValue = paramValue;
+    }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "Parameter{" +
+        "id=" + id +
+        ", paramKey=" + paramKey +
+        ", paramValue=" + paramValue +
+        ", note=" + note +
+        "}";
+    }
+}

+ 16 - 0
pcbms/src/main/java/com/hssx/pcbms/mapper/ParameterMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.pcbms.mapper;
+
+import com.hssx.pcbms.entity.Parameter;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-02
+ */
+public interface ParameterMapper extends BaseMapper<Parameter> {
+
+}

+ 16 - 0
pcbms/src/main/java/com/hssx/pcbms/service/ParameterService.java

@@ -0,0 +1,16 @@
+package com.hssx.pcbms.service;
+
+import com.hssx.pcbms.entity.Parameter;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-02
+ */
+public interface ParameterService extends IService<Parameter> {
+
+}

+ 2 - 2
pcbms/src/main/java/com/hssx/pcbms/service/impl/GoodsServiceImpl.java

@@ -237,12 +237,12 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     @Override
     public HttpRespMsg maintain(MaintainRecordVO operateRecordVO) {
         HttpRespMsg msg = new HttpRespMsg();
-        MaintainRecord operateRecord = new MaintainRecord();
         List<MaintainRecord> operateRecords = new ArrayList<>();
         if(null != operateRecordVO.getIds()){
             List<Integer> idList = ListUtil.convertIntegerIdsArrayToList(operateRecordVO.getIds());
-            BeanUtils.copyProperties(operateRecordVO,operateRecord);
             for (Integer id : idList) {
+                MaintainRecord operateRecord = new MaintainRecord();
+                BeanUtils.copyProperties(operateRecordVO,operateRecord);
                 operateRecord.setGoodsNoId(id);
                 operateRecords.add(operateRecord);
             }

+ 20 - 0
pcbms/src/main/java/com/hssx/pcbms/service/impl/ParameterServiceImpl.java

@@ -0,0 +1,20 @@
+package com.hssx.pcbms.service.impl;
+
+import com.hssx.pcbms.entity.Parameter;
+import com.hssx.pcbms.mapper.ParameterMapper;
+import com.hssx.pcbms.service.ParameterService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-02
+ */
+@Service
+public class ParameterServiceImpl extends ServiceImpl<ParameterMapper, Parameter> implements ParameterService {
+
+}

+ 18 - 0
pcbms/src/main/resources/mapper/ParameterMapper.xml

@@ -0,0 +1,18 @@
+<?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.hssx.pcbms.mapper.ParameterMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.pcbms.entity.Parameter">
+        <id column="id" property="id" />
+        <result column="param_key" property="paramKey" />
+        <result column="param_value" property="paramValue" />
+        <result column="note" property="note" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, param_key, param_value, note
+    </sql>
+
+</mapper>