Przeglądaj źródła

品牌授权part2

Aslee 4 lat temu
rodzic
commit
ba14b35fcb
24 zmienionych plików z 1335 dodań i 678 usunięć
  1. 9 0
      src/main/java/com/caimei/modules/brand/entity/CmBrand.java
  2. 53 0
      src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthDao.java
  3. 36 0
      src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthProductDao.java
  4. 0 30
      src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthorizationDao.java
  5. 0 15
      src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthorizationProductDao.java
  6. 18 18
      src/main/java/com/caimei/modules/zplm/entity/CmBrandAuth.java
  7. 21 8
      src/main/java/com/caimei/modules/zplm/entity/CmBrandAuthProduct.java
  8. 55 0
      src/main/java/com/caimei/modules/zplm/entity/CmBrandProductParam.java
  9. 89 0
      src/main/java/com/caimei/modules/zplm/service/CmBrandAuthProductService.java
  10. 28 17
      src/main/java/com/caimei/modules/zplm/service/CmBrandAuthService.java
  11. 0 44
      src/main/java/com/caimei/modules/zplm/service/CmBrandAuthorizationProductService.java
  12. 100 0
      src/main/java/com/caimei/modules/zplm/web/CmBrandAuthController.java
  13. 92 0
      src/main/java/com/caimei/modules/zplm/web/CmBrandAuthProductController.java
  14. 0 89
      src/main/java/com/caimei/modules/zplm/web/CmBrandAuthorizationController.java
  15. 0 76
      src/main/java/com/caimei/modules/zplm/web/CmBrandAuthorizationProductController.java
  16. 49 36
      src/main/resources/mappings/modules/zplm/CmBrandAuthDao.xml
  17. 39 29
      src/main/resources/mappings/modules/zplm/CmBrandAuthProductMapper.xml
  18. 104 43
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthForm.jsp
  19. 13 13
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthList.jsp
  20. 264 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. 0 184
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthorizationProductForm.jsp
  23. 0 76
      src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthorizationProductList.jsp
  24. 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 auditStatus;		// 审核备注
 	private String sort;		// 排序
 	private String sort;		// 排序
 	private String logo;		//品牌logo
 	private String logo;		//品牌logo
+	private String authLogo;	//品牌授权logo
 	private String description;
 	private String description;
 
 
 	private String shopName;//供应商名称
 	private String shopName;//供应商名称
@@ -139,4 +140,12 @@ public class CmBrand extends DataEntity<CmBrand> {
 	public void setDescriptionFlag(String descriptionFlag) {
 	public void setDescriptionFlag(String descriptionFlag) {
 		this.descriptionFlag = descriptionFlag;
 		this.descriptionFlag = descriptionFlag;
 	}
 	}
+
+	public String getAuthLogo() {
+		return authLogo;
+	}
+
+	public void setAuthLogo(String authLogo) {
+		this.authLogo = authLogo;
+	}
 }
 }

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

@@ -0,0 +1,53 @@
+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);
+}

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

@@ -0,0 +1,36 @@
+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);
+}

+ 0 - 30
src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthorizationDao.java

@@ -1,30 +0,0 @@
-package com.caimei.modules.zplm.dao;
-
-import com.caimei.modules.brand.entity.CmBrand;
-import com.caimei.modules.common.entity.Country;
-import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.zplm.entity.CmBrandAuthorization;
-
-import java.util.List;
-
-/**
- * 品牌授权DAO接口
- * @author Aslee
- * @version 2021-03-24
- */
-@MyBatisDao
-public interface CmBrandAuthorizationDao extends CrudDao<CmBrandAuthorization> {
-
-    /**
-     * 查询品牌列表
-     * @return CmBrand
-     */
-    List<CmBrand> findBrandList();
-
-    /**
-     * 查询国家名称列表
-     * @return Country
-     */
-    List<Country> findCountryList();
-}

+ 0 - 15
src/main/java/com/caimei/modules/zplm/dao/CmBrandAuthorizationProductDao.java

@@ -1,15 +0,0 @@
-package com.caimei.modules.zplm.dao;
-
-import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.zplm.entity.CmBrandAuthorizationProduct;
-
-/**
- * 品牌授权商品DAO接口
- * @author Aslee
- * @version 2021-03-25
- */
-@MyBatisDao
-public interface CmBrandAuthorizationProductDao extends CrudDao<CmBrandAuthorizationProduct> {
-	
-}

+ 18 - 18
src/main/java/com/caimei/modules/zplm/entity/CmBrandAuthorization.java → src/main/java/com/caimei/modules/zplm/entity/CmBrandAuth.java

@@ -11,29 +11,29 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
  * @author Aslee
  * @author Aslee
  * @version 2021-03-24
  * @version 2021-03-24
  */
  */
