Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/zx_saas_goods' into zx_saas_goods

zouxuan 1 anno fa
parent
commit
db75b4c60f

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

@@ -55,6 +55,12 @@ public class GoodsQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "品牌ID")
     private String brandId;
 
+    @ApiModelProperty(value = "商品名称")
+    private String name;
+
+    @ApiModelProperty(value = "货号")
+    private String sn;
+
     private Integer subjectId;
 
     public Integer getNoOrganSearch() {
@@ -184,4 +190,20 @@ public class GoodsQueryInfo extends QueryInfo {
     public void setBrandId(String brandId) {
         this.brandId = brandId;
     }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
 }

+ 10 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -717,10 +717,15 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 							}
 						}
 					} else {
-						if ("image".equals(fieldCode) && value instanceof List) { // 图片数组 取第一个
-							Object data = ((List<?>) value).get(0);
-							if (data instanceof PictureData) {
-								value = ((PictureData) data).getData();
+						if ("image".equals(fieldCode)) { // 图片数组 取第一个
+							if (value instanceof List) {
+								Object data = ((List<?>) value).get(0);
+								if (data instanceof PictureData) {
+									value = ((PictureData) data).getData();
+								}
+							} else {
+								lineErrList.add("图片格式错误");
+								continue;
 							}
 						}
 						beforeGoods.put(fieldCode, value);
@@ -1456,7 +1461,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		}
 
 		String format = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
-		File file = createImportGoodsTempFile(format + ".csv");
+		File file = createImportGoodsTempFile("商品导入回执" + format + ".csv");
 		try {
 			FileOutputStream out = new FileOutputStream(file);
 			byte[] uft8bom = {(byte) 0xef, (byte) 0xbb, (byte) 0xbf}; // 处理乱码

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

@@ -385,6 +385,12 @@
             <if test="search!=null and search!=''">
                 AND (g.sn_=#{search} OR g.id_=#{search} OR g.name_ LIKE CONCAT('%', #{search}, '%'))
             </if>
+            <if test="name != null and name != ''">
+                AND t.name_ like CONCAT('%', #{name}, '%'))
+            </if>
+            <if test="sn != null and sn != ''">
+                AND t.sn_ like CONCAT('%', #{sn}, '%'))
+            </if>
             <if test="groupGoods != null">
                 AND t.group_goods_ = #{groupGoods}
             </if>