فهرست منبع

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

Aslee 4 سال پیش
والد
کامیت
99b9d21b95
22فایلهای تغییر یافته به همراه2264 افزوده شده و 6 حذف شده
  1. 9 0
      src/main/java/com/caimei/modules/brand/entity/CmBrand.java
  2. 42 0
      src/main/java/com/caimei/modules/common/entity/Country.java
  3. 9 4
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  4. 4 0
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  5. 59 0
      src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthDao.java
  6. 43 0
      src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthProductDao.java
  7. 149 0
      src/main/java/com/caimei/modules/zplm/entity/CmBrandAuth.java
  8. 106 0
      src/main/java/com/caimei/modules/zplm/entity/CmBrandAuthProduct.java
  9. 55 0
      src/main/java/com/caimei/modules/zplm/entity/CmBrandProductParam.java
  10. 106 0
      src/main/java/com/caimei/modules/zplm/service/CmBrandAuthProductService.java
  11. 82 0
      src/main/java/com/caimei/modules/zplm/service/CmBrandAuthService.java
  12. 105 0
      src/main/java/com/caimei/modules/zplm/web/CmBrandAuthController.java
  13. 116 0
      src/main/java/com/caimei/modules/zplm/web/CmBrandAuthProductController.java
  14. 1 0
      src/main/resources/mappings/modules/order/OrderMapper.xml
  15. 167 0
      src/main/resources/mappings/modules/zplm/CmBrandAuthMapper.xml
  16. 124 0
      src/main/resources/mappings/modules/zplm/CmBrandAuthProductMapper.xml
  17. 2 2
      src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp
  18. 327 0
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthForm.jsp
  19. 87 0
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthList.jsp
  20. 306 0
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthProductForm.jsp
  21. 219 0
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthProductList.jsp
  22. 146 0
      src/main/webapp/static/QRCode/qrcode.js

+ 9 - 0
src/main/java/com/caimei/modules/brand/entity/CmBrand.java