-public class CmBrandAuthorization extends DataEntity<CmBrandAuthorization> {
+public class CmBrandAuth extends DataEntity<CmBrandAuth> {
 	
 	
 	private static final long serialVersionUID = 1L;
 	private static final long serialVersionUID = 1L;
 	private Integer brandId;		// 品牌Id
 	private Integer brandId;		// 品牌Id
 	private Integer countryId;		// 品牌产地国家Id
 	private Integer countryId;		// 品牌产地国家Id
-	private String brandLogo;		// 品牌logo
 	private String securityLink;		// 防伪链接
 	private String securityLink;		// 防伪链接
 	private Integer agentFlag;		// 是否有代理商:0没有,1有
 	private Integer agentFlag;		// 是否有代理商:0没有,1有
 	private String agentName;		// 代理商名称
 	private String agentName;		// 代理商名称
 	private Integer statementType;		// 代理声明类型:1弹窗,2链接
 	private Integer statementType;		// 代理声明类型:1弹窗,2链接
 	private String statementContent;		// 声明弹窗内容
 	private String statementContent;		// 声明弹窗内容
 	private String statementLink;		// 声明链接
 	private String statementLink;		// 声明链接
-	private String authorizedParty;		// 被授权方名称
+	private String authParty;		// 被授权方名称
 	private Date createTime;		// 创建时间
 	private Date createTime;		// 创建时间
 
 
 	private String brandName;		//品牌名
 	private String brandName;		//品牌名
+	private String authLogo;	// 品牌授权logo
 	private String createUserName;	//创建人用户名
 	private String createUserName;	//创建人用户名
 
 
-	public CmBrandAuthorization() {
+	public CmBrandAuth() {
 		super();
 		super();
 	}
 	}
 
 
-	public CmBrandAuthorization(String id){
+	public CmBrandAuth(String id){
 		super(id);
 		super(id);
 	}
 	}
 
 
@@ -53,15 +53,6 @@ public class CmBrandAuthorization extends DataEntity<CmBrandAuthorization> {
 		this.countryId = countryId;
 		this.countryId = countryId;
 	}
 	}
 	
 	
-	@Length(min=0, max=255, message="品牌logo长度必须介于 0 和 255 之间")
-	public String getBrandLogo() {
-		return brandLogo;
-	}
-
-	public void setBrandLogo(String brandLogo) {
-		this.brandLogo = brandLogo;
-	}
-	
 	@Length(min=0, max=255, message="防伪链接长度必须介于 0 和 255 之间")
 	@Length(min=0, max=255, message="防伪链接长度必须介于 0 和 255 之间")
 	public String getSecurityLink() {
 	public String getSecurityLink() {
 		return securityLink;
 		return securityLink;
@@ -114,12 +105,12 @@ public class CmBrandAuthorization extends DataEntity<CmBrandAuthorization> {
 	}
 	}
 	
 	
 	@Length(min=0, max=50, message="被授权方名称长度必须介于 0 和 50 之间")
 	@Length(min=0, max=50, message="被授权方名称长度必须介于 0 和 50 之间")
-	public String getAuthorizedParty() {
-		return authorizedParty;
+	public String getAuthParty() {
+		return authParty;
 	}
 	}
 
 
-	public void setAuthorizedParty(String authorizedParty) {
-		this.authorizedParty = authorizedParty;
+	public void setAuthParty(String authParty) {
+		this.authParty = authParty;
 	}
 	}
 	
 	
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -146,4 +137,13 @@ public class CmBrandAuthorization extends DataEntity<CmBrandAuthorization> {
 	public void setCreateUserName(String createUserName) {
 	public void setCreateUserName(String createUserName) {
 		this.createUserName = 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;
+	}
 }
 }

+ 21 - 8
src/main/java/com/caimei/modules/zplm/entity/CmBrandAuthorizationProduct.java → src/main/java/com/caimei/modules/zplm/entity/CmBrandAuthProduct.java

@@ -2,6 +2,8 @@ package com.caimei.modules.zplm.entity;
 
 
 import org.hibernate.validator.constraints.Length;
 import org.hibernate.validator.constraints.Length;
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
 
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
@@ -11,30 +13,33 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
  * @author Aslee
  * @author Aslee
  * @version 2021-03-25
  * @version 2021-03-25
  */
  */
-public class CmBrandAuthorizationProduct extends DataEntity<CmBrandAuthorizationProduct> {
+public class CmBrandAuthProduct extends DataEntity<CmBrandAuthProduct> {
 	
 	
 	private static final long serialVersionUID = 1L;
 	private static final long serialVersionUID = 1L;
-	private Integer authorizationId;		// 授权Id
+	private Integer authId;		// 授权Id
 	private String name;		// 商品名称
 	private String name;		// 商品名称
 	private String snCode;		// sn码
 	private String snCode;		// sn码
 	private String image;		// 商品图片
 	private String image;		// 商品图片
 	private Date createTime;		// 创建时间
 	private Date createTime;		// 创建时间
 	private String createUserName;	//创建人名称
 	private String createUserName;	//创建人名称
+
+
+    private List<CmBrandProductParam> paramList;      //商品参数列表
 	
 	
-	public CmBrandAuthorizationProduct() {
+	public CmBrandAuthProduct() {
 		super();
 		super();
 	}
 	}
 
 
-	public CmBrandAuthorizationProduct(String id){
+	public CmBrandAuthProduct(String id){
 		super(id);
 		super(id);
 	}
 	}
 
 
-	public Integer getAuthorizationId() {
-		return authorizationId;
+	public Integer getAuthId() {
+		return authId;
 	}
 	}
 
 
-	public void setAuthorizationId(Integer authorizationId) {
-		this.authorizationId = authorizationId;
+	public void setAuthId(Integer authId) {
+		this.authId = authId;
 	}
 	}
 	
 	
 	@Length(min=0, max=50, message="商品名称长度必须介于 0 和 50 之间")
 	@Length(min=0, max=50, message="商品名称长度必须介于 0 和 50 之间")
@@ -80,4 +85,12 @@ public class CmBrandAuthorizationProduct extends DataEntity<CmBrandAuthorization
 	public void setCreateUserName(String createUserName) {
 	public void setCreateUserName(String createUserName) {
 		this.createUserName = 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;
+	}
+	
+}

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

@@ -0,0 +1,89 @@
+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 logo = cmBrandAuthProduct.getImage();
+		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);
+				cmBrandAuthProduct.setImage(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->{
+				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);
+	}
+}

+ 28 - 17
src/main/java/com/caimei/modules/zplm/service/CmBrandAuthorizationService.java → src/main/java/com/caimei/modules/zplm/service/CmBrandAuthService.java

@@ -6,6 +6,7 @@ import java.util.List;
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.brand.utils.ImagePathUtils;
 import com.caimei.modules.brand.utils.ImagePathUtils;
 import com.caimei.modules.sys.utils.UploadImageUtils;
 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.config.Global;
 import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.utils.StringUtils;
@@ -15,8 +16,9 @@ import org.springframework.transaction.annotation.Transactional;
 
 
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.zplm.entity.CmBrandAuthorization;
-import com.caimei.modules.zplm.dao.CmBrandAuthorizationDao;
+import com.caimei.modules.zplm.dao.CmBrandAuthDao;
+
+import javax.annotation.Resource;
 
 
 /**
 /**
  * 品牌授权Service
  * 品牌授权Service
@@ -25,24 +27,26 @@ import com.caimei.modules.zplm.dao.CmBrandAuthorizationDao;
  */
  */
 @Service
 @Service
 @Transactional(readOnly = true)
 @Transactional(readOnly = true)
-public class CmBrandAuthorizationService extends CrudService<CmBrandAuthorizationDao, CmBrandAuthorization> {
+public class CmBrandAuthService extends CrudService<CmBrandAuthDao, CmBrandAuth> {
+	@Resource
+	CmBrandAuthDao cmBrandAuthDao;
 
 
-	public CmBrandAuthorization get(String id) {
+	public CmBrandAuth get(String id) {
 		return super.get(id);
 		return super.get(id);
 	}
 	}
 	
 	
-	public List<CmBrandAuthorization> findList(CmBrandAuthorization cmBrandAuthorization) {
-		return super.findList(cmBrandAuthorization);
+	public List<CmBrandAuth> findList(CmBrandAuth cmBrandAuth) {
+		return super.findList(cmBrandAuth);
 	}
 	}
 	
 	
-	public Page<CmBrandAuthorization> findPage(Page<CmBrandAuthorization> page, CmBrandAuthorization cmBrandAuthorization) {
-		return super.findPage(page, cmBrandAuthorization);
+	public Page<CmBrandAuth> findPage(Page<CmBrandAuth> page, CmBrandAuth cmBrandAuth) {
+		return super.findPage(page, cmBrandAuth);
 	}
 	}
 	
 	
 	@Transactional(readOnly = false)
 	@Transactional(readOnly = false)
-	public void save(CmBrandAuthorization cmBrandAuthorization) {
+	public void save(CmBrandAuth cmBrandAuth) {
 		//保存图片
 		//保存图片
-		String logo = cmBrandAuthorization.getBrandLogo();
+		String logo = cmBrandAuth.getAuthLogo();
 		if(StringUtils.isNotBlank(logo) && !logo.startsWith("http")){
 		if(StringUtils.isNotBlank(logo) && !logo.startsWith("http")){
 			String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
 			String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
 			logo= Encodes.urlDecode(logo);
 			logo= Encodes.urlDecode(logo);
@@ -51,21 +55,28 @@ public class CmBrandAuthorizationService extends CrudService<CmBrandAuthorizatio
 			ImageUploadInfo saveImageSerivce;
 			ImageUploadInfo saveImageSerivce;
 			try {
 			try {
 				saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
 				saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex,realPath);
-				cmBrandAuthorization.setBrandLogo(photoServer+saveImageSerivce.getSource());
+				cmBrandAuth.setAuthLogo(photoServer+saveImageSerivce.getSource());
 			} catch (Exception e) {
 			} catch (Exception e) {
 				logger.error("图片上传错误:"+e.toString(),e);
 				logger.error("图片上传错误:"+e.toString(),e);
 			}
 			}
 		}
 		}
-		if (cmBrandAuthorization.getIsNewRecord()) {
-			cmBrandAuthorization.setCreateBy(UserUtils.getUser());
-			cmBrandAuthorization.setCreateTime(new Date());
+		if (cmBrandAuth.getIsNewRecord()) {
+			cmBrandAuth.setCreateBy(UserUtils.getUser());
+			cmBrandAuth.setCreateTime(new Date());
 		}
 		}
-		super.save(cmBrandAuthorization);
+		//更新品牌授权logo
+        cmBrandAuthDao.updateBrandAuthLogo(cmBrandAuth.getBrandId(), cmBrandAuth.getAuthLogo());
+		//保存品牌授权
+		super.save(cmBrandAuth);
 	}
 	}
 	
 	
 	@Transactional(readOnly = false)
 	@Transactional(readOnly = false)
-	public void delete(CmBrandAuthorization cmBrandAuthorization) {
-		super.delete(cmBrandAuthorization);
+	public void delete(CmBrandAuth cmBrandAuth) {
+		//删除授权商品参数
+		cmBrandAuthDao.deleteParamsByAuthId(cmBrandAuth.getId());
+		//删除授权商品
+		cmBrandAuthDao.deleteProductsByAuthId(cmBrandAuth.getId());
+		super.delete(cmBrandAuth);
 	}
 	}
 	
 	
 }
 }

+ 0 - 44
src/main/java/com/caimei/modules/zplm/service/CmBrandAuthorizationProductService.java

@@ -1,44 +0,0 @@
-package com.caimei.modules.zplm.service;
-
-import java.util.List;
-
-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.CmBrandAuthorizationProduct;
-import com.caimei.modules.zplm.dao.CmBrandAuthorizationProductDao;
-
-/**
- * 品牌授权商品Service
- * @author Aslee
- * @version 2021-03-25
- */
-@Service
-@Transactional(readOnly = true)
-public class CmBrandAuthorizationProductService extends CrudService<CmBrandAuthorizationProductDao, CmBrandAuthorizationProduct> {
-
-	public CmBrandAuthorizationProduct get(String id) {
-		return super.get(id);
-	}
-	
-	public List<CmBrandAuthorizationProduct> findList(CmBrandAuthorizationProduct cmBrandAuthorizationProduct) {
-		return super.findList(cmBrandAuthorizationProduct);
-	}
-	
-	public Page<CmBrandAuthorizationProduct> findPage(Page<CmBrandAuthorizationProduct> page, CmBrandAuthorizationProduct cmBrandAuthorizationProduct) {
-		return super.findPage(page, cmBrandAuthorizationProduct);
-	}
-	
-	@Transactional(readOnly = false)
-	public void save(CmBrandAuthorizationProduct cmBrandAuthorizationProduct) {
-		super.save(cmBrandAuthorizationProduct);
-	}
-	
-	@Transactional(readOnly = false)
-	public void delete(CmBrandAuthorizationProduct cmBrandAuthorizationProduct) {
-		super.delete(cmBrandAuthorizationProduct);
-	}
-	
-}

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

@@ -0,0 +1,100 @@
+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;
+		}
+		return false;
+	}
+}

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

