Browse Source

feat:商品经销存

Joburgess 4 years ago
parent
commit
9776154920

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.GoodsType;
+import com.ym.mec.biz.dal.enums.StockType;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 
 import io.swagger.annotations.ApiModelProperty;
@@ -123,6 +124,26 @@ public class Goods {
 
 	private String supplyChannel;
 
+	private Integer clientShow;
+
+	private StockType stockType;
+
+	public Integer getClientShow() {
+		return clientShow;
+	}
+
+	public void setClientShow(Integer clientShow) {
+		this.clientShow = clientShow;
+	}
+
+	public StockType getStockType() {
+		return stockType;
+	}
+
+	public void setStockType(StockType stockType) {
+		this.stockType = stockType;
+	}
+
 	public BigDecimal getAgreeCostPrice() {
 		return agreeCostPrice;
 	}

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/StockType.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.10.10
+ **/
+public enum StockType implements BaseEnum<String, StockType> {
+    INTERNAL("INTERNAL", "内部"),
+    EXTERNAL("EXTERNAL", "外部"),
+    ALL("ALL", "全部"),;
+
+    private String code;
+    private String msg;
+
+    StockType(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    @Override
+    public String getCode() {
+        return null;
+    }
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/GoodsQueryInfo.java

@@ -25,6 +25,17 @@ public class GoodsQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "商品类型", required = false)
     private GoodsType type;
 
+    @ApiModelProperty(value = "是否组合商品:0/1")
+    private Integer groupGoods;
+
+    public Integer getGroupGoods() {
+        return groupGoods;
+    }
+
+    public void setGroupGoods(Integer groupGoods) {
+        this.groupGoods = groupGoods;
+    }
+
     public GoodsType getType() {
         return type;
     }

+ 10 - 0
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -266,12 +266,22 @@
             <if test="status != null">
                 AND g.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="groupGoods!=null and groupGoods==0">
+                AND g.complement_goods_id_list_ IS NULL
+            </if>
+            <if test="groupGoods!=null and groupGoods==1">
+                AND g.complement_goods_id_list_ IS NOT NULL
+            </if>
+            <if test="search!=null and search!=''">
+                AND (g.sn_=#{search} OR g.name_ LIKE CONCAT('%', #{search}, '%') OR gp.supply_channel_ LIKE CONCAT('%', #{search}, '%'))
+            </if>
         </where>
     </sql>
 
     <select id="findGoodsBySubId" resultMap="Goods">
         SELECT g.* FROM subject_goods_mapper sgm
         LEFT JOIN goods g ON sgm.goods_category_id_ = g.goods_category_id_
+        LEFT JOIN goods_procurement gp ON  g.id_=gp.goods_id_
         WHERE sgm.subject_id_ = #{subjectId} AND g.type_ = #{type} and g.status_ != 0
     </select>