Explorar o código

Merge branch 'developer' into developerB

plf %!s(int64=3) %!d(string=hai) anos
pai
achega
6cd1a253a8
Modificáronse 40 ficheiros con 2773 adicións e 47 borrados
  1. 9 1
      pom.xml
  2. 29 0
      src/main/java/com/caimei/modules/archive/dao/CmProductArchiveContentDao.java
  3. 21 0
      src/main/java/com/caimei/modules/archive/dao/CmProductArchiveDao.java
  4. 112 0
      src/main/java/com/caimei/modules/archive/entity/CmProductArchive.java
  5. 84 0
      src/main/java/com/caimei/modules/archive/entity/CmProductArchiveContent.java
  6. 70 0
      src/main/java/com/caimei/modules/archive/entity/CmProductArchiveFile.java
  7. 2 1
      src/main/java/com/caimei/modules/archive/service/CmOrderArchiveService.java
  8. 159 0
      src/main/java/com/caimei/modules/archive/service/CmProductArchiveContentService.java
  9. 109 0
      src/main/java/com/caimei/modules/archive/service/CmProductArchiveService.java
  10. 5 1
      src/main/java/com/caimei/modules/archive/utils/OssArchiveUtil.java
  11. 99 0
      src/main/java/com/caimei/modules/archive/web/CmProductArchiveContentController.java
  12. 86 0
      src/main/java/com/caimei/modules/archive/web/CmProductArchiveController.java
  13. 8 0
      src/main/java/com/caimei/modules/coupon/dao/CmCouponClubDao.java
  14. 18 0
      src/main/java/com/caimei/modules/order/entity/CmMainReceiptExport.java
  15. 38 8
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  16. 12 5
      src/main/java/com/caimei/modules/order/web/CmDiscernReceiptController.java
  17. 13 1
      src/main/java/com/caimei/modules/user/service/NewCmShopService.java
  18. 3 0
      src/main/resources/config/beta/caimei.properties
  19. 4 0
      src/main/resources/config/dev/caimei.properties
  20. BIN=BIN
      src/main/resources/export/discern_receipt_export.xls
  21. 107 0
      src/main/resources/mappings/modules/archive/CmProductArchiveContentMapper.xml
  22. 163 0
      src/main/resources/mappings/modules/archive/CmProductArchiveMapper.xml
  23. 20 0
      src/main/resources/mappings/modules/coupon/CmCouponClubMapper.xml
  24. 1 0
      src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml
  25. 280 0
      src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp
  26. 280 0
      src/main/webapp/WEB-INF/views/modules/archive/addVideoForm.jsp
  27. 125 0
      src/main/webapp/WEB-INF/views/modules/archive/archiveAddProduct.jsp
  28. 12 1
      src/main/webapp/WEB-INF/views/modules/archive/cmOrderArchiveFileList.jsp
  29. 14 2
      src/main/webapp/WEB-INF/views/modules/archive/cmOrderArchiveForm.jsp
  30. 302 0
      src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentForm.jsp
  31. 125 0
      src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentList.jsp
  32. 306 0
      src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveForm.jsp
  33. 116 0
      src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveList.jsp
  34. 3 3
      src/main/webapp/WEB-INF/views/modules/cmpage/cmPageBeautyForm.jsp
  35. 17 17
      src/main/webapp/WEB-INF/views/modules/newhome/beautyFloorContentForm.jsp
  36. 3 3
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp
  37. 3 0
      src/main/webapp/WEB-INF/views/modules/order/orderForm.jsp
  38. 4 2
      src/main/webapp/WEB-INF/views/modules/product/cmSecondHandDetailForm.jsp
  39. 4 0
      src/main/webapp/WEB-INF/views/modules/user/cmUserbeanshistoryList.jsp
  40. 7 2
      src/main/webapp/static/modules/bulkpurchase/orderForm.js

+ 9 - 1
pom.xml

@@ -665,7 +665,7 @@
 			<version>1.0</version>
 		</dependency>-->
 
-    </dependencies>
+	</dependencies>
 
 	<build>
 		<finalName>manager</finalName>
@@ -910,6 +910,14 @@
 				<artifactId>maven-dependency-plugin</artifactId>
 				<version>2.5.1</version>
 			</plugin>
+
+
+			<plugin>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<argLine> -XX:-UseSplitVerifier</argLine>
+				</configuration>
+			</plugin>
 		</plugins>
 	</build>
 

+ 29 - 0
src/main/java/com/caimei/modules/archive/dao/CmProductArchiveContentDao.java

@@ -0,0 +1,29 @@
+package com.caimei.modules.archive.dao;
+
+import com.caimei.modules.archive.entity.CmOrderArchiveFile;
+import com.caimei.modules.archive.entity.CmProductArchiveFile;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.archive.entity.CmProductArchiveContent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 商品资料内容DAO接口
+ * @author Aslee
+ * @version 2021-09-06
+ */
+@MyBatisDao
+public interface CmProductArchiveContentDao extends CrudDao<CmProductArchiveContent> {
+
+    List<CmProductArchiveFile> getImageList(String id);
+
+    void deleteFile(String archiveContentId);
+
+    void insertFile(CmProductArchiveFile file);
+
+    void updateFile(@Param("fileId") Integer fileId, @Param("archiveContentId") Integer archiveContentId);
+
+    Integer getDbFileId(String id);
+}

+ 21 - 0
src/main/java/com/caimei/modules/archive/dao/CmProductArchiveDao.java

@@ -0,0 +1,21 @@
+package com.caimei.modules.archive.dao;
+
+import com.caimei.modules.product.entity.Product;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.archive.entity.CmProductArchive;
+
+import java.util.List;
+
+/**
+ * 商品资料DAO接口
+ * @author Aslee
+ * @version 2021-09-03
+ */
+@MyBatisDao
+public interface CmProductArchiveDao extends CrudDao<CmProductArchive> {
+
+    List<Integer> findArchiveProductId();
+
+    List<Product> findAllProduct(Product product);
+}

+ 112 - 0
src/main/java/com/caimei/modules/archive/entity/CmProductArchive.java

@@ -0,0 +1,112 @@
+package com.caimei.modules.archive.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 商品资料Entity
+ * @author Aslee
+ * @version 2021-09-03
+ */
+public class CmProductArchive extends DataEntity<CmProductArchive> {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer productId;		// 商品id
+	private String productName;		// 商品名称
+	private String shopName;		// 供应商名称
+	private String productImage;		// 商品图片
+	private Integer archiveLevel;		// 资料等级:1一类资料,2二类资料,3三类资料
+	private Integer productType;		// 商品属性:1产品,2仪器
+	private Integer productClassify;		// 商品分类:1生美,2医美
+	private Date addTime;		// 添加时间
+
+
+	private Integer existProductType;	//商品库商品是否有设置商品属性:0没有,1有
+	
+	public CmProductArchive() {
+		super();
+	}
+
+	public CmProductArchive(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=50, message="商品名称长度必须介于 0 和 50 之间")
+	public String getProductName() {
+		return productName;
+	}
+
+	public void setProductName(String productName) {
+		this.productName = productName;
+	}
+	
+	@Length(min=0, max=50, message="供应商名称长度必须介于 0 和 50 之间")
+	public String getShopName() {
+		return shopName;
+	}
+
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+	
+	@Length(min=0, max=300, message="商品图片长度必须介于 0 和 300 之间")
+	public String getProductImage() {
+		return productImage;
+	}
+
+	public void setProductImage(String productImage) {
+		this.productImage = productImage;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getAddTime() {
+		return addTime;
+	}
+
+	public void setAddTime(Date addTime) {
+		this.addTime = addTime;
+	}
+
+	public Integer getProductId() {
+		return productId;
+	}
+
+	public void setProductId(Integer productId) {
+		this.productId = productId;
+	}
+
+	public Integer getArchiveLevel() {
+		return archiveLevel;
+	}
+
+	public void setArchiveLevel(Integer archiveLevel) {
+		this.archiveLevel = archiveLevel;
+	}
+
+	public Integer getProductType() {
+		return productType;
+	}
+
+	public void setProductType(Integer productType) {
+		this.productType = productType;
+	}
+
+	public Integer getProductClassify() {
+		return productClassify;
+	}
+
+	public void setProductClassify(Integer productClassify) {
+		this.productClassify = productClassify;
+	}
+
+	public Integer getExistProductType() {
+		return existProductType;
+	}
+
+	public void setExistProductType(Integer existProductType) {
+		this.existProductType = existProductType;
+	}
+}

+ 84 - 0
src/main/java/com/caimei/modules/archive/entity/CmProductArchiveContent.java

@@ -0,0 +1,84 @@
+package com.caimei.modules.archive.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 商品资料内容Entity
+ * @author Aslee
+ * @version 2021-09-06
+ */
+public class CmProductArchiveContent extends DataEntity<CmProductArchiveContent> {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer productArchiveId;		// 商品资料库id
+	private String title;		// 资料标题
+	private Integer type;		// 资料类型:1图片资料,2视频资料,3文件资料
+	private Date addTime;		// 添加时间
+
+	private List<CmProductArchiveFile> fileList;	//图片列表
+    private Integer fileId;                 //上传的文件id
+
+	public CmProductArchiveContent() {
+		super();
+	}
+
+	public CmProductArchiveContent(String id){
+		super(id);
+	}
+
+	public Integer getProductArchiveId() {
+		return productArchiveId;
+	}
+
+	public void setProductArchiveId(Integer productArchiveId) {
+		this.productArchiveId = productArchiveId;
+	}
+	
+	@Length(min=0, max=50, message="资料标题长度必须介于 0 和 50 之间")
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getAddTime() {
+		return addTime;
+	}
+
+	public void setAddTime(Date addTime) {
+		this.addTime = addTime;
+	}
+
+    public Integer getFileId() {
+        return fileId;
+    }
+
+    public void setFileId(Integer fileId) {
+        this.fileId = fileId;
+    }
+
+	public List<CmProductArchiveFile> getFileList() {
+		return fileList;
+	}
+
+	public void setFileList(List<CmProductArchiveFile> fileList) {
+		this.fileList = fileList;
+	}
+}

+ 70 - 0
src/main/java/com/caimei/modules/archive/entity/CmProductArchiveFile.java

@@ -0,0 +1,70 @@
+package com.caimei.modules.archive.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import org.hibernate.validator.constraints.Length;
+
+import java.util.Date;
+
+/**
+ * 商品资料图片Entity
+ * @author Aslee
+ * @version 2021-09-06
+ */
+public class CmProductArchiveFile extends DataEntity<CmProductArchiveFile> {
+
+	private static final long serialVersionUID = 1L;
+	private Integer archiveContentId;		// 资料库内容id
+	private String fileName;		// 文件名称
+	private String ossName;		// oss名称
+	private String ossUrl;		// oss链接
+	private Date uploadTime;		// 上传时间
+
+	public CmProductArchiveFile() {
+		super();
+	}
+
+	public CmProductArchiveFile(String id){
+		super(id);
+	}
+
+	public Integer getArchiveContentId() {
+		return archiveContentId;
+	}
+
+	public void setArchiveContentId(Integer archiveContentId) {
+		this.archiveContentId = archiveContentId;
+	}
+
+	public String getFileName() {
+		return fileName;
+	}
+
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+
+	public String getOssName() {
+		return ossName;
+	}
+
+	public void setOssName(String ossName) {
+		this.ossName = ossName;
+	}
+
+	public String getOssUrl() {
+		return ossUrl;
+	}
+
+	public void setOssUrl(String ossUrl) {
+		this.ossUrl = ossUrl;
+	}
+
+	public Date getUploadTime() {
+		return uploadTime;
+	}
+
+	public void setUploadTime(Date uploadTime) {
+		this.uploadTime = uploadTime;
+	}
+}

+ 2 - 1
src/main/java/com/caimei/modules/archive/service/CmOrderArchiveService.java

@@ -107,8 +107,9 @@ public class CmOrderArchiveService extends CrudService<CmOrderArchiveDao, CmOrde
             //保存本地
             File file = OssArchiveUtil.ossUpload(multipartFile);
             logger.info("默认路径>>>" + file.getAbsolutePath());
+            String contentDispositon = "pdf".equals(fileType) ? "inline" : "attachment";
             //上传oss
-            String url = OssArchiveUtil.ossUpload(filePath, "archiveFile/", file, contentType);
+            String url = OssArchiveUtil.ossUpload(filePath, "archiveFile/", file, contentType, contentDispositon);
             //删除本地文件
             OssArchiveUtil.deleteFile(file);
             //保存关联关系

+ 159 - 0
src/main/java/com/caimei/modules/archive/service/CmProductArchiveContentService.java

@@ -0,0 +1,159 @@
+package com.caimei.modules.archive.service;
+
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.net.URL;
+import java.util.*;
+import java.util.List;
+
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.archive.entity.CmProductArchiveFile;
+import com.caimei.modules.archive.utils.OssArchiveUtil;
+import com.caimei.modules.common.utils.UploadUtils;
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.caimei.modules.archive.entity.CmProductArchiveContent;
+import com.caimei.modules.archive.dao.CmProductArchiveContentDao;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.imageio.ImageIO;
+
+/**
+ * 商品资料内容Service
+ * @author Aslee
+ * @version 2021-09-06
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmProductArchiveContentService extends CrudService<CmProductArchiveContentDao, CmProductArchiveContent> {
+    @Resource
+    CmProductArchiveContentDao cmProductArchiveContentDao;
+
+	public CmProductArchiveContent get(String id) {
+		return super.get(id);
+	}
+
+	private final String htmlTempPath = Global.getConfig("archive.htmlTempPath");
+
+	public List<CmProductArchiveContent> findList(CmProductArchiveContent cmProductArchiveContent) {
+		return super.findList(cmProductArchiveContent);
+	}
+	
+	public Page<CmProductArchiveContent> findPage(Page<CmProductArchiveContent> page, CmProductArchiveContent cmProductArchiveContent) {
+		return super.findPage(page, cmProductArchiveContent);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CmProductArchiveContent cmProductArchiveContent) {
+		super.save(cmProductArchiveContent);
+		if (1 == cmProductArchiveContent.getType()) {
+			cmProductArchiveContentDao.deleteFile(cmProductArchiveContent.getId());
+			//保存图片
+			List<CmProductArchiveFile> imageList = cmProductArchiveContent.getFileList();
+			//上传图片
+			imageList.forEach(image -> {
+				if (StringUtils.isNotEmpty(image.getOssUrl())) {
+					if (!image.getOssUrl().startsWith("http")) {
+                        String imageUrl = getImageUrl(image.getOssUrl());
+						try {
+							//获取图片的size
+							BufferedImage buffImg = ImageIO.read(new URL(imageUrl));
+							imageUrl += "?width=" + buffImg.getWidth() + "&height=" + buffImg.getHeight();
+						} catch (IOException e) {
+							e.printStackTrace();
+						}
+						image.setOssUrl(imageUrl);
+					}
+					image.setArchiveContentId(Integer.parseInt(cmProductArchiveContent.getId()));
+					cmProductArchiveContentDao.insertFile(image);
+				}
+			});
+		} else {
+			// 更新文件的archiveContentId
+			Integer fileId = cmProductArchiveContent.getFileId();
+			Integer dbFileId = cmProductArchiveContentDao.getDbFileId(cmProductArchiveContent.getId());
+			if (null != fileId && !fileId.equals(dbFileId)) {
+				cmProductArchiveContentDao.deleteFile(cmProductArchiveContent.getId());
+				cmProductArchiveContentDao.updateFile(fileId, Integer.valueOf(cmProductArchiveContent.getId()));
+			}
+		}
+
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CmProductArchiveContent cmProductArchiveContent) {
+		super.delete(cmProductArchiveContent);
+	}
+
+    public List<CmProductArchiveFile> getImageList(String id) {
+        return cmProductArchiveContentDao.getImageList(id);
+    }
+
+	/**
+	 * 获取商品图片服务器全路径
+	 *
+	 * @param imageUrl
+	 * @return
+	 */
+	public String getImageUrl(String imageUrl) {
+		String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+		ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
+		if (StringUtils.isNotBlank(imageUrl) && !imageUrl.startsWith("http:") && !imageUrl.startsWith("https:")) {
+			imageUrl = Encodes.urlDecode(imageUrl);
+			String realPath = UploadImageUtils.getAbsolutePath(imageUrl);
+			int pointerIndex = realPath.lastIndexOf(".");
+			try {
+				saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex, realPath);
+				imageUrl = photoServer + saveImageSerivce.getSource();
+			} catch (Exception e) {
+				logger.error("图片上传错误:" + e.toString(), e);
+			}
+		}
+		return imageUrl;
+	}
+
+    @Transactional(readOnly = false)
+    public Map<String, Object> upload(MultipartFile multipartFile, String fileName) {
+        Map<String, Object> map = new HashMap<>();
+        String fileAllName = multipartFile.getOriginalFilename();
+        String fileType = fileAllName.substring(fileAllName.lastIndexOf(".") + 1);
+		String fileShortName = fileAllName.substring(0, fileAllName.lastIndexOf("."));
+        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
+        String filePath = uuid + "." + fileType;
+        String contentType = OssArchiveUtil.getContentType(fileAllName);
+        try {
+            //保存本地
+            File file = OssArchiveUtil.ossUpload(multipartFile);
+			logger.info("默认路径>>>" + file.getAbsolutePath());
+			String contentDispositon = "pdf".equals(fileType) ? "inline" : "attachment";
+			//上传oss
+			String url = OssArchiveUtil.ossUpload(filePath, "archiveFile/", file, contentType, contentDispositon);
+			//删除本地文件
+			OssArchiveUtil.deleteFile(file);
+            //保存关联关系
+            CmProductArchiveFile archiveFile = new CmProductArchiveFile();
+            archiveFile.setFileName(fileName);
+            archiveFile.setOssName(filePath);
+            archiveFile.setOssUrl(url);
+            archiveFile.setUploadTime(new Date());
+            cmProductArchiveContentDao.insertFile(archiveFile);
+            map.put("success", true);
+            map.put("msg", "操作成功");
+            map.put("archiveFile", archiveFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+            map.put("success", false);
+            map.put("msg", "操作失败");
+            logger.info("上传异常!!!");
+        }
+        return map;
+    }
+}