@@ -0,0 +1,92 @@
+package com.caimei.modules.zplm.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.live.entity.NewPageLive;
+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.List;
+
+/**
+ * 品牌授权商品Controller
+ * @author Aslee
+ * @version 2021-03-25
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/zplm/cmBrandAuthProduct")
+public class CmBrandAuthProductController extends BaseController {
+
+	@Autowired
+	private CmBrandAuthProductService cmBrandAuthProductService;
+	
+	@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 = cmBrandAuthProductService.getProductParams(cmBrandAuthProduct.getId());
+		cmBrandAuthProduct.setParamList(paramList);
+		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&authorizationId="+cmBrandAuthProduct.getAuthId();
+	}
+	
+	@RequestMapping(value = "delete")
+	public String delete(CmBrandAuthProduct cmBrandAuthProduct, RedirectAttributes redirectAttributes) {
+		cmBrandAuthProductService.delete(cmBrandAuthProduct);
+		addMessage(redirectAttributes, "删除品牌授权商品成功");
+		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuthProduct/?repage&authorizationId="+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;
+		}
+		return false;
+	}
+}

+ 0 - 89
src/main/java/com/caimei/modules/zplm/web/CmBrandAuthorizationController.java

@@ -1,89 +0,0 @@
-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.CmBrandAuthorizationDao;
-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.CmBrandAuthorization;
-import com.caimei.modules.zplm.service.CmBrandAuthorizationService;
-
-import java.util.List;
-
-/**
- * 品牌授权Controller
- * @author Aslee
- * @version 2021-03-24
- */
-@Controller
-@RequestMapping(value = "${adminPath}/zplm/cmBrandAuthorization")
-public class CmBrandAuthorizationController extends BaseController {
-
-	@Autowired
-	private CmBrandAuthorizationService cmBrandAuthorizationService;
-
-	@Resource
-	private CmBrandAuthorizationDao cmBrandAuthorizationDao;
-	
-	@ModelAttribute
-	public CmBrandAuthorization get(@RequestParam(required=false) String id) {
-		CmBrandAuthorization entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmBrandAuthorizationService.get(id);
-		}
-		if (entity == null){
-			entity = new CmBrandAuthorization();
-		}
-		return entity;
-	}
-	
-	@RequestMapping(value = {"list", ""})
-	public String list(CmBrandAuthorization cmBrandAuthorization, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<CmBrandAuthorization> page = cmBrandAuthorizationService.findPage(new Page<CmBrandAuthorization>(request, response), cmBrandAuthorization); 
-		model.addAttribute("page", page);
-		return "modules/zplm/cmBrandAuthorizationList";
-	}
-
-	@RequestMapping(value = "form")
-	public String form(CmBrandAuthorization cmBrandAuthorization, Model model) {
-		List<CmBrand> brandList = cmBrandAuthorizationDao.findBrandList();
-		List<Country> countryList = cmBrandAuthorizationDao.findCountryList();
-		model.addAttribute("brandList", brandList);
-		model.addAttribute("countryList", countryList);
-		model.addAttribute("cmBrandAuthorization", cmBrandAuthorization);
-		return "modules/zplm/cmBrandAuthorizationForm";
-	}
-
-	@RequestMapping(value = "save")
-	public String save(CmBrandAuthorization cmBrandAuthorization, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, cmBrandAuthorization)){
-			return form(cmBrandAuthorization, model);
-		}
-		cmBrandAuthorizationService.save(cmBrandAuthorization);
-		addMessage(redirectAttributes, "保存品牌授权成功");
-		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuthorization/?repage";
-	}
-	
-	@RequestMapping(value = "delete")
-	public String delete(CmBrandAuthorization cmBrandAuthorization, RedirectAttributes redirectAttributes) {
-		cmBrandAuthorizationService.delete(cmBrandAuthorization);
-		addMessage(redirectAttributes, "删除品牌授权成功");
-		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuthorization/?repage";
-	}
-
-}

