1
0
Quellcode durchsuchen

1.产品备案图片上传与oms对接等,eoss对接
2.活动时间校验修改

yangbo vor 4 Jahren
Ursprung
Commit
83eb514aee
20 geänderte Dateien mit 1460 neuen und 389 gelöschten Zeilen
  1. 290 23
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsProductController.java
  2. 4 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsProductDao.java
  3. 57 0
      kmall-admin/src/main/java/com/kmall/admin/dto/PdProductImgDto.java
  4. 124 27
      kmall-admin/src/main/java/com/kmall/admin/entity/GoodsProductEntity.java
  5. 4 0
      kmall-admin/src/main/java/com/kmall/admin/service/GoodsProductService.java
  6. 10 3
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsProductServiceImpl.java
  7. 20 4
      kmall-admin/src/main/java/com/kmall/admin/service/impl/mk/Mk2GoodsTopicPriceServiceImpl.java
  8. 164 8
      kmall-admin/src/main/resources/mybatis/mapper/GoodsProductDao.xml
  9. 156 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsproduct.html
  10. 3 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/storetransferinventoryorder.html
  11. 458 318
      kmall-admin/src/main/webapp/js/shop/goodsproduct.js
  12. 3 3
      kmall-admin/src/main/webapp/js/shop/storetransferinventoryorderdetail.js
  13. 37 0
      kmall-common/src/main/java/com/kmall/common/constant/Dict.java
  14. 7 0
      kmall-common/src/main/java/com/kmall/common/fileserver/minio/EOSSConfiguration.java
  15. 34 0
      kmall-common/src/main/java/com/kmall/common/fileserver/minio/FileInfo.java
  16. 50 0
      kmall-common/src/main/java/com/kmall/common/fileserver/minio/MinIOUtils.java
  17. 20 0
      kmall-common/src/main/java/com/kmall/common/fileserver/util/FileManager.java
  18. 10 0
      kmall-manager/src/main/java/com/kmall/manager/manager/merch/OmsMerchProperties.java
  19. 8 2
      kmall-manager/src/main/resources/conf/oms-merch.properties
  20. 1 0
      kmall-manager/src/main/resources/spring/spring-oms-merch.xml

+ 290 - 23
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsProductController.java

@@ -1,21 +1,37 @@
 package com.kmall.admin.controller;
 
-import java.util.*;
-
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.ImmutableBiMap;
-import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.dto.GoodsProductDto;
+import com.kmall.admin.dto.PdProductImgDto;
+import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.entity.GoodsProductEntity;
+import com.kmall.admin.entity.SysOssEntity;
+import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.service.GoodsProductService;
+import com.kmall.admin.service.SysOssService;
+import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.constant.JxlsXmlTemplateName;
+import com.kmall.common.fileserver.util.FileManager;
 import com.kmall.common.utils.*;
 import com.kmall.common.utils.excel.ExcelUtil;
+import com.kmall.manager.manager.merch.OmsMerchProperties;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipFile;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.*;
+import java.util.*;
 
 
 /**
@@ -31,9 +47,16 @@ public class GoodsProductController {
     @Autowired
     private GoodsProductService goodsProductService;
 
+
+    @Autowired
+    private OmsMerchProperties omsMerchProperties;
+
     @Autowired
     private ExcelUtil excelUtil;
 
+    @Autowired
+    private SysOssService sysOssService;
+
     /**
      * 查看列表
      */