+ 109 - 0
src/main/java/com/caimei/modules/archive/service/CmProductArchiveService.java

@@ -0,0 +1,109 @@
+package com.caimei.modules.archive.service;
+
+import java.util.Date;
+import java.util.List;
+
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.modules.product.entity.Product;
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import com.caimei.utils.AppUtils;
+import com.caimei.utils.StringUtil;
+import com.caimei.utils.StringUtils;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.caimei.modules.archive.entity.CmProductArchive;
+import com.caimei.modules.archive.dao.CmProductArchiveDao;
+
+import javax.annotation.Resource;
+
+/**
+ * 商品资料Service
+ * @author Aslee
+ * @version 2021-09-03
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmProductArchiveService extends CrudService<CmProductArchiveDao, CmProductArchive> {
+	@Resource
+	private CmProductArchiveDao cmProductArchiveDao;
+
+	public CmProductArchive get(String id) {
+		CmProductArchive cmProductArchive = super.get(id);
+		String wwwServer = Global.getConfig("wwwServer");
+		if (null != cmProductArchive.getProductId() && StringUtil.isNotBlank(cmProductArchive.getProductImage())) {
+			cmProductArchive.setProductImage(AppUtils.getImageURL("product", cmProductArchive.getProductImage(), 0, wwwServer));
+		}
+		return cmProductArchive;
+	}
+	
+	public List<CmProductArchive> findList(CmProductArchive cmProductArchive) {
+		return super.findList(cmProductArchive);
+	}
+	
+	public Page<CmProductArchive> findPage(Page<CmProductArchive> page, CmProductArchive cmProductArchive) {
+		Page<CmProductArchive> archivePage = super.findPage(page, cmProductArchive);
+		String wwwServer = Global.getConfig("wwwServer");
+		archivePage.getList().forEach(item -> {
+			if (null != item.getProductId() && StringUtils.isNotEmpty(item.getProductImage())) {
+				item.setProductImage(AppUtils.getImageURL("product", item.getProductImage(), 0, wwwServer));
+			}
+		});
+		return archivePage;
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CmProductArchive cmProductArchive) {
+		if (cmProductArchive.getIsNewRecord()) {
+			cmProductArchive.setAddTime(new Date());
+		}
+		if (null != cmProductArchive.getProductId()) {
+			cmProductArchive.setProductName(null);
+			cmProductArchive.setProductImage(null);
+			cmProductArchive.setShopName(null);
+		}
+		if (null == cmProductArchive.getProductId()) {
+			String productImage = cmProductArchive.getProductImage();
+			if(com.thinkgem.jeesite.common.utils.StringUtils.isNotBlank(productImage) && !productImage.startsWith("http")){
+				String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+				productImage= Encodes.urlDecode(productImage);
+				String realPath = UploadImageUtils.getAbsolutePath(productImage);
+				int pointerIndex = realPath.lastIndexOf(".");
+				ImageUploadInfo saveImageSerivce=new ImageUploadInfo();
+				try {
+					saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+					cmProductArchive.setProductImage(photoServer+saveImageSerivce.getSource());
+				} catch (Exception e) {
+					logger.error("图片上传错误:"+e.toString(),e);
+				}
+			}
+		}
+		super.save(cmProductArchive);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CmProductArchive cmProductArchive) {
+		super.delete(cmProductArchive);
+	}
+
+	@Transactional(readOnly = false)
+	public Page<Product> findProductPage(Page<Product> productPage, Product product) {
+		List<Integer> ids = cmProductArchiveDao.findArchiveProductId();
+		product.setIds(ids);
+		product.setPage(productPage);
+		List<Product> productList = cmProductArchiveDao.findAllProduct(product);
+		String wwwServer = Global.getConfig("wwwServer");
+		productList.forEach(item -> {
+			if (StringUtil.isNotBlank(item.getMainImage())) {
+				item.setMainImage(AppUtils.getImageURL("product", item.getMainImage(), 0, wwwServer));
+			}
+		});
+		productPage.setList(productList);
+		return productPage;
+	}
+}

+ 5 - 1
src/main/java/com/caimei/modules/archive/utils/OssArchiveUtil.java

@@ -2,9 +2,11 @@ package com.caimei.modules.archive.utils;
 
 import com.aliyun.oss.OSS;
 import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.CannedAccessControlList;
 import com.aliyun.oss.model.GetObjectRequest;
 import com.aliyun.oss.model.ObjectMetadata;
 import com.aliyun.oss.model.UploadFileRequest;
+import com.caimei.utils.StringUtils;
 import com.thinkgem.jeesite.common.config.Global;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -20,7 +22,7 @@ public class OssArchiveUtil {
     private static String privateBucket = Global.getConfig("aliyun.bucketName");
     private static String config = Global.getConfig("cm.config");
 
-    public static String ossUpload(String fileName, String path, File file, String contentType) {
+    public static String ossUpload(String fileName, String path, File file, String contentType, String contentDisposition) {
         String url = null;
         try {
             if ("product".equals(config)) {
@@ -31,6 +33,8 @@ public class OssArchiveUtil {
             OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
             ObjectMetadata meta = new ObjectMetadata();
             meta.setContentType(contentType);
+            meta.setObjectAcl(CannedAccessControlList.PublicRead);
+            meta.setContentDisposition(StringUtils.isEmpty(contentDisposition) ? "inline" : contentDisposition);
             UploadFileRequest uploadFileRequest = new UploadFileRequest(privateBucket, fileName);
             // 指定上传的本地文件。
             uploadFileRequest.setUploadFile(file.toString());

+ 99 - 0
src/main/java/com/caimei/modules/archive/web/CmProductArchiveContentController.java

@@ -0,0 +1,99 @@
+package com.caimei.modules.archive.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.archive.entity.CmProductArchiveFile;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.caimei.modules.archive.entity.CmProductArchiveContent;
+import com.caimei.modules.archive.service.CmProductArchiveContentService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 商品资料内容Controller
+ *
+ * @author Aslee
+ * @version 2021-09-06
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/archive/cmProductArchiveContent")
+public class CmProductArchiveContentController extends BaseController {
+
+	@Autowired
+	private CmProductArchiveContentService cmProductArchiveContentService;
+
+	@ModelAttribute
+	public CmProductArchiveContent get(@RequestParam(required = false) String id) {
+		CmProductArchiveContent entity = null;
+		if (StringUtils.isNotBlank(id)) {
+			entity = cmProductArchiveContentService.get(id);
+		}
+		if (entity == null) {
+			entity = new CmProductArchiveContent();
+		}
+		return entity;
+	}
+
+	@RequestMapping(value = {"list", ""})
+	public String list(CmProductArchiveContent cmProductArchiveContent, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CmProductArchiveContent> page = cmProductArchiveContentService.findPage(new Page<CmProductArchiveContent>(request, response), cmProductArchiveContent);
+		model.addAttribute("page", page);
+		return "modules/archive/cmProductArchiveContentList";
+	}
+
+	@RequestMapping(value = "form")
+	public String form(CmProductArchiveContent cmProductArchiveContent, Model model) {
+		model.addAttribute("cmProductArchiveContent", cmProductArchiveContent);
+		Integer type = cmProductArchiveContent.getType();
+		if (StringUtils.isNotEmpty(cmProductArchiveContent.getId())) {
+			List<CmProductArchiveFile> fileList = cmProductArchiveContentService.getImageList(cmProductArchiveContent.getId());
+			cmProductArchiveContent.setFileList(fileList);
+		}
+		if (1 == type) {
+			return "modules/archive/cmProductArchiveContentForm";
+		} else if (2 == type) {
+			return "modules/archive/addVideoForm";
+		}else {
+ 			return "modules/archive/addFileForm";
+		}
+	}
+
+	@RequestMapping(value = "save")
+	public String save(CmProductArchiveContent cmProductArchiveContent, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, cmProductArchiveContent)) {
+			return form(cmProductArchiveContent, model);
+		}
+		cmProductArchiveContentService.save(cmProductArchiveContent);
+		addMessage(redirectAttributes, "保存资料成功");
+        return "redirect:" + Global.getAdminPath() + "/archive/cmProductArchiveContent/?repage&type=" + cmProductArchiveContent.getType() + "&productArchiveId=" + cmProductArchiveContent.getProductArchiveId();
+	}
+
+	@RequestMapping(value = "delete")
+	public String delete(CmProductArchiveContent cmProductArchiveContent, RedirectAttributes redirectAttributes) {
+		cmProductArchiveContentService.delete(cmProductArchiveContent);
+		addMessage(redirectAttributes, "删除资料成功");
+		return "redirect:" + Global.getAdminPath() + "/archive/cmProductArchiveContent/?repage&type=" + cmProductArchiveContent.getType() + "&productArchiveId=" + cmProductArchiveContent.getProductArchiveId();
+	}
+
+    @ResponseBody
+    @RequestMapping(value = "upload")
+    public Map<String, Object> upload(@RequestParam("file") MultipartFile file, @RequestParam("fileName") String fileName) {
+        return cmProductArchiveContentService.upload(file, fileName);
+    }
+}

+ 86 - 0
src/main/java/com/caimei/modules/archive/web/CmProductArchiveController.java

@@ -0,0 +1,86 @@
+package com.caimei.modules.archive.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.product.entity.Product;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.caimei.modules.archive.entity.CmProductArchive;
+import com.caimei.modules.archive.service.CmProductArchiveService;
+
+/**
+ * 商品资料Controller
+ * @author Aslee
+ * @version 2021-09-03
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/archive/cmProductArchive")
+public class CmProductArchiveController extends BaseController {
+
+	@Autowired
+	private CmProductArchiveService cmProductArchiveService;
+	
+	@ModelAttribute
+	public CmProductArchive get(@RequestParam(required=false) String id) {
+		CmProductArchive entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = cmProductArchiveService.get(id);
+		}
+		if (entity == null){
+			entity = new CmProductArchive();
+		}
+		return entity;
+	}
+	
+	@RequestMapping(value = {"list", ""})
+	public String list(CmProductArchive cmProductArchive, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CmProductArchive> page = cmProductArchiveService.findPage(new Page<CmProductArchive>(request, response), cmProductArchive); 
+		model.addAttribute("page", page);
+		return "modules/archive/cmProductArchiveList";
+	}
+
+	@RequestMapping(value = "form")
+	public String form(CmProductArchive cmProductArchive, Model model) {
+		model.addAttribute("cmProductArchive", cmProductArchive);
+		return "modules/archive/cmProductArchiveForm";
+	}
+
+	@RequestMapping(value = "save")
+	public String save(CmProductArchive cmProductArchive, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, cmProductArchive)){
+			return form(cmProductArchive, model);
+		}
+		cmProductArchiveService.save(cmProductArchive);
+		addMessage(redirectAttributes, "保存商品资料成功");
+		return "redirect:"+Global.getAdminPath()+"/archive/cmProductArchive/?repage";
+	}
+	
+	@RequestMapping(value = "delete")
+	public String delete(CmProductArchive cmProductArchive, RedirectAttributes redirectAttributes) {
+		cmProductArchiveService.delete(cmProductArchive);
+		addMessage(redirectAttributes, "删除商品资料成功");
+		return "redirect:"+Global.getAdminPath()+"/archive/cmProductArchive/?repage";
+	}
+
+    @RequestMapping(value = "findProductPage")
+    public String findProductPage(Product product, Model model, HttpServletRequest request, HttpServletResponse response) {
+        Page<Product> page = cmProductArchiveService.findProductPage(new Page<Product>(request, response), product);
+        model.addAttribute("page", page);
+        model.addAttribute("promotionType", product.getPromotionType());
+        model.addAttribute("ids", product.getIds());
+        model.addAttribute("delProductIds", product.getDelProductIds());
+        return "modules/archive/archiveAddProduct";
+    }
+}

+ 8 - 0
src/main/java/com/caimei/modules/coupon/dao/CmCouponClubDao.java

@@ -52,4 +52,12 @@ public interface CmCouponClubDao extends CrudDao<CmCouponClub> {
      * @param returnedId
      */
     void deleteByReturnedId(int returnedId);