+ 0 - 76
src/main/java/com/caimei/modules/zplm/web/CmBrandAuthorizationProductController.java

@@ -1,76 +0,0 @@
-package com.caimei.modules.zplm.web;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-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.CmBrandAuthorizationProduct;
-import com.caimei.modules.zplm.service.CmBrandAuthorizationProductService;
-
-/**
- * 品牌授权商品Controller
- * @author Aslee
- * @version 2021-03-25
- */
-@Controller
-@RequestMapping(value = "${adminPath}/zplm/cmBrandAuthorizationProduct")
-public class CmBrandAuthorizationProductController extends BaseController {
-
-	@Autowired
-	private CmBrandAuthorizationProductService cmBrandAuthorizationProductService;
-	
-	@ModelAttribute
-	public CmBrandAuthorizationProduct get(@RequestParam(required=false) String id) {
-		CmBrandAuthorizationProduct entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmBrandAuthorizationProductService.get(id);
-		}
-		if (entity == null){
-			entity = new CmBrandAuthorizationProduct();
-		}
-		return entity;
-	}
-	
-	@RequestMapping(value = {"list", ""})
-	public String list(CmBrandAuthorizationProduct cmBrandAuthorizationProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<CmBrandAuthorizationProduct> page = cmBrandAuthorizationProductService.findPage(new Page<CmBrandAuthorizationProduct>(request, response), cmBrandAuthorizationProduct); 
-		model.addAttribute("page", page);
-		return "modules/zplm/cmBrandAuthorizationProductList";
-	}
-
-	@RequestMapping(value = "form")
-	public String form(CmBrandAuthorizationProduct cmBrandAuthorizationProduct, Model model) {
-		model.addAttribute("cmBrandAuthorizationProduct", cmBrandAuthorizationProduct);
-		return "modules/zplm/cmBrandAuthorizationProductForm";
-	}
-
-	@RequestMapping(value = "save")
-	public String save(CmBrandAuthorizationProduct cmBrandAuthorizationProduct, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, cmBrandAuthorizationProduct)){
-			return form(cmBrandAuthorizationProduct, model);
-		}
-		cmBrandAuthorizationProductService.save(cmBrandAuthorizationProduct);
-		addMessage(redirectAttributes, "保存品牌授权商品成功");
-		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuthorizationProduct/?repage&authorizationId="+cmBrandAuthorizationProduct.getAuthorizationId();
-	}
-	
-	@RequestMapping(value = "delete")
-	public String delete(CmBrandAuthorizationProduct cmBrandAuthorizationProduct, RedirectAttributes redirectAttributes) {
-		cmBrandAuthorizationProductService.delete(cmBrandAuthorizationProduct);
-		addMessage(redirectAttributes, "删除品牌授权商品成功");
-		return "redirect:"+Global.getAdminPath()+"/zplm/cmBrandAuthorizationProduct/?repage&authorizationId="+cmBrandAuthorizationProduct.getAuthorizationId();
-	}
-
-}

+ 49 - 36
src/main/resources/mappings/modules/zplm/CmBrandAuthorizationMapper.xml → src/main/resources/mappings/modules/zplm/CmBrandAuthDao.xml

@@ -1,43 +1,43 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?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">
 <!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.CmBrandAuthorizationDao">
+<mapper namespace="com.caimei.modules.zplm.dao.CmBrandAuthDao">
     
     
-	<sql id="cmBrandAuthorizationColumns">
+	<sql id="cmBrandAuthColumns">
 		a.id AS "id",
 		a.id AS "id",
 		a.brandId AS "brandId",
 		a.brandId AS "brandId",
 		a.countryId AS "countryId",
 		a.countryId AS "countryId",
-		a.brandLogo AS "logoImage",
 		a.securityLink AS "securityLink",
 		a.securityLink AS "securityLink",
 		a.agentFlag AS "agentFlag",
 		a.agentFlag AS "agentFlag",
 		a.agentName AS "agentName",
 		a.agentName AS "agentName",
 		a.statementType AS "statementType",
 		a.statementType AS "statementType",
 		a.statementContent AS "statementContent",
 		a.statementContent AS "statementContent",
 		a.statementLink AS "statementLink",
 		a.statementLink AS "statementLink",
-		a.authorizedParty AS "authorizedParty",
+		a.authParty AS "authParty",
 		a.createTime AS "createTime",
 		a.createTime AS "createTime",
 		a.createBy AS "createBy.id",
 		a.createBy AS "createBy.id",
 		cb.name AS "brandName",
 		cb.name AS "brandName",
+		cb.authLogo AS "authLogo",
 		su.login_name AS "createUserName"
 		su.login_name AS "createUserName"
 	</sql>
 	</sql>
 	
 	
-	<sql id="cmBrandAuthorizationJoins">
+	<sql id="cmBrandAuthJoins">
 		left join cm_brand cb on a.brandId = cb.id
 		left join cm_brand cb on a.brandId = cb.id
 		left join sys_user su on a.createBy = su.id
 		left join sys_user su on a.createBy = su.id
 	</sql>
 	</sql>
     
     
-	<select id="get" resultType="CmBrandAuthorization">
+	<select id="get" resultType="CmBrandAuth">
 		SELECT 
 		SELECT 