@@ -22,6 +22,7 @@ public class CmBrand extends DataEntity<CmBrand> {
 	private String auditStatus;		// 审核备注
 	private String sort;		// 排序
 	private String logo;		//品牌logo
+	private String authLogo;	//品牌授权logo
 	private String description;
 
 	private String shopName;//供应商名称
@@ -139,4 +140,12 @@ public class CmBrand extends DataEntity<CmBrand> {
 	public void setDescriptionFlag(String descriptionFlag) {
 		this.descriptionFlag = descriptionFlag;
 	}
+
+	public String getAuthLogo() {
+		return authLogo;
+	}
+
+	public void setAuthLogo(String authLogo) {
+		this.authLogo = authLogo;
+	}
 }

+ 42 - 0
src/main/java/com/caimei/modules/common/entity/Country.java

@@ -0,0 +1,42 @@
+package com.caimei.modules.common.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+
+/**
+ * @author Aslee
+ * @date 2021/3/24
+ */
+public class Country implements java.io.Serializable {
+	
+	private static final long serialVersionUID = 1L;
+
+
+	private Integer countryId;
+	private String name;
+	private String validFlag;
+
+    public Integer getCountryId() {
+        return countryId;
+    }
+
+    public void setCountryId(Integer countryId) {
+        this.countryId = countryId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+}

+ 9 - 4
src/main/java/com/caimei/modules/order/entity/NewOrder.java

@@ -54,15 +54,11 @@ public class NewOrder extends DataEntity<NewOrder> {
     private Integer buyUserID;//            下单人
     private String orderType;//      char(2) comment '订单类型 协销订单0 普通订单1',
     private List<NewShopOrder> newShopOrders;
-    //    private List<OrderStages> orderStages = Lists.newArrayList();//分期信息
     private OrderUserInfo bpOrderUserinfo; //订单用户信息表
     private OrderInvoice orderInvoice;
-    //    private String stagesFlag;// 是否是分期订单 分期标志0否 1是
-//    private String stagesRemarks;// 分期备注
     private Integer productCount;        // 商品总数
     private Integer presentCount;        // 赠送总数
     private Integer promotionalGiftsCount; // INT(11) NULL   COMMENT '促销赠品总数' AFTER `presentCount
-    //    private String contractId;		// 采购ID
     private String payTime; //订单支付时间
     private String payFlag;//是否已支付 未支付0 已支付1
     private String onlinePayFlag;//能否显示支付 :0 能线上 1 线下
@@ -132,6 +128,7 @@ public class NewOrder extends DataEntity<NewOrder> {
     private String affirmPaymentFlag;// 二手订单确认付款供应商标识 0未确认,1已确认
     private String rebateFlag;//返佣订单标识,0非返佣订单,1返佣订单
     private String associationType;//订单关联方式: 1手动 2自动
+    private Double ableUserMoney; //当前下单用户可用余额
 
     public List<CmPromotion> getPromotions() {
         return promotions;
@@ -987,5 +984,13 @@ public class NewOrder extends DataEntity<NewOrder> {
     public void setProductName(String productName) {
         this.productName = productName;
     }
+
+    public Double getAbleUserMoney() {
+        return ableUserMoney;
+    }
+
+    public void setAbleUserMoney(Double ableUserMoney) {
+        this.ableUserMoney = ableUserMoney;
+    }
 }
 

+ 4 - 0
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -1527,6 +1527,9 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             orderIdsInApplyReturn = cmReturnedPurchaseDao.findOrderIDsInApplyReturnFlag(oId);
         }
         for (NewOrder order : results) {
+            CmUser user = cmUserDao.get(order.getUserID().toString());
+            Double ableUserMoney = user.getAbleUserMoney() == null ? 0d : user.getAbleUserMoney();
+            order.setAbleUserMoney(ableUserMoney);
             if ((orderIds != null && orderIds.contains(order.getOrderID())) || "1".equals(order.getRebateFlag())) {
                 order.setRebateOrder("1");
             } else {
@@ -1917,6 +1920,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
 
     /**
      * 获取上线协销人员,排除采美默认协销经理
+     *
      * @return NewCmSp
      */
     public List<NewCmSp> findServiceProviderList() {

+ 59 - 0
src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthDao.java

@@ -0,0 +1,59 @@
+package com.caimei.modules.zplm.dao;
+
+import com.caimei.modules.brand.entity.CmBrand;
+import com.caimei.modules.common.entity.Country;
+import com.caimei.modules.zplm.entity.CmBrandAuth;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 品牌授权DAO接口
+ * @author Aslee
+ * @version 2021-03-24
+ */
+@MyBatisDao
+public interface CmBrandAuthDao extends CrudDao<CmBrandAuth> {
+
+    /**
+     * 查询品牌列表
+     * @return CmBrand
+     */
+    List<CmBrand> findBrandList();
+
+    /**
+     * 查询国家名称列表
+     * @return Country
+     */
+    List<Country> findCountryList();
+
+
+    /**
+     * 根据授权Id删除授权的所有商品的参数
+     * @param authId
+     * @return
+     */
+    void deleteParamsByAuthId(String authId);
+
+    /**
+     * 根据授权Id删除授权的所有商品
+     * @param authId
+     * @return
+     */
+    void deleteProductsByAuthId(String authId);
+
+    /**
+     * 更新品牌授权logo
+     * @param brandId
+     * @param authLogo
+     */
+    void updateBrandAuthLogo(@Param("brandId") Integer brandId,@Param("authLogo") String authLogo);
+
+    /**
+     * 查找同种授权数量
+     * @param cmBrandAuth
+     */
+    CmBrandAuth findSameAuth(CmBrandAuth cmBrandAuth);
+}

+ 43 - 0
src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthProductDao.java

@@ -0,0 +1,43 @@
+package com.caimei.modules.zplm.dao;
+
+import com.caimei.modules.zplm.entity.CmBrandProductParam;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.zplm.entity.CmBrandAuthProduct;
+
+import java.util.List;
+
+/**
+ * 品牌授权商品DAO接口
+ * @author Aslee
+ * @version 2021-03-25
+ */
+@MyBatisDao
+public interface CmBrandAuthProductDao extends CrudDao<CmBrandAuthProduct> {
+
+    /**
+     * 根据授权商品Id删除参数
+     * @param productId
+     */
+    void deleteParamsByProductId(String productId);
+
+    /**
+     * 添加授权商品参数
+     * @param param
+     */
+    void insertParam(CmBrandProductParam param);
+
+    /**
+     * 获取商品参数
+     * @param productId
+     * @return
+     */
+    List<CmBrandProductParam> findParamsByProductId(String productId);
+
+    /**
+     * 查找品牌授权下相同名称/SN码的商品
+     * @param cmBrandAuthProduct
+     * @return
+     */
+    CmBrandAuthProduct findSameProduct(CmBrandAuthProduct cmBrandAuthProduct);
+}

+ 149 - 0
src/main/java/com/caimei/modules/zplm/entity/CmBrandAuth.java

@@ -0,0 +1,149 @@
+package com.caimei.modules.zplm.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-03-24
+ */
+public class CmBrandAuth extends DataEntity<CmBrandAuth> {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer brandId;		// 品牌Id
+	private Integer countryId;		// 品牌产地国家Id
+	private String securityLink;		// 防伪链接
+	private Integer agentFlag;		// 是否有代理商:0没有,1有
+	private String agentName;		// 代理商名称
+	private Integer statementType;		// 代理声明类型:1弹窗,2链接
+	private String statementContent;		// 声明弹窗内容
+	private String statementLink;		// 声明链接
+	private String authParty;		// 被授权方名称
+	private Date createTime;		// 创建时间
+
+	private String brandName;		//品牌名
+	private String authLogo;	// 品牌授权logo
+	private String createUserName;	//创建人用户名
+
+	public CmBrandAuth() {
+		super();
+	}
+
+	public CmBrandAuth(String id){
+		super(id);
+	}
+
+	public Integer getBrandId() {
+		return brandId;
+	}
+
+	public void setBrandId(Integer brandId) {
+		this.brandId = brandId;
+	}
+	
+	public Integer getCountryId() {
+		return countryId;
+	}
+
+	public void setCountryId(Integer countryId) {
+		this.countryId = countryId;
+	}
+	
+	@Length(min=0, max=255, message="防伪链接长度必须介于 0 和 255 之间")
+	public String getSecurityLink() {
+		return securityLink;
+	}
+
+	public void setSecurityLink(String securityLink) {
+		this.securityLink = securityLink;
+	}
+	
+	public Integer getAgentFlag() {
+		return agentFlag;
+	}
+
+	public void setAgentFlag(Integer agentFlag) {
+		this.agentFlag = agentFlag;
+	}
+	
+	@Length(min=0, max=50, message="代理商名称长度必须介于 0 和 50 之间")
+	public String getAgentName() {
+		return agentName;
+	}
+
+	public void setAgentName(String agentName) {
+		this.agentName = agentName;
+	}
+	
+	public Integer getStatementType() {
+		return statementType;
+	}
+
+	public void setStatementType(Integer statementType) {
+		this.statementType = statementType;
+	}
+	
+	public String getStatementContent() {
+		return statementContent;
+	}
+
+	public void setStatementContent(String statementContent) {
+		this.statementContent = statementContent;
+	}
+	
+	@Length(min=0, max=255, message="声明链接长度必须介于 0 和 255 之间")
+	public String getStatementLink() {
+		return statementLink;
+	}
+
+	public void setStatementLink(String statementLink) {
+		this.statementLink = statementLink;
+	}
+	
+	@Length(min=0, max=50, message="被授权方名称长度必须介于 0 和 50 之间")
+	public String getAuthParty() {
+		return authParty;
+	}
+
+	public void setAuthParty(String authParty) {
+		this.authParty = authParty;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getBrandName() {
+		return brandName;
+	}
+
+	public void setBrandName(String brandName) {
+		this.brandName = brandName;
+	}
+
+	public String getCreateUserName() {
+		return createUserName;
+	}
+
+	public void setCreateUserName(String createUserName) {
+		this.createUserName = createUserName;
+	}
+
+	@Length(min=0, max=255, message="品牌授权logo长度必须介于 0 和 255 之间")
+	public String getAuthLogo() {
+		return authLogo;
+	}
+
+	public void setAuthLogo(String authLogo) {
+		this.authLogo = authLogo;
+	}
+}

+ 106 - 0
src/main/java/com/caimei/modules/zplm/entity/CmBrandAuthProduct.java

@@ -0,0 +1,106 @@
+package com.caimei.modules.zplm.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-03-25
+ */
+public class CmBrandAuthProduct extends DataEntity<CmBrandAuthProduct> {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer authId;		// 授权Id
+	private String name;		// 商品名称
+	private String snCode;		// sn码
+	private String image;		// 商品图片
+    private String certificateImage;    //授权牌照
+	private Date createTime;		// 创建时间
+	private String createUserName;	//创建人名称
+
+
+    private List<CmBrandProductParam> paramList;      //商品参数列表
+	
+	public CmBrandAuthProduct() {
+		super();
+	}
+
+	public CmBrandAuthProduct(String id){
+		super(id);
+	}
+
+	public Integer getAuthId() {
+		return authId;
+	}
+
+	public void setAuthId(Integer authId) {
+		this.authId = authId;
+	}
+	
+	@Length(min=0, max=50, message="商品名称长度必须介于 0 和 50 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=255, message="sn码长度必须介于 0 和 255 之间")
+	public String getSnCode() {
+		return snCode;
+	}
+
+	public void setSnCode(String snCode) {
+		this.snCode = snCode;
+	}
+	
+	@Length(min=0, max=255, message="商品图片长度必须介于 0 和 255 之间")
+	public String getImage() {
+		return image;
+	}
+
+	public void setImage(String image) {
+		this.image = image;
+	}
+
+	@Length(min=0, max=255, message="授权牌照长度必须介于 0 和 255 之间")
+	public String getCertificateImage() {
+		return certificateImage;
+	}
+
+	public void setCertificateImage(String certificateImage) {
+		this.certificateImage = certificateImage;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getCreateUserName() {
+		return createUserName;
+	}
+
+	public void setCreateUserName(String createUserName) {
+		this.createUserName = createUserName;
+	}
+
+    public List<CmBrandProductParam> getParamList() {
+        return paramList;
+    }
+
+    public void setParamList(List<CmBrandProductParam> paramList) {
+        this.paramList = paramList;
+    }
+}

+ 55 - 0
src/main/java/com/caimei/modules/zplm/entity/CmBrandProductParam.java

@@ -0,0 +1,55 @@
+package com.caimei.modules.zplm.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-03-25
+ */
+public class CmBrandProductParam extends DataEntity<CmBrandProductParam> {
+
+	private static final long serialVersionUID = 1L;
+	private Integer productId;		// 授权商品Id
+	private String name;		// 参数名称
+	private String content;		// 参数信息
+
+	public CmBrandProductParam() {
+		super();
+	}
+
+	public CmBrandProductParam(String id){
+		super(id);
+	}
+
+	public Integer getProductId() {
+		return productId;
+	}
+
+	public void setProductId(Integer productId) {
+		this.productId = productId;
+	}
+
+	@Length(min=0, max=50, message="参数信息长度必须介于 0 和 50 之间")
+	public String getContent() {
+		return content;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	@Length(min=0, max=10, message="参数名称长度必须介于 0 和 10 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+}

+ 106 - 0
src/main/java/com/caimei/modules/zplm/service/CmBrandAuthProductService.java

@@ -0,0 +1,106 @@
+package com.caimei.modules.zplm.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.sys.utils.UploadImageUtils;
+import com.caimei.modules.zplm.entity.CmBrandProductParam;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
+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.zplm.entity.CmBrandAuthProduct;
+import com.caimei.modules.zplm.dao.CmBrandAuthProductDao;
+
+import javax.annotation.Resource;
+
+/**
+ * 品牌授权商品Service
+ * @author Aslee
+ * @version 2021-03-25
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmBrandAuthProductService extends CrudService<CmBrandAuthProductDao, CmBrandAuthProduct> {
+	@Resource
+	CmBrandAuthProductDao cmBrandAuthProductDao;
+
+	public CmBrandAuthProduct get(String id) {
+		return super.get(id);
+	}
+	
+	public List<CmBrandAuthProduct> findList(CmBrandAuthProduct cmBrandAuthProduct) {
+		return super.findList(cmBrandAuthProduct);
+	}
+	
+	public Page<CmBrandAuthProduct> findPage(Page<CmBrandAuthProduct> page, CmBrandAuthProduct cmBrandAuthProduct) {
+		return super.findPage(page, cmBrandAuthProduct);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CmBrandAuthProduct cmBrandAuthProduct) {
+		//保存商品图片
+		String image = cmBrandAuthProduct.getImage();
+		if(StringUtils.isNotBlank(image) && !image.startsWith("http")){
+			String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+			image= Encodes.urlDecode(image);
+			String realPath = UploadImageUtils.getAbsolutePath(image);
+			int pointerIndex = realPath.lastIndexOf(".");
+			ImageUploadInfo saveImageSerivce;
+			try {
+				saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+				cmBrandAuthProduct.setImage(photoServer+saveImageSerivce.getSource());
+			} catch (Exception e) {
+				logger.error("图片上传错误:"+e.toString(),e);
+			}
+		}
+		//保存授权牌照
+		String certificateImage = cmBrandAuthProduct.getCertificateImage();
+		if(StringUtils.isNotBlank(certificateImage) && !certificateImage.startsWith("http")){
+			String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+			certificateImage= Encodes.urlDecode(certificateImage);
+			String realPath = UploadImageUtils.getAbsolutePath(certificateImage);
+			int pointerIndex = realPath.lastIndexOf(".");
+			ImageUploadInfo saveImageSerivce;
+			try {
+				saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+				cmBrandAuthProduct.setCertificateImage(photoServer+saveImageSerivce.getSource());
+			} catch (Exception e) {
+				logger.error("图片上传错误:"+e.toString(),e);
+			}
+		}
+		if (cmBrandAuthProduct.getIsNewRecord()) {
+			cmBrandAuthProduct.setCreateBy(UserUtils.getUser());
+			cmBrandAuthProduct.setCreateTime(new Date());
+		} else {
+			cmBrandAuthProductDao.deleteParamsByProductId(cmBrandAuthProduct.getId());
+		}
+		super.save(cmBrandAuthProduct);
+		//添加参数
+		List<CmBrandProductParam> paramList = cmBrandAuthProduct.getParamList();
+		if (paramList != null && paramList.size() > 0) {
+			paramList.forEach(param->{
+				if (StringUtils.isNotBlank(param.getName()) && StringUtils.isNotBlank(param.getContent())) {
+					param.setProductId(Integer.parseInt(cmBrandAuthProduct.getId()));
+					cmBrandAuthProductDao.insertParam(param);
+				}
+			});
+		}
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CmBrandAuthProduct cmBrandAuthProduct) {
+		super.delete(cmBrandAuthProduct);
+	}
+
+	public List<CmBrandProductParam> getProductParams(String productId) {
+		return cmBrandAuthProductDao.findParamsByProductId(productId);
+	}
+}

+ 82 - 0
src/main/java/com/caimei/modules/zplm/service/CmBrandAuthService.java

@@ -0,0 +1,82 @@
+package com.caimei.modules.zplm.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.sys.utils.UploadImageUtils;
+import com.caimei.modules.zplm.entity.CmBrandAuth;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
+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.zplm.dao.CmBrandAuthDao;
+
+import javax.annotation.Resource;
+
+/**
+ * 品牌授权Service
+ * @author Aslee
+ * @version 2021-03-24
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmBrandAuthService extends CrudService<CmBrandAuthDao, CmBrandAuth> {
+	@Resource
+	CmBrandAuthDao cmBrandAuthDao;
+
+	public CmBrandAuth get(String id) {
+		return super.get(id);
+	}
+	
+	public List<CmBrandAuth> findList(CmBrandAuth cmBrandAuth) {
+		return super.findList(cmBrandAuth);
+	}
+	
+	public Page<CmBrandAuth> findPage(Page<CmBrandAuth> page, CmBrandAuth cmBrandAuth) {
+		return super.findPage(page, cmBrandAuth);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CmBrandAuth cmBrandAuth) {
+		//保存图片
+		String logo = cmBrandAuth.getAuthLogo();
+		if(StringUtils.isNotBlank(logo) && !logo.startsWith("http")){
+			String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+			logo= Encodes.urlDecode(logo);
+			String realPath = UploadImageUtils.getAbsolutePath(logo);
+			int pointerIndex = realPath.lastIndexOf(".");
+			ImageUploadInfo saveImageSerivce;
+			try {
+				saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
+				cmBrandAuth.setAuthLogo(photoServer+saveImageSerivce.getSource());
+			} catch (Exception e) {
+				logger.error("图片上传错误:"+e.toString(),e);
+			}
+		}
+		if (cmBrandAuth.getIsNewRecord()) {
+			cmBrandAuth.setCreateBy(UserUtils.getUser());
+			cmBrandAuth.setCreateTime(new Date());
+		}
+		//更新品牌授权logo
+        cmBrandAuthDao.updateBrandAuthLogo(cmBrandAuth.getBrandId(), cmBrandAuth.getAuthLogo());
+		//保存品牌授权
+		super.save(cmBrandAuth);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CmBrandAuth cmBrandAuth) {
+		//删除授权商品参数
+		cmBrandAuthDao.deleteParamsByAuthId(cmBrandAuth.getId());
+		//删除授权商品
+		cmBrandAuthDao.deleteProductsByAuthId(cmBrandAuth.getId());
+		super.delete(cmBrandAuth);
+	}
+	
+}

+ 105 - 0
src/main/java/com/caimei/modules/zplm/web/CmBrandAuthController.java

@@ -0,0 +1,105 @@
+package com.caimei.modules.zplm.web;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.brand.entity.CmBrand;
+import com.caimei.modules.common.entity.Country;
+import com.caimei.modules.zplm.dao.CmBrandAuthDao;
+import com.caimei.modules.zplm.entity.CmBrandAuth;
+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.zplm.service.CmBrandAuthService;
+
+import java.util.List;
+
+/**
+ * 品牌授权Controller
+ * @author Aslee
+ * @version 2021-03-24
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/zplm/cmBrandAuth")
+public class CmBrandAuthController extends BaseController {
+
+	@Autowired
+	private CmBrandAuthService cmBrandAuthService;
+
+	@Resource
+	private CmBrandAuthDao cmBrandAuthDao;
+	
+	@ModelAttribute
+	public CmBrandAuth get(@RequestParam(required=false) String id) {
+		CmBrandAuth entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = cmBrandAuthService.get(id);
+		}
+		if (entity == null){
+			entity = new CmBrandAuth();
+		}
+		return entity;
+	}
+	
+	@RequestMapping(value = {"list", ""})
+	public String list(CmBrandAuth cmBrandAuth, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CmBrandAuth> page = cmBrandAuthService.findPage(new Page<CmBrandAuth>(request, response), cmBrandAuth);
+		model.addAttribute("page", page);
+		return "modules/zplm/cmBrandAuthList";
+	}
+
+	@RequestMapping(value = "form")
+	public String form(CmBrandAuth cmBrandAuth, Model model) {
+		//品牌列表
+		List<CmBrand> brandList = cmBrandAuthDao.findBrandList();
+		List<Country> countryList = cmBrandAuthDao.findCountryList();
+		model.addAttribute("brandList", brandList);
+		model.addAttribute("countryList", countryList);
+		model.addAttribute("cmBrandAuth", cmBrandAuth);
+		return "modules/zplm/cmBrandAuthForm";
+	}
+
+	@RequestMapping(value = "save")
+	public String save(CmBrandAuth cmBrandAuth, Model model, RedirectAttributes redirectAttributes) {
+		if (checkValidator(model, cmBrandAuth)){
+			return form(cmBrandAuth, model);
+		}
+		cmBrandAuthService.save(cmBrandAuth);
+		addMessage(redirectAttributes, "保存品牌授权成功");
+		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuth/?repage";
+	}
+	
+	@RequestMapping(value = "delete")
+	public String delete(CmBrandAuth cmBrandAuth, RedirectAttributes redirectAttributes) {
+		cmBrandAuthService.delete(cmBrandAuth);
+		addMessage(redirectAttributes, "删除品牌授权成功");
+		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuth/?repage";
+	}
+
+
+	private boolean checkValidator(Model model, CmBrandAuth cmBrandAuth) {
+		if (!beanValidator(model, cmBrandAuth)){
+			return true;
+		}
+		if (StringUtils.isEmpty(cmBrandAuth.getAuthLogo())) {
+			model.addAttribute("errorMsg", "请上传品牌logo!");
+			return true;
+		}
+		CmBrandAuth sameAuth = cmBrandAuthDao.findSameAuth(cmBrandAuth);
+		if (null != sameAuth) {
+			model.addAttribute("errorMsg", sameAuth.getBrandName() + "品牌" + (sameAuth.getAgentFlag() == 1 ? "-" + sameAuth.getAgentName() + "代理" : "") + "下的" + sameAuth.getAuthParty() + "已存在,请勿重复添加");
+			return true;
+		}
+		return false;
+	}
+}

+ 116 - 0
src/main/java/com/caimei/modules/zplm/web/CmBrandAuthProductController.java

@@ -0,0 +1,116 @@
+package com.caimei.modules.zplm.web;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.live.entity.NewPageLive;
+import com.caimei.modules.zplm.dao.CmBrandAuthProductDao;
+import com.caimei.modules.zplm.entity.CmBrandProductParam;
+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.zplm.entity.CmBrandAuthProduct;
+import com.caimei.modules.zplm.service.CmBrandAuthProductService;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * 品牌授权商品Controller
+ * @author Aslee
+ * @version 2021-03-25
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/zplm/cmBrandAuthProduct")
+public class CmBrandAuthProductController extends BaseController {
+
+	@Autowired
+	private CmBrandAuthProductService cmBrandAuthProductService;
+	@Resource
+	private CmBrandAuthProductDao cmBrandAuthProductDao;
+	
+	@ModelAttribute
+	public CmBrandAuthProduct get(@RequestParam(required=false) String id) {
+		CmBrandAuthProduct entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = cmBrandAuthProductService.get(id);
+		}
+		if (entity == null){
+			entity = new CmBrandAuthProduct();
+		}
+		return entity;
+	}
+	
+	@RequestMapping(value = {"list", ""})
+	public String list(CmBrandAuthProduct cmBrandAuthProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CmBrandAuthProduct> page = cmBrandAuthProductService.findPage(new Page<CmBrandAuthProduct>(request, response), cmBrandAuthProduct); 
+		model.addAttribute("page", page);
+		return "modules/zplm/cmBrandAuthProductList";
+	}
+
+	@RequestMapping(value = "form")
+	public String form(CmBrandAuthProduct cmBrandAuthProduct, Model model) {
+		List<CmBrandProductParam> paramList = cmBrandAuthProduct.getParamList();
+		if (StringUtils.isNotBlank(cmBrandAuthProduct.getId()) && paramList == null) {
+			List<CmBrandProductParam> dbParamList = cmBrandAuthProductService.getProductParams(cmBrandAuthProduct.getId());
+			cmBrandAuthProduct.setParamList(dbParamList);
+		} else if (paramList != null) {
+			//清除空数据
+			for (int i = 0; i < paramList.size(); i++) {
+				if (paramList.get(i) == null || StringUtils.isBlank(paramList.get(i).getName())) {
+					paramList.remove(i);
+				}
+			}
+		}
+		model.addAttribute("cmBrandAuthProduct", cmBrandAuthProduct);
+		return "modules/zplm/cmBrandAuthProductForm";
+	}
+
+	@RequestMapping(value = "save")
+	public String save(CmBrandAuthProduct cmBrandAuthProduct, Model model, RedirectAttributes redirectAttributes) {
+		if (checkValidator(model, cmBrandAuthProduct)){
+			return form(cmBrandAuthProduct, model);
+		}
+		cmBrandAuthProductService.save(cmBrandAuthProduct);
+		addMessage(redirectAttributes, "保存品牌授权商品成功");
+		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuthProduct/?repage&authId="+cmBrandAuthProduct.getAuthId();
+	}
+	
+	@RequestMapping(value = "delete")
+	public String delete(CmBrandAuthProduct cmBrandAuthProduct, RedirectAttributes redirectAttributes) {
+		cmBrandAuthProductService.delete(cmBrandAuthProduct);
+		addMessage(redirectAttributes, "删除品牌授权商品成功");
+		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuthProduct/?repage&authId="+cmBrandAuthProduct.getAuthId();
+	}
+
+	private boolean checkValidator(Model model, CmBrandAuthProduct cmBrandAuthProduct) {
+		if (!beanValidator(model, cmBrandAuthProduct)){
+			return true;
+		}
+		if (StringUtils.isEmpty(cmBrandAuthProduct.getImage())) {
+			model.addAttribute("errorMsg", "请上传商品图片!");
+			return true;
+		}
+		CmBrandAuthProduct sameProduct = cmBrandAuthProductDao.findSameProduct(cmBrandAuthProduct);
+		if (null != sameProduct) {
+			if (cmBrandAuthProduct.getName().equals(sameProduct.getName())) {
+				model.addAttribute("errorMsg", "该品牌授权下的"+sameProduct.getName()+"商品名称已存在,请勿重复添加");
+			}else if (cmBrandAuthProduct.getSnCode().equals(sameProduct.getSnCode())) {
+				model.addAttribute("errorMsg", "该品牌授权下的"+sameProduct.getSnCode()+"商品SN码已存在,请勿重复添加");
+			}
+			return true;
+		}
+		return false;
+	}
+}

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

@@ -92,6 +92,7 @@
         co.orderID AS orderID,
         co.orderNo AS orderNo,
 		co.organizeID AS organizeID,
+		co.userID AS userID,
         co.orderType AS orderType,
         co.secondHandOrderFlag AS secondHandOrderFlag,
 		co.onlinePayFlag AS onlinePayFlag,

+ 167 - 0
src/main/resources/mappings/modules/zplm/CmBrandAuthMapper.xml

@@ -0,0 +1,167 @@
+<?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.zplm.dao.CmBrandAuthDao">
+    
+	<sql id="cmBrandAuthColumns">
+		a.id AS "id",
+		a.brandId AS "brandId",
+		a.countryId AS "countryId",
+		a.securityLink AS "securityLink",
+		a.agentFlag AS "agentFlag",
+		a.agentName AS "agentName",
+		a.statementType AS "statementType",
+		a.statementContent AS "statementContent",
+		a.statementLink AS "statementLink",
+		a.authParty AS "authParty",
+		a.createTime AS "createTime",
+		a.createBy AS "createBy.id",
+		cb.name AS "brandName",
+		cb.authLogo AS "authLogo",
+		su.name AS "createUserName"
+	</sql>
+	
+	<sql id="cmBrandAuthJoins">
+		left join cm_brand cb on a.brandId = cb.id
+		left join sys_user su on a.createBy = su.id
+	</sql>
+    
+	<select id="get" resultType="CmBrandAuth">
+		SELECT 
+			<include refid="cmBrandAuthColumns"/>
+		FROM cm_brand_auth a
+		<include refid="cmBrandAuthJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmBrandAuth">
+		SELECT 
+			<include refid="cmBrandAuthColumns"/>
+		FROM cm_brand_auth a
+		<include refid="cmBrandAuthJoins"/>
+		<where>
+			
+			<if test="brandName != null and brandName != ''">
+				AND cb.name like concat('%',#{brandName},'%')
+			</if>
+			<if test="agentName != null and agentName != ''">
+				AND a.agentName LIKE 
+					<if test="dbName == 'oracle'">'%'||#{agentName}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{agentName}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{agentName},'%')</if>
+			</if>
+			<if test="authParty != null and authParty != ''">
+				AND a.authParty LIKE 
+					<if test="dbName == 'oracle'">'%'||#{authParty}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{authParty}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{authParty},'%')</if>
+			</if>
+		</where>
+		order by a.id desc
+	</select>
+	
+	<select id="findAllList" resultType="CmBrandAuth">
+		SELECT 
+			<include refid="cmBrandAuthColumns"/>
+		FROM cm_brand_auth a
+		<include refid="cmBrandAuthJoins"/>
+		<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="findBrandList" resultType="com.caimei.modules.brand.entity.CmBrand">
+		select id, name, authLogo from cm_brand where delFlag = '0';
+	</select>
+	<select id="findCountryList" resultType="com.caimei.modules.common.entity.Country">
+		select countryId, name from country;
+	</select>
+	<select id="findSameAuth" resultType="com.caimei.modules.zplm.entity.CmBrandAuth">
+		select b.name as brandName,ba.agentFlag, ba.agentName,ba.authParty
+		from cm_brand_auth ba
+		left join cm_brand b on ba.brandId = b.id
+		<where>
+			ba.brandId = #{brandId} and ba.authParty = #{authParty} and ba.agentFlag = #{agentFlag}
+			<if test="agentFlag == 1">
+				and ba.agentName = #{agentName}
+			</if>
+			<if test="id != null and id != ''">
+				and ba.id != #{id}
+			</if>
+		</where>
+		limit 1
+	</select>
+
+	<insert id="insert" parameterType="CmBrandAuth"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_brand_auth(
+			brandId,
+			countryId,
+			securityLink,
+			agentFlag,
+			agentName,
+			statementType,
+			statementContent,
+			statementLink,
+			authParty,
+			createTime,
+			createBy
+		) VALUES (
+			#{brandId},
+			#{countryId},
+			#{securityLink},
+			#{agentFlag},
+			#{agentName},
+			#{statementType},
+			#{statementContent},
+			#{statementLink},
+			#{authParty},
+			#{createTime},
+			#{createBy.id}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_brand_auth SET 	
+			brandId = #{brandId},
+			countryId = #{countryId},
+			securityLink = #{securityLink},
+			agentFlag = #{agentFlag},
+			agentName = #{agentName},
+			statementType = #{statementType},
+		    <if test="statementContent != null and statementContent != ''">
+				statementContent = #{statementContent},
+			</if>
+			<if test="statementLink != null and statementLink != ''">
+				statementLink = #{statementLink},
+			</if>
+			authParty = #{authParty}
+		WHERE id = #{id}
+	</update>
+    <update id="updateBrandAuthLogo">
+        update cm_brand
+        set authLogo = #{authLogo}
+        where id = #{brandId}
+    </update>
+
+    <delete id="delete">
+		DELETE FROM cm_brand_auth
+		WHERE id = #{id}
+	</delete>
+	<delete id="deleteParamsByAuthId">
+		delete from cm_brand_product_param pp
+		where pp.productId in
+		      (select ap.id
+		      from cm_brand_auth_product ap
+		      where ap.authId = #{authId})
+	</delete>
+	<delete id="deleteProductsByAuthId">
+		delete from cm_brand_auth_product
+		where authId = #{authId}
+	</delete>
+
+</mapper>

+ 124 - 0
src/main/resources/mappings/modules/zplm/CmBrandAuthProductMapper.xml

@@ -0,0 +1,124 @@
+<?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.zplm.dao.CmBrandAuthProductDao">
+    
+	<sql id="cmBrandAuthProductColumns">
+		a.id AS "id",
+		a.authId AS "authId",
+		a.name AS "name",
+		a.snCode AS "snCode",
+		a.image AS "image",
+        a.certificateImage AS "certificateImage",
+		a.createTime AS "createTime",
+		a.createBy AS "createBy.id",
+		su.name AS "createUserName"
+	</sql>
+	
+	<sql id="cmBrandAuthProductJoins">
+		left join cm_brand_auth cba on a.authId = cba.id
+		left join sys_user su on a.createBy = su.id
+	</sql>
+    
+	<select id="get" resultType="CmBrandAuthProduct">
+		SELECT 
+			<include refid="cmBrandAuthProductColumns"/>
+		FROM cm_brand_auth_product a
+		<include refid="cmBrandAuthProductJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmBrandAuthProduct">
+		SELECT 
+			<include refid="cmBrandAuthProductColumns"/>
+		FROM cm_brand_auth_product a
+		<include refid="cmBrandAuthProductJoins"/>
+		<where>
+			<if test="authId != null">
+				AND a.authId = #{authId}
+			</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="snCode != null and snCode != ''">
+				AND a.snCode LIKE 
+					<if test="dbName == 'oracle'">'%'||#{snCode}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{snCode}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{snCode},'%')</if>
+			</if>
+		</where>
+		order by a.id desc
+	</select>
+	
+	<select id="findAllList" resultType="CmBrandAuthProduct">
+		SELECT 
+			<include refid="cmBrandAuthProductColumns"/>
+		FROM cm_brand_auth_product a
+		<include refid="cmBrandAuthProductJoins"/>
+		<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="findParamsByProductId" resultType="com.caimei.modules.zplm.entity.CmBrandProductParam">
+		select name,content from cm_brand_product_param where productId = #{productId}
+	</select>
+	<select id="findSameProduct" resultType="com.caimei.modules.zplm.entity.CmBrandAuthProduct">
+		select name,snCode from cm_brand_auth_product
+		where (name = #{name} or snCode = #{snCode}) and authId = #{authId}
+		<if test="id != null and id != ''">
+			and id != #{id}
+		</if>
+		limit 1
+	</select>
+
+	<insert id="insert" parameterType="CmBrandAuthProduct"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_brand_auth_product(
+			authId,
+			name,
+			snCode,
+			image,
+            certificateImage,
+			createTime,
+			createBy
+		) VALUES (
+			#{authId},
+			#{name},
+			#{snCode},
+			#{image},
+			#{certificateImage},
+			#{createTime},
+			#{createBy.id}
+		)
+	</insert>
+	<insert id="insertParam">
+		insert into cm_brand_product_param (productId, name, content)
+		values (#{productId},#{name},#{content})
+	</insert>
+
+	<update id="update">
+		UPDATE cm_brand_auth_product SET 	
+			name = #{name},
+			snCode = #{snCode},
+			image = #{image},
+            certificateImage = #{certificateImage}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		DELETE FROM cm_brand_auth_product
+		WHERE id = #{id}
+	</delete>
+    <delete id="deleteParamsByProductId">
+		delete from cm_brand_product_param where productId = #{productId}
+	</delete>
+
+</mapper>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp

@@ -1051,9 +1051,9 @@
                             </c:if>
                             <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||
 				            order.status eq 23 || order.status eq 0}">
-                                <c:if test="${!order.rechargeGoods || order.status eq 0}">
+                                <c:if test="${(empty order.rechargeGoods && order.ableUserMoney > 0) || order.status eq 0}">
                                     <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag != 1}">
-                                        <a href="${ctx}/order/form?id=${order.orderID}">修改订单</a>
+                                        <a href="${ctx}/order/form?id=${order.orderID}">修改订单${order.rechargeGoods}</a>
                                     </c:if>
                                     <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag == 1}">
                                         <a href="${ctx}/order/secondeProductOrderForm?id=${order.orderID}">修改订单</a>

+ 327 - 0
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthForm.jsp

@@ -0,0 +1,327 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>品牌授权管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function(form){
+					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>
+    <style>
+        .iconBox{
+            font-size: 0;
+        }
+        .controls .conList{
+            display: inline-block;
+            margin-right: 15px;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .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>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/zplm/cmBrandAuth/">品牌授权列表</a></li>
+		<li class="active"><a href="${ctx}/zplm/cmBrandAuth/form?id=${cmBrandAuth.id}">品牌授权${not empty cmBrandAuth.id?'编辑':'添加'}</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmBrandAuth" action="${ctx}/zplm/cmBrandAuth/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<sys:message content="${message}"/>		
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>品牌:</label>
+			<div class="controls">
+				<form:select path="brandId" class="input-large required" onchange="changeBrand()">
+					<form:option value="" label="请选择"/>
+					<form:options items="${brandList}" itemLabel="name" itemValue="id"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>产地:</label>
+			<div class="controls">
+				<form:select path="countryId" class="input-large required">
+					<form:option value="" label="请选择"/>
+                    <form:options items="${countryList}" itemLabel="name" itemValue="countryId"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group iconBox">
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>品牌logo:</label>
+            <div class="controls upload-content" id="authLogoBox">
+                <div class="conList">
+                    <form:hidden id="authLogo" path="authLogo" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
+                    <sys:ckfinder input="authLogo" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                    <br>
+                    <label style="margin-left: 150px">建议图片分辨率128px*88px</label>
+                </div>
+            </div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">防伪链接:</label>
+			<div class="controls">
+				<form:input path="securityLink" htmlEscape="false" maxlength="255" class="input-xlarge" placeholder="输入官方防伪链接"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">代理商:</label>
+			<div class="controls">
+				<input type="radio" name="agentFlag" value="0" onclick="changeAgentFlag()" ${cmBrandAuth.agentFlag eq 0?"checked":""}/>无
+				<input type="radio" name="agentFlag" value="1" onclick="changeAgentFlag()" ${cmBrandAuth.agentFlag eq null?"checked":cmBrandAuth.agentFlag eq 1?"checked":""}/>有
+			</div>
+		</div>
+
+        <div id="agentDiv">
+            <div class="control-group">
+                <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>代理商名称:</label>
+                <div class="controls">
+                    <form:input path="agentName" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入代理商名称"/>
+                </div>
+            </div>
+            <div class="control-group">
+                <label class="control-label">代理声明:</label>
+                <div class="controls">
+					<input type="radio" name="statementType" value="1" onclick="changeStatementType()" ${cmBrandAuth.statementType eq null?"checked":cmBrandAuth.statementType eq 1?"checked":""}/>弹窗
+					<input type="radio" name="statementType" value="2" onclick="changeStatementType()" ${cmBrandAuth.statementType eq 2?"checked":""} />链接
+                </div>
+            </div>
+            <div class="control-group" id="statementContentDiv">
+                <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>内容:</label>
+                <div class="controls">
+                    <form:textarea path="statementContent" htmlEscape="false" rows="4" class="input-xxlarge required"/>
+                </div>
+            </div>
+            <div class="control-group" id="statementLinkDiv">
+                <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>链接:</label>
+                <div class="controls">
+                    <form:input path="statementLink" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
+                </div>
+            </div>
+        </div>
+
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>被授权方:</label>
+			<div class="controls">
+				<form:input path="authParty" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入被授权方名称"/>
+			</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 type = text/javascript>
+    $(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 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 () {
+				$("#authLogoBox").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);
+		});
+	});
+</script>
+<script type="text/javascript">
+    $(function () {
+		changeAgentFlag();
+		changeStatementType();
+    })
+
+	//修改有无代理商
+    function changeAgentFlag() {
+        var agentFlag = $('input[name="agentFlag"]:checked').val();
+        if (agentFlag == 0) {
+			$("#agentDiv").hide();
+        }else {
+			$("#agentDiv").show();
+		}
+    }
+
+
+
+    //修改声明类型
+    function changeStatementType() {
+		var statementType = $('input[name="statementType"]:checked').val();
+		if (statementType == 1) {
+			$("#statementContentDiv").show();
+			$("#statementLinkDiv").hide();
+		} else {
+			$("#statementContentDiv").hide();
+			$("#statementLinkDiv").show();
+		}
+	}
+	
+	//修改品牌,品牌logo跟着修改
+	function changeBrand() {
+		var brandId = $("#brandId").val();
+    	var url;
+		<c:forEach items="${brandList}" var="brand">
+			if ('${brand.id}' == brandId){
+				url = '${brand.authLogo}';
+				$("#authLogoPreview a").attr('href','${brand.authLogo}')
+				$("#authLogoPreview img").attr('src','${brand.authLogo}')
+				$("#authLogoPreview img").attr('url','${brand.authLogo}')
+			}
+		</c:forEach>
+		if ($("#authLogoPreview a").attr('href') == '') {
+			clearLogoImage()
+		}else {
+			if ($("#authLogoPreview a").attr('href') == undefined){
+				$("#authLogoPreview li").append("<a href=\"http://192.168.2.100/group1/M00/00/05/wKgCZGBdlSyAHzPDAAJDl8RXwhI006.png\" target=\"_blank\">\n" +
+						"\t\t\t\t\t\t<img src=\"http://192.168.2.100/group1/M00/00/05/wKgCZGBdlSyAHzPDAAJDl8RXwhI006.png\" url=\"http://192.168.2.100/group1/M00/00/05/wKgCZGBdlSyAHzPDAAJDl8RXwhI006.png\" style=\"max-width:100px;max-height:100px;_height:100px;border:0;padding:3px;\">\n" +
+						"\t\t\t\t\t\t</a>&nbsp;&nbsp;\n" +
+						"\t\t\t\t\t\t<a href=\"javascript:\" onclick=\"authLogoDel(this);\">×</a>")
+				$("#authLogoPreview a").attr('href', url);
+				$("#authLogoPreview img").attr('src', url);
+				$("#authLogoPreview img").attr('url', url);
+				if (url == '') {
+					clearLogoImage()
+				}
+			}else {
+				var wrapper = $("#authLogoBox .conList");
+				var nextEle = wrapper.next();
+				wrapper.find('li').css('z-index', 99);
+				wrapper.find('.cancel-upload').show();
+				if (nextEle.hasClass('hide-pic')) {
+					nextEle.removeClass('hide-pic');
+				}
+				$("#authLogo").val($("#authLogoPreview a").attr('href'));
+			}
+
+		}
+	}
+
+	//清除Logo图片
+	function clearLogoImage() {
+		var wrapper = $("#authLogoBox .conList");
+		wrapper.find('li').css('z-index', '-1');
+		wrapper.find('input').val('');
+		$('.cancel-upload').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")
+			}
+		})
+	}
+
+	//错误提示
+	var errorMsg  = "${errorMsg}";
+	if(errorMsg){
+		alertx(errorMsg);
+	}
+</script>
+</body>
+</html>

+ 87 - 0
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthList.jsp

@@ -0,0 +1,87 @@
+<%@ 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}/zplm/cmBrandAuth/">品牌授权列表</a></li>
+		<li><a href="${ctx}/zplm/cmBrandAuth/form">新增</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmBrandAuth" action="${ctx}/zplm/cmBrandAuth/" 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="brandName" htmlEscape="false" maxlength="50" class="input-medium"/>
+			<label>代理商名称:</label>
+				<form:input path="agentName" htmlEscape="false" maxlength="50" class="input-medium"/>
+			 <label>被授权方名称:</label>
+				<form:input path="authParty" htmlEscape="false" maxlength="50" class="input-medium"/>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" 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>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmBrandAuth" varStatus="index">
+			<tr>
+				<td>
+					${index.index+1}
+				</a></td>
+				<td>
+					${cmBrandAuth.brandName}
+				</td>
+				<td>
+					${cmBrandAuth.agentFlag eq 0?'---':cmBrandAuth.agentName}
+				</td>
+				<td>
+					${cmBrandAuth.authParty}
+				</td>
+				<td>
+					<fmt:formatDate value="${cmBrandAuth.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					${cmBrandAuth.createUserName}
+				</td>
+				<td>
+    				<a href="${ctx}/zplm/cmBrandAuth/form?id=${cmBrandAuth.id}">编辑</a>
+					<a href="${ctx}/zplm/cmBrandAuth/delete?id=${cmBrandAuth.id}" onclick="return confirmx('是否删除该数据,删除后,对应的商品数据也将被全部删除,确认是否删除', this.href)">删除</a>
+					<a href="${ctx}/zplm/cmBrandAuthProduct/?authId=${cmBrandAuth.id}">商品列表</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

+ 306 - 0
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthProductForm.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"/>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            //$("#name").focus();
+            $("#inputForm").validate({
+                submitHandler: function (form) {
+                    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>
+    <style>
+        .iconBox {
+            font-size: 0;
+        }
+
+        .controls .conList {
+            display: inline-block;
+            margin-right: 15px;
+        }
+
+        .conList .btn:nth-of-type(1) {
+            margin-left: 25px;
+        }
+
+        .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;
+        }
+
+        .paramRow {
+            margin-top: 10px;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/zplm/cmBrandAuth/">品牌授权列表</a></li>
+    <li><a href="${ctx}/zplm/cmBrandAuthProduct/?authId=${cmBrandAuthProduct.authId}">商品列表</a></li>
+    <li class="active"><a
+            href="${ctx}/zplm/cmBrandAuthProduct/form?id=${cmBrandAuthProduct.id}&authId=${cmBrandAuthProduct.authId}">商品${not empty cmBrandAuthProduct.id?'编辑':'添加'}</a>
+    </li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="cmBrandAuthProduct" action="${ctx}/zplm/cmBrandAuthProduct/save" method="post"
+           class="form-horizontal">
+    <form:hidden path="id"/>
+    <form:hidden path="authId"/>
+    <sys:message content="${message}"/>
+    <div class="control-group">
+        <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>商品名称:</label>
+        <div class="controls">
+            <form:input path="name" htmlEscape="false" maxlength="50" placeholder="建议输入30个字符效果最佳"
+                        class="input-xlarge required"/>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>商品SN码:</label>
+        <div class="controls">
+            <form:input path="snCode" htmlEscape="false" maxlength="255" onchange="inputnum(this)"
+                        style="position:relative" class="input-xlarge required"/>
+        </div>
+    </div>
+    <div class="control-group iconBox">
+        <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>商品图片:</label>
+        <div class="controls upload-content" id="imageBox">
+            <div class="conList">
+                <form:hidden id="image" path="image" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
+                <sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+                              maxHeight="100"/>
+                <br>
+                <label style="margin-left: 150px">建议图片分辨率542px*542px</label>
+            </div>
+        </div>
+    </div>
+    <div class="control-group iconBox">
+        <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>授权牌照:</label>
+        <div class="controls upload-content" id="certificateImageBox">
+            <div class="conList">
+                <form:hidden id="certificateImage" path="certificateImage" htmlEscape="false" maxlength="255"
+                             class="input-xlarge required"/>
+                <sys:ckfinder input="certificateImage" type="images" uploadPath="/photo" selectMultiple="false"
+                              maxWidth="100" maxHeight="100"/>
+                <br>
+                <label style="margin-left: 150px">建议图片分辨率150px*112px</label>
+            </div>
+        </div>
+    </div>
+    <div class="control-group paramList">
+        <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>相关参数:</label>
+        <button class="btn btn-primary" type="button" style="margin-left: 20px" onclick="addParam()">添加参数</button>
+        <div class="controls paramRow" id="paramRow0">
+            <input name="paramList[0].name" htmlEscape="false" class="input-small required" maxlength="10"
+                   placeholder="建议输入品牌">
+            <input name="paramList[0].content" htmlEscape="false" class="input-xlarge required" maxlength="50"
+                   placeholder="输入参数信息">
+        </div>
+        <div class="controls paramRow" id="paramRow1">
+            <input name="paramList[1].name" htmlEscape="false" class="input-small required" maxlength="10"
+                   placeholder="建议输入尺寸">
+            <input name="paramList[1].content" htmlEscape="false" class="input-xlarge required" maxlength="50"
+                   placeholder="输入参数信息">
+        </div>
+        <div class="controls paramRow" id="paramRow2">
+            <input name="paramList[2].name" htmlEscape="false" class="input-small required" maxlength="10"
+                   placeholder="建议输入功率">
+            <input name="paramList[2].content" htmlEscape="false" class="input-xlarge required" maxlength="50"
+                   placeholder="输入参数信息">
+        </div>
+        <div class="controls paramRow" id="paramRow3">
+            <input name="paramList[3].name" htmlEscape="false" class="input-small required" maxlength="10"
+                   placeholder="建议输入重量">
+            <input name="paramList[3].content" htmlEscape="false" class="input-xlarge required" maxlength="50"
+                   placeholder="输入参数信息">
+        </div>
+    </div>
+    <div class="form-actions">
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
+        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+    </div>
+</form:form>
+<script type=text/javascript>
+    //参数索引
+    var paramIndex = 4;
+    $(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 observeEle = document.getElementsByClassName('upload-content')[0];
+        var observeEle1 = document.getElementsByClassName('upload-content')[1];
+        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);
+        observer.observe(observeEle1, 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 () {
+                $("#imageBox").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")
+                    }
+                })
+                $("#certificateImageBox").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);
+        });
+
+        var paramListSize = ${empty cmBrandAuthProduct.paramList.size() ? 0: cmBrandAuthProduct.paramList.size()};
+        paramIndex = paramListSize > 0 ? paramListSize : paramIndex;
+        if (paramListSize > 4) {
+            var index = 4;
+            while (index < paramListSize) {
+                $(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + index + "\">\n" +
+                    "\t\t\t\t<input name=\"paramList[" + index + "].name\" htmlEscape=\"false\" class=\"input-small required\" maxlength=\"10\" placeholder=\"参数名称\">\n" +
+                    "\t\t\t\t<input name=\"paramList[" + index + "].content\" htmlEscape=\"false\" class=\"input-xlarge required\" maxlength=\"50\" placeholder=\"输入参数信息\">\n" +
+                    "\t\t\t\t<a onclick=\"deleteParam(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
+                    "            </div>");
+                index = index + 1;
+            }
+        }
+        var nameArray = new Array();
+        var contentArray = new Array();
+        <c:forEach items="${cmBrandAuthProduct.paramList}" var="item">
+        nameArray.push('${item.name}')
+        contentArray.push('${item.content}')
+        </c:forEach>
+        for (var i = 0; i < nameArray.length; i++) {
+            var nameInput = "paramList[" + i + "].name";
+            var contentInput = "paramList[" + i + "].content";
+            $('input[name="' + nameInput + '"]').val(nameArray[i]);
+            $('input[name="' + contentInput + '"]').val(contentArray[i]);
+        }
+    });
+
+    //删除参数
+    function deleteParam(index) {
+        $("#paramRow" + index).remove();
+    }
+
+    //添加参数
+    function addParam() {
+        $(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + paramIndex + "\">\n" +
+            "\t\t\t\t<input name=\"paramList[" + paramIndex + "].name\" htmlEscape=\"false\" class=\"input-small required\" maxlength=\"10\" placeholder=\"参数名称\">\n" +
+            "\t\t\t\t<input name=\"paramList[" + paramIndex + "].content\" htmlEscape=\"false\" class=\"input-xlarge required\" maxlength=\"50\" placeholder=\"输入参数信息\">\n" +
+            "\t\t\t\t<a onclick=\"deleteParam(" + paramIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
+            "            </div>")
+        paramIndex = paramIndex + 1;
+    }
+
+
+    //限制只能输入数字和英文
+    function inputnum(obj, val) {
+        obj.value = obj.value.replace(/[^\w.\/]/ig, ""); //清除"数字"和"英文"以外的字符
+    }
+
+    //错误提示
+    var errorMsg = "${errorMsg}";
+    if (errorMsg) {
+        alertx(errorMsg);
+    }
+</script>
+</body>
+</html>

+ 219 - 0
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthProductList.jsp

@@ -0,0 +1,219 @@
+<%@ 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;}
+
+        .qrcodeBox-content {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            left: 0;
+            background: rgba(0, 0, 0, 0.2);
+            z-index: 999999;
+            display: none;
+        }
+
+        .content-box {
+            border-radius: 5px;
+            width: 260px;
+            height: 300px;
+            background-color: #FFF;
+            border: 1px solid #ebebeb;
+            position: absolute;
+            top: 0;
+            left: 0;
+            bottom: 0;
+            right: 0;
+            margin: auto;
+            z-index: 999;
+            box-sizing: border-box;
+            padding: 20px;
+        }
+
+        .qrcodeBox {
+            width: 220px;
+            height: 220px;
+        }
+
+        .qrcodeBox-colse {
+            width: 50%;
+            height: 50px;
+            display: inline;
+            float: right;
+        }
+        .qrcodeBox-download {
+            width: 50%;
+            height: 50px;
+            display: inline;
+            float: left;
+        }
+
+        .close-btn {
+            width: 60px;
+            height: 30px;
+            border-radius: 3px;
+            line-height: 30px;
+            text-align: center;
+            font-size: 14px;
+            background-color: #999;
+            color: #FFFFD5;
+            float: right;
+            margin-top: 10px;
+            cursor: pointer;
+        }
+
+        .download-btn {
+            width: 120px;
+            height: 30px;
+            border-radius: 3px;
+            line-height: 30px;
+            text-align: center;
+            font-size: 14px;
+            background-color: #999;
+            color: #FFFFD5;
+            float: left;
+            margin-top: 10px;
+            cursor: pointer;
+        }
+	</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}/zplm/cmBrandAuth/">品牌授权列表</a></li>
+		<li class="active"><a href="${ctx}/zplm/cmBrandAuthProduct/?authId=${cmBrandAuthProduct.authId}">商品列表</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmBrandAuthProduct" action="${ctx}/zplm/cmBrandAuthProduct/?authId=${cmBrandAuthProduct.authId}" 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="name" htmlEscape="false" maxlength="50" class="input-medium"/>
+			 <label>商品sn码:</label>
+				<form:input path="snCode" htmlEscape="false" maxlength="255" class="input-medium"/>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			  <a class="btn btn-primary" href="${ctx}/zplm/cmBrandAuthProduct/form?authId=${cmBrandAuthProduct.authId}">新增</a>
+			<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>商品SN码</th>
+				<th>创建时间</th>
+				<th>创建人</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="product" varStatus="index">
+			<tr>
+				<td>
+					${index.index+1}
+				</td>
+				<td>
+					${product.name}
+				</td>
+				<td>
+					${product.snCode}
+				</td>
+				<td>
+					<fmt:formatDate value="${product.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					${product.createUserName}
+				</td>
+				<td>
+    				<a href="${ctx}/zplm/cmBrandAuthProduct/form?id=${product.id}&authId=${cmBrandAuthProduct.authId}">编辑</a>
+					<a href="${ctx}/zplm/cmBrandAuthProduct/delete?id=${product.id}&authId=${cmBrandAuthProduct.authId}" onclick="return confirmx('确认要删除该品牌授权商品吗?', this.href)">删除</a>
+					<a href="javascript:;" onclick="show('${product.id}','${fns:getConfig('wwwServer')}')">二维码</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+    <div class="qrcodeBox-content">
+        <div class="content-box">
+            <div class="qrcodeBox" id="qrcode">
+
+            </div>
+            <div class="qrcodeBox-colse">
+                <div class="close-btn">关闭</div>
+            </div>
+            <div class="qrcodeBox-download">
+                <div class="download-btn" onclick="downloadClick()">下载二维码</div>
+            </div>
+        </div>
+    </div>
+    <a id="downloadLink"></a>
+
+	<div class="pagination">${page}</div>
+    <script type="text/javascript" src="${ctxStatic}/QRCode/qrcode.js"></script>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            //弹出框去滚动条
+            top.$('#jbox-content').css("overflow-y", "hidden");
+            show_title(30);
+            $('.close-btn').click(function () {
+                closeAlert();
+            })
+        });
+
+        function show(id, wwwServer) {
+            $('.qrcodeBox-content').show(100);
+            new QRCode(document.getElementById("qrcode"), {
+                width: 220, //生成的二维码的宽度
+                height: 220, //生成的二维码的高度
+				text: wwwServer + "product/auth/product-" + id + ".html", //任意内容
+                colorDark : "#000000", // 生成的二维码的深色部分
+                colorLight : "#ffffff", //生成二维码的浅色部分
+                correctLevel : QRCode.CorrectLevel.H
+            });
+        }
+
+        function closeAlert() {
+            $('.qrcodeBox-content').hide(100);
+            $('#qrcode').empty();
+        }
+
+        //jquery
+        function downloadClick () {
+            // 获取base64的图片节点
+            debugger
+            var img = document.getElementById('qrcode').getElementsByTagName('img')[0];
+            // 构建画布
+            var canvas = document.createElement('canvas');
+            canvas.width = img.width;
+            canvas.height = img.height;
+            canvas.getContext('2d').drawImage(img, 0, 0);
+            // 构造url
+            url = canvas.toDataURL('image/png');
+            // 构造a标签并模拟点击
+            var downloadLink = document.getElementById('downloadLink');
+            downloadLink.setAttribute('href', url);
+            downloadLink.setAttribute('download', '二维码.png');
+            downloadLink.click();
+        }
+    </script>
+</body>
+</html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 146 - 0
src/main/webapp/static/QRCode/qrcode.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است