@@ -94,7 +117,7 @@ public class GoodsProductController {
     @RequestMapping("/delete")
     @RequiresPermissions("goodsproduct:delete")
     @ResponseBody
-    public R delete(@RequestBody Integer[]mallGoodsProductSns) {
+    public R delete(@RequestBody Integer[] mallGoodsProductSns) {
         goodsProductService.deleteBatch(mallGoodsProductSns);
 
         return R.ok();
@@ -113,9 +136,6 @@ public class GoodsProductController {
     }
 
 
-
-
-
     /**
      * 上传文件
      */
@@ -134,7 +154,7 @@ public class GoodsProductController {
             e.printStackTrace();
             return R.error("导入失败!");
         }
-        if (Objects.nonNull(goodsProductDtoList) && goodsProductDtoList.size()>0){
+        if (Objects.nonNull(goodsProductDtoList) && goodsProductDtoList.size() > 0) {
             for (GoodsProductDto goodsProductDto : goodsProductDtoList) {
                 Map<String, Object> valideDate = MapBeanUtil.fromObject(goodsProductDto);
                 ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
@@ -166,16 +186,273 @@ public class GoodsProductController {
         }
         try {
             goodsProductService.uploadExcel(goodsProductDtoList);
-        }catch(Exception e){
+        } catch (Exception e) {
             return R.error(e.getMessage());
         }
         //上传文件
         return R.ok();
     }
 
+    @RequestMapping("/generalGoodsImgUploadByZip")
+    @ResponseBody
+    public R batchAddImgByZip(@RequestParam("file") MultipartFile file) throws IOException {
+        //上传文件
+        batchAdd(file, 2);
+        return R.ok();
+    }
+
+
+    private Map<String, Object> batchAdd(MultipartFile file, int type) throws IOException {
+        /*
+         *创建临时文件夹
+         * 解压文件
+         */
+        String fileName = file.getOriginalFilename();
+        String path = "/data/project/img/";
+        File dir = new File(path);
+        dir.mkdirs();
+        String filePath = "/data/project/img2/";
+        File fileDir = new File(filePath);
+        fileDir.mkdirs();
+        File saveFile = new File(fileDir, fileName);//将压缩包解析到指定位置
+        List<String> list = new ArrayList<>();
+        try {
+            file.transferTo(saveFile);
+            String newFilePath = filePath + fileName;
+            File zipFile = new File(newFilePath);
+            unZipFiles(zipFile, path, list, type);//解压文件,获取文件路径
+
+            System.out.println(JSON.toJSONString(list));
+        } catch (Exception e) {
+            e.printStackTrace();
+
+            System.out.println("解压执行失败");
+            throw e;
+        }
+        //程序结束时,删除临时文件
+        deleteFiles(filePath);//删除压缩包文件夹
+        deleteFiles(path);//删除解压文件夹**
+
+        Map<String, Object> jsonMap = new HashMap<String, Object>();
+        jsonMap.put("ret", list);
+        return jsonMap;
+    }
+
+    public void unZipFiles(File srcFile, String destDirPath, List<String> list, int type) throws RuntimeException {
+        long start = System.currentTimeMillis();
+        // 判断源文件是否存在
+        if (!srcFile.exists()) {
+            throw new RuntimeException(srcFile.getPath() + "所指文件不存在");
+        }
+        // 开始解压
+        ZipFile zipFile = null;
+        List<PdProductImgDto> pdProductImgDtoList = new ArrayList<>();
+        try {
+            zipFile = new ZipFile(srcFile);
+            Enumeration<?> entries = zipFile.getEntries();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = (ZipEntry) entries.nextElement();
+                System.out.println("解压" + entry.getName());
+                // 如果是文件夹,就创建个文件夹
+                if (entry.isDirectory()) {
+                    String dirPath = destDirPath + "/" + entry.getName();
+                    File dir = new File(dirPath);
+                    dir.mkdirs();
+                } else {
+                    // 如果是文件,就先创建一个文件,然后用io流把内容copy过去
+                    File targetFile = new File(destDirPath + "/" + entry.getName());
+                    // 保证这个文件的父文件夹必须要存在
+
+                    if (!targetFile.getParentFile().exists()) {
+
+                    }
+                    targetFile.createNewFile();
+                    // 将压缩文件内容写入到这个文件中
+                    InputStream is = zipFile.getInputStream(entry);
+                    FileOutputStream fos = new FileOutputStream(targetFile);
+                    int len;
+                    byte[] buf = new byte[1024];
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                    }
+
+
+                    MultipartFile mulFileByPath = getMulFileByPath(destDirPath + "/" + entry.getName());
+                    //上传文件
+                    String url = FileManager.uploadToMinIO(mulFileByPath);
+                    list.add(url);
+                    if (type == 1) {
+                        String tmp = entry.getName();
+                        if (entry.getName().indexOf("/") > 0) {
+                            tmp = entry.getName().split("/")[1];
+                        }
+                        String fileName = tmp.split("\\.")[0];
+                        String[] split = fileName.split("_");
+                        String sku = split[0];
+                        String imgType = split[1];
+                        GoodsProductEntity entity = goodsProductService.queryBySku(sku);
+                        GoodsProductEntity upd = new GoodsProductEntity();
+                        upd.setMallGoodsProductSn(entity.getMallGoodsProductSn());
+                        PdProductImgDto tmpDto = new PdProductImgDto();
+                        if (imgType.equals("up")) {
+                            upd.setUpImg(url);
+                            tmpDto.setType(Dict.productImgType.item_11.getItem());
+                        } else if (imgType.equals("down")) {
+                            upd.setDownImg(url);
+                            tmpDto.setType(Dict.productImgType.item_12.getItem());
+                        } else if (imgType.equals("left")) {
+                            upd.setLeftImg(url);
+                            tmpDto.setType(Dict.productImgType.item_13.getItem());
+                        } else if (imgType.equals("right")) {
+                            upd.setRightImg(url);
+                            tmpDto.setType(Dict.productImgType.item_14.getItem());
+                        } else if (imgType.equals("before")) {
+                            upd.setBeforeImg(url);
+                            tmpDto.setType(Dict.productImgType.item_15.getItem());
+                        } else if (imgType.equals("after")) {
+                            upd.setAfterImg(url);
+                            tmpDto.setType(Dict.productImgType.item_16.getItem());
+                        }
+                        SysUserEntity userEntity = ShiroUtils.getUserEntity();
+                        String merchSn = userEntity.getMerchSn();
+                        tmpDto.setMerchSn(merchSn);
+                        tmpDto.setSku(sku);
+                        tmpDto.setImageUrl(url);
+                        pdProductImgDtoList.add(tmpDto);
+
+
+                        goodsProductService.update(upd);
+
+                    } else if (type == 2) {
+//                        String fileName = entry.getName().split("/")[1];
+                        String tmp = entry.getName();
+                        if (entry.getName().indexOf("/") > 0) {
+                            tmp = entry.getName().split("/")[1];
+                        }
+                        String fileName = tmp.split("\\.")[0];
+                        String[] split = fileName.split("_");
+                        String barCode = split[0];
+                        String imgType = split[1];
+                        GoodsProductEntity entity = goodsProductService.queryByBarcode(barCode);
+                        GoodsProductEntity upd = new GoodsProductEntity();
+                        upd.setMallGoodsProductSn(entity.getMallGoodsProductSn());
+                        if (imgType.equals("up")) {
+                            upd.setUpImg(url);
+                        } else if (imgType.equals("down")) {
+                            upd.setDownImg(url);
+                        } else if (imgType.equals("left")) {
+                            upd.setLeftImg(url);
+                        } else if (imgType.equals("right")) {
+                            upd.setRightImg(url);
+                        } else if (imgType.equals("before")) {
+                            upd.setBeforeImg(url);
+                        } else if (imgType.equals("after")) {
+                            upd.setAfterImg(url);
+                        }
+                        goodsProductService.update(upd);
+                    }
+
+                    //保存文件信息
+                    SysOssEntity ossEntity = new SysOssEntity();
+                    ossEntity.setUrl(url);
+                    ossEntity.setCreateDate(new Date());
+                    sysOssService.save(ossEntity);
+
+
+                    // 关流顺序,先打开的后关闭
+                    fos.close();
+                    is.close();
+                }
+            }
+            if (pdProductImgDtoList.size() > 0) {
+                String url = omsMerchProperties.getPdProductImgInsertOrUpdateUrl();
+                String jsonString = JSONObject.toJSONString(pdProductImgDtoList);
+                String post = OkHttpUtils.post(jsonString, url, "json", null);
+                    System.out.println(post);
+
+            }
+            long end = System.currentTimeMillis();
+            System.out.println("解压完成,耗时:" + (end - start) + " ms");
+        } catch (Exception e) {
+            throw new RuntimeException("unzip error from ZipUtils", e);
+        } finally {
+            if (zipFile != null) {
+                try {
+                    zipFile.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    private static MultipartFile getMulFileByPath(String picPath) {
+        FileItem fileItem = createFileItem(picPath);
+        MultipartFile mfile = new CommonsMultipartFile(fileItem);
+        return mfile;
+    }
 
+    private static FileItem createFileItem(String filePath) {
+        FileItemFactory factory = new DiskFileItemFactory(16, null);
+        String textFieldName = "textField";
+        int num = filePath.lastIndexOf(".");
+        int index1 = filePath.lastIndexOf("/");
+        String fileName = filePath.substring(index1 + 1, num);
+        String extFile = filePath.substring(num);
+        FileItem item = factory.createItem(textFieldName, "text/plain", true,
+                fileName + extFile);
+        File newfile = new File(filePath);
+        int bytesRead = 0;
+        byte[] buffer = new byte[8192];
+        try {
+            FileInputStream fis = new FileInputStream(newfile);
+            OutputStream os = item.getOutputStream();
+            while ((bytesRead = fis.read(buffer, 0, 8192))
+                    != -1) {
+                os.write(buffer, 0, bytesRead);
+            }
+            os.close();
+            fis.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return item;
+    }
+
+
+    public void deleteFiles(String filePath) {
+        File file = new File(filePath);
+        if ((!file.exists()) || (!file.isDirectory())) {
+            System.out.println("file not exist");
+            return;
+        }
+        String[] tempList = file.list();
+        File temp = null;
+        for (int i = 0; i < tempList.length; i++) {
+            if (filePath.endsWith(File.separator)) {
+                temp = new File(filePath + tempList[i]);
+            } else {
+                temp = new File(filePath + File.separator + tempList[i]);
+            }
+            if (temp.isFile()) {
+                temp.delete();
+            }
+            if (temp.isDirectory()) {
+                this.deleteFiles(filePath + "/" + tempList[i]);
+            }
+        }
+        // 空文件的删除
+        file.delete();
+    }
 
 
+    @RequestMapping("/generalGoodsImgUpload")
+    @ResponseBody
+    public R batchAddImg(@RequestParam("file") MultipartFile file) throws IOException {
+        //上传文件
+        batchAdd(file, 1);
+        return R.ok();
+    }
 
 
     /**
@@ -183,13 +460,12 @@ public class GoodsProductController {
      */
     @RequestMapping("/sendSelectProductByAdd")
     @ResponseBody
-    public R sendSelectProductByAdd(@RequestBody Integer[]mallGoodsProductSns) {
-        String result = goodsProductService.sendSelectProduct(mallGoodsProductSns,Dict.operateFlag.item_1.getItem());
+    public R sendSelectProductByAdd(@RequestBody Integer[] mallGoodsProductSns) {
+        String result = goodsProductService.sendSelectProduct(mallGoodsProductSns, Dict.operateFlag.item_1.getItem());
         return R.ok(result);
     }
 
 
-
     /**
      * sendAllProduct
      */
@@ -201,20 +477,17 @@ public class GoodsProductController {
     }
 
 
-
-
     /**
      * sendSelectProduct
      */
     @RequestMapping("/sendSelectProductByUpdate")
     @ResponseBody
-    public R sendSelectProductByUpdate(@RequestBody Integer[]mallGoodsProductSns) {
-        String result = goodsProductService.sendSelectProduct(mallGoodsProductSns,Dict.operateFlag.item_2.getItem());
+    public R sendSelectProductByUpdate(@RequestBody Integer[] mallGoodsProductSns) {
+        String result = goodsProductService.sendSelectProduct(mallGoodsProductSns, Dict.operateFlag.item_2.getItem());
         return R.ok(result);
     }
 
 
-
     /**
      * sendAllProduct
      */
@@ -226,10 +499,4 @@ public class GoodsProductController {
     }
 
 
-
-
-
-
-
-
 }

+ 4 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsProductDao.java

@@ -20,4 +20,8 @@ public interface GoodsProductDao extends BaseDao<GoodsProductEntity> {
                                       @Param("thirdMerchSn") String thirdMerchSn);
 
     List<GoodsProductEntity> selectByMallGoodsProductSns(@Param("mallGoodsProductSns") Integer[] mallGoodsProductSns);
+
+    GoodsProductEntity selectBySku(String sku);
+
+    GoodsProductEntity selectByBarcode(String barCode);
 }

+ 57 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/PdProductImgDto.java

@@ -0,0 +1,57 @@
+package com.kmall.admin.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class PdProductImgDto implements Serializable {
+
+    private String merchSn;
+
+    private String sku;
+
+    private String type;
+
+    private String imageUrl;
+
+    private Date upStreamUpdateTime;
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    public String getSku() {
+        return sku;
+    }
+
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public Date getUpStreamUpdateTime() {
+        return upStreamUpdateTime;
+    }
+
+    public void setUpStreamUpdateTime(Date upStreamUpdateTime) {
+        this.upStreamUpdateTime = upStreamUpdateTime;
+    }
+}

+ 124 - 27
kmall-admin/src/main/java/com/kmall/admin/entity/GoodsProductEntity.java

@@ -135,23 +135,23 @@ public class GoodsProductEntity implements Serializable {
      */
     private Date tstm;
     /**
-     * 
+     *
      */
     private String exField;
     /**
-     * 
+     *
      */
     private String exField2;
     /**
-     * 
+     *
      */
     private String exField3;
     /**
-     * 
+     *
      */
     private String exField4;
     /**
-     * 
+     *
      */
     private String exField5;
     /**
@@ -192,6 +192,65 @@ public class GoodsProductEntity implements Serializable {
 
     private String prodEname;
 
+    private String upImg;
+
+    private String downImg;
+
+    private String leftImg;
+
+    private String rightImg;
+
+    private String beforeImg;
+
+    private String afterImg;
+
+    public String getUpImg() {
+        return upImg;
+    }
+
+    public void setUpImg(String upImg) {
+        this.upImg = upImg;
+    }
+
+    public String getDownImg() {
+        return downImg;
+    }
+
+    public void setDownImg(String downImg) {
+        this.downImg = downImg;
+    }
+
+    public String getLeftImg() {
+        return leftImg;
+    }
+
+    public void setLeftImg(String leftImg) {
+        this.leftImg = leftImg;
+    }
+
+    public String getRightImg() {
+        return rightImg;
+    }
+
+    public void setRightImg(String rightImg) {
+        this.rightImg = rightImg;
+    }
+
+    public String getBeforeImg() {
+        return beforeImg;
+    }
+
+    public void setBeforeImg(String beforeImg) {
+        this.beforeImg = beforeImg;
+    }
+
+    public String getAfterImg() {
+        return afterImg;
+    }
+
+    public void setAfterImg(String afterImg) {
+        this.afterImg = afterImg;
+    }
 
     public String getProdRecordName() {
         return prodRecordName;
@@ -238,6 +297,7 @@ public class GoodsProductEntity implements Serializable {
     public Integer getMallGoodsProductSn() {
         return mallGoodsProductSn;
     }
+
     /**
      * 设置:商户编号
      */
@@ -251,6 +311,7 @@ public class GoodsProductEntity implements Serializable {
     public String getMerchSn() {
         return merchSn;
     }
+
     /**
      * 设置:第三方商户编号
      */
@@ -264,6 +325,7 @@ public class GoodsProductEntity implements Serializable {
     public String getThirdMerchSn() {
         return thirdMerchSn;
     }
+
     /**
      * 设置:产品条码
      */
@@ -277,6 +339,7 @@ public class GoodsProductEntity implements Serializable {
     public String getProdBarcode() {
         return prodBarcode;
     }
+
     /**
      * 设置:sku
      */
@@ -290,6 +353,7 @@ public class GoodsProductEntity implements Serializable {
     public String getSku() {
         return sku;
     }
+
     /**
      * 设置:海关商品编码
      */
@@ -303,6 +367,7 @@ public class GoodsProductEntity implements Serializable {
     public String getCusGoodsCode() {
         return cusGoodsCode;
     }
+
     /**
      * 设置:中文名称
      */
@@ -316,6 +381,7 @@ public class GoodsProductEntity implements Serializable {
     public String getProdName() {
         return prodName;
     }
+
     /**
      * 设置:国检规格型号
      */
@@ -329,6 +395,7 @@ public class GoodsProductEntity implements Serializable {
     public String getCiqProdModel() {
         return ciqProdModel;
     }
+
     /**
      * 设置:品牌
      */
@@ -342,6 +409,7 @@ public class GoodsProductEntity implements Serializable {
     public String getProdBrand() {
         return prodBrand;
     }
+
     /**
      * 设置:原产国代码,海关编码
      */
@@ -355,6 +423,7 @@ public class GoodsProductEntity implements Serializable {
     public String getOriCntCode() {
         return oriCntCode;
     }
+
     /**
      * 设置:计量单位代码,参见海关编码
      */
@@ -368,6 +437,7 @@ public class GoodsProductEntity implements Serializable {
     public String getUnitCode() {
         return unitCode;
     }
+
     /**
      * 设置:申报价格
      */
@@ -381,6 +451,7 @@ public class GoodsProductEntity implements Serializable {
     public BigDecimal getDeclPrice() {
         return declPrice;
     }
+
     /**
      * 设置:申报币种代码,参见海关编码
      */
@@ -394,6 +465,7 @@ public class GoodsProductEntity implements Serializable {
     public String getDeclCurrencyCode() {
         return declCurrencyCode;
     }
+
     /**
      * 设置:供应商企业名称,非必送
      */
@@ -407,6 +479,7 @@ public class GoodsProductEntity implements Serializable {
     public String getSupplierName() {
         return supplierName;
     }
+
     /**
      * 设置:供货商企业国别代码,非必送,海关编码
      */
@@ -420,6 +493,7 @@ public class GoodsProductEntity implements Serializable {
     public String getSupplierCntCode() {
         return supplierCntCode;
     }
+
     /**
      * 设置:生产企业名称
      */
@@ -433,6 +507,7 @@ public class GoodsProductEntity implements Serializable {
     public String getProdCompName() {
         return prodCompName;
     }
+
     /**
      * 设置:生产企业国别名称
      */
@@ -446,6 +521,7 @@ public class GoodsProductEntity implements Serializable {
     public String getProdCompCntCode() {
         return prodCompCntCode;
     }
+
     /**
      * 设置:主要成分
      */
@@ -459,19 +535,20 @@ public class GoodsProductEntity implements Serializable {
     public String getCiqMainEle() {
         return ciqMainEle;
     }
+
     /**
      * 设置:国检监管类别,
-             0101:3C目录内
-             0102:HS编码涉及3C但在3C目录外
-             0201:普通食品、化妆品及一般要求
-             0202:保健食品
-             0203:有检疫要求(含肉、含蛋、含乳等)的深加工食品
-             0204:备案管理的化妆品(婴幼儿化妆品除外)
-             0205:实施注册管理的进口婴幼儿乳粉、实施备案管理的进口婴幼儿化妆品
-             0206:其他有特殊检验检疫监管要求的食品
-             0301:一次性卫生用品
-             0401:医学微生物、人体组、生物制品、血液及其制品、环保微生物菌剂
-             9999:其他产品)
+     * 0101:3C目录内
+     * 0102:HS编码涉及3C但在3C目录外
+     * 0201:普通食品、化妆品及一般要求
+     * 0202:保健食品
+     * 0203:有检疫要求(含肉、含蛋、含乳等)的深加工食品
+     * 0204:备案管理的化妆品(婴幼儿化妆品除外)
+     * 0205:实施注册管理的进口婴幼儿乳粉、实施备案管理的进口婴幼儿化妆品
+     * 0206:其他有特殊检验检疫监管要求的食品
+     * 0301:一次性卫生用品
+     * 0401:医学微生物、人体组、生物制品、血液及其制品、环保微生物菌剂
+     * 9999:其他产品)
      */
     public void setCiqMonitorType(String ciqMonitorType) {
         this.ciqMonitorType = ciqMonitorType;
@@ -479,21 +556,22 @@ public class GoodsProductEntity implements Serializable {
 
     /**
      * 获取:国检监管类别,
-             0101:3C目录内
-             0102:HS编码涉及3C但在3C目录外
-             0201:普通食品、化妆品及一般要求
-             0202:保健食品
-             0203:有检疫要求(含肉、含蛋、含乳等)的深加工食品
-             0204:备案管理的化妆品(婴幼儿化妆品除外)
-             0205:实施注册管理的进口婴幼儿乳粉、实施备案管理的进口婴幼儿化妆品
-             0206:其他有特殊检验检疫监管要求的食品
-             0301:一次性卫生用品
-             0401:医学微生物、人体组、生物制品、血液及其制品、环保微生物菌剂
-             9999:其他产品)
+     * 0101:3C目录内
+     * 0102:HS编码涉及3C但在3C目录外
+     * 0201:普通食品、化妆品及一般要求
+     * 0202:保健食品
+     * 0203:有检疫要求(含肉、含蛋、含乳等)的深加工食品
+     * 0204:备案管理的化妆品(婴幼儿化妆品除外)
+     * 0205:实施注册管理的进口婴幼儿乳粉、实施备案管理的进口婴幼儿化妆品
+     * 0206:其他有特殊检验检疫监管要求的食品
+     * 0301:一次性卫生用品
+     * 0401:医学微生物、人体组、生物制品、血液及其制品、环保微生物菌剂
+     * 9999:其他产品)
      */
     public String getCiqMonitorType() {
         return ciqMonitorType;
     }
+
     /**
      * 设置:是否法检   0:否 1:是
      */
@@ -507,6 +585,7 @@ public class GoodsProductEntity implements Serializable {
     public String getIsLaw() {
         return isLaw;
     }
+
     /**
      * 设置:是否赠品 0:否 1:是
      */
@@ -520,6 +599,7 @@ public class GoodsProductEntity implements Serializable {
     public String getIsGift() {
         return isGift;
     }
+
     /**
      * 设置:海关申报要素,报统一版
      */
@@ -533,6 +613,7 @@ public class GoodsProductEntity implements Serializable {
     public String getCusDeclEle() {
         return cusDeclEle;
     }
+
     /**
      * 设置:创建人编号
      */
@@ -546,6 +627,7 @@ public class GoodsProductEntity implements Serializable {
     public String getCreaterSn() {
         return createrSn;
     }
+
     /**
      * 设置:创建时间,yyyy-MM-dd HH:mm:ss
      */
@@ -559,6 +641,7 @@ public class GoodsProductEntity implements Serializable {
     public Date getCreateTime() {
         return createTime;
     }
+
     /**
      * 设置:修改人编号
      */
@@ -572,6 +655,7 @@ public class GoodsProductEntity implements Serializable {
     public String getModerSn() {
         return moderSn;
     }
+
     /**
      * 设置:修改时间,yyyy-MM-dd HH:mm:ss
      */
@@ -585,6 +669,7 @@ public class GoodsProductEntity implements Serializable {
     public Date getModTime() {
         return modTime;
     }
+
     /**
      * 设置:时间戳
      */
@@ -598,6 +683,7 @@ public class GoodsProductEntity implements Serializable {
     public Date getTstm() {
         return tstm;
     }
+
     /**
      * 设置:
      */
@@ -611,6 +697,7 @@ public class GoodsProductEntity implements Serializable {
     public String getExField() {
         return exField;
     }
+
     /**
      * 设置:
      */
@@ -624,6 +711,7 @@ public class GoodsProductEntity implements Serializable {
     public String getExField2() {
         return exField2;
     }
+
     /**
      * 设置:
      */
@@ -637,6 +725,7 @@ public class GoodsProductEntity implements Serializable {
     public String getExField3() {
         return exField3;
     }
+
     /**
      * 设置:
      */
@@ -650,6 +739,7 @@ public class GoodsProductEntity implements Serializable {
     public String getExField4() {
         return exField4;
     }
+
     /**
      * 设置:
      */
@@ -663,6 +753,7 @@ public class GoodsProductEntity implements Serializable {
     public String getExField5() {
         return exField5;
     }
+
     /**
      * 设置:第一法定单位数量
      */
@@ -676,6 +767,7 @@ public class GoodsProductEntity implements Serializable {
     public BigDecimal getLegalUnit1Qty() {
         return legalUnit1Qty;
     }
+
     /**
      * 设置:净重,kg
      */
@@ -689,6 +781,7 @@ public class GoodsProductEntity implements Serializable {
     public BigDecimal getNetWeight() {
         return netWeight;
     }
+
     /**
      * 设置:第二法定单位数量
      */
@@ -702,6 +795,7 @@ public class GoodsProductEntity implements Serializable {
     public BigDecimal getLegalUnit2Qty() {
         return legalUnit2Qty;
     }
+
     /**
      * 设置:毛重,kg
      */
@@ -715,6 +809,7 @@ public class GoodsProductEntity implements Serializable {
     public BigDecimal getGrossWeight() {
         return grossWeight;
     }
+
     /**
      * 设置:园区账册编号
      */
@@ -728,6 +823,7 @@ public class GoodsProductEntity implements Serializable {
     public String getLocalEmsNo() {
         return localEmsNo;
     }
+
     /**
      * 设置:园区商品序号
      */
@@ -741,6 +837,7 @@ public class GoodsProductEntity implements Serializable {
     public String getItemRecordNo() {
         return itemRecordNo;
     }
+
     /**
      * 设置:账册分类代码
      */

+ 4 - 0
kmall-admin/src/main/java/com/kmall/admin/service/GoodsProductService.java

@@ -78,4 +78,8 @@ public interface GoodsProductService {
 
     String sendAllProduct(String operateFlag);
 
+    GoodsProductEntity queryBySku(String sku);
+
+    GoodsProductEntity queryByBarcode(String barCode);
+
 }

+ 10 - 3
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsProductServiceImpl.java

@@ -7,11 +7,9 @@ import com.kmall.admin.dto.GoodsProductDto;
 import com.kmall.admin.dto.PdProductDtoInfo;
 import com.kmall.admin.entity.GoodsProductEntity;
 import com.kmall.admin.service.GoodsProductService;
-import com.kmall.admin.utils.OkHttpUtils;
 import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.admin.utils.data.response.ResponseMessage;
 import com.kmall.admin.utils.oms.OmsSign;
-import com.kmall.common.constant.Dict;
 import com.kmall.common.utils.RRException;
 import com.kmall.manager.manager.merch.OmsMerchProperties;
 import okhttp3.Request;
@@ -23,7 +21,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.*;
 
@@ -225,6 +222,16 @@ public class GoodsProductServiceImpl implements GoodsProductService {
         return "请求失败,请联系管理员";
     }
 
+    @Override
+    public GoodsProductEntity queryBySku(String sku) {
+        return goodsProductDao.selectBySku(sku);
+    }
+
+    @Override
+    public GoodsProductEntity queryByBarcode(String barCode) {
+        return goodsProductDao.selectByBarcode(barCode);
+    }
+
 
     private ResponseMessage requestOmsProduct(List<GoodsProductDto> goodsProductDtoList){
         Map<String, String> sParaTemp = new TreeMap<String, String>();

+ 20 - 4
kmall-admin/src/main/java/com/kmall/admin/service/impl/mk/Mk2GoodsTopicPriceServiceImpl.java

@@ -15,10 +15,7 @@ import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.api.util.StockUtil;
 import com.kmall.common.constant.Dict;
-import com.kmall.common.utils.MapBeanUtil;
-import com.kmall.common.utils.R;
-import com.kmall.common.utils.RRException;
-import com.kmall.common.utils.ValidatorUtil;
+import com.kmall.common.utils.*;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -118,6 +115,25 @@ public class Mk2GoodsTopicPriceServiceImpl implements Mk2GoodsTopicPriceService
                 if (Integer.valueOf(r.get("code").toString()) != 0) {
                     throw new RRException(r.get("msg").toString());
                 }
+
+                // 校验活动时间
+                String topicBeginTime = storeTopicGoodsDto.getTopicBeginTime();
+                String topicEndTime = storeTopicGoodsDto.getTopicEndTime();
+                Date now = new Date();
+                Date topicBeginDate = DateUtils.convertStringToDate(topicBeginTime, DateUtils.DATE_TIME_PATTERN);
+                Date topicEndDate = DateUtils.convertStringToDate(topicEndTime, DateUtils.DATE_TIME_PATTERN);
+                // 活动开始时间不得小于当前时间
+                if (DateUtils.compareDate(topicBeginDate, now)) {
+                    String msg = String.format("表格数据第%s行校验失败,活动开始时间不得小于当前时间", i);
+                    throw new RRException(msg);
+                }
+                // 活动结束时间不得小于开始时间
+                if (DateUtils.compareDate(topicBeginDate, topicEndDate)) {
+                    String msg = String.format("表格数据第%s行校验失败,活动结束时间不得小于开始时间", i);
+                    throw new RRException(msg);
+                }
+
+
                 // 1.保存门店活动
                 if(storeTopicEntity == null){
                     storeTopicEntity = new StoreTopicEntity();

+ 164 - 8
kmall-admin/src/main/resources/mybatis/mapper/GoodsProductDao.xml

@@ -47,6 +47,12 @@
         <result property="itemRecordNo" column="item_record_no"/>
         <result property="emsClassCode" column="ems_class_code"/>
 		<result property="isSend" column="is_send"/>
+		<result property="upImg" column="up_img"/>
+		<result property="downImg" column="down_img"/>
+		<result property="leftImg" column="left_img"/>
+		<result property="rightImg" column="right_img"/>
+		<result property="beforeImg" column="before_img"/>
+		<result property="afterImg" column="after_img"/>
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.GoodsProductEntity">
@@ -93,7 +99,13 @@
 			`local_ems_no`,
 			`item_record_no`,
 			`is_send`,
-			`ems_class_code`
+			`ems_class_code`,
+			`up_img`,
+			`down_img`,
+			`left_img`,
+			`right_img`,
+			`before_img`,
+			`after_img`
 		from mall_goods_product
 		where mall_goods_product_sn = #{id}
 	</select>
@@ -142,7 +154,13 @@
     		`local_ems_no`,
     		`item_record_no`,
 			`is_send`,
-    		`ems_class_code`
+    		`ems_class_code`,
+			`up_img`,
+			`down_img`,
+			`left_img`,
+			`right_img`,
+			`before_img`,
+			`after_img`
 		from mall_goods_product
 		WHERE 1=1
 		<if test="name != null and name.trim() != ''">
@@ -212,7 +230,13 @@
 		`local_ems_no`,
 		`item_record_no`,
 		`is_send`,
-		`ems_class_code`
+		`ems_class_code`,
+		`up_img`,
+		`down_img`,
+		`left_img`,
+		`right_img`,
+		`before_img`,
+		`after_img`
 		from mall_goods_product
 		WHERE 1=1
 		<if test="sku != null and sku.trim() != ''">
@@ -269,7 +293,13 @@
 		`local_ems_no`,
 		`item_record_no`,
 		`is_send`,
-		`ems_class_code`
+		`ems_class_code`,
+		`up_img`,
+		`down_img`,
+		`left_img`,
+		`right_img`,
+		`before_img`,
+		`after_img`
 		from mall_goods_product
 		WHERE 1=1
 		<if test="mallGoodsProductSns != null">
@@ -280,6 +310,114 @@
 		</if>
 
 	</select>
+	<select id="selectBySku" resultType="com.kmall.admin.entity.GoodsProductEntity">
+		select
+			`mall_goods_product_sn`,
+			`merch_sn`,
+			`third_merch_sn`,
+			`prod_barcode`,
+			`sku`,
+			`cus_goods_code`,
+			`prod_name`,
+			`prod_ename`,
+			`prod_record_name`,
+			`prod_record_ename`,
+			`ciq_prod_model`,
+			`prod_brand`,
+			`ori_cnt_code`,
+			`unit_code`,
+			`decl_price`,
+			`decl_currency_code`,
+			`supplier_name`,
+			`supplier_cnt_code`,
+			`prod_comp_name`,
+			`prod_comp_cnt_code`,
+			`ciq_main_ele`,
+			`ciq_monitor_type`,
+			`is_law`,
+			`is_gift`,
+			`cus_decl_ele`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`,
+			`ex_field`,
+			`ex_field2`,
+			`ex_field3`,
+			`ex_field4`,
+			`ex_field5`,
+			`legal_unit1_qty`,
+			`net_weight`,
+			`legal_unit2_qty`,
+			`gross_weight`,
+			`local_ems_no`,
+			`item_record_no`,
+			`is_send`,
+			`ems_class_code`,
+			`up_img`,
+			`down_img`,
+			`left_img`,
+			`right_img`,
+			`before_img`,
+			`after_img`
+		from mall_goods_product
+		where sku = #{sku}
+	</select>
+	<select id="selectByBarcode" resultType="com.kmall.admin.entity.GoodsProductEntity">
+		select
+			`mall_goods_product_sn`,
+			`merch_sn`,
+			`third_merch_sn`,
+			`prod_barcode`,
+			`sku`,
+			`cus_goods_code`,
+			`prod_name`,
+			`prod_ename`,
+			`prod_record_name`,
+			`prod_record_ename`,
+			`ciq_prod_model`,
+			`prod_brand`,
+			`ori_cnt_code`,
+			`unit_code`,
+			`decl_price`,
+			`decl_currency_code`,
+			`supplier_name`,
+			`supplier_cnt_code`,
+			`prod_comp_name`,
+			`prod_comp_cnt_code`,
+			`ciq_main_ele`,
+			`ciq_monitor_type`,
+			`is_law`,
+			`is_gift`,
+			`cus_decl_ele`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`,
+			`ex_field`,
+			`ex_field2`,
+			`ex_field3`,
+			`ex_field4`,
+			`ex_field5`,
+			`legal_unit1_qty`,
+			`net_weight`,
+			`legal_unit2_qty`,
+			`gross_weight`,
+			`local_ems_no`,
+			`item_record_no`,
+			`is_send`,
+			`ems_class_code`,
+			`up_img`,
+			`down_img`,
+			`left_img`,
+			`right_img`,
+			`before_img`,
+			`after_img`
+		from mall_goods_product
+		where prod_barcode = #{barCode}
+	</select>
 
 	<insert id="save" parameterType="com.kmall.admin.entity.GoodsProductEntity">
 		insert into mall_goods_product(
@@ -325,7 +463,13 @@
 			`local_ems_no`,
 			`item_record_no`,
 			`is_send`,
-			`ems_class_code`)
+			`ems_class_code`,
+			`up_img`,
+			`down_img`,
+			`left_img`,
+			`right_img`,
+			`before_img`,
+			`after_img`)
 		values(
 			#{mallGoodsProductSn},
 			#{merchSn},
@@ -369,9 +513,15 @@
 			#{localEmsNo},
 			#{itemRecordNo},
 			'0',
-			#{emsClassCode})
+			#{emsClassCode},
+			#{upImg},
+			#{dowmImg},
+			#{leftImg},
+			#{rightImg},
+			#{beforeImg},
+			#{afterImg})
 	</insert>
-	 
+
 	<update id="update" parameterType="com.kmall.admin.entity.GoodsProductEntity">
 		update mall_goods_product 
 		<set>
@@ -416,7 +566,13 @@
 			<if test="localEmsNo != null">`local_ems_no` = #{localEmsNo}, </if>
 			<if test="itemRecordNo != null">`item_record_no` = #{itemRecordNo}, </if>
 			<if test="isSend != null">`is_send` = #{isSend}, </if>
-			<if test="emsClassCode != null">`ems_class_code` = #{emsClassCode}</if>
+			<if test="emsClassCode != null">`ems_class_code` = #{emsClassCode},</if>
+			<if test="upImg != null">`up_img` = #{upImg},</if>
+			<if test="downImg != null">`down_img` = #{downImg},</if>
+			<if test="leftImg != null">`left_img` = #{leftImg},</if>
+			<if test="rightImg != null">`right_img` = #{rightImg},</if>
+			<if test="beforeImg != null">`before_img` = #{beforeImg},</if>
+			<if test="afterImg != null">`after_img` = #{afterImg}</if>
 		</set>
 		where mall_goods_product_sn = #{mallGoodsProductSn}
 	</update>

+ 156 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsproduct.html

@@ -39,6 +39,24 @@
                 #if($shiro.hasPermission("goodsproduct:delete"))
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                 #end
+
+                <i-col style="display: inline-grid;">
+                    <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
+                            :on-progress="uploadExcelProgress"
+                            :format="['xls','xlsx','zip']"
+                            action="../goodsproduct/generalGoodsImgUpload">
+                        <i-button type="ghost" icon="ios-cloud-upload-outline">商品图片批量导入</i-button>
+                    </Upload>
+                </i-col>
+                <i-col style="display: inline-grid;">
+                    <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
+                            :on-progress="uploadExcelProgress"
+                            :format="['xls','xlsx','zip']"
+                            action="../goodsproduct/generalGoodsImgUploadByZip">
+                        <i-button type="ghost" icon="ios-cloud-upload-outline">商品图片(文件夹)批量导入</i-button>
+                    </Upload>
+                </i-col>
+
                 <i-col style="display: inline-grid;">
                     <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
                             :on-progress="uploadExcelProgress"
@@ -170,6 +188,144 @@
             <Form-item label="账册分类代码" prop="emsClassCode">
                 <i-input v-model="goodsProduct.emsClassCode" placeholder="账册分类代码"/>
             </Form-item>
+            <Row>
+                <i-col span="16">
+                    <Form-item label="上方图片" prop="upImg">
+                        <i-input v-model="goodsProduct.upImg" placeholder="上方图片" readonly/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
+                                max-size="100"
+                                :on-success="handleSuccessUpImg" :on-format-error="handleFormatError"
+                                :show-upload-list="false"
+                                :on-exceeded-size="handleMaxSize">
+                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
+                        </Upload>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <i-button icon="eye" @click="eyeImageUpImg">预览图片</i-button>
+                    </Form-item>
+                </i-col>
+            </Row>
+            <Row>
+                <i-col span="16">
+                    <Form-item label="下方图片" prop="downImg">
+                        <i-input v-model="goodsProduct.downImg" placeholder="下方图片" readonly/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
+                                max-size="100"
+                                :on-success="handleSuccessDownImg" :on-format-error="handleFormatError"
+                                :show-upload-list="false"
+                                :on-exceeded-size="handleMaxSize">
+                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
+                        </Upload>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <i-button icon="eye" @click="eyeImageDownImg">预览图片</i-button>
+                    </Form-item>
+                </i-col>
+            </Row>
+            <Row>
+                <i-col span="16">
+                    <Form-item label="左侧图片" prop="leftImg">
+                        <i-input v-model="goodsProduct.leftImg" placeholder="左侧图片" readonly/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
+                                max-size="100"
+                                :on-success="handleSuccessLeftImg" :on-format-error="handleFormatError"
+                                :show-upload-list="false"
+                                :on-exceeded-size="handleMaxSize">
+                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
+                        </Upload>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <i-button icon="eye" @click="eyeImageLeftImg">预览图片</i-button>
+                    </Form-item>
+                </i-col>
+            </Row>
+            <Row>
+                <i-col span="16">
+                    <Form-item label="右侧图片" prop="rightImg">
+                        <i-input v-model="goodsProduct.rightImg" placeholder="右侧图片" readonly/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
+                                max-size="100"
+                                :on-success="handleSuccessRightImg" :on-format-error="handleFormatError"
+                                :show-upload-list="false"
+                                :on-exceeded-size="handleMaxSize">
+                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
+                        </Upload>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <i-button icon="eye" @click="eyeImageRightImg">预览图片</i-button>
+                    </Form-item>
+                </i-col>
+            </Row>
+            <Row>
+                <i-col span="16">
+                    <Form-item label="前方图片" prop="beforeImg">
+                        <i-input v-model="goodsProduct.beforeImg" placeholder="前方图片" readonly/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
+                                max-size="100"
+                                :on-success="handleSuccessBeforeImg" :on-format-error="handleFormatError"
+                                :show-upload-list="false"
+                                :on-exceeded-size="handleMaxSize">
+                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
+                        </Upload>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <i-button icon="eye" @click="eyeImageBeforeImg">预览图片</i-button>
+                    </Form-item>
+                </i-col>
+            </Row>
+            <Row>
+                <i-col span="16">
+                    <Form-item label="后方图片" prop="afterImg">
+                        <i-input v-model="goodsProduct.afterImg" placeholder="后方图片" readonly/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
+                                max-size="100"
+                                :on-success="handleSuccessAfterImg" :on-format-error="handleFormatError"
+                                :show-upload-list="false"
+                                :on-exceeded-size="handleMaxSize">
+                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
+                        </Upload>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item :label-width="1">
+                        <i-button icon="eye" @click="eyeImageAfterImg">预览图片</i-button>
+                    </Form-item>
+                </i-col>
+            </Row>
             <Form-item>
                 <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                 <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>

+ 3 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/storetransferinventoryorder.html

@@ -25,7 +25,9 @@
                 <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                 <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-                <i-button type="info" @click="transfer"><i class="fa fa-plus"></i>&nbsp;库存转移</i-button>
+                <i-button type="info" @click="transfer"><i class="fa fa-car"></i>&nbsp;库存转移</i-button>
+                <i-button type="info" @click="enterTransferOut"><i class="fa fa-plus"></i>&nbsp;确认转出完成</i-button>
+                <i-button type="info" @click="enterTransferIn"><i class="fa fa-plus"></i>&nbsp;确认转入完成</i-button>
                 <i-col style="display: inline-grid;">
                     <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-format-error="uploadExcelFormatError"
                             :format="['xls','xlsx']"

+ 458 - 318
kmall-admin/src/main/webapp/js/shop/goodsproduct.js

@@ -1,333 +1,473 @@
 $(function () {
-	$("#jqGrid").jqGrid({
-		url: '../goodsproduct/list',
-		datatype: "json",
-		colModel: [
-			{label: 'mallGoodsProductSn', name: 'mallGoodsProductSn', index: 'mall_goods_product_sn', key: true, hidden: true},
-			{label: '商户编号', name: 'merchSn', index: 'merch_sn', width: 160},
-			{label: '第三方商户编号', name: 'thirdMerchSn', index: 'third_merch_sn', width: 160},
-			{label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 140},
-			{label: 'sku', name: 'sku', index: 'sku', width: 140},
-			{label: '海关商品编码', name: 'cusGoodsCode', index: 'cus_goods_code', width: 140},
-			{label: '中文名称', name: 'prodName', index: 'prod_name', width: 140},
-			{label: '英文名称', name: 'prodEname', index: 'prod_ename', width: 140},
-			{label: '中文备案名称', name: 'prodRecordName', index: 'prod_record_name', width: 140},
-			{label: '英文备案名称', name: 'prodRecordEname', index: 'prod_record_ename', width: 140},
-			{label: '国检规格型号', name: 'ciqProdModel', index: 'ciq_prod_model', width: 140},
-			{label: '品牌', name: 'prodBrand', index: 'prod_brand', width: 140},
-			{label: '原产国代码', name: 'oriCntCode', index: 'ori_cnt_code', width: 140},
-			{label: '计量单位代码', name: 'unitCode', index: 'unit_code', width: 140},
-			{label: '申报价格', name: 'declPrice', index: 'decl_price', width: 140},
-			{label: '申报币种代码', name: 'declCurrencyCode', index: 'decl_currency_code', width: 140},
-			{label: '供应商企业名称', name: 'supplierName', index: 'supplier_name', width: 140},
-			{label: '供货商企业国别代码', name: 'supplierCntCode', index: 'supplier_cnt_code', width: 140},
-			{label: '生产企业名称', name: 'prodCompName', index: 'prod_comp_name', width: 140},
-			{label: '生产企业国别名称', name: 'prodCompCntCode', index: 'prod_comp_cnt_code', width: 140},
-			{label: '主要成分', name: 'ciqMainEle', index: 'ciq_main_ele', width: 140},
-			{label: '国检监管类别', name: 'ciqMonitorType', index: 'ciq_monitor_type', width: 140},
-			{label: '是否法检', name: 'isLaw', index: 'is_law', width: 140,
-				formatter: function (value) {
-					if (value == '0') {
-						return '否';
-					} else if (value == '1') {
-						return '是';
-					}
-					return '';
-				}},
-			{label: '是否赠品', name: 'isGift', index: 'is_gift', width: 140,
-				formatter: function (value) {
-					if (value == '0') {
-						return '否';
-					} else if (value == '1') {
-						return '是';
-					}
-					return '';
-				}},
-			{label: '第一法定单位数量', name: 'legalUnit1Qty', index: 'legal_unit1_qty', width: 140},
-			{label: '净重,kg', name: 'netWeight', index: 'net_weight', width: 140},
-			{label: '第二法定单位数量', name: 'legalUnit2Qty', index: 'legal_unit2_qty', width: 140},
-			{label: '毛重,kg', name: 'grossWeight', index: 'gross_weight', width: 140},
-			{label: '园区账册编号', name: 'localEmsNo', index: 'local_ems_no', width: 140},
-			{label: '园区商品序号', name: 'itemRecordNo', index: 'item_record_no', width: 140},
-			{label: '账册分类代码', name: 'emsClassCode', index: 'ems_class_code', width: 140},
-			{label: '是否发送', name: 'isSend', index: 'is_send', width: 140,formatter: function (value) {
-					if (value == '0') {
-						return '未发送';
-					} else if (value == '1') {
-						return '发送成功';
-					} else if (value == '2') {
-						return '发送失败';
-					}
-					return '';
-				}},
-			{label: '海关申报要素', name: 'cusDeclEle', index: 'cus_decl_ele', width: 140},
-			{label: '创建人编号', name: 'createrSn', index: 'creater_sn', width: 140},
-			{label: '创建时间', name: 'createTime', index: 'create_time', width: 140,
-				formatter: function (value) {
-					return transDate(value, 'yyyy-MM-dd hh:mm:ss');
-				}},
-			{label: '修改人编号', name: 'moderSn', index: 'moder_sn', width: 140},
-			{label: '修改时间', name: 'modTime', index: 'mod_time', width: 140,
-				formatter: function (value) {
-					return transDate(value, 'yyyy-MM-dd hh:mm:ss');
-				}},
+    $("#jqGrid").jqGrid({
+        url: '../goodsproduct/list',
+        datatype: "json",
+        colModel: [
+            {
+                label: 'mallGoodsProductSn',
+                name: 'mallGoodsProductSn',
+                index: 'mall_goods_product_sn',
+                key: true,
+                hidden: true
+            },
+            {label: '商户编号', name: 'merchSn', index: 'merch_sn', width: 160},
+            {label: '第三方商户编号', name: 'thirdMerchSn', index: 'third_merch_sn', width: 160},
+            {label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 140},
+            {label: 'sku', name: 'sku', index: 'sku', width: 140},
+            {label: '海关商品编码', name: 'cusGoodsCode', index: 'cus_goods_code', width: 140},
+            {label: '中文名称', name: 'prodName', index: 'prod_name', width: 140},
+            {label: '英文名称', name: 'prodEname', index: 'prod_ename', width: 140},
+            {label: '中文备案名称', name: 'prodRecordName', index: 'prod_record_name', width: 140},
+            {label: '英文备案名称', name: 'prodRecordEname', index: 'prod_record_ename', width: 140},
+            {label: '国检规格型号', name: 'ciqProdModel', index: 'ciq_prod_model', width: 140},
+            {label: '品牌', name: 'prodBrand', index: 'prod_brand', width: 140},
+            {label: '原产国代码', name: 'oriCntCode', index: 'ori_cnt_code', width: 140},
+            {label: '计量单位代码', name: 'unitCode', index: 'unit_code', width: 140},
+            {label: '申报价格', name: 'declPrice', index: 'decl_price', width: 140},
+            {label: '申报币种代码', name: 'declCurrencyCode', index: 'decl_currency_code', width: 140},
+            {label: '供应商企业名称', name: 'supplierName', index: 'supplier_name', width: 140},
+            {label: '供货商企业国别代码', name: 'supplierCntCode', index: 'supplier_cnt_code', width: 140},
+            {label: '生产企业名称', name: 'prodCompName', index: 'prod_comp_name', width: 140},
+            {label: '生产企业国别名称', name: 'prodCompCntCode', index: 'prod_comp_cnt_code', width: 140},
+            {label: '主要成分', name: 'ciqMainEle', index: 'ciq_main_ele', width: 140},
+            {label: '国检监管类别', name: 'ciqMonitorType', index: 'ciq_monitor_type', width: 140},
+            {
+                label: '是否法检', name: 'isLaw', index: 'is_law', width: 140,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '否';
+                    } else if (value == '1') {
+                        return '是';
+                    }
+                    return '';
+                }
+            },
+            {
+                label: '是否赠品', name: 'isGift', index: 'is_gift', width: 140,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '否';
+                    } else if (value == '1') {
+                        return '是';
+                    }
+                    return '';
+                }
+            },
+            {label: '第一法定单位数量', name: 'legalUnit1Qty', index: 'legal_unit1_qty', width: 140},
+            {label: '净重,kg', name: 'netWeight', index: 'net_weight', width: 140},
+            {label: '第二法定单位数量', name: 'legalUnit2Qty', index: 'legal_unit2_qty', width: 140},
+            {label: '毛重,kg', name: 'grossWeight', index: 'gross_weight', width: 140},
+            {label: '园区账册编号', name: 'localEmsNo', index: 'local_ems_no', width: 140},
+            {label: '园区商品序号', name: 'itemRecordNo', index: 'item_record_no', width: 140},
+            {label: '账册分类代码', name: 'emsClassCode', index: 'ems_class_code', width: 140},
+            {
+                label: '是否发送', name: 'isSend', index: 'is_send', width: 140, formatter: function (value) {
+                    if (value == '0') {
+                        return '未发送';
+                    } else if (value == '1') {
+                        return '发送成功';
+                    } else if (value == '2') {
+                        return '发送失败';
+                    }
+                    return '';
+                }
+            },
+            {label: '海关申报要素', name: 'cusDeclEle', index: 'cus_decl_ele', width: 140},
+            {label: '创建人编号', name: 'createrSn', index: 'creater_sn', width: 140},
+            {
+                label: '创建时间', name: 'createTime', index: 'create_time', width: 140,
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }
+            },
+            {label: '修改人编号', name: 'moderSn', index: 'moder_sn', width: 140},
+            {
+                label: '修改时间', name: 'modTime', index: 'mod_time', width: 140,
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }
+            },
 
-		],
-		viewrecords: true,
-		height: 550,
-		rowNum: 10,
-		rowList: [10, 30, 50],
-		rownumbers: true,
-		rownumWidth: 25,
-		autowidth: true,
-		shrinkToFit: false,
-		autoScroll: true,   //开启水平滚动条
-		multiselect: true,
-		width: 1600,
-		pager: "#jqGridPager",
-		jsonReader: {
-			root: "page.list",
-			page: "page.currPage",
-			total: "page.totalPage",
-			records: "page.totalCount"
-		},
-		prmNames: {
-			page: "page",
-			rows: "limit",
-			order: "order"
-		},
-		gridComplete: function () {
-			$("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
-		}
-	});
+        ],
+        viewrecords: true,
+        height: 550,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        shrinkToFit: false,
+        autoScroll: true,   //开启水平滚动条
+        multiselect: true,
+        width: 1600,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
+        }
+    });
 });
 
 var exportMsg;
 
 let vm = new Vue({
-	el: '#rrapp',
-	data: {
-		showList: true,
-		title: null,
-		goodsProduct: {},
-		ruleValidate: {
-			name: [
-				{required: true, message: '名称不能为空', trigger: 'blur'}
-			]
-		},
-		q: {
-			name: ''
-		}
-	},
-	methods: {
-		query: function () {
-			vm.reload();
-		},
-		add: function () {
-			vm.showList = false;
-			vm.title = "新增";
-			vm.goodsProduct = {};
-		},
-		update: function (event) {
-			let mallGoodsProductSn = getSelectedRow();
-			if (mallGoodsProductSn == null) {
-				return;
-			}
-			vm.showList = false;
-			vm.title = "修改";
+    el: '#rrapp',
+    data: {
+        showList: true,
+        title: null,
+        goodsProduct: {},
+        ruleValidate: {
+            name: [
+                {required: true, message: '名称不能为空', trigger: 'blur'}
+            ]
+        },
+        q: {
+            name: ''
+        }
+    },
+    methods: {
+        query: function () {
+            vm.reload();
+        },
+        add: function () {
+            vm.showList = false;
+            vm.title = "新增";
+            vm.goodsProduct = {};
+        },
+        update: function (event) {
+            let mallGoodsProductSn = getSelectedRow();
+            if (mallGoodsProductSn == null) {
+                return;
+            }
+            vm.showList = false;
+            vm.title = "修改";
 
-			vm.getInfo(mallGoodsProductSn)
-		},
-		saveOrUpdate: function (event) {
-			let url = vm.goodsProduct.mallGoodsProductSn == null ? "../goodsproduct/save" : "../goodsproduct/update";
-			$.ajax({
-				type: "POST",
-				url: url,
-				contentType: "application/json",
-				data: JSON.stringify(vm.goodsProduct),
-				success: function (r) {
-					if (r.code === 0) {
-						alert('操作成功', function (index) {
-							vm.reload();
-						});
-					} else {
-						alert(r.msg);
-					}
-				}
-			});
-		},
-		del: function (event) {
-			let mallGoodsProductSns = getSelectedRows();
-			if (mallGoodsProductSns == null){
-				return;
-			}
+            vm.getInfo(mallGoodsProductSn)
+        },
+        saveOrUpdate: function (event) {
+            let url = vm.goodsProduct.mallGoodsProductSn == null ? "../goodsproduct/save" : "../goodsproduct/update";
+            $.ajax({
+                type: "POST",
+                url: url,
+                contentType: "application/json",
+                data: JSON.stringify(vm.goodsProduct),
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('操作成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+            });
+        },
+        del: function (event) {
+            let mallGoodsProductSns = getSelectedRows();
+            if (mallGoodsProductSns == null) {
+                return;
+            }
 
-			confirm('确定要删除选中的记录?', function () {
-				$.ajax({
-					type: "POST",
-					url: "../goodsproduct/delete",
-					contentType: "application/json",
-					data: JSON.stringify(mallGoodsProductSns),
-					success: function (r) {
-						if (r.code == 0) {
-							alert('操作成功', function (index) {
-								$("#jqGrid").trigger("reloadGrid");
-							});
-						} else {
-							alert(r.msg);
-						}
-					}
-				});
-			});
-		},
-		getInfo: function(mallGoodsProductSn){
-			$.get("../goodsproduct/info/"+mallGoodsProductSn, function (r) {
-				vm.goodsProduct = r.goodsProduct;
-			});
-		},
-		reloadSearch: function() {
-			vm.q = {
-				name: ''
-			}
-			vm.reload();
-		},
-		reload: function (event) {
-			vm.showList = true;
-			let page = $("#jqGrid").jqGrid('getGridParam', 'page');
-			$("#jqGrid").jqGrid('setGridParam', {
-				postData: {'name': vm.q.name},
-				page: page
-			}).trigger("reloadGrid");
-			vm.handleReset('formValidate');
-		},
-		handleSubmit: function (name) {
-			handleSubmitValidate(this, name, function () {
-				vm.saveOrUpdate()
-			});
-		},
-		handleReset: function (name) {
-			handleResetForm(this, name);
-		},
-		uploadExcelSuccess: function (data) {
-			// console.log(data);
-			if(data.code==0){
-				alert('导入成功', function (index) {
-					$("#jqGrid").trigger("reloadGrid");
-				});
-			}else{
-				alert(data.msg);
-			}
-			setTimeout(exportMsg, 100);
-		},
-		uploadExcelError: function () {
-			alert('上传出现异常,请重试!');
-			setTimeout(exportMsg, 100);
-		},
-		uploadExcelProgress:function(event, file, fileList){
-			console.log("上传中")
-			console.log(event)
-			console.log(file)
-			console.log(fileList)
-			console.log("上传中")
-			exportMsg = this.$Message.loading({
-				content: 'Loading...',
-				duration: 0
-			});
-			// setTimeout(msg, 3000);
-		},
-		uploadExcelFormatError: function (file) {
-			this.$Notice.warning({
-				title: '文件格式不正确',
-				desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
-			});
-			setTimeout(exportMsg, 100);
-		},
-		sendSelectProductByAdd: function (event) {
-			let mallGoodsProductSns = getSelectedRows();
-			if (mallGoodsProductSns == null){
-				return;
-			}
+            confirm('确定要删除选中的记录?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goodsproduct/delete",
+                    contentType: "application/json",
+                    data: JSON.stringify(mallGoodsProductSns),
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert('操作成功', function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        },
+        getInfo: function (mallGoodsProductSn) {
+            $.get("../goodsproduct/info/" + mallGoodsProductSn, function (r) {
+                vm.goodsProduct = r.goodsProduct;
+            });
+        },
+        reloadSearch: function () {
+            vm.q = {
+                name: ''
+            }
+            vm.reload();
+        },
+        reload: function (event) {
+            vm.showList = true;
+            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
+            $("#jqGrid").jqGrid('setGridParam', {
+                postData: {'name': vm.q.name},
+                page: page
+            }).trigger("reloadGrid");
+            vm.handleReset('formValidate');
+        },
+        handleSubmit: function (name) {
+            handleSubmitValidate(this, name, function () {
+                vm.saveOrUpdate()
+            });
+        },
+        handleReset: function (name) {
+            handleResetForm(this, name);
+        },
+        uploadExcelSuccess: function (data) {
+            // console.log(data);
+            if (data.code == 0) {
+                alert('导入成功', function (index) {
+                    $("#jqGrid").trigger("reloadGrid");
+                });
+            } else {
+                alert(data.msg);
+            }
+            setTimeout(exportMsg, 100);
+        },
+        uploadExcelError: function () {
+            alert('上传出现异常,请重试!');
+            setTimeout(exportMsg, 100);
+        },
+        uploadExcelProgress: function (event, file, fileList) {
+            console.log("上传中")
+            console.log(event)
+            console.log(file)
+            console.log(fileList)
+            console.log("上传中")
+            exportMsg = this.$Message.loading({
+                content: 'Loading...',
+                duration: 0
+            });
+            // setTimeout(msg, 3000);
+        },
+        handleFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 jpg 或 png 格式的图片。'
+            });
+        },
+        handleMaxSize: function (file) {
+            this.$Notice.warning({
+                title: '超出文件大小限制',
+                desc: '文件 ' + file.name + ' 太大,不能超过 100k。'
+            });
+        },
+        handleMaxSizeByInfo: function (file) {
+            this.$Notice.warning({
+                title: '超出文件大小限制',
+                desc: '文件 ' + file.name + ' 太大,不能超过 300k。'
+            });
+        },
+        uploadExcelFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
+            });
+            setTimeout(exportMsg, 100);
+        },
+        handleSuccessUpImg: function (res, file) {
+            if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
+                this.$Notice.warning({
+                    title: res.msg,
+                    desc: "无上传文件的权限,请联系管理员授权"
+                });
+            }
+            vm.goodsProduct.upImg = file.response.url;
+        },
+        handleSuccessDownImg: function (res, file) {
+            if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
+                this.$Notice.warning({
+                    title: res.msg,
+                    desc: "无上传文件的权限,请联系管理员授权"
+                });
+            }
+            vm.goodsProduct.downImg = file.response.url;
+        },
+        handleSuccessLeftImg: function (res, file) {
+            if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
+                this.$Notice.warning({
+                    title: res.msg,
+                    desc: "无上传文件的权限,请联系管理员授权"
+                });
+            }
+            vm.goodsProduct.leftImg = file.response.url;
+        },
+        handleSuccessRightImg: function (res, file) {
+            if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
+                this.$Notice.warning({
+                    title: res.msg,
+                    desc: "无上传文件的权限,请联系管理员授权"
+                });
+            }
+            vm.goodsProduct.rightImg = file.response.url;
+        },
+        handleSuccessBeforeImg: function (res, file) {
+            if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
+                this.$Notice.warning({
+                    title: res.msg,
+                    desc: "无上传文件的权限,请联系管理员授权"
+                });
+            }
+            vm.goodsProduct.beforeImg = file.response.url;
+        },
+        handleSuccessAfterImg: function (res, file) {
+            if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
+                this.$Notice.warning({
+                    title: res.msg,
+                    desc: "无上传文件的权限,请联系管理员授权"
+                });
+            }
+            vm.goodsProduct.afterImg = file.response.url;
+        },
+        eyeImageUpImg: function () {
+            var url = vm.goodsProduct.upImg
+            eyeImage(url);
+        },
+        eyeImageDownImg: function () {
+            var url = vm.goodsProduct.downImg
+            eyeImage(url);
+        },
+        eyeImageLeftImg: function () {
+            var url = vm.goodsProduct.leftImg
+            eyeImage(url);
+        },
+        eyeImageRightImg: function () {
+            var url = vm.goodsProduct.rightImg
+            eyeImage(url);
+        },
+        eyeImageBeforeImg: function () {
+            var url = vm.goodsProduct.beforeImg
+            eyeImage(url);
+        },
+        eyeImageAfterImg: function () {
+            var url = vm.goodsProduct.AfterImg
+            eyeImage(url);
+        },
+        eyeImage: function (e) {
+            eyeImage($(e.target).attr('src'));
+        },
+        eyeImageListVideoUrl: function (e) {
+            var url = vm.goods.videoUrl;
+            eyeVideo(url);
+        },
+        handleVideoFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 mp4 格式的图片。'
+            });
+        },
+        handleVideoMaxSize: function (file) {
+            this.$Notice.warning({
+                title: '超出文件大小限制',
+                desc: '文件 ' + file.name + ' 太大,不能超过 1M。'
+            });
+        },
+        handleSuccessListVideoUrl: function (res, file) {
+            if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
+                this.$Notice.warning({
+                    title: res.msg,
+                    desc: "无上传文件的权限,请联系管理员授权"
+                });
+            }
+            vm.goods.videoUrl = file.response.url;
+        },
+        sendSelectProductByAdd: function (event) {
+            let mallGoodsProductSns = getSelectedRows();
+            if (mallGoodsProductSns == null) {
+                return;
+            }
 
-			confirm('确定要发送选中的产品备案信息?', function () {
-				$.ajax({
-					type: "POST",
-					url: "../goodsproduct/sendSelectProductByAdd",
-					contentType: "application/json",
-					data: JSON.stringify(mallGoodsProductSns),
-					success: function (r) {
-						if (r.code == 0) {
-							alert(r.msg, function (index) {
-								$("#jqGrid").trigger("reloadGrid");
-							});
-						} else {
-							alert(r.msg);
-						}
-					}
-				});
-			});
-		},
-		sendAllProductByAdd: function (event) {
+            confirm('确定要发送选中的产品备案信息?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goodsproduct/sendSelectProductByAdd",
+                    contentType: "application/json",
+                    data: JSON.stringify(mallGoodsProductSns),
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert(r.msg, function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        },
+        sendAllProductByAdd: function (event) {
 
-			confirm('确定要发送所有的产品备案信息?', function () {
-				$.ajax({
-					type: "POST",
-					url: "../goodsproduct/sendAllProductByAdd",
-					contentType: "application/json",
-					success: function (r) {
-						if (r.code == 0) {
-							alert(r.msg, function (index) {
-								$("#jqGrid").trigger("reloadGrid");
-							});
-						} else {
-							alert(r.msg);
-						}
-					}
-				});
-			});
-		},
+            confirm('确定要发送所有的产品备案信息?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goodsproduct/sendAllProductByAdd",
+                    contentType: "application/json",
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert(r.msg, function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        },
 
-		sendSelectProductByUpdate: function (event) {
-			let mallGoodsProductSns = getSelectedRows();
-			if (mallGoodsProductSns == null){
-				return;
-			}
+        sendSelectProductByUpdate: function (event) {
+            let mallGoodsProductSns = getSelectedRows();
+            if (mallGoodsProductSns == null) {
+                return;
+            }
 
-			confirm('确定要发送选中的产品备案信息?', function () {
-				$.ajax({
-					type: "POST",
-					url: "../goodsproduct/sendSelectProductByUpdate",
-					contentType: "application/json",
-					data: JSON.stringify(mallGoodsProductSns),
-					success: function (r) {
-						if (r.code == 0) {
-							alert(r.msg, function (index) {
-								$("#jqGrid").trigger("reloadGrid");
-							});
-						} else {
-							alert(r.msg);
-						}
-					}
-				});
-			});
-		},
-		sendAllProductByUpdate: function (event) {
+            confirm('确定要发送选中的产品备案信息?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goodsproduct/sendSelectProductByUpdate",
+                    contentType: "application/json",
+                    data: JSON.stringify(mallGoodsProductSns),
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert(r.msg, function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        },
+        sendAllProductByUpdate: function (event) {
 
-			confirm('确定要发送所有的产品备案信息?', function () {
-				$.ajax({
-					type: "POST",
-					url: "../goodsproduct/sendAllProductByUpdate",
-					contentType: "application/json",
-					success: function (r) {
-						if (r.code == 0) {
-							alert(r.msg, function (index) {
-								$("#jqGrid").trigger("reloadGrid");
-							});
-						} else {
-							alert(r.msg);
-						}
-					}
-				});
-			});
-		}
-	}
+            confirm('确定要发送所有的产品备案信息?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goodsproduct/sendAllProductByUpdate",
+                    contentType: "application/json",
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert(r.msg, function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        }
+    }
 });

+ 3 - 3
kmall-admin/src/main/webapp/js/shop/storetransferinventoryorderdetail.js

@@ -9,13 +9,13 @@ $(function () {
 			{label: '转移商品数量', name: 'num', index: 'num', width: 80},
 			{label: '备注', name: 'remark', index: 'remark', width: 80},
 			{label: '创建人', name: 'createSn', index: 'create_sn', width: 80},
-			{label: '修改时间', name: 'modifyTime', index: 'modify_time', width: 80},
-			{label: '修改人', name: 'modifySn', index: 'modify_sn',formatter: function (val) {
+			{label: '修改时间', name: 'modifyTime', index: 'modify_time',formatter: function (val) {
 				if (!val || val <= 0) {
 					return "";
 				}
 				return dateFormat("YYYY-mm-dd HH:MM:SS", new Date(val));
-			}, width: 80}],
+			}, width: 80},
+			{label: '修改人', name: 'modifySn', index: 'modify_sn', width: 80}],
 		viewrecords: true,
         height: 550,
         rowNum: 10,

+ 37 - 0
kmall-common/src/main/java/com/kmall/common/constant/Dict.java

@@ -1773,5 +1773,42 @@ public class Dict {
         }
     }
 
+    /**
+     * 产品图片类型
+     */
+    public enum productImgType {
+        item_11("11", "产品备案图上方"),
+        item_12("12", "产品备案图下方"),
+        item_13("13", "产品备案图左侧"),
+        item_14("14", "产品备案图右侧"),
+        item_15("15", "产品备案图正面"),
+        item_16("16", "产品备案图反面");
+
+        private String item;
+        private String itemName;
+
+        productImgType(String item, String itemName) {
+            this.item = item;
+            this.itemName = itemName;
+        }
+
+        public String getItem() {
+            return item;
+        }
+
+        public void setItem(String item) {
+            this.item = item;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+
+    }
+
 
 }

+ 7 - 0
kmall-common/src/main/java/com/kmall/common/fileserver/minio/EOSSConfiguration.java

@@ -0,0 +1,7 @@
+package com.kmall.common.fileserver.minio;
+
+public class EOSSConfiguration {
+
+    public static final String uploadUrl = "http://127.0.0.1:9393/dev-api/upload";
+
+}

+ 34 - 0
kmall-common/src/main/java/com/kmall/common/fileserver/minio/FileInfo.java

@@ -0,0 +1,34 @@
+package com.kmall.common.fileserver.minio;
+
+public class FileInfo {
+
+    private String bucket;
+
+    private String fileName;
+
+    private String uri;
+
+    public String getBucket() {
+        return bucket;
+    }
+
+    public void setBucket(String bucket) {
+        this.bucket = bucket;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getUri() {
+        return uri;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+}

+ 50 - 0
kmall-common/src/main/java/com/kmall/common/fileserver/minio/MinIOUtils.java

@@ -0,0 +1,50 @@
+package com.kmall.common.fileserver.minio;
+
+import com.alibaba.fastjson.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.io.ByteArrayResource;
+import org.springframework.core.io.Resource;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsFileUploadSupport;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+public class MinIOUtils {
+
+    private static final Logger log = LoggerFactory.getLogger(MinIOUtils.class);
+
+    private static final RestTemplate restTemplate = new RestTemplate();
+
+    public static FileInfo upload(MultipartFile file) throws IOException {
+        String url = EOSSConfiguration.uploadUrl;
+        MediaType mediaType = MediaType.MULTIPART_FORM_DATA;
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(mediaType);
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        Resource resource = new ByteArrayResource(file.getBytes(),file.getName()) {
+            @Override
+            public String getFilename() {
+                return file.getOriginalFilename();
+            }
+        };
+        body.set("file", resource);
+        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(body, headers);
+        ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(url, httpEntity, String.class);
+        String responseBody = stringResponseEntity.getBody();
+        JSONObject result = JSONObject.parseObject(responseBody);
+        log.info("upload file result {}", result);
+        JSONObject dataJsonObject = result.getJSONObject("data");
+        FileInfo data = dataJsonObject.getJSONArray("rows").getObject(0,FileInfo.class);
+        return data;
+    }
+}

+ 20 - 0
kmall-common/src/main/java/com/kmall/common/fileserver/util/FileManager.java

@@ -2,6 +2,7 @@ package com.kmall.common.fileserver.util;
 
 import com.kmall.common.fileserver.common.NameValuePair;
 import com.kmall.common.fileserver.fastdfs.*;
+import com.kmall.common.fileserver.minio.MinIOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.Logger;
@@ -93,6 +94,25 @@ public class FileManager implements Serializable {
      * <strong>方法概要: 文件上传</strong> <br>
      * <strong>创建时间: 2016-9-26 上午10:26:11</strong> <br>
      *
+     * @param attach file
+     * @return fileAbsolutePath
+     * @author Wang Liang
+     */
+    public static String uploadToMinIO(MultipartFile attach) {
+        try {
+            return MinIOUtils.upload(attach).getUri();
+        } catch (IOException e) {
+            logger.error(e);
+            return "";
+        }
+    }
+
+
+
+    /**
+     * <strong>方法概要: 文件上传</strong> <br>
+     * <strong>创建时间: 2016-9-26 上午10:26:11</strong> <br>
+     *
      * @return fileAbsolutePath
      * @author Wang Liang
      */

+ 10 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/merch/OmsMerchProperties.java

@@ -35,6 +35,16 @@ public class OmsMerchProperties implements Serializable {
 
     private String sendTransferUrl;
 
+    private String pdProductImgInsertOrUpdateUrl;
+
+    public String getPdProductImgInsertOrUpdateUrl() {
+        return pdProductImgInsertOrUpdateUrl;
+    }
+
+    public void setPdProductImgInsertOrUpdateUrl(String pdProductImgInsertOrUpdateUrl) {
+        this.pdProductImgInsertOrUpdateUrl = pdProductImgInsertOrUpdateUrl;
+    }
+
     public String getAddPdProductListUrl() {
         return addPdProductListUrl;
     }

+ 8 - 2
kmall-manager/src/main/resources/conf/oms-merch.properties

@@ -24,7 +24,9 @@ merch.wxOrderResendUrl=http://8.135.102.238:8680/wx/wxOrderResendQueryAll
 ##oms\u6D4B\u8BD5\u73AF\u5883\u8DE8\u5883\u989D\u5EA6\u67E5\u8BE2\u63A5\u53E3
 #merch.quotaInquiryUrl=http://127.0.0.1:8680/al/cus/yearLimit
 #\u7533\u8BF7\u4EA7\u54C1\u5907\u6848\u63A5\u53E3(\u672C\u5730\u6D4B\u8BD5)
-#merch.addPdProductListUrl=http://127.0.0.1:8680/al/product/addPdProductList
+merch.addPdProductListUrl=http://127.0.0.1:8181/al/product/addPdProductList
+#\u7533\u8BF7\u4EA7\u54C1\u5907\u6848\u63A5\u53E3
+merch.pdProductImgInsertOrUpdateUrl=http://127.0.0.1:8181/pdProductImg/insertOrUpdateSkuImg
 
 
 ####oms\u751F\u4EA7\u73AF\u5883\u5BC6\u94A5
@@ -34,7 +36,9 @@ merch.livenessRecognitionUrl=http://ws.ds-bay.com/al/faceid/livenessRecognition
 ##oms\u6D4B\u8BD5\u73AF\u5883\u8DE8\u5883\u989D\u5EA6\u67E5\u8BE2\u63A5\u53E3
 merch.quotaInquiryUrl=http://ws.ds-bay.com/al/cus/yearLimit
 #\u7533\u8BF7\u4EA7\u54C1\u5907\u6848\u63A5\u53E3
-merch.addPdProductListUrl=http://ws.ds-bay.com/al/product/addPdProductList
+#merch.addPdProductListUrl=http://ws.ds-bay.com/al/product/addPdProductList
+#\u4EA7\u54C1\u5907\u6848\u56FE\u7247\u66F4\u65B0\u63A5\u53E3
+#merch.pdProductImgInsertOrUpdateUrl=http://ws.ds-bay.com/al/pdProductImg/insertOrUpdateSkuImg
 
 
 
@@ -47,3 +51,5 @@ merch.addPdProductListUrl=http://ws.ds-bay.com/al/product/addPdProductList
 #merch.quotaInquiryUrl=http://183.3.221.143:8680/al/cus/yearLimit
 #\u7533\u8BF7\u4EA7\u54C1\u5907\u6848\u63A5\u53E3
 #merch.addPdProductListUrl=http://183.3.221.143:8680/al/product/addPdProductList
+#\u4EA7\u54C1\u5907\u6848\u56FE\u7247\u66F4\u65B0\u63A5\u53E3
+#merch.pdProductImgInsertOrUpdateUrl=http://183.3.221.143:8680/al/pdProductImg/insertOrUpdateSkuImg

+ 1 - 0
kmall-manager/src/main/resources/spring/spring-oms-merch.xml

@@ -27,6 +27,7 @@
         <property name="queryOrderUrl" value="${merch.queryOrderUrl}"/>
         <property name="queryInveResponseUrl" value="${merch.queryInveResponseUrl}"/>
         <property name="addPdProductListUrl" value="${merch.addPdProductListUrl}"/>
+        <property name="pdProductImgInsertOrUpdateUrl" value="${merch.pdProductImgInsertOrUpdateUrl}"/>
         <property name="sendTransferUrl" value="${merch.sendTransferUrl}"/>
     </bean>
 </beans>