-			<include refid="cmBrandAuthorizationColumns"/>
-		FROM cm_brand_authorization a
-		<include refid="cmBrandAuthorizationJoins"/>
+			<include refid="cmBrandAuthColumns"/>
+		FROM cm_brand_auth a
+		<include refid="cmBrandAuthJoins"/>
 		WHERE a.id = #{id}
 		WHERE a.id = #{id}
 	</select>
 	</select>
 	
 	
-	<select id="findList" resultType="CmBrandAuthorization">
+	<select id="findList" resultType="CmBrandAuth">
 		SELECT 
 		SELECT 
-			<include refid="cmBrandAuthorizationColumns"/>
-		FROM cm_brand_authorization a
-		<include refid="cmBrandAuthorizationJoins"/>
+			<include refid="cmBrandAuthColumns"/>
+		FROM cm_brand_auth a
+		<include refid="cmBrandAuthJoins"/>
 		<where>
 		<where>
 			
 			
 			<if test="brandName != null and brandName != ''">
 			<if test="brandName != null and brandName != ''">
@@ -49,11 +49,11 @@
 					<if test="dbName == 'mssql'">'%'+#{agentName}+'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{agentName}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{agentName},'%')</if>
 					<if test="dbName == 'mysql'">concat('%',#{agentName},'%')</if>
 			</if>
 			</if>
-			<if test="authorizedParty != null and authorizedParty != ''">
-				AND a.authorizedParty LIKE 
-					<if test="dbName == 'oracle'">'%'||#{authorizedParty}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{authorizedParty}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{authorizedParty},'%')</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>
 			</if>
 		</where>
 		</where>
 		<choose>
 		<choose>
@@ -65,11 +65,11 @@
 		</choose>
 		</choose>
 	</select>
 	</select>
 	
 	
-	<select id="findAllList" resultType="CmBrandAuthorization">
+	<select id="findAllList" resultType="CmBrandAuth">
 		SELECT 
 		SELECT 
-			<include refid="cmBrandAuthorizationColumns"/>
-		FROM cm_brand_authorization a
-		<include refid="cmBrandAuthorizationJoins"/>
+			<include refid="cmBrandAuthColumns"/>
+		FROM cm_brand_auth a
+		<include refid="cmBrandAuthJoins"/>
 		<where>
 		<where>
 			
 			
 		</where>		
 		</where>		
@@ -82,47 +82,44 @@
 		</choose>
 		</choose>
 	</select>
 	</select>
 	<select id="findBrandList" resultType="com.caimei.modules.brand.entity.CmBrand">
 	<select id="findBrandList" resultType="com.caimei.modules.brand.entity.CmBrand">
-		select id, name from cm_brand;
+		select id, name, authLogo from cm_brand;
 	</select>
 	</select>
 	<select id="findCountryList" resultType="com.caimei.modules.common.entity.Country">
 	<select id="findCountryList" resultType="com.caimei.modules.common.entity.Country">
 		select countryId, name from country;
 		select countryId, name from country;
 	</select>
 	</select>
 
 
-	<insert id="insert" parameterType="CmBrandAuthorization"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_brand_authorization(
+    <insert id="insert" parameterType="CmBrandAuth"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_brand_auth(
 			brandId,
 			brandId,
 			countryId,
 			countryId,
-			brandLogo,
 			securityLink,
 			securityLink,
 			agentFlag,
 			agentFlag,
 			agentName,
 			agentName,
 			statementType,
 			statementType,
 			statementContent,
 			statementContent,
 			statementLink,
 			statementLink,
-			authorizedParty,
+			authParty,
 			createTime,
 			createTime,
 			createBy
 			createBy
 		) VALUES (
 		) VALUES (
 			#{brandId},
 			#{brandId},
 			#{countryId},
 			#{countryId},
-			#{brandLogo},
 			#{securityLink},
 			#{securityLink},
 			#{agentFlag},
 			#{agentFlag},
 			#{agentName},
 			#{agentName},
 			#{statementType},
 			#{statementType},
 			#{statementContent},
 			#{statementContent},
 			#{statementLink},
 			#{statementLink},
-			#{authorizedParty},
+			#{authParty},
 			#{createTime},
 			#{createTime},
 			#{createBy.id}
 			#{createBy.id}
 		)
 		)
 	</insert>
 	</insert>
 	
 	
 	<update id="update">
 	<update id="update">
-		UPDATE cm_brand_authorization SET 	
+		UPDATE cm_brand_auth SET 	
 			brandId = #{brandId},
 			brandId = #{brandId},
 			countryId = #{countryId},
 			countryId = #{countryId},
-			brandLogo = #{brandLogo},
 			securityLink = #{securityLink},
 			securityLink = #{securityLink},
 			agentFlag = #{agentFlag},
 			agentFlag = #{agentFlag},
 			agentName = #{agentName},
 			agentName = #{agentName},
@@ -133,13 +130,29 @@
 			<if test="statementLink != null and statementLink != ''">
 			<if test="statementLink != null and statementLink != ''">
 				statementLink = #{statementLink},
 				statementLink = #{statementLink},
 			</if>
 			</if>
-			authorizedParty = #{authorizedParty}
+			authParty = #{authParty}
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</update>
 	</update>
-	
-	<delete id="delete">
-		DELETE FROM cm_brand_authorization
+    <update id="updateBrandAuthLogo">
+        update cm_brand
+        set authLogo = #{authLogo}
+        where id = #{brandId}
+    </update>
+
+    <delete id="delete">
+		DELETE FROM cm_brand_auth
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</delete>
 	</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>
 </mapper>

+ 39 - 29
src/main/resources/mappings/modules/zplm/CmBrandAuthorizationProductMapper.xml → src/main/resources/mappings/modules/zplm/CmBrandAuthProductMapper.xml

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?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">
 <!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.CmBrandAuthorizationProductDao">
+<mapper namespace="com.caimei.modules.zplm.dao.CmBrandAuthProductDao">
     
     
-	<sql id="cmBrandAuthorizationProductColumns">
+	<sql id="cmBrandAuthProductColumns">
 		a.id AS "id",
 		a.id AS "id",
-		a.authorizationId AS "authorizationId",
+		a.authId AS "authId",
 		a.name AS "name",
 		a.name AS "name",
 		a.snCode AS "snCode",
 		a.snCode AS "snCode",
 		a.image AS "image",
 		a.image AS "image",
@@ -13,27 +13,27 @@
 		su.login_name AS "createUserName"
 		su.login_name AS "createUserName"
 	</sql>
 	</sql>
 	
 	
-	<sql id="cmBrandAuthorizationProductJoins">
-		left join cm_brand_authorization cba on a.authorizationId = cba.id
+	<sql id="cmBrandAuthProductJoins">
+		left join cm_brand_auth cba on a.authId = cba.id
 		left join sys_user su on a.createBy = su.id
 		left join sys_user su on a.createBy = su.id
 	</sql>
 	</sql>
     
     
-	<select id="get" resultType="CmBrandAuthorizationProduct">
+	<select id="get" resultType="CmBrandAuthProduct">
 		SELECT 
 		SELECT 
-			<include refid="cmBrandAuthorizationProductColumns"/>
-		FROM cm_brand_authorization_product a
-		<include refid="cmBrandAuthorizationProductJoins"/>
+			<include refid="cmBrandAuthProductColumns"/>
+		FROM cm_brand_auth_product a
+		<include refid="cmBrandAuthProductJoins"/>
 		WHERE a.id = #{id}
 		WHERE a.id = #{id}
 	</select>
 	</select>
 	
 	
-	<select id="findList" resultType="CmBrandAuthorizationProduct">
+	<select id="findList" resultType="CmBrandAuthProduct">
 		SELECT 
 		SELECT 
-			<include refid="cmBrandAuthorizationProductColumns"/>
-		FROM cm_brand_authorization_product a
-		<include refid="cmBrandAuthorizationProductJoins"/>
+			<include refid="cmBrandAuthProductColumns"/>
+		FROM cm_brand_auth_product a
+		<include refid="cmBrandAuthProductJoins"/>
 		<where>
 		<where>
-			<if test="authorizationId != null">
-				AND a.authorizationId = #{authorizationId}
+			<if test="authId != null">
+				AND a.authId = #{authId}
 			</if>
 			</if>
 			<if test="name != null and name != ''">
 			<if test="name != null and name != ''">
 				AND a.name LIKE 
 				AND a.name LIKE 
@@ -57,11 +57,11 @@
 		</choose>
 		</choose>
 	</select>
 	</select>
 	
 	
-	<select id="findAllList" resultType="CmBrandAuthorizationProduct">
+	<select id="findAllList" resultType="CmBrandAuthProduct">
 		SELECT 
 		SELECT 
-			<include refid="cmBrandAuthorizationProductColumns"/>
-		FROM cm_brand_authorization_product a
-		<include refid="cmBrandAuthorizationProductJoins"/>
+			<include refid="cmBrandAuthProductColumns"/>
+		FROM cm_brand_auth_product a
+		<include refid="cmBrandAuthProductJoins"/>
 		<where>
 		<where>
 			
 			
 		</where>		
 		</where>		
@@ -73,17 +73,20 @@
 			</otherwise>
 			</otherwise>
 		</choose>
 		</choose>
 	</select>
 	</select>
-	
-	<insert id="insert" parameterType="CmBrandAuthorizationProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_brand_authorization_product(
-			authorizationId,
+	<select id="findParamsByProductId" resultType="com.caimei.modules.zplm.entity.CmBrandProductParam">
+		select name,content from cm_brand_product_param where productId = #{productId}
+	</select>
+
+	<insert id="insert" parameterType="CmBrandAuthProduct"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_brand_auth_product(
+			authId,
 			name,
 			name,
 			snCode,
 			snCode,
 			image,
 			image,
 			createTime,
 			createTime,
 			createBy
 			createBy
 		) VALUES (
 		) VALUES (
-			#{authorizationId},
+			#{authId},
 			#{name},
 			#{name},
 			#{snCode},
 			#{snCode},
 			#{image},
 			#{image},
@@ -91,10 +94,14 @@
 			#{createBy.id}
 			#{createBy.id}
 		)
 		)
 	</insert>
 	</insert>