+
+    /**
+     * 查询一张未使用兑换码券
+     *
+     * @param couponId
+     * @return
+     */
+    CmCouponRedemptionCode findRedemptionCode(int couponId);
 }

+ 18 - 0
src/main/java/com/caimei/modules/order/entity/CmMainReceiptExport.java

@@ -4,6 +4,7 @@ public class CmMainReceiptExport {
 	private String orderID;		// 主订单ID
 
 	private String userName;	//客户名
+	private String productNames; //商品名称
 	private String receiptDate;	//收款时间
 	private String payType;		//收款账号
 	private Double associateAmount;	//收款金额
@@ -11,6 +12,7 @@ public class CmMainReceiptExport {
 	private String status;      //订单状态
 	private String relationType; //关系类型:1返佣订单(返佣款)、2非返佣订单(订单款或者非订单款)
 	private String receiptAmount; //返佣订单收款金额
+	private String receiptType;		// 收款类型
 
 	public String getReceiptAmount() {
 		return receiptAmount;
@@ -83,4 +85,20 @@ public class CmMainReceiptExport {
 	public void setShopOrderID(String shopOrderID) {
 		this.shopOrderID = shopOrderID;
 	}
+
+	public String getProductNames() {
+		return productNames;
+	}
+
+	public void setProductNames(String productNames) {
+		this.productNames = productNames;
+	}
+
+	public String getReceiptType() {
+		return receiptType;
+	}
+
+	public void setReceiptType(String receiptType) {
+		this.receiptType = receiptType;
+	}
 }

+ 38 - 8
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -12,6 +12,7 @@ import com.caimei.modules.coupon.dao.CmCouponDao;
 import com.caimei.modules.coupon.entity.CmCoupon;
 import com.caimei.modules.coupon.entity.CmCouponClub;
 import com.caimei.modules.coupon.entity.CmCouponOrderRecord;
+import com.caimei.modules.coupon.entity.CmCouponRedemptionCode;
 import com.caimei.modules.coupon.service.CmCouponService;
 import com.caimei.modules.miniprogram.utils.UploadPicUtils;
 import com.caimei.modules.order.dao.*;
@@ -34,6 +35,8 @@ import com.caimei.modules.user.service.CmUserBalanceRecordService;
 import com.caimei.modules.user.service.CmUserService;
 import com.caimei.modules.user.utils.ReturnedPurchaseStatus;
 import com.caimei.modules.user.utils.UserUtils;
+import com.caimei.po.CouponClub;
+import com.caimei.po.CouponRedemptionCode;
 import com.caimei.po.ProductLadderPrice;
 import com.caimei.po.neworder.CmShopOrder;
 import com.caimei.utils.*;
@@ -688,7 +691,10 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             newOrderDao.update(newOrder);
 
             //下单短信推送
-            try {
+            /**
+             * 后台下单不推送短信
+             */
+            /*try {
                 if (flag && "0".equals(newOrder.getRebateFlag())) {
                     CmUser user = cmUserDao.get(newOrder.getUserID().toString());
                     if (user != null && StringUtils.isNotBlank(user.getBindMobile())) {
@@ -708,7 +714,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                 }
             } catch (Exception e) {
                 e.printStackTrace();
-            }
+            }*/
         }
 
     }
@@ -1225,6 +1231,30 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         order.setConfirmTime(curDateStr);
         if (order.getBalancePayFee() != null && order.getBalancePayFee() > 0) {
             saveDiscernReceipt(order.getBalancePayFee(), orderID);
+            //针对商品productId:6898,做兑换券操作(couponId:15)
+            if ("3".equals(order.getReceiptStatus())) {
+                List<NewOrderProduct> orderProducts = newOrderProductDao.findListByOrderID(orderID);
+                for (NewOrderProduct orderProduct : orderProducts) {
+                    if (orderProduct.getProductID().equals(6898)) {
+                        Integer num = orderProduct.getNum();
+                        for (int i = 0; i < num; i++) {
+                            CmCouponRedemptionCode redemptionCode = cmCouponClubDao.findRedemptionCode(15);
+                            if (redemptionCode != null) {
+                                CmCouponClub couponClub = new CmCouponClub();
+                                couponClub.setCouponId(redemptionCode.getCouponId());
+                                couponClub.setUserId(order.getUserID());
+                                couponClub.setSource("5");
+                                couponClub.setStatus("1");
+                                couponClub.setCreateDate(new Date());
+                                couponClub.setDelFlag("0");
+                                cmCouponClubDao.insert(couponClub);
+                                cmCouponClubDao.updateRedemptionCode(redemptionCode.getId(), couponClub.getId());
+                            }
+                        }
+                        break;
+                    }
+                }
+            }
         }
         newOrderDao.update(order);
     }
@@ -1301,8 +1331,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             int userBeans = user.getUserBeans() + order.getUserBeans();
             cmUserDao.updateUserBeans(order.getUserID(), userBeans);
         }
-        //取消订单短信推送
-        try {
+        //取消订单短信推送(取消订单推送)
+        /*try {
             if (user != null && StringUtils.isNotBlank(user.getBindMobile()) && "0".equals(order.getRebateFlag())) {
                 String wwwServer = Global.getConfig("wwwServer");
                 String shortLink = getShortLink(8, 11, wwwServer + "user/order/detail.html?orderId=" + orderID);
@@ -1315,7 +1345,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }*/
         //客服确认注册机构,一天内取消有效
         if (user != null && "94".equals(user.getClubStatus())) {
             Integer userId = user.getUserID();
@@ -1505,8 +1535,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             }
         }
 
-        try {
-            //发货短信推送
+        /*try {
+            //发货短信推送(取消推送)
             CmUser user = cmUserDao.get(order.getUserID().toString());
             if (user != null && StringUtils.isNotBlank(user.getBindMobile()) && "0".equals(order.getRebateFlag())) {
                 String wwwServer = Global.getConfig("wwwServer");
@@ -1530,7 +1560,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }*/
         return lb.getId();
     }
 

+ 12 - 5
src/main/java/com/caimei/modules/order/web/CmDiscernReceiptController.java

@@ -246,13 +246,20 @@ public class CmDiscernReceiptController extends BaseController {
 
             List<CmMainReceiptExport> list = cmDiscernReceiptService.exportTest(cmDiscernReceipt);
             for (CmMainReceiptExport bean : list) {
+                String productNames = bean.getProductNames();
+                String[] productNameArr = productNames.split(",");
+                for (int i = 0; i < productNameArr.length; i++) {
+                    productNameArr[i] = (i + 1) + "." + productNameArr[i] + "\r\n";
+                    productNames = i==0?productNameArr[i]:productNames + productNameArr[i];
+                }
+                bean.setProductNames(productNames);
                 bean.setPayType(OrderUtil.getPayTypeStr(bean.getPayType()));
             }
             //返佣数据
             List<CmMainReceiptExport> list1 = cmDiscernReceiptService.exportRebate(cmDiscernReceipt);
             for (CmMainReceiptExport export : list1) {
                 export.setPayType(OrderUtil.getPayTypeStr(export.getPayType()));
-                export.setOrderID(export.getOrderID() + "(返佣订单)");
+                export.setOrderID(export.getOrderID() + ("5".equals(export.getReceiptType())?"(供应商退款订单)":"(返佣订单)"));
                 list.add(export);
             }
             //非订单款
@@ -291,15 +298,15 @@ public class CmDiscernReceiptController extends BaseController {
             List<CmReceiptExportData> ListExportData2 = getListExportData(cmDiscernReceipt);
 
             objects.add(list);
-            objects.add(ListExportData1);
+            /*objects.add(ListExportData1);
             objects.add(ListExportData2);
             objects.add(getListOrderPayment(cmDiscernReceipt));
-            objects.add(purchases);
+            objects.add(purchases);*/
             listSheetNames.add("收款表");
-            listSheetNames.add("部分收款");
+            /*listSheetNames.add("部分收款");
             listSheetNames.add("已收款");
             listSheetNames.add("返佣订单");
-            listSheetNames.add("退款记录表");
+            listSheetNames.add("退款记录表");*/
 
             new ExcelUtil().createMultipleSheetsExcel(templateFileName, fileName, listSheetNames, objects, response);
         } catch (Exception e) {

+ 13 - 1
src/main/java/com/caimei/modules/user/service/NewCmShopService.java

@@ -119,7 +119,19 @@ public class NewCmShopService extends CrudService<NewCmShopDao, NewCmShop> {
 
 	@Transactional(readOnly = false)
 	public void update(NewCmShop newCmShop){
-		// 供应商基础信息保存
+	    // 供应商logo
+		String logo = newCmShop.getLogo();
+		if(StringUtils.isNotEmpty(logo)){
+			logo = getImageUrl(logo);
+			newCmShop.setLogo(logo);
+		}
+		// 营业执照
+        String businessLicenseImage = newCmShop.getBusinessLicenseImage();
+        if (StringUtils.isNotEmpty(businessLicenseImage)) {
+			businessLicenseImage = getImageUrl(businessLicenseImage);
+            newCmShop.setBusinessLicenseImage(businessLicenseImage);
+        }
+        // 供应商基础信息保存
 		newCmShopDao.update(newCmShop);
 		//清除所有供应商证书再保存
 		newCmShopDao.deleteCert(newCmShop.getShopID());

+ 3 - 0
src/main/resources/config/beta/caimei.properties

@@ -181,3 +181,6 @@ aliyun.accessKeyId=LTAI4GBL3o4YkWnbKYgf2Xia
 aliyun.accessKeySecret=dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
 aliyun.bucketName=caimei-oss
 aliyun.endpoint=https://oss-cn-shenzhen.aliyuncs.com
+
+#商品资料库html文件临时路径
+archive.htmlTempPath=/mnt/newdatadrive/data/runtime/tomcat-instance/manager/temphtml/

+ 4 - 0
src/main/resources/config/dev/caimei.properties

@@ -194,3 +194,7 @@ aliyun.accessKeyId=LTAI4GBL3o4YkWnbKYgf2Xia
 aliyun.accessKeySecret=dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
 aliyun.bucketName=caimei-oss
 aliyun.endpoint=https://oss-cn-shenzhen.aliyuncs.com
+
+#商品资料库html文件临时路径
+archive.htmlTempPath=D:\\poi-test\\wordToHtml\\
+

BIN=BIN
src/main/resources/export/discern_receipt_export.xls


+ 107 - 0
src/main/resources/mappings/modules/archive/CmProductArchiveContentMapper.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.archive.dao.CmProductArchiveContentDao">
+    
+	<sql id="cmProductArchiveContentColumns">
+		a.id AS "id",
+		a.productArchiveId AS "productArchiveId",
+		a.title AS "title",
+		a.type AS "type",
+		a.addTime AS "addTime"
+	</sql>
+	
+	<sql id="cmProductArchiveContentJoins">
+	</sql>
+    
+	<select id="get" resultType="CmProductArchiveContent">
+		SELECT 
+			<include refid="cmProductArchiveContentColumns"/>
+		FROM cm_product_archive_content a
+		<include refid="cmProductArchiveContentJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmProductArchiveContent">
+		SELECT 
+			<include refid="cmProductArchiveContentColumns"/>
+		FROM cm_product_archive_content a
+		<include refid="cmProductArchiveContentJoins"/>
+		<where>
+			
+			<if test="title != null and title != ''">
+				AND a.title LIKE 
+					<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
+			</if>
+			<if test="type != null">
+				and a.type = #{type}
+			</if>
+		    <if test="productArchiveId != null">
+                and a.productArchiveId = #{productArchiveId}
+            </if>
+		</where>
+		order by a.addTime desc
+	</select>
+	
+	<select id="findAllList" resultType="CmProductArchiveContent">
+		SELECT 
+			<include refid="cmProductArchiveContentColumns"/>
+		FROM cm_product_archive_content a
+		<include refid="cmProductArchiveContentJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+    <select id="getImageList" resultType="com.caimei.modules.archive.entity.CmProductArchiveFile">
+        select * from cm_product_archive_file where archiveContentId = #{id}
+    </select>
+	<select id="getDbFileId" resultType="java.lang.Integer">
+		select id from cm_product_archive_file where archiveContentId = #{id} limit 1
+	</select>
+
+	<insert id="insert" parameterType="CmProductArchiveContent"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_product_archive_content(
+			productArchiveId,
+			title,
+			type,
+			addTime
+		) VALUES (
+			#{productArchiveId},
+			#{title},
+			#{type},
+			now()
+		)
+	</insert>
+	<insert id="insertFile" parameterType="CmProductArchiveFile" keyProperty="id" useGeneratedKeys="true">
+        insert into cm_product_archive_file(archiveContentId, fileName, ossName, ossUrl, uploadTime)
+        values (#{archiveContentId}, #{fileName}, #{ossName}, #{ossUrl}, now());
+	</insert>
+
+	<update id="update">
+		UPDATE cm_product_archive_content SET 	
+			title = #{title}
+		WHERE id = #{id}
+	</update>
+	<update id="updateFile">
+		update cm_product_archive_file
+		set archiveContentId = #{archiveContentId}
+		where id = #{fileId}
+	</update>
+
+	<delete id="delete">
+		DELETE FROM cm_product_archive_content
+		WHERE id = #{id}
+	</delete>
+	<delete id="deleteFile">
+		delete from cm_product_archive_file where archiveContentId = #{archiveContentId}
+	</delete>
+
+</mapper>

+ 163 - 0
src/main/resources/mappings/modules/archive/CmProductArchiveMapper.xml

@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.archive.dao.CmProductArchiveDao">
+    
+	<sql id="cmProductArchiveColumns">
+		a.id AS "id",
+		a.productId AS "productId",
+		if(a.productId is not null,p.name,a.productName)  AS "productName",
+		if(a.productId is not null,s.name,a.shopName) AS "shopName",
+		if(a.productId is not null,p.mainImage,a.productImage) AS "productImage",
+		a.archiveLevel AS "archiveLevel",
+		if(a.productId is not null,ifnull(p.commodityType,a.productType),a.productType) AS "productType",
+		a.productClassify AS "productClassify",
+		if(a.productId is not null and p.commodityType is null,0,1) AS "existProductType",
+		a.addTime AS "addTime"
+	</sql>
+	
+	<sql id="cmProductArchiveJoins">
+	</sql>
+    
+	<select id="get" resultType="CmProductArchive">
+		SELECT 
+			<include refid="cmProductArchiveColumns"/>
+		FROM cm_product_archive a
+		left join product p on a.productId = p.productID
+		left join shop s on p.shopID = s.shopID
+		<include refid="cmProductArchiveJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmProductArchive">
+		SELECT 
+			<include refid="cmProductArchiveColumns"/>
+		FROM cm_product_archive a
+		<include refid="cmProductArchiveJoins"/>
+		left join product p on a.productId = p.productID
+	    left join shop s on p.shopID = s.shopID
+		<where>
+			
+			<if test="productName != null and productName != ''">
+				AND (a.productName LIKE
+					<if test="dbName == 'oracle'">'%'||#{productName}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{productName}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{productName},'%')</if>
+					or p.name like concat('%',#{productName},'%'))
+			</if>
+			<if test="shopName != null and shopName != ''">
+				AND (a.shopName LIKE
+					<if test="dbName == 'oracle'">'%'||#{shopName}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{shopName}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
+					or s.name like concat('%',#{shopName},'%'))
+			</if>
+			<if test="archiveLevel != null and archiveLevel != ''">
+				AND a.archiveLevel = #{archiveLevel}
+			</if>
+			<if test="productType != null and productType != ''">
+				AND if(a.productId is not null and p.commodityType is not null,p.commodityType = #{productType}, a.productType = #{productType})
+			</if>
+			<if test="productClassify != null and productClassify != ''">
+				AND a.productClassify = #{productClassify}
+			</if>
+		</where>
+		order by a.addTime desc
+	</select>
+	
+	<select id="findAllList" resultType="CmProductArchive">
+		SELECT 
+			<include refid="cmProductArchiveColumns"/>
+		FROM cm_product_archive a
+		<include refid="cmProductArchiveJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+    <select id="findArchiveProductId" resultType="java.lang.Integer">
+		SELECT IFNULL(productId,0) FROM cm_product_archive GROUP BY productId
+	</select>
+	<select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
+		SELECT
+		a.*,s.name AS "shopName"
+		FROM product a
+		LEFT JOIN shop s on s.shopID = a.shopID
+		<where>
+			<if test="productID != null" >
+				AND a.productID = #{productID}
+			</if>
+			<if test="name != null and name != ''">
+				AND a.name LIKE
+				<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+			</if>
+			<if test="shopName != null and shopName != ''">
+				AND s.name LIKE
+				<if test="dbName == 'oracle'">'%'||#{shopName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{shopName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
+			</if>
+			<if test="ids != null and ids.size() > 0 ">
+				AND a.productID NOT IN
+				<foreach collection="ids" open="(" close=")" item="id" separator=",">
+					#{id}
+				</foreach>
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				order by a.productID
+			</otherwise>
+		</choose>
+	</select>
+
+	<insert id="insert" parameterType="CmProductArchive"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_product_archive(
+			productId,
+			productName,
+			shopName,
+			productImage,
+			archiveLevel,
+			productType,
+			productClassify,
+			addTime
+		) VALUES (
+			#{productId},
+			#{productName},
+			#{shopName},
+			#{productImage},
+			#{archiveLevel},
+			#{productType},
+			#{productClassify},
+			#{addTime}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_product_archive SET 	
+			productId = #{productId},
+			productName = #{productName},
+			shopName = #{shopName},
+			productImage = #{productImage},
+			archiveLevel = #{archiveLevel},
+			productType = #{productType},
+			productClassify = #{productClassify}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		DELETE FROM cm_product_archive
+		WHERE id = #{id}
+	</delete>
+	
+</mapper>

+ 20 - 0
src/main/resources/mappings/modules/coupon/CmCouponClubMapper.xml

@@ -242,5 +242,25 @@
 	<update id="deleteByReturnedId">
 		UPDATE cm_coupon_club SET delFlag = 1 WHERE returnedId = #{returnedId} AND status = 1 AND source = 3
 	</update>
+
+	<select id="findRedemptionCode" resultType="com.caimei.modules.coupon.entity.CmCouponRedemptionCode">
+        SELECT
+          `id`,
+          `couponId`,
+          `clubCouponId`,
+          `redemptionCode`,
+          `status`,
+          `redemptionTime`,
+          `addTime`
+        FROM
+          cm_coupon_redemption_code
+        WHERE
+          couponId = #{couponId}
+          AND STATUS = 1
+        ORDER BY
+          id
+        LIMIT
+          1
+    </select>
 	
 </mapper>

+ 1 - 0
src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml

@@ -163,6 +163,7 @@
     <select id="exportTest" resultType="com.caimei.modules.order.entity.CmMainReceiptExport">
         SELECT
         r.orderID,
+        (select group_concat(distinct p.name) from product p left join cm_order_product cop on p.productID = cop.productID where cop.orderID = o.orderID group by cop.orderID) as productNames,
         IF(u.userIdentity = 2,u.name,u.userName) AS userName,
         d.receiptDate,
         d.payType,

+ 280 - 0
src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp

@@ -0,0 +1,280 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>添加视频资料</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .controls .new-tag {
+            display: inline-block;
+            width: 78px;
+            height: 30px;
+            border: 1px solid #e5e5e5;
+            border-radius: 5px;
+            margin: 7px;
+            text-align: center;
+            line-height: 30px;
+            font-size: 14px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            cursor: pointer;
+        }
+
+        .controls .new-tag.active {
+            border-color: #e15616;
+            color: #e15616;
+        }
+
+        #tagInput {
+            width: 263px;
+            margin: 7px;
+            display: inline-block;
+            height: 30px;
+        }
+
+        .controls .tags-operate .tag-add {
+            height: 40px;
+            line-height: 40px;
+            vertical-align: middle;
+        }
+
+        .upload {
+            position: relative;
+            display: inline-block;
+            background: #D0EEFF;
+            border: 1px solid #99D3F5;
+            border-radius: 4px;
+            padding: 4px 12px;
+            color: #1E88C7;
+            text-decoration: none;
+            text-indent: 0;
+            line-height: 20px;
+            margin-left: 20px;
+            cursor: pointer;
+            width: 52px;
+            height: 20px;
+        }
+
+        .upload input {
+            position: absolute;
+            width: 170px;
+            font-size: 20px;
+            right: 0;
+            top: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+
+        .upload:hover {
+            background: #AADFFD;
+            border-color: #78C3F3;
+            color: #004974;
+            text-decoration: none;
+        }
+
+        .add-submit {
+            position: relative;
+            display: inline;
+            background: #D0EEFF;
+            border: 1px solid #99D3F5;
+            border-radius: 4px;
+            padding: 4px 12px;
+            color: #1E88C7;
+            text-decoration: none;
+            text-indent: 0;
+            line-height: 20px;
+            margin-left: 20px;
+            cursor: pointer;
+            width: 52px;
+            height: 30px;
+        }
+
+        .add-submit input {
+            position: absolute;
+            width: 50px;
+            font-size: 20px;
+            right: 0;
+            top: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+
+        .add-submit:hover {
+            background: #AADFFD;
+            border-color: #78C3F3;
+            color: #004974;
+            text-decoration: none;
+        }
+
+        .upload-loading{
+            display: none;
+            width: 32px;
+            height: 32px;
+            margin-left: 10px;
+        }
+        .upload-loading img{
+            width: 16px;
+            height: 16px;
+            margin: 0 auto 0;
+        }
+
+        #file-list-display {
+            width: 600px;
+            height: auto;
+            float: left;
+            margin-left: 20px;
+        }
+
+        #file-list-display p {
+            line-height: 30px;
+            font-size: 14px;
+            color: #333333;
+            margin: 0;
+        }
+
+        #file-list-display p .del {
+            color: #2fa4e7;
+            font-size: 12px;
+            cursor: pointer;
+            margin-left: 20px;
+        }
+
+        .Main-content{
+            height: 100px;
+        }
+
+        .control-group{
+            margin-top: 40px;
+        }
+    </style>
+
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $("#searchForm").validate({
+                submitHandler: function (form) {
+                    var isSubMitFlag = true;
+                    var productID = $("#productID").val();
+                    if (isNaN(productID) || productID.indexOf('0') == 0 ) {
+                        alertx("请输入正确的商品ID");
+                        isSubMitFlag = false;
+                        return false;
+                    }
+                    if (isSubMitFlag) {
+                        form.submit();
+                    }
+                }
+            })
+        });
+    </script>
+</head>
+<body>
+<form:form id="inputForm" modelAttribute="cmProductArchiveContent" action="${ctx}/archive/cmOrderArchiveContent/save" method="post" class="form-horizontal">
+    <form:hidden path="id"/>
+    <form:hidden path="type" value="3"/>
+    <sys:message content="${message}"/>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>标题:</label>
+        <div class="controls">
+            <form:input path="title" htmlEscape="false" maxlength="50" class="input-xlarge "  style="position:relative"/>
+        </div>
+        <div style="margin:5px 0 0 180px">
+            <font color="red">标题输入不超过50个字</font>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>文件路径:</label>
+        <input id="uploadFileName" type="text" style="display: inline;margin-left:20px" disabled="true" class="input-xlarge required" />
+        <div class="upload">
+            <input type="file" name="file" id="archiveFile" accept=".pdf,.doc,.docx,.ppt,.pptx">选择文件
+        </div>
+        <div class="add-submit">
+            <input id="addSubmit" type="button" value="上传" style="cursor: pointer"/>上传&nbsp;
+        </div>
+        <div class="upload-loading">
+            <img alt="gif" src="/static/images/upload.gif" width="32px" border="none">
+        </div>
+        <div style="margin:5px 0 0 180px">
+            <font color="red">支持上传pdf丶word丶ppt文件格式</font>
+        </div>
+    </div>
+</form:form>
+
+<script>
+    var fileId = '';
+
+    function getCheckedItems() {
+        var items = new Array();
+        items.push({
+            id: $("#id").val(),
+            title: $("#title").val(),
+            fileId: fileId
+        })
+        return items;
+    }
+
+    $(function () {
+        //初始化文件名称
+        if (${cmProductArchiveContent.id ne null}) {
+            var fileName = '${cmProductArchiveContent.fileList[0].fileName}';
+            var id = '${cmProductArchiveContent.fileList[0].id}';
+            $("#uploadFileName").val(fileName);
+            fileId = id;
+        }
+
+        //点击上传按钮后上传文件
+        $('#addSubmit').click(function () {
+            var filesById = document.getElementById('archiveFile');
+            var files = $('#archiveFile');
+            var fileList = files.prop('files');
+            var fileName = $('#uploadFileName').val();
+            if (files === '' || fileList.length == 0 || fileName == '') {
+                alertx('请选择上传文件');
+                return;
+            }
+            var data = new FormData();
+            data.append('file', fileList[0]);
+            data.append('fileName', fileName);
+            $('.upload-loading').css("display", "inline");
+            $.ajax({
+                url: "${ctx}/archive/cmProductArchiveContent/upload",
+                data: data,
+                type: "POST",
+                processData: false,
+                contentType: false,
+                dataType: "json",
+                success: function (res) {
+                    if (res.success) {
+                        debugger
+                        filesById.value = '';
+                        fileId = res.archiveFile.id;
+                        $('.upload-loading').hide();
+                        $.jBox.tip('上传成功', 'info');
+                    } else {
+                        $.jBox.tip(res.msg, 'error');
+                        $('.upload-loading').hide();
+                    }
+                },
+                error: function (json) {
+
+                }
+            });
+        });
+
+
+        var fileList = [];
+        var fileIds = '';
+        var files = document.getElementById("archiveFile");
+        //选择上传文件后显示文件名称
+        files.addEventListener("change", function (event) {
+            var name = event.target.files[0].name;
+            $('#uploadFileName').val(name);
+            fileId = '';
+        });
+    })
+
+
+</script>
+</body>
+</html>
+

+ 280 - 0
src/main/webapp/WEB-INF/views/modules/archive/addVideoForm.jsp

@@ -0,0 +1,280 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>添加视频资料</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .controls .new-tag {
+            display: inline-block;
+            width: 78px;
+            height: 30px;
+            border: 1px solid #e5e5e5;
+            border-radius: 5px;
+            margin: 7px;
+            text-align: center;
+            line-height: 30px;
+            font-size: 14px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            cursor: pointer;
+        }
+
+        .controls .new-tag.active {
+            border-color: #e15616;
+            color: #e15616;
+        }
+
+        #tagInput {
+            width: 263px;
+            margin: 7px;
+            display: inline-block;
+            height: 30px;
+        }
+
+        .controls .tags-operate .tag-add {
+            height: 40px;
+            line-height: 40px;
+            vertical-align: middle;
+        }
+
+        .upload {
+            position: relative;
+            display: inline-block;
+            background: #D0EEFF;
+            border: 1px solid #99D3F5;
+            border-radius: 4px;
+            padding: 4px 12px;
+            color: #1E88C7;
+            text-decoration: none;
+            text-indent: 0;
+            line-height: 20px;
+            margin-left: 20px;
+            cursor: pointer;
+            width: 52px;
+            height: 20px;
+        }
+
+        .upload input {
+            position: absolute;
+            width: 170px;
+            font-size: 20px;
+            right: 0;
+            top: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+
+        .upload:hover {
+            background: #AADFFD;
+            border-color: #78C3F3;
+            color: #004974;
+            text-decoration: none;
+        }
+
+        .add-submit {
+            position: relative;
+            display: inline;
+            background: #D0EEFF;
+            border: 1px solid #99D3F5;
+            border-radius: 4px;
+            padding: 4px 12px;
+            color: #1E88C7;
+            text-decoration: none;
+            text-indent: 0;
+            line-height: 20px;
+            margin-left: 20px;
+            cursor: pointer;
+            width: 52px;
+            height: 30px;
+        }
+
+        .add-submit input {
+            position: absolute;
+            width: 50px;
+            font-size: 20px;
+            right: 0;
+            top: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+
+        .add-submit:hover {
+            background: #AADFFD;
+            border-color: #78C3F3;
+            color: #004974;
+            text-decoration: none;
+        }
+
+        .upload-loading{
+            display: none;
+            width: 32px;
+            height: 32px;
+            margin-left: 10px;
+        }
+        .upload-loading img{
+            width: 16px;
+            height: 16px;
+            margin: 0 auto 0;
+        }
+
+        #file-list-display {
+            width: 600px;
+            height: auto;
+            float: left;
+            margin-left: 20px;
+        }
+
+        #file-list-display p {
+            line-height: 30px;
+            font-size: 14px;
+            color: #333333;
+            margin: 0;
+        }
+
+        #file-list-display p .del {
+            color: #2fa4e7;
+            font-size: 12px;
+            cursor: pointer;
+            margin-left: 20px;
+        }
+
+        .Main-content{
+            height: 100px;
+        }
+
+        .control-group{
+            margin-top: 40px;
+        }
+    </style>
+
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $("#searchForm").validate({
+                submitHandler: function (form) {
+                    var isSubMitFlag = true;
+                    var productID = $("#productID").val();
+                    if (isNaN(productID) || productID.indexOf('0') == 0 ) {
+                        alertx("请输入正确的商品ID");
+                        isSubMitFlag = false;
+                        return false;
+                    }
+                    if (isSubMitFlag) {
+                        form.submit();
+                    }
+                }
+            })
+        });
+    </script>
+</head>
+<body>
+<form:form id="inputForm" modelAttribute="cmProductArchiveContent" action="${ctx}/archive/cmOrderArchiveContent/save" method="post" class="form-horizontal">
+    <form:hidden path="id"/>
+    <form:hidden path="type" value="2"/>
+    <sys:message content="${message}"/>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>标题:</label>
+        <div class="controls">
+            <form:input path="title" htmlEscape="false" maxlength="50" class="input-xlarge "  style="position:relative"/>
+        </div>
+        <div style="margin:5px 0 0 180px">
+            <font color="red">标题输入不超过50个字</font>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>视频路径:</label>
+        <input id="uploadFileName" type="text" style="display: inline;margin-left:20px" disabled="true" class="input-xlarge required" />
+        <div class="upload">
+            <input type="file" name="file" id="archiveFile" accept=".mp4">选择文件
+        </div>
+        <div class="add-submit">
+            <input id="addSubmit" type="button" value="上传" style="cursor: pointer"/>上传&nbsp;
+        </div>
+        <div class="upload-loading">
+            <img alt="gif" src="/static/images/upload.gif" width="32px" border="none">
+        </div>
+        <div style="margin:5px 0 0 180px">
+            <font color="red">视频大小不超过50M</font>
+        </div>
+    </div>
+</form:form>
+
+<script>
+    var fileId = '';
+
+    function getCheckedItems() {
+        var items = new Array();
+        items.push({
+            id: $("#id").val(),
+            title: $("#title").val(),
+            fileId: fileId
+        })
+        return items;
+    }
+
+    $(function () {
+        //初始化文件名称
+        if (${cmProductArchiveContent.id ne null}) {
+            var fileName = '${cmProductArchiveContent.fileList[0].fileName}';
+            var id = '${cmProductArchiveContent.fileList[0].id}';
+            $("#uploadFileName").val(fileName);
+            fileId = id;
+        }
+
+        //点击上传按钮后上传文件
+        $('#addSubmit').click(function () {
+            debugger
+            var filesById = document.getElementById('archiveFile');
+            var files = $('#archiveFile');
+            var fileList = files.prop('files');
+            var fileName = $('#uploadFileName').val();
+            if (files === '' || fileList.length == 0 || fileName == '') {
+                alertx('请选择上传文件');
+                return;
+            }
+            var data = new FormData();
+            data.append('file', fileList[0]);
+            data.append('fileName', fileName);
+            $('.upload-loading').css("display", "inline");
+            $.ajax({
+                url: "${ctx}/archive/cmProductArchiveContent/upload",
+                data: data,
+                type: "POST",
+                processData: false,
+                contentType: false,
+                dataType: "json",
+                success: function (res) {
+                    if (res.success) {
+                        filesById.value = '';
+                        fileId = res.archiveFile.id;
+                        $('.upload-loading').hide();
+                        $.jBox.tip('上传成功', 'info');
+                    } else {
+                        $.jBox.tip(res.msg, 'error');
+                        $('.upload-loading').hide();
+                    }
+                },
+                error: function (json) {
+
+                }
+            });
+        });
+
+
+        var fileList = [];
+        var fileIds = '';
+        var files = document.getElementById("archiveFile");
+        //选择上传文件后显示文件名称
+        files.addEventListener("change", function (event) {
+            var name = event.target.files[0].name;
+            $('#uploadFileName').val(name);
+            fileId = '';
+        });
+    })
+
+
+</script>
+</body>
+</html>
+

+ 125 - 0
src/main/webapp/WEB-INF/views/modules/archive/archiveAddProduct.jsp

@@ -0,0 +1,125 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>选择商品</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table td i {
+            margin: 0 2px;
+        }
+    </style>
+
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $("#searchForm").validate({
+                submitHandler: function (form) {
+                    var isSubMitFlag = true;
+                    var productID = $("#productID").val();
+                    if (isNaN(productID) || productID.indexOf('0') == 0 ) {
+                        alertx("请输入正确的商品ID");
+                        isSubMitFlag = false;
+                        return false;
+                    }
+                    if (isSubMitFlag) {
+                        form.submit();
+                    }
+                }
+            })
+        });
+    </script>
+</head>
+<body>
+<form:form id="searchForm" modelAttribute="product" action="${ctx}/archive/cmProductArchive/findProductPage" method="post"
+           class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <form:hidden path="productIds"/>
+    <form:hidden path="promotionType"/>
+    <form:hidden path="ids"/>
+    <form:hidden path="delProductIds"/>
+    <div class="ul-form">
+        <label>商品ID:</label>
+        <form:input path="productID" id="productID" htmlEscape="false" maxlength="8" class="input-mini" onkeyup="onlynum(this)"/>
+        <label>商品名称:</label>
+        <form:input path="name" htmlEscape="false" class="input-medium" maxlength="20"/>
+        <label>供应商名称:</label>
+        <form:input path="shopName" htmlEscape="false" class="input-medium" maxlength="20"/>
+        &nbsp;&nbsp;  <input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table class="table table-striped table-bordered table-condensed table-hover">
+    <tr>
+        <th style="width:20px;"></th>
+        <th>商品ID</th>
+        <th>商品图片</th>
+        <th>商品名称</th>
+        <th>供应商名称</th>
+    </tr>
+    <tbody>
+    <c:if test="${not empty page.list}">
+        <c:forEach items="${page.list}" var="item">
+            <tr id="${item.productID}" class="itemtr">
+                <th>
+                    <input class="check-item" type="radio" name="info" value='${item.productID}'/>
+                </th>
+                <td>${item.productID}</td>
+                <td><img class="mainImage" src="${item.mainImage}" width="50px" height="50px"></td>
+                <td class="productName">${item.name}</td>
+                <td>${item.shopName}</td>
+                <td hidden class="commodityType">${item.commodityType}</td>
+            </tr>
+        </c:forEach>
+    </c:if>
+    </tbody>
+</table>
+<c:if test="${empty  page.list}">
+    <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
+</c:if>
+<div class="pagination">${page}</div>
+<script type="text/javascript">
+    $(document).ready(function () {
+        //弹出框去滚动条
+        top.$('#jbox-content').css("overflow-y", "hidden");
+        show_title(30);
+    });
+
+    function page(n, s) {
+        $("#pageNo").val(n);
+        $("#pageSize").val(s);
+        $("#searchForm").submit();
+        return false;
+    }
+
+    function getCheckedItems() {
+        var items = new Array();
+        var $items = $('.check-item:checked');
+        $items.each(function () {
+            items.push({
+                productId: $(this).val(),
+                mainImage: $(this).parents(".itemtr").find(".mainImage").attr("src"),
+                productName: $(this).parents(".itemtr").find(".productName").text(),
+                commodityType: $(this).parents(".itemtr").find(".commodityType").text()
+            })
+        });
+        return items;
+    }
+
+    function clickAllSelect(ckb) {
+        var isChecked = ckb.checked;
+        $(".check-item").attr('checked', isChecked);
+    }
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+</script>
+</body>
+</html>
+

+ 12 - 1
src/main/webapp/WEB-INF/views/modules/archive/cmOrderArchiveFileList.jsp

@@ -58,6 +58,17 @@
                     return;
             }
         }
+
+        function previewFile(url) {
+            var index = url.lastIndexOf(".");
+            var suffix = url.substring(index);
+            if (suffix.startsWith(".png") || suffix.startsWith(".jpg") || suffix.startsWith(".pdf")) {
+                window.open(url, '_blank');
+            } else {
+                var previewUrl = "https://view.officeapps.live.com/op/view.aspx?src="+encodeURIComponent(url);
+                window.open(previewUrl, '_blank');
+            }
+        }
     </script>
 </head>
 <body>
@@ -85,7 +96,7 @@
                     ${cmOrderArchiveFile.fileName}
             </td>
             <td>
-                <a href="${cmOrderArchiveFile.ossUrl}" target="_blank">预览</a>
+                <a onclick="previewFile('${cmOrderArchiveFile.ossUrl}')" target="_blank">预览</a>
                 <a href="${ctx}/archive/cmOrderArchive/downFile?fileId=${cmOrderArchiveFile.id}">下载</a>
             </td>
         </tr>

+ 14 - 2
src/main/webapp/WEB-INF/views/modules/archive/cmOrderArchiveForm.jsp

@@ -277,7 +277,7 @@
 				<c:if test="${not empty archiveFileList}">
 					<c:forEach items="${archiveFileList}" var="archiveFile" varStatus="statusIndex">
 						<p>${archiveFile.fileName}
-							<span class="del"><a href="${archiveFile.ossUrl}" target="_blank">预览</a></span>
+							<span class="del"><a onclick="previewFile('${archiveFile.ossUrl}')" target="_blank">预览</a></span>
 							<span class="del" onclick="dataDelete(this,'${archiveFile.id}')">删除</span>
 						</p>
 					</c:forEach>
@@ -400,7 +400,7 @@
 				var viewFileUrl = document.createElement("a");
 				//预览链接
 				viewFileUrl.innerHTML = '预览';
-				viewFileUrl.setAttribute("href", file.ossUrl);
+				viewFileUrl.setAttribute("onclick", "previewFile('" + file.ossUrl + "')");
 				viewFileUrl.setAttribute("target", "_blank");
 				//预览按钮
 				viewFile.className = 'viewFile';
@@ -499,6 +499,18 @@
 			type: "POST"
 		});
 	}
+
+
+	function previewFile(url) {
+		var index = url.lastIndexOf(".");
+		var suffix = url.substring(index);
+		if (suffix.startsWith(".png") || suffix.startsWith(".jpg") || suffix.startsWith(".pdf")) {
+			window.open(url, '_blank');
+		} else {
+			var previewUrl = "https://view.officeapps.live.com/op/view.aspx?src="+encodeURIComponent(url);
+			window.open(previewUrl, '_blank');
+		}
+	}
 </script>
 </body>
 </html>

+ 302 - 0
src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentForm.jsp

@@ -0,0 +1,302 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>资料管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		.clearfix::after{
+			content: "";
+			display: block;
+			clear: both;
+		}
+		.iconBox{
+			font-size: 0;
+		}
+		.controls{
+			margin-left: 0 !important;
+		}
+		.controls .conList{
+			display: inline-block;
+			margin-right: 15px;
+		}
+		.conList .btn:nth-of-type(1){
+			margin-left: 25px;
+		}
+		.select2-choice{
+			width: 100px;
+		}
+		.upload-content {
+			float: left;
+			margin-top: -100px;
+			margin-right: -40px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) {
+			width: 90px;
+			height: 100px;
+			border: 2px solid #eee;
+			background: #fff;
+			position: relative;
+		}
+		.upload-content .conList .btn:nth-of-type(1)>div {
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			transform: translate(-50%, -50%);
+			color: #666;
+		}
+		.upload-content .conList .btn:nth-of-type(1) span {
+			font-size: 35px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) h5 {
+			color: #666;
+		}
+		.cancel-upload {
+			background: transparent;
+			border: none;
+			box-shadow: none;
+			position: relative;
+			top: -38px;
+			left: -25px;
+			cursor: pointer;
+			z-index: 100;
+		}
+		.upload-content .conList ol li {
+      		width: 114px;
+			min-height: 80px;
+			text-align: center;
+			background: #fff;
+			position: relative;
+			top: 120px;
+			margin-left: 2px;
+			height: 100px;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			box-sizing: border-box;
+		}
+		.hide-pic {
+			display: none !important;
+		}
+		.upload-image-list{
+			width: 660px;
+			float: left;
+		}
+	</style>
+	<style>
+		.iconBox{
+			font-size: 0;
+		}
+		.controls .conList{
+			display: inline-block;
+			margin-right: 15px;
+		}
+		.conList .btn:nth-of-type(1){
+			margin-left: 25px;
+		}
+		.select2-choice{
+			width: 100px;
+		}
+		.upload-content {
+			float: left;
+			margin-top: -70px;
+			margin-left: 20px !important;
+		}
+		.upload-content .conList .btn:nth-of-type(1) {
+			width: 90px;
+			height: 100px;
+			border: 2px solid #eee;
+			background: #fff;
+			position: relative;
+		}
+		.upload-content .conList .btn:nth-of-type(1)>div {
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			transform: translate(-50%, -50%);
+			color: #666;
+		}
+		.upload-content .conList .btn:nth-of-type(1) span {
+			font-size: 35px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) h5 {
+			color: #666;
+		}
+		.cancel-upload {
+			background: transparent;
+			border: none;
+			box-shadow: none;
+			position: relative;
+			top: -38px;
+			left: -25px;
+			cursor: pointer;
+			z-index: 100;
+		}
+		.hide-pic {
+			display: none !important;
+		}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function(form){
+					if ($('.cancel-upload:visible').length <= 0) {
+						alertx("至少上传一张图片");
+						return false;
+					}
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/archive/cmProductArchiveContent/?type=1&productArchiveId=${cmProductArchiveContent.productArchiveId}">资料列表</a></li>
+		<li class="active"><a href="${ctx}/archive/cmProductArchiveContent/form?id=${cmProductArchiveContent.id}&productArchiveId=${cmProductArchiveContent.productArchiveId}&type=${cmProductArchiveContent.type}">${not empty cmProductArchiveContent.id?'编辑':'添加'}图片资料</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmProductArchiveContent" action="${ctx}/archive/cmProductArchiveContent/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="productArchiveId"/>
+		<form:hidden path="type" value="1"/>
+		<sys:message content="${message}"/>		
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>标题:</label>
+			<div class="controls">
+				<form:input path="title" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入图片标题"  style="position:relative"/>
+			</div>
+		</div>
+		<div class="control-group" style="width: 1000px">
+			<label class="control-label"><font color="red">*</font>图片:</label>
+<%--				<c:if test="${not empty cmProductArchiveContent.imageList}">--%>
+			<div style="display: flex">
+				<label style="color:#AEAEAE;margin-left: 20px">最多上传12张</label>
+			</div>
+			<div class="upload-image-list" style="display: flex;flex-wrap: wrap">
+				<c:forEach items="${cmProductArchiveContent.fileList}" var="image" varStatus="index">
+					<div class="controls upload-content iconBox" id="imageBox${index.index}">
+						<div class="conList">
+							<form:hidden id="pImage${index.index}" path="fileList[${index.index}].ossUrl" htmlEscape="false"
+										 maxlength="255"
+										 class="input-xlarge required"/>
+							<sys:ckfinder input="pImage${index.index}" type="images" uploadPath="/photo"
+										  selectMultiple="false"
+										  maxWidth="100" maxHeight="100"/><br>
+						</div>
+					</div>
+				</c:forEach>
+				<c:set var="size" value="${empty cmProductArchiveContent.fileList?0:cmProductArchiveContent.fileList.size()}"/>
+				<c:forEach var="emptyIndex" begin="${size}" end="${11}">
+					<div class="controls upload-content iconBox conList ${emptyIndex eq 0?'':'hide-pic'}" id="imageBox${emptyIndex}" >
+						<div class="conList">
+							<form:hidden id="pImage${emptyIndex}" path="fileList[${emptyIndex}].ossUrl" htmlEscape="false"
+										 maxlength="255"
+										 class="input-xlarge required"/>
+							<sys:ckfinder input="pImage${emptyIndex}" type="images" uploadPath="/photo"
+										  selectMultiple="false"
+										  maxWidth="100" maxHeight="100"/><br>
+						</div>
+					</div>
+				</c:forEach>
+			</div>
+
+
+<%--			</div>--%>
+
+				<%--</c:if>
+				<c:if test="${empty cmProductArchiveContent.imageList}">
+					111
+				</c:if>--%>
+		</div>
+		<div class="form-actions">
+			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		</div>
+	</form:form>
+<script>
+	$(function () {
+		$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+		$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+		$('.upload-content .conList').find('.cancel-upload').hide();
+		var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+		var MutationObserverConfig = {
+			childList: true,
+			subtree: true,
+			characterData: true
+		};
+		var observer = new MutationObserver(function (mutations) {
+			$.each(mutations, function (index, item) {
+				if (item.type === 'childList') {
+					debugger
+					// 在创建新的 element 时调用
+					var target = $(item.target),
+							thisWrapper = target.closest('.conList'),
+							nextEle = thisWrapper.parents('.controls').next();
+					thisWrapper.find('li').css('z-index', 99);
+					thisWrapper.find('.cancel-upload').show();
+					if (nextEle.hasClass('hide-pic')) {
+						nextEle.removeClass('hide-pic');
+					}
+				}
+			})
+		});
+		var observeEle = document.getElementsByClassName('upload-image-list')[0];
+		observer.observe(observeEle, MutationObserverConfig);
+
+		$('body').on('click', '.cancel-upload',function() {
+			debugger
+			var wrapper = $(this).closest('.controls');
+			wrapper.find('li').css('z-index','-1');
+			wrapper.find('input').val('');
+			$(this).hide();
+			if ($('.cancel-upload:visible').length < 12) {
+				wrapper.addClass("hide-pic");
+			}else{
+				wrapper.removeClass("hide-pic");
+			}
+			wrapper.parent().append(wrapper.clone());
+			wrapper.remove();
+			$(".controls").each(function(i,ele){
+				if($(ele).find("input.input-xlarge").val()){
+					$(ele).next().removeClass("hide-pic")
+				}
+			})
+			console.log(--imageSize)
+		});
+
+		$('body').on('click','.upload-content li',function() {
+			var index = $(this).closest('.conList').index() + 1,
+					str = 'image'+index+'FinderOpen';
+			eval(str+'()');
+		});
+
+		$(window).on("load", function () {
+			setTimeout(function () {
+				for (var i = 0; i < 12; i++) {
+					$("#imageBox"+i).find("input.input-xlarge").each(function (i, ele) {
+						if ($(ele).val()) {
+							$(ele).next().find("li").css("z-index", "99");
+							$(ele).parents(".conList").find(".cancel-upload").show();
+							$(ele).parent().parents(".controls").next().removeClass("hide-pic")
+						}
+					})
+				}
+			}, 200);
+		});
+	});
+
+
+</script>
+</body>
+</html>

+ 125 - 0
src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentList.jsp

@@ -0,0 +1,125 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>资料管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/archive/cmProductArchive/">商品资料列表</a></li>
+		<li class="active"><a href="${ctx}/archive/cmProductArchiveContent/?type=${cmProductArchiveContent.type}&productArchiveId=${cmProductArchiveContent.productArchiveId}">${cmProductArchiveContent.type eq 1?'图片资料':cmProductArchiveContent.type eq 2?'视频资料':'文件资料'}</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmProductArchiveContent" action="${ctx}/archive/cmProductArchiveContent/" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<div class="ul-form">
+			<form:hidden path="type"/>
+			<form:hidden path="productArchiveId"/>
+			 <label>标题:</label>
+				<form:input path="title" htmlEscape="false" maxlength="50" class="input-medium"/>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			&nbsp;&nbsp;<input class="btn btn-primary" style="width: 50px"
+							   onclick="showAddForm('', ${cmProductArchiveContent.type},${cmProductArchiveContent.productArchiveId})" value="添加"/>
+			<div class="clearfix"></div>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>序号</th>
+				<th>标题</th>
+				<th>添加时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmProductArchiveContent" varStatus="index">
+			<tr>
+				<td>${index.index+1}</td>
+				<td>
+					${cmProductArchiveContent.title}
+				</td>
+				<td>
+					<fmt:formatDate value="${cmProductArchiveContent.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+    				<a onclick="showAddForm(${cmProductArchiveContent.id},${cmProductArchiveContent.type},${cmProductArchiveContent.productArchiveId})">编辑</a>
+					<a href="${ctx}/archive/cmProductArchiveContent/delete?id=${cmProductArchiveContent.id}" onclick="return confirmx('确认要删除该资料吗?', this.href)">删除</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+<script>
+	function showAddForm(id,type,productArchiveId) {
+		if (type == 1) {
+			window.location = '${ctx}/archive/cmProductArchiveContent/form?type=1&productArchiveId=' + productArchiveId + '&id=' + id;
+		}else {
+			//添加视频资料
+			var url = '';
+			var title = '';
+			url = "${ctx}/archive/cmProductArchiveContent/form?type=" + type + "&productArchiveId=" + productArchiveId + '&id=' + id;
+			title = type == 2?"添加视频文件":"添加文件资料";
+			top.$.jBox("iframe:" + url, {
+				iframeScrolling: 'yes',
+				width: 800,
+				height: 300,
+				persistent: true,
+				title: title,
+				buttons: {"保存": '1', "取消": '-1'},
+				submit: function (v, h, f) {
+					//确定
+					var $jboxFrame = top.$('#jbox-iframe');
+					var $mainFrame = top.$('#mainFrame');
+					if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+						var items = $jboxFrame[0].contentWindow.getCheckedItems(0);
+						if (items.length > 0) {
+							console.log(items)
+							var archiveContentId = items[0].id;
+							var title = items[0].title;
+							var fileId = items[0].fileId;
+							if (title == '') {
+								top.$.jBox.tip("标题不能为空");
+								return false;
+							}
+							if (fileId == '') {
+								top.$.jBox.tip("请先上传文件");
+								return false;
+							}
+							$.post("${ctx}/archive/cmProductArchiveContent/save?type="+type+"&id=" + archiveContentId + "&title=" + title + "&fileId=" + fileId+"&productArchiveId=" + productArchiveId, function (data) {
+								top.$.jBox.tip("保存资料成功");
+								setTimeout(function () {
+									window.location.href = "${ctx}/archive/cmProductArchiveContent/?type="+type+"&productArchiveId=" + productArchiveId;
+								}, 200);
+							});
+						} else {
+							top.$.jBox.tip("请先上传视频...");
+							return false;
+						}
+					}
+					return true;
+				}
+			});
+		}
+	}
+</script>
+</body>
+</html>

+ 306 - 0
src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveForm.jsp

@@ -0,0 +1,306 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>商品资料管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		.iconBox{
+			font-size: 0;
+		}
+		.controls .conList{
+			display: inline-block;
+			margin-right: 15px;
+		}
+		.conList .btn:nth-of-type(1){
+			margin-left: 25px;
+		}
+		.select2-choice{
+			width: 100px;
+		}
+		.upload-content {
+			margin-top: -70px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) {
+			width: 90px;
+			height: 100px;
+			border: 2px solid #eee;
+			background: #fff;
+			position: relative;
+		}
+		.upload-content .conList .btn:nth-of-type(1)>div {
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			transform: translate(-50%, -50%);
+			color: #666;
+		}
+		.upload-content .conList .btn:nth-of-type(1) span {
+			font-size: 35px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) h5 {
+			color: #666;
+		}
+		.cancel-upload {
+			background: transparent;
+			border: none;
+			box-shadow: none;
+			position: relative;
+			top: -38px;
+			left: -25px;
+			cursor: pointer;
+			z-index: 100;
+		}
+		.upload-content .conList ol li {
+			width: 114px;
+			min-height: 80px;
+			text-align: center;
+			background: #fff;
+			position: relative;
+			top: 120px;
+			margin-left: 2px;
+		}
+		.hide-pic {
+			display: none !important;
+		}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function(form){
+					var infoType = $("input[name='infoType']:checked").val();
+					if (infoType == 2) {
+						$("#productId").val('');
+					}else if ($("#productId").val() == '') {
+						alertx("请先选择商品");
+						return
+					}
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/archive/cmProductArchive/">商品资料列表</a></li>
+		<li class="active"><a href="${ctx}/archive/cmProductArchive/form?id=${cmProductArchive.id}">商品资料${not empty cmProductArchive.id?'编辑':'添加'}</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmProductArchive" action="${ctx}/archive/cmProductArchive/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="existProductType" />
+		<sys:message content="${message}"/>
+		<div class="control-group">
+			<label class="control-label">商品信息:</label>
+			<div class="controls">
+				<input type="radio" name="infoType" value="1" ${empty cmProductArchive.id ? "checked" :(not empty cmProductArchive.productId ? "checked" : "")} />商品库获取
+				<input type="radio" name="infoType" value="2" ${(not empty cmProductArchive.id && empty cmProductArchive.productId) ? "checked" : ""} />自定义
+			</div>
+		</div>
+		<div class="control-group auto">
+			<div class="controls">
+				<img id="mainImage" src="${cmProductArchive.productImage}" border="none" width="60" height="60"
+					 style="${empty cmProductArchive.productImage ? 'display:none':''}" class="productInfo">
+				<font id="productName" class="productInfo">${cmProductArchive.productName}</font>
+				<a href="JavaScript:;" onclick="showSelect()">选择商品</a>
+				<input type="hidden" name="productId" id="productId" value="${cmProductArchive.productId}">
+			</div>
+		</div>
+		<div class="control-group custom">
+			<label class="control-label"><font color="red">*</font>商品名称:</label>
+			<div class="controls">
+				<form:input path="productName" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入或选择商品" style="position:relative"/>
+			</div>
+		</div>
+		<div class="control-group custom">
+			<label class="control-label">商品图片:</label>
+			<div class="controls upload-content iconBox" id="productImageBox">
+				<div class="conList">
+					<form:hidden id="pImage" path="productImage" htmlEscape="false"
+								 maxlength="255"
+								 class="input-xlarge required"/>
+					<sys:ckfinder input="pImage" type="images" uploadPath="/photo"
+								  selectMultiple="false"
+								  maxWidth="100" maxHeight="100"/><br>
+				</div>
+			</div>
+		</div>
+		<div class="control-group custom">
+			<label class="control-label"><font color="red">*</font>供应商名称:</label>
+			<div class="controls">
+				<form:input path="shopName" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">资料等级:</label>
+			<div class="controls">
+				<form:select path="archiveLevel" class="input-medium ">
+					<form:option value="1" label="一类资料"/>
+					<form:option value="2" label="二类资料"/>
+					<form:option value="3" label="三类资料"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group custom productType">
+			<label class="control-label">商品属性:</label>
+			<div class="controls">
+				<form:select path="productType" class="input-medium ">
+					<form:option value="1" label="产品"/>
+					<form:option value="2" label="仪器"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">商品分类:</label>
+			<div class="controls">
+				<form:select path="productClassify" class="input-medium ">
+					<form:option value="2" label="生美"/>
+					<form:option value="1" label="医美"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="form-actions">
+			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		</div>
+	</form:form>
+<script>
+	$(function () {
+		showInfo();
+		$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+		$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+		$('.upload-content .conList').find('.cancel-upload').hide();
+		var observeEle = document.getElementsByClassName('upload-content')[0];
+		var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+		var MutationObserverConfig = {
+			childList: true,
+			subtree: true,
+			characterData: true
+		};
+		var observer = new MutationObserver(function (mutations) {
+			$.each(mutations, function (index, item) {
+				if (item.type === 'childList') {
+					// 在创建新的 element 时调用
+					var target = $(item.target),
+							thisWrapper = target.closest('.conList'),
+							nextEle = thisWrapper.next();
+					thisWrapper.find('li').css('z-index', 99);
+					thisWrapper.find('.cancel-upload').show();
+					if (nextEle.hasClass('hide-pic')) {
+						nextEle.removeClass('hide-pic');
+					}
+				}
+			})
+		});
+		observer.observe(observeEle, MutationObserverConfig);
+
+		$('body').on('click', '.cancel-upload', function () {
+			var wrapper = $(this).closest('.conList');
+			wrapper.find('li').css('z-index', '-1');
+			wrapper.find('input').val('');
+			$(this).hide();
+			wrapper.removeClass("hide-pic");
+			wrapper.parent().append(wrapper.clone());
+			wrapper.remove();
+			$(".conList").each(function (i, ele) {
+				if ($(ele).find("input.input-xlarge").val()) {
+					$(ele).next().removeClass("hide-pic")
+				}
+			})
+		});
+		$(window).on("load", function () {
+			setTimeout(function () {
+				$("#productImageBox").find("input.input-xlarge").each(function (i, ele) {
+					if ($(ele).val()) {
+						$(ele).next().find("li").css("z-index", "99");
+						$(ele).parents(".conList").find(".cancel-upload").show();
+						$(ele).parents(".conList").next().removeClass("hide-pic")
+					}
+				})
+			}, 200);
+		});
+	});
+
+	$("input[name='infoType']").change(function () {
+		showInfo();
+	})
+
+	// 展示表单信息
+	function showInfo() {
+		var infoType = $("input[name='infoType']:checked").val();
+		if (infoType == 2) {
+			$(".auto").hide();
+			$(".custom").show();
+			$(".productInfo").show();
+		} else {
+			$(".auto").show();
+			$(".custom").hide();
+			if ($("#productId").val() == '') {
+				$(".productInfo").hide();
+			}
+			if ($("#existProductType").val() == 0) {
+				$(".productType").show();
+			} else {
+				$(".productType").hide();
+			}
+		}
+	}
+
+	//选择添加商品
+	function showSelect() {
+		var url = '';
+		var title = '';
+		url = "${ctx}/archive/cmProductArchive/findProductPage";
+		title = "选择商品";
+		top.$.jBox("iframe:" + url, {
+			iframeScrolling: 'yes',
+			width: $(top.document).width() - 600,
+			height: $(top.document).height() - 160,
+			persistent: true,
+			title: title,
+			buttons: {"确定": '1', "关闭": '-1'},
+			submit: function (v, h, f) {
+				//确定
+				var $jboxFrame = top.$('#jbox-iframe');
+				var $mainFrame = top.$('#mainFrame');
+				if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+					var items = $jboxFrame[0].contentWindow.getCheckedItems(0);
+					if (items.length > 0) {
+						console.log(items)
+						var productId = items[0].productId;
+						var mainImage = items[0].mainImage;
+						var productName = items[0].productName;
+						var productType = items[0].commodityType;
+						$("#mainImage").attr("src", mainImage).show();
+						$("#productName").text(productName);
+						$("#productId").val(productId);
+						$("#name").val(productName);
+						$(".productInfo").show();
+						if ('' == productType ) {
+							$(".productType").show();
+						}else {
+							$(".productType").hide();
+						}
+					} else {
+						top.$.jBox.tip("请先勾选商品...");
+						return false;
+					}
+				}
+				return true;
+			}
+		});
+	}
+</script>
+</body>
+</html>

+ 116 - 0
src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveList.jsp

@@ -0,0 +1,116 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>商品资料管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/archive/cmProductArchive/">商品资料列表</a></li>
+		<shiro:hasPermission name="archive:cmProductArchive:edit"><li><a href="${ctx}/archive/cmProductArchive/form">商品资料添加</a></li></shiro:hasPermission>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmProductArchive" action="${ctx}/archive/cmProductArchive/" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<div class="ul-form">
+			 <label>商品名称:</label>
+				<form:input path="productName" htmlEscape="false" maxlength="50" class="input-medium"/>
+			 <label>供应商名称:</label>
+				<form:input path="shopName" htmlEscape="false" maxlength="50" class="input-medium"/>
+			 <label>资料等级:</label>
+				<form:select path="archiveLevel" class="input-medium">
+					<form:option value="" label="全部"/>
+					<form:option value="1" label="一类资料"/>
+					<form:option value="2" label="二类资料"/>
+					<form:option value="3" label="三类资料"/>
+				</form:select>
+			 <label>商品属性:</label>
+				<form:select path="productType" class="input-medium">
+					<form:option value="" label="全部"/>
+					<form:option value="1" label="产品"/>
+					<form:option value="2" label="仪器"/>
+				</form:select>
+			 <label>商品分类:</label>
+				<form:select path="productClassify" class="input-medium">
+					<form:option value="" label="全部"/>
+					<form:option value="2" label="生美"/>
+					<form:option value="1" label="医美"/>
+				</form:select>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			&nbsp;&nbsp;<input class="btn btn-primary" style="width: 50px"
+				   onclick="window.location='${ctx}/archive/cmProductArchive/form'" value="添加"/>
+			<div class="clearfix"></div>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>序号</th>
+				<th>商品名称</th>
+				<th>供应商名称</th>
+				<th>商品图片</th>
+				<th>资料等级</th>
+				<th>商品属性</th>
+				<th>商品分类</th>
+				<th>添加时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmProductArchive" varStatus="index">
+			<tr>
+				<td>
+					${index.index +1}
+				</td>
+				<td>
+					${cmProductArchive.productName}
+				</td>
+				<td>
+					${cmProductArchive.shopName}
+				</td>
+				<td>
+					<img src=" ${empty cmProductArchive.productImage?'https://www.caimei365.com/img/base/placeholder.png':cmProductArchive.productImage}" style="width: 80px">
+				</td>
+				<td>
+					${cmProductArchive.archiveLevel eq 1?'一类资料':(cmProductArchive.archiveLevel eq 2?'二类资料':'三类资料')}
+				</td>
+				<td>
+					${cmProductArchive.productType eq 1?'产品':'仪器'}
+				</td>
+				<td>
+					${cmProductArchive.productClassify eq 1?'医美':'生美'}
+				</td>
+				<td>
+					<fmt:formatDate value="${cmProductArchive.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+    				<a href="${ctx}/archive/cmProductArchive/form?id=${cmProductArchive.id}">编辑</a>
+					<a href="${ctx}/archive/cmProductArchive/delete?id=${cmProductArchive.id}" onclick="return confirmx('确认要删除该商品资料吗?', this.href)">删除</a>
+					<a href="${ctx}/archive/cmProductArchiveContent/?productArchiveId=${cmProductArchive.id}&type=1">图片资料</a>
+					<a href="${ctx}/archive/cmProductArchiveContent/?productArchiveId=${cmProductArchive.id}&type=2">视频资料</a>
+					<a href="${ctx}/archive/cmProductArchiveContent/?productArchiveId=${cmProductArchive.id}&type=3">文件资料</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/cmpage/cmPageBeautyForm.jsp

@@ -79,7 +79,7 @@
             <sys:ckfinder input="headImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
         </div>
         <div class="controls" style="padding-top: 20px;">
-        <label style="color:#D0D0D0 ;">建议图片尺寸1920*510px</label>
+        <label style="color:#D0D0D0 ;">建议图片尺寸1920*480px</label>
         </div>
     </div>
     <div class="control-group">
@@ -89,7 +89,7 @@
             <sys:ckfinder input="crmHeadImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
         </div>
         <div class="controls" style="padding-top: 20px;">
-            <label style="color:#D0D0D0 ;">建议图片尺寸750px*366px</label>
+            <label style="color:#D0D0D0 ;">建议图片尺寸1000px*450px</label>
         </div>
     </div>
     <div class="control-group">
@@ -116,8 +116,8 @@
         <label class="control-label">咨询浮窗:</label>
         <div class="controls">
             <form:select path="infoBarStatus" class="input-xlarge ">
-                <form:option value="0" label="停用"/>
                 <form:option value="1" label="启用"/>
+                <form:option value="0" label="停用"/>
             </form:select>
         </div>
     </div>

+ 17 - 17
src/main/webapp/WEB-INF/views/modules/newhome/beautyFloorContentForm.jsp

@@ -847,7 +847,7 @@
                                     <img src="/static/template/beauty/pc/21.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate22" class="mallTemplate">
+                            <div id="pcTemplate22" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="22" label="模板22" id="templateType22"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
@@ -857,7 +857,7 @@
                                     <img src="/static/template/beauty/pc/22.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate23" class="mallTemplate">
+                            <div id="pcTemplate23" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="23" label="模板23" id="templateType23"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
@@ -867,7 +867,7 @@
                                     <img src="/static/template/beauty/pc/23.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate24" class="mallTemplate">
+                            <div id="pcTemplate24" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="24" label="模板24" id="templateType24"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
@@ -877,7 +877,7 @@
                                     <img src="/static/template/beauty/pc/24.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate25" class="mallTemplate">
+                            <div id="pcTemplate25" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="25" label="模板25" id="templateType25"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
@@ -887,7 +887,7 @@
                                     <img src="/static/template/beauty/pc/25.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate26" class="mallTemplate">
+                            <div id="pcTemplate26" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="26" label="模板26" id="templateType26"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
@@ -897,17 +897,17 @@
                                     <img src="/static/template/beauty/pc/26.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate27" class="mallTemplate">
+                            <div id="pcTemplate27" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="27" label="模板27" id="templateType27"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
-                                <em class="middleEm">偏商城活动</em>
+                                <em class="middleEm">偏展会活动</em>
                                 <em class="rightEm">PC端</em>
                                 <div class="templateImageDiv">
                                     <img src="/static/template/beauty/pc/27.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate28" class="mallTemplate">
+                            <div id="pcTemplate28" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="28" label="模板28" id="templateType28"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
@@ -917,7 +917,7 @@
                                     <img src="/static/template/beauty/pc/28.png">
                                 </div>
                             </div>
-                            <div id="pcTemplate29" class="mallTemplate">
+                            <div id="pcTemplate29" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="29" label="模板29" id="templateType29"
                                                   cssClass="templateButton"
                                                   onclick="showContent('pc')"/>
@@ -1139,7 +1139,7 @@
                                     <img src="/static/template/beauty/applets/21.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate22" class="mallTemplate">
+                            <div id="appletsTemplate22" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="72" label="模板22" id="templateType72"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>
@@ -1150,7 +1150,7 @@
                                     <img src="/static/template/beauty/applets/22.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate23" class="mallTemplate">
+                            <div id="appletsTemplate23" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="73" label="模板23" id="templateType73"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>
@@ -1160,7 +1160,7 @@
                                     <img src="/static/template/beauty/applets/23.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate24" class="mallTemplate">
+                            <div id="appletsTemplate24" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="74" label="模板24" id="templateType74"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>
@@ -1170,7 +1170,7 @@
                                     <img src="/static/template/beauty/applets/24.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate25" class="mallTemplate">
+                            <div id="appletsTemplate25" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="75" label="模板25" id="templateType75"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>
@@ -1180,7 +1180,7 @@
                                     <img src="/static/template/beauty/applets/25.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate26" class="mallTemplate">
+                            <div id="appletsTemplate26" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="76" label="模板26" id="templateType76"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>
@@ -1190,7 +1190,7 @@
                                     <img src="/static/template/beauty/applets/26.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate27" class="mallTemplate">
+                            <div id="appletsTemplate27" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="77" label="模板27" id="templateType77"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>
@@ -1200,7 +1200,7 @@
                                     <img src="/static/template/beauty/applets/27.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate28" class="mallTemplate">
+                            <div id="appletsTemplate28" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="78" label="模板28" id="templateType78"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>
@@ -1210,7 +1210,7 @@
                                     <img src="/static/template/beauty/applets/28.png">
                                 </div>
                             </div>
-                            <div id="appletsTemplate29" class="mallTemplate">
+                            <div id="appletsTemplate29" class="displayTemplate">
                                 <form:radiobutton path="templateType" name="templateType" value="79" label="模板29" id="templateType79"
                                                   cssClass="templateButton"
                                                   onclick="showContent('applets')"/>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -297,10 +297,10 @@
 			</c:if>
 			<div>
 				<label>欠款抵扣:</label>
-				总欠款:<span id="rebateAmount">${empty cmPayShop.rebateAmount ? 0 : cmPayShop.rebateAmount}</span>,
-				可抵扣欠款:<span id="ableRebateAmount">${empty cmPayShop.ableRebateAmount ? 0 : cmPayShop.ableRebateAmount}</span>,
+				总欠款:<span id="rebateAmount">${empty cmPayShop.rebateAmount ? 0 : cmPayShop.rebateAmount }</span>,
+				可抵扣欠款:<span id="ableRebateAmount">${empty cmPayShop.ableRebateAmount ? 0 : cmPayShop.ableRebateAmount }</span>,
 				使用:${cmPayShop.balancePayFee},
-				剩余:<span id="remainingBalance">${(empty cmPayShop.rebateAmount ? 0 : cmPayShop.rebateAmount) - (empty cmPayShop.balancePayFee ? 0 : cmPayShop.balancePayFee)}</span>
+				剩余:<span id="remainingBalance"> ${cmPayShop.status == '2'?((empty cmPayShop.ableRebateAmount ? 0:cmPayShop.ableRebateAmount)-cmPayShop.balancePayFee): (empty cmPayShop.ableRebateAmount ? 0 : cmPayShop.ableRebateAmount)}</span>
 			</div>
 			<c:if test="${cmPayShop.payType ne '6'}">
 				<div>

+ 3 - 0
src/main/webapp/WEB-INF/views/modules/order/orderForm.jsp

@@ -786,7 +786,10 @@
 
     $(function () {
         setBalancePayFee();
+      var orderId = $("#orderID").val()*1;
+      if (orderId && orderId > 0){
         setFreight();
+      }
         $(".freight").val($("#freight").val());
         var tablehtml = $(".stagesTable1").html();
         var tablehtml2 = $(".stagesTable").html();

+ 4 - 2
src/main/webapp/WEB-INF/views/modules/product/cmSecondHandDetailForm.jsp

@@ -348,9 +348,9 @@
 		<label class="control-label"><font color="red">*</font>商品可见度:</label>
 		<div class="controls">
 			<form:select path="visibility" class="input-large required" id="visibility">
-				<form:option value="3" label="所有人可见"/>
-				<form:option value="2" label="所有机构可见"/>
 				<form:option value="1" label="仅会员机构可见"/>
+				<form:option value="2" label="所有机构可见"/>
+				<form:option value="3" label="所有人可见"/>
 			</form:select>
 		</div>
 	</div>
@@ -629,6 +629,7 @@
         };
         var observer = new MutationObserver(function(mutations){
             $.each(mutations, function(index,item) {
+            	debugger
                 if (item.type === 'childList') {
                     // 在创建新的 element 时调用
                     var target = $(item.target),
@@ -650,6 +651,7 @@
             eval(str+'()');
         });
         $('body').on('click', '.cancel-upload',function() {
+        	debugger
             var wrapper = $(this).closest('.conList');
             wrapper.find('li').css('z-index','-1');
             wrapper.find('input').val('');

+ 4 - 0
src/main/webapp/WEB-INF/views/modules/user/cmUserbeanshistoryList.jsp

@@ -51,6 +51,7 @@
 				<form:option value="10" label="抵用运费"/>
 				<form:option value="11" label="退款回收"/>
 				<form:option value="12" label="登录奖励"/>
+				<form:option value="13" label="查看商品资料"/>
 			</form:select>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			<div class="clearfix"></div>
@@ -112,6 +113,9 @@
 					<c:if test="${userBeansHistory.beansType eq 12}">
 						登录奖励
 					</c:if>
+					<c:if test="${userBeansHistory.beansType eq 13}">
+						查看商品资料
+					</c:if>
 				</td>
 			</tr>
 		</c:forEach>

+ 7 - 2
src/main/webapp/static/modules/bulkpurchase/orderForm.js

@@ -219,6 +219,7 @@ $(function() {
         productList.forEach(function(data) {
             setProductList(data);
         });
+        setOrderFee(); //设置底部订单金额
         initFlag = true;
     }
 });
@@ -394,6 +395,7 @@ function editShop(obj) {
                         console.log(items[0]);
                         setProductList(items[0], false); //设置商品列表
                         //                            initStages();//初始化分期信息
+                        setOrderFee(); //设置底部订单金额
                     }
                     return true;
                 }
@@ -519,6 +521,7 @@ function orderSecondHandEditShop(obj) {
                     } else {
                         console.log(items[0]);
                         setProductList(items[0], false); //设置商品列表
+                        setOrderFee(); //设置底部订单金额
                     }
                     return true;
                 }
@@ -629,6 +632,7 @@ function resetProductList(setData) {
             setProductList(setData, false);
         }
     }
+    setOrderFee(); //设置底部订单金额
 }
 
 function deleteShopProduct(obj) {
@@ -935,7 +939,7 @@ function appendProductList(str, data, cmPromotion) {
         }
     }
     setShopOrderFee(data.shopId);
-    setOrderFee(); //设置底部订单金额
+    // setOrderFee(); //设置底部订单金额
     product_index++;
     // 设置赠品
     setGiftHtmlList(data, cmPromotion);
@@ -1092,7 +1096,7 @@ function setGiftHtmlList(data, cmPromotion) {
         }
     }
     // 重新设置底部订单金额
-    setOrderFee();
+    // setOrderFee();
     // 重新设置返佣订单选项
     showRebateCheck();
 }
@@ -1915,6 +1919,7 @@ function cmFee(i) {
 
 //经理折扣后计算
 function setProductTotalFee() {
+    debugger
     var discount = Number($("#discount").val()); //经理折扣金额
     if (isNaN(discount)) {
         discount = Number($("#discountFee").val());