-	
+	<insert id="insertParam">
+		insert into cm_brand_product_param (productId, name, content)
+		values (#{productId},#{name},#{content})
+	</insert>
+
 	<update id="update">
 	<update id="update">
-		UPDATE cm_brand_authorization_product SET 	
-			authorizationId = #{authorizationId},
+		UPDATE cm_brand_auth_product SET 	
+			authId = #{authId},
 			name = #{name},
 			name = #{name},
 			snCode = #{snCode},
 			snCode = #{snCode},
 			image = #{image}
 			image = #{image}
@@ -102,8 +109,11 @@
 	</update>
 	</update>
 	
 	
 	<delete id="delete">
 	<delete id="delete">
-		DELETE FROM cm_brand_authorization_product
+		DELETE FROM cm_brand_auth_product
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</delete>
 	</delete>
-	
+    <delete id="deleteParamsByProductId">
+		delete from cm_brand_product_param where productId = #{productId}
+	</delete>
+
 </mapper>
 </mapper>

+ 104 - 43
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthorizationForm.jsp → src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthForm.jsp

@@ -88,16 +88,16 @@
 </head>
 </head>
 <body>
 <body>
 	<ul class="nav nav-tabs">
 	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/zplm/cmBrandAuthorization/">品牌授权列表</a></li>
-		<li class="active"><a href="${ctx}/zplm/cmBrandAuthorization/form?id=${cmBrandAuthorization.id}">品牌授权${not empty cmBrandAuthorization.id?'编辑':'添加'}</a></li>
+		<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/>
 	</ul><br/>
-	<form:form id="inputForm" modelAttribute="cmBrandAuthorization" action="${ctx}/zplm/cmBrandAuthorization/save" method="post" class="form-horizontal">
+	<form:form id="inputForm" modelAttribute="cmBrandAuth" action="${ctx}/zplm/cmBrandAuth/save" method="post" class="form-horizontal">
 		<form:hidden path="id"/>
 		<form:hidden path="id"/>
 		<sys:message content="${message}"/>		
 		<sys:message content="${message}"/>		
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label">*品牌:</label>
 			<label class="control-label">*品牌:</label>
 			<div class="controls">
 			<div class="controls">
-				<form:select path="brandId" class="input-medium ">
+				<form:select path="brandId" class="input-medium required" onchange="changeBrand()">
 					<form:option value="" label="请选择"/>
 					<form:option value="" label="请选择"/>
 					<form:options items="${brandList}" itemLabel="name" itemValue="id"/>
 					<form:options items="${brandList}" itemLabel="name" itemValue="id"/>
 				</form:select>
 				</form:select>
@@ -106,7 +106,7 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label">*产地:</label>
 			<label class="control-label">*产地:</label>
 			<div class="controls">
 			<div class="controls">
-				<form:select path="countryId" class="input-medium ">
+				<form:select path="countryId" class="input-medium required">
 					<form:option value="" label="请选择"/>
 					<form:option value="" label="请选择"/>
                     <form:options items="${countryList}" itemLabel="name" itemValue="countryId"/>
                     <form:options items="${countryList}" itemLabel="name" itemValue="countryId"/>
 				</form:select>
 				</form:select>
@@ -114,10 +114,10 @@
 		</div>
 		</div>
 		<div class="control-group iconBox">
 		<div class="control-group iconBox">
 			<label class="control-label">*品牌logo:</label>
 			<label class="control-label">*品牌logo:</label>
-            <div class="controls upload-content" id="brandLogoBox">
+            <div class="controls upload-content" id="authLogoBox">
                 <div class="conList">
                 <div class="conList">
-                    <form:hidden id="brandLogo" path="brandLogo" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-                    <sys:ckfinder input="brandLogo" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                    <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>
                     <br>
                     <label style="margin-left: 150px">建议图片分辨率252px*252px</label>
                     <label style="margin-left: 150px">建议图片分辨率252px*252px</label>
                 </div>
                 </div>
@@ -126,14 +126,14 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label">防伪链接:</label>
 			<label class="control-label">防伪链接:</label>
 			<div class="controls">
 			<div class="controls">
-				<form:input path="securityLink" htmlEscape="false" maxlength="255" class="input-xlarge "/>
+				<form:input path="securityLink" htmlEscape="false" maxlength="255" class="input-xlarge" placeholder="输入官方防伪链接"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label">代理商:</label>
 			<label class="control-label">代理商:</label>
 			<div class="controls">
 			<div class="controls">
-				<form:radiobutton path="agentFlag" value="0" label="无" onclick="changeAgentFlag()"/>
-				<form:radiobutton path="agentFlag" value="1" label="有" checked="true" onclick="changeAgentFlag()"/>
+				<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>
 		</div>
 
 
@@ -141,26 +141,26 @@
             <div class="control-group">
             <div class="control-group">
                 <label class="control-label">*代理商名称:</label>
                 <label class="control-label">*代理商名称:</label>
                 <div class="controls">
                 <div class="controls">
-                    <form:input path="agentName" htmlEscape="false" maxlength="50" class="input-xlarge "/>
+                    <form:input path="agentName" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入代理商名称"/>
                 </div>
                 </div>
             </div>
             </div>
             <div class="control-group">
             <div class="control-group">
                 <label class="control-label">代理声明:</label>
                 <label class="control-label">代理声明:</label>
                 <div class="controls">
                 <div class="controls">
-                    <form:radiobutton path="statementType" value="1" label="弹窗" checked="true" onclick="changeStatementType()"/>
-                    <form:radiobutton path="statementType" value="2" label="链接" onclick="changeStatementType()"/>
+					<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>
             </div>
             <div class="control-group" id="statementContentDiv">
             <div class="control-group" id="statementContentDiv">
                 <label class="control-label">*内容:</label>
                 <label class="control-label">*内容:</label>
                 <div class="controls">
                 <div class="controls">
-                    <form:textarea path="statementContent" htmlEscape="false" rows="4" class="input-xxlarge "/>
+                    <form:textarea path="statementContent" htmlEscape="false" rows="4" class="input-xxlarge required"/>
                 </div>
                 </div>
             </div>
             </div>
             <div class="control-group" id="statementLinkDiv">
             <div class="control-group" id="statementLinkDiv">
                 <label class="control-label">*链接:</label>
                 <label class="control-label">*链接:</label>
                 <div class="controls">
                 <div class="controls">
-                    <form:input path="statementLink" htmlEscape="false" maxlength="255" class="input-xlarge "/>
+                    <form:input path="statementLink" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
@@ -168,7 +168,7 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label">*被授权方:</label>
 			<label class="control-label">*被授权方:</label>
 			<div class="controls">
 			<div class="controls">
-				<form:input path="authorizedParty" htmlEscape="false" maxlength="50" class="input-xlarge "/>
+				<form:input path="authParty" htmlEscape="false" maxlength="50" class="input-xlarge required" placeholder="输入被授权方名称"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="form-actions">
 		<div class="form-actions">
@@ -205,32 +205,34 @@
         });
         });
         observer.observe(observeEle, MutationObserverConfig);
         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 () {
-                $("#brandLogo").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);
-        });
-    });
+		$('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>
 <script type="text/javascript">
 <script type="text/javascript">
     $(function () {
     $(function () {
@@ -248,6 +250,8 @@
 		}
 		}
     }
     }
 
 
+
+
     //修改声明类型
     //修改声明类型
     function changeStatementType() {
     function changeStatementType() {
 		var statementType = $('input[name="statementType"]:checked').val();
 		var statementType = $('input[name="statementType"]:checked').val();
@@ -259,6 +263,63 @@
 			$("#statementLinkDiv").show();
 			$("#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);
+			}
+			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>
 </script>
 </body>
 </body>
 </html>
 </html>

+ 13 - 13
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthorizationList.jsp → src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthList.jsp

@@ -22,10 +22,10 @@
 </head>
 </head>
 <body>
 <body>
 	<ul class="nav nav-tabs">
 	<ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/zplm/cmBrandAuthorization/">品牌授权列表</a></li>
-		<li><a href="${ctx}/zplm/cmBrandAuthorization/form">新增</a></li>
+		<li class="active"><a href="${ctx}/zplm/cmBrandAuth/">品牌授权列表</a></li>
+		<li><a href="${ctx}/zplm/cmBrandAuth/form">新增</a></li>
 	</ul>
 	</ul>
-	<form:form id="searchForm" modelAttribute="cmBrandAuthorization" action="${ctx}/zplm/cmBrandAuthorization/" method="post" class="breadcrumb form-search">
+	<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="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 		<div class="ul-form">
 		<div class="ul-form">
@@ -34,7 +34,7 @@
 			<label>代理商名称:</label>
 			<label>代理商名称:</label>
 				<form:input path="agentName" htmlEscape="false" maxlength="50" class="input-medium"/>
 				<form:input path="agentName" htmlEscape="false" maxlength="50" class="input-medium"/>
 			 <label>被授权方名称:</label>
 			 <label>被授权方名称:</label>
-				<form:input path="authorizedParty" htmlEscape="false" maxlength="50" class="input-medium"/>
+				<form:input path="authParty" htmlEscape="false" maxlength="50" class="input-medium"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			<div class="clearfix"></div>
 			<div class="clearfix"></div>
 		</div>
 		</div>
@@ -53,30 +53,30 @@
 			</tr>
 			</tr>
 		</thead>
 		</thead>
 		<tbody>
 		<tbody>
-		<c:forEach items="${page.list}" var="cmBrandAuthorization" varStatus="index">
+		<c:forEach items="${page.list}" var="cmBrandAuth" varStatus="index">
 			<tr>
 			<tr>
 				<td>
 				<td>
 					${index.index+1}
 					${index.index+1}
 				</a></td>
 				</a></td>
 				<td>
 				<td>
-					${cmBrandAuthorization.brandName}
+					${cmBrandAuth.brandName}
 				</td>
 				</td>
 				<td>
 				<td>
-					${cmBrandAuthorization.agentName eq null?'---':cmBrandAuthorization.agentName}
+					${cmBrandAuth.agentFlag eq 0?'---':cmBrandAuth.agentName}
 				</td>
 				</td>
 				<td>
 				<td>
-					${cmBrandAuthorization.authorizedParty}
+					${cmBrandAuth.authParty}
 				</td>
 				</td>
 				<td>
 				<td>
-					<fmt:formatDate value="${cmBrandAuthorization.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+					<fmt:formatDate value="${cmBrandAuth.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
 				</td>
 				<td>
 				<td>
-					${cmBrandAuthorization.createUserName}
+					${cmBrandAuth.createUserName}
 				</td>
 				</td>
 				<td>
 				<td>
-    				<a href="${ctx}/zplm/cmBrandAuthorization/form?id=${cmBrandAuthorization.id}">编辑</a>
-					<a href="${ctx}/zplm/cmBrandAuthorization/delete?id=${cmBrandAuthorization.id}" onclick="return confirmx('是否删除该数据,删除后,对应的商品数据也将被全部删除,确认是否删除', this.href)">删除</a>
-					<a href="${ctx}/zplm/cmBrandAuthorizationProduct/?authorizationId=${cmBrandAuthorization.id}">商品列表</a>
+    				<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>
 				</td>
 			</tr>
 			</tr>
 		</c:forEach>
 		</c:forEach>

+ 264 - 0
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthProductForm.jsp

@@ -0,0 +1,264 @@
+<%@ 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;
+		}
+		.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;
+		}
+        .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="authId"/>
+		<sys:message content="${message}"/>
+		<div class="control-group">
+			<label class="control-label">*商品名称:</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">*商品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">*商品图片:</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">建议图片分辨率252px*252px</label>
+				</div>
+			</div>
+		</div>
+        <div class="control-group paramList">
+            <label class="control-label">*相关参数:</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" value="品牌" 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" value="尺寸" 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" value="功率" 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" value="重量" placeholder="参数名称">
+				<input name="paramList[3].content" htmlEscape="false" class="input-xlarge required" maxlength="50" placeholder="输入参数信息">
+            </div>
+			<div class="controls paramRow" id="paramRow4">
+				<input name="paramList[4].name" htmlEscape="false" class="input-small required" maxlength="10" placeholder="参数名称">
+				<input name="paramList[4].content" htmlEscape="false" class="input-xlarge required" maxlength="50" placeholder="输入参数信息">
+				<a onclick="deleteParam(4)" style="cursor: pointer">删除</a>
+            </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>
+		<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 () {
+						$("#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")
+							}
+						})
+					}, 200);
+				});
+				var productId = ${empty cmBrandAuthProduct.id?'null':cmBrandAuthProduct.id};
+				if (productId != null) {
+					var paramListSize = ${cmBrandAuthProduct.paramList.size()} ;
+					if (paramListSize == 4){
+						$("#paramRow4").remove();
+					}else if (paramListSize > 5) {
+						var index = 5;
+						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]);
+                    }
+				}
+			});
+
+			//参数索引
+			var paramIndex = 5;
+
+			//删除参数
+			function deleteParam(index){
+				$("#paramRow" + index).remove();
+				paramIndex = paramIndex -1;
+			}
+
+			//添加参数
+			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, ""); //清除"数字"和"英文"以外的字符
+            }
+
+		</script>
+	</form:form>
+</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>

+ 0 - 184
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthorizationProductForm.jsp

@@ -1,184 +0,0 @@
-<%@ 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;
-		}
-		.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>
-</head>
-<body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/zplm/cmBrandAuthorization/">品牌授权列表</a></li>
-		<li><a href="${ctx}/zplm/cmBrandAuthorizationProduct/?authorizationId=${cmBrandAuthorizationProduct.authorizationId}">商品列表</a></li>
-		<li class="active"><a href="${ctx}/zplm/cmBrandAuthorizationProduct/form?id=${cmBrandAuthorizationProduct.id}&authorizationId=${cmBrandAuthorizationProduct.authorizationId}">商品${not empty cmBrandAuthorizationProduct.id?'编辑':'添加'}</a></li>
-	</ul><br/>
-	<form:form id="inputForm" modelAttribute="cmBrandAuthorizationProduct" action="${ctx}/zplm/cmBrandAuthorizationProduct/save" method="post" class="form-horizontal">
-		<form:hidden path="id"/>
-		<form:hidden path="authorizationId"/>
-		<sys:message content="${message}"/>
-		<div class="control-group">
-			<label class="control-label">商品名称:</label>
-			<div class="controls">
-				<form:input path="name" htmlEscape="false" maxlength="50" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">sn码:</label>
-			<div class="controls">
-				<form:input path="snCode" htmlEscape="false" maxlength="255" class="input-xlarge "/>
-			</div>
-		</div>
-		<div class="control-group iconBox">
-			<label class="control-label">*商品图片:</label>
-			<div class="controls upload-content" id="imageBox">
-				<div class="conList">
-					<form:hidden id="image" path="image" htmlEscape="false" maxlength="255" class="input-xlarge"/>
-					<sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
-					<br>
-					<label style="margin-left: 150px">建议图片分辨率252px*252px</label>
-				</div>
-			</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>
-	$(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 () {
-				$("#image").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>
-</body>
-</html>

+ 0 - 76
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthorizationProductList.jsp

@@ -1,76 +0,0 @@
-<%@ 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}/zplm/cmBrandAuthorization/">品牌授权列表</a></li>
-		<li class="active"><a href="${ctx}/zplm/cmBrandAuthorizationProduct/?authorizationId=${cmBrandAuthorizationProduct.authorizationId}">商品列表</a></li>
-	</ul>
-	<form:form id="searchForm" modelAttribute="cmBrandAuthorizationProduct" action="${ctx}/zplm/cmBrandAuthorizationProduct/?authorizationId=${cmBrandAuthorizationProduct.authorizationId}" 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="查询"/>
-			  <button class="btn btn-primary" value="新增" href="${ctx}/zplm/cmBrandAuthorizationProduct/form?authorizationId=${cmBrandAuthorizationProduct.authorizationId}"  />
-			<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>商品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}
-				</a></td>
-				<td>
-					${product.snCode}
-				</td>
-				<td>
-					<fmt:formatDate value="${product.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
-				</td>
-				<td>
-					${product.createUserName}
-				</td>
-    				<a href="${ctx}/zplm/cmBrandAuthorizationProduct/form?id=${product.id}&authorizationId=${cmBrandAuthorizationProduct.authorizationId}">编辑</a>
-					<a href="${ctx}/zplm/cmBrandAuthorizationProduct/delete?id=${product.id}&authorizationId=${cmBrandAuthorizationProduct.authorizationId}" onclick="return confirmx('确认要删除该品牌授权商品吗?', this.href)">删除</a>
-				</td>
-			</tr>
-		</c:forEach>
-		</tbody>
-	</table>
-	<div class="pagination">${page}</div>
-</body>
-</html>

Plik diff jest za duży
+ 146 - 0
src/main/webapp/static/QRCode/qrcode.js


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików