Parcourir la source

品牌授权part1

Aslee il y a 4 ans
Parent
commit
939336c026

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

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

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

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

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

@@ -0,0 +1,15 @@
+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> {
+	
+}

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

@@ -0,0 +1,149 @@
+package com.caimei.modules.zplm.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 品牌授权Entity
+ * @author Aslee
+ * @version 2021-03-24
+ */
+public class CmBrandAuthorization extends DataEntity<CmBrandAuthorization> {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer brandId;		// 品牌Id
+	private Integer countryId;		// 品牌产地国家Id
+	private String brandLogo;		// 品牌logo
+	private String securityLink;		// 防伪链接
+	private Integer agentFlag;		// 是否有代理商:0没有,1有
+	private String agentName;		// 代理商名称
+	private Integer statementType;		// 代理声明类型:1弹窗,2链接
+	private String statementContent;		// 声明弹窗内容
+	private String statementLink;		// 声明链接
+	private String authorizedParty;		// 被授权方名称
+	private Date createTime;		// 创建时间
+
+	private String brandName;		//品牌名
+	private String createUserName;	//创建人用户名
+
+	public CmBrandAuthorization() {
+		super();
+	}
+
+	public CmBrandAuthorization(String id){
+		super(id);
+	}
+
+	public Integer getBrandId() {
+		return brandId;
+	}
+
+	public void setBrandId(Integer brandId) {
+		this.brandId = brandId;
+	}
+	
+	public Integer getCountryId() {
+		return countryId;
+	}
+
+	public void setCountryId(Integer countryId) {
+		this.countryId = countryId;
+	}
+	
+	@Length(min=0, max=255, message="品牌logo长度必须介于 0 和 255 之间")
+	public String getBrandLogo() {
+		return brandLogo;
+	}
+
+	public void setBrandLogo(String brandLogo) {
+		this.brandLogo = brandLogo;
+	}
+	
+	@Length(min=0, max=255, message="防伪链接长度必须介于 0 和 255 之间")
+	public String getSecurityLink() {
+		return securityLink;
+	}
+
+	public void setSecurityLink(String securityLink) {
+		this.securityLink = securityLink;
+	}
+	
+	public Integer getAgentFlag() {
+		return agentFlag;
+	}
+
+	public void setAgentFlag(Integer agentFlag) {
+		this.agentFlag = agentFlag;
+	}
+	
+	@Length(min=0, max=50, message="代理商名称长度必须介于 0 和 50 之间")
+	public String getAgentName() {
+		return agentName;
+	}
+
+	public void setAgentName(String agentName) {
+		this.agentName = agentName;
+	}
+	
+	public Integer getStatementType() {
+		return statementType;
+	}
+
+	public void setStatementType(Integer statementType) {
+		this.statementType = statementType;
+	}
+	
+	public String getStatementContent() {
+		return statementContent;
+	}
+
+	public void setStatementContent(String statementContent) {
+		this.statementContent = statementContent;
+	}
+	
+	@Length(min=0, max=255, message="声明链接长度必须介于 0 和 255 之间")
+	public String getStatementLink() {
+		return statementLink;
+	}
+
+	public void setStatementLink(String statementLink) {
+		this.statementLink = statementLink;
+	}
+	
+	@Length(min=0, max=50, message="被授权方名称长度必须介于 0 和 50 之间")
+	public String getAuthorizedParty() {
+		return authorizedParty;
+	}
+
+	public void setAuthorizedParty(String authorizedParty) {
+		this.authorizedParty = authorizedParty;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getBrandName() {
+		return brandName;
+	}
+
+	public void setBrandName(String brandName) {
+		this.brandName = brandName;
+	}
+
+	public String getCreateUserName() {
+		return createUserName;
+	}
+
+	public void setCreateUserName(String createUserName) {
+		this.createUserName = createUserName;
+	}
+}

+ 83 - 0
src/main/java/com/caimei/modules/zplm/entity/CmBrandAuthorizationProduct.java

@@ -0,0 +1,83 @@
+package com.caimei.modules.zplm.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 品牌授权商品Entity
+ * @author Aslee
+ * @version 2021-03-25
+ */
+public class CmBrandAuthorizationProduct extends DataEntity<CmBrandAuthorizationProduct> {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer authorizationId;		// 授权Id
+	private String name;		// 商品名称
+	private String snCode;		// sn码
+	private String image;		// 商品图片
+	private Date createTime;		// 创建时间
+	private String createUserName;	//创建人名称
+	
+	public CmBrandAuthorizationProduct() {
+		super();
+	}
+
+	public CmBrandAuthorizationProduct(String id){
+		super(id);
+	}
+
+	public Integer getAuthorizationId() {
+		return authorizationId;
+	}
+
+	public void setAuthorizationId(Integer authorizationId) {
+		this.authorizationId = authorizationId;
+	}
+	
+	@Length(min=0, max=50, message="商品名称长度必须介于 0 和 50 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=255, message="sn码长度必须介于 0 和 255 之间")
+	public String getSnCode() {
+		return snCode;
+	}
+
+	public void setSnCode(String snCode) {
+		this.snCode = snCode;
+	}
+	
+	@Length(min=0, max=255, message="商品图片长度必须介于 0 和 255 之间")
+	public String getImage() {
+		return image;
+	}
+
+	public void setImage(String image) {
+		this.image = image;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getCreateUserName() {
+		return createUserName;
+	}
+
+	public void setCreateUserName(String createUserName) {
+		this.createUserName = createUserName;
+	}
+}

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

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

+ 71 - 0
src/main/java/com/caimei/modules/zplm/service/CmBrandAuthorizationService.java

@@ -0,0 +1,71 @@
+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.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.CmBrandAuthorization;
+import com.caimei.modules.zplm.dao.CmBrandAuthorizationDao;
+
+/**
+ * 品牌授权Service
+ * @author Aslee
+ * @version 2021-03-24
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmBrandAuthorizationService extends CrudService<CmBrandAuthorizationDao, CmBrandAuthorization> {
+
+	public CmBrandAuthorization get(String id) {
+		return super.get(id);
+	}
+	
+	public List<CmBrandAuthorization> findList(CmBrandAuthorization cmBrandAuthorization) {
+		return super.findList(cmBrandAuthorization);
+	}
+	
+	public Page<CmBrandAuthorization> findPage(Page<CmBrandAuthorization> page, CmBrandAuthorization cmBrandAuthorization) {
+		return super.findPage(page, cmBrandAuthorization);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CmBrandAuthorization cmBrandAuthorization) {
+		//保存图片
+		String logo = cmBrandAuthorization.getBrandLogo();
+		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);
+				cmBrandAuthorization.setBrandLogo(photoServer+saveImageSerivce.getSource());
+			} catch (Exception e) {
+				logger.error("图片上传错误:"+e.toString(),e);
+			}
+		}
+		if (cmBrandAuthorization.getIsNewRecord()) {
+			cmBrandAuthorization.setCreateBy(UserUtils.getUser());
+			cmBrandAuthorization.setCreateTime(new Date());
+		}
+		super.save(cmBrandAuthorization);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CmBrandAuthorization cmBrandAuthorization) {
+		super.delete(cmBrandAuthorization);
+	}
+	
+}

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

@@ -0,0 +1,89 @@
+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";
+	}
+
+}

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

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

+ 145 - 0
src/main/resources/mappings/modules/zplm/CmBrandAuthorizationMapper.xml

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.zplm.dao.CmBrandAuthorizationDao">
+    
+	<sql id="cmBrandAuthorizationColumns">
+		a.id AS "id",
+		a.brandId AS "brandId",
+		a.countryId AS "countryId",
+		a.brandLogo AS "logoImage",
+		a.securityLink AS "securityLink",
+		a.agentFlag AS "agentFlag",
+		a.agentName AS "agentName",
+		a.statementType AS "statementType",
+		a.statementContent AS "statementContent",
+		a.statementLink AS "statementLink",
+		a.authorizedParty AS "authorizedParty",
+		a.createTime AS "createTime",
+		a.createBy AS "createBy.id",
+		cb.name AS "brandName",
+		su.login_name AS "createUserName"
+	</sql>
+	
+	<sql id="cmBrandAuthorizationJoins">
+		left join cm_brand cb on a.brandId = cb.id
+		left join sys_user su on a.createBy = su.id
+	</sql>
+    
+	<select id="get" resultType="CmBrandAuthorization">
+		SELECT 
+			<include refid="cmBrandAuthorizationColumns"/>
+		FROM cm_brand_authorization a
+		<include refid="cmBrandAuthorizationJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmBrandAuthorization">
+		SELECT 
+			<include refid="cmBrandAuthorizationColumns"/>
+		FROM cm_brand_authorization a
+		<include refid="cmBrandAuthorizationJoins"/>
+		<where>
+			
+			<if test="brandName != null and brandName != ''">
+				AND cb.name like concat('%',#{brandName},'%')
+			</if>
+			<if test="agentName != null and agentName != ''">
+				AND a.agentName LIKE 
+					<if test="dbName == 'oracle'">'%'||#{agentName}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{agentName}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{agentName},'%')</if>
+			</if>
+			<if test="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>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="CmBrandAuthorization">
+		SELECT 
+			<include refid="cmBrandAuthorizationColumns"/>
+		FROM cm_brand_authorization a
+		<include refid="cmBrandAuthorizationJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	<select id="findBrandList" resultType="com.caimei.modules.brand.entity.CmBrand">
+		select id, name from cm_brand;
+	</select>
+	<select id="findCountryList" resultType="com.caimei.modules.common.entity.Country">
+		select countryId, name from country;
+	</select>
+
+	<insert id="insert" parameterType="CmBrandAuthorization"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_brand_authorization(
+			brandId,
+			countryId,
+			brandLogo,
+			securityLink,
+			agentFlag,
+			agentName,
+			statementType,
+			statementContent,
+			statementLink,
+			authorizedParty,
+			createTime,
+			createBy
+		) VALUES (
+			#{brandId},
+			#{countryId},
+			#{brandLogo},
+			#{securityLink},
+			#{agentFlag},
+			#{agentName},
+			#{statementType},
+			#{statementContent},
+			#{statementLink},
+			#{authorizedParty},
+			#{createTime},
+			#{createBy.id}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_brand_authorization SET 	
+			brandId = #{brandId},
+			countryId = #{countryId},
+			brandLogo = #{brandLogo},
+			securityLink = #{securityLink},
+			agentFlag = #{agentFlag},
+			agentName = #{agentName},
+			statementType = #{statementType},
+		    <if test="statementContent != null and statementContent != ''">
+				statementContent = #{statementContent},
+			</if>
+			<if test="statementLink != null and statementLink != ''">
+				statementLink = #{statementLink},
+			</if>
+			authorizedParty = #{authorizedParty}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		DELETE FROM cm_brand_authorization
+		WHERE id = #{id}
+	</delete>
+	
+</mapper>

+ 109 - 0
src/main/resources/mappings/modules/zplm/CmBrandAuthorizationProductMapper.xml

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.zplm.dao.CmBrandAuthorizationProductDao">
+    
+	<sql id="cmBrandAuthorizationProductColumns">
+		a.id AS "id",
+		a.authorizationId AS "authorizationId",
+		a.name AS "name",
+		a.snCode AS "snCode",
+		a.image AS "image",
+		a.createTime AS "createTime",
+		a.createBy AS "createBy.id",
+		su.login_name AS "createUserName"
+	</sql>
+	
+	<sql id="cmBrandAuthorizationProductJoins">
+		left join cm_brand_authorization cba on a.authorizationId = cba.id
+		left join sys_user su on a.createBy = su.id
+	</sql>
+    
+	<select id="get" resultType="CmBrandAuthorizationProduct">
+		SELECT 
+			<include refid="cmBrandAuthorizationProductColumns"/>
+		FROM cm_brand_authorization_product a
+		<include refid="cmBrandAuthorizationProductJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmBrandAuthorizationProduct">
+		SELECT 
+			<include refid="cmBrandAuthorizationProductColumns"/>
+		FROM cm_brand_authorization_product a
+		<include refid="cmBrandAuthorizationProductJoins"/>
+		<where>
+			<if test="authorizationId != null">
+				AND a.authorizationId = #{authorizationId}
+			</if>
+			<if test="name != null and name != ''">
+				AND a.name LIKE 
+					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+			</if>
+			<if test="snCode != null and snCode != ''">
+				AND a.snCode LIKE 
+					<if test="dbName == 'oracle'">'%'||#{snCode}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{snCode}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{snCode},'%')</if>
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="CmBrandAuthorizationProduct">
+		SELECT 
+			<include refid="cmBrandAuthorizationProductColumns"/>
+		FROM cm_brand_authorization_product a
+		<include refid="cmBrandAuthorizationProductJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert" parameterType="CmBrandAuthorizationProduct"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_brand_authorization_product(
+			authorizationId,
+			name,
+			snCode,
+			image,
+			createTime,
+			createBy
+		) VALUES (
+			#{authorizationId},
+			#{name},
+			#{snCode},
+			#{image},
+			#{createTime},
+			#{createBy.id}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_brand_authorization_product SET 	
+			authorizationId = #{authorizationId},
+			name = #{name},
+			snCode = #{snCode},
+			image = #{image}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		DELETE FROM cm_brand_authorization_product
+		WHERE id = #{id}
+	</delete>
+	
+</mapper>

+ 264 - 0
src/main/webapp/WEB-INF/views/modules/zplm/cmBrandAuthorizationForm.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;
+        }
+
+    </style>
+</head>
+<body>
+	<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>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmBrandAuthorization" action="${ctx}/zplm/cmBrandAuthorization/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<sys:message content="${message}"/>		
+		<div class="control-group">
+			<label class="control-label">*品牌:</label>
+			<div class="controls">
+				<form:select path="brandId" class="input-medium ">
+					<form:option value="" label="请选择"/>
+					<form:options items="${brandList}" itemLabel="name" itemValue="id"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">*产地:</label>
+			<div class="controls">
+				<form:select path="countryId" class="input-medium ">
+					<form:option value="" label="请选择"/>
+                    <form:options items="${countryList}" itemLabel="name" itemValue="countryId"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group iconBox">
+			<label class="control-label">*品牌logo:</label>
+            <div class="controls upload-content" id="brandLogoBox">
+                <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"/>
+                    <br>
+                    <label style="margin-left: 150px">建议图片分辨率252px*252px</label>
+                </div>
+            </div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">防伪链接:</label>
+			<div class="controls">
+				<form:input path="securityLink" htmlEscape="false" maxlength="255" class="input-xlarge "/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">代理商:</label>
+			<div class="controls">
+				<form:radiobutton path="agentFlag" value="0" label="无" onclick="changeAgentFlag()"/>
+				<form:radiobutton path="agentFlag" value="1" label="有" checked="true" onclick="changeAgentFlag()"/>
+			</div>
+		</div>
+
+        <div id="agentDiv">
+            <div class="control-group">
+                <label class="control-label">*代理商名称:</label>
+                <div class="controls">
+                    <form:input path="agentName" htmlEscape="false" maxlength="50" class="input-xlarge "/>
+                </div>
+            </div>
+            <div class="control-group">
+                <label class="control-label">代理声明:</label>
+                <div class="controls">
+                    <form:radiobutton path="statementType" value="1" label="弹窗" checked="true" onclick="changeStatementType()"/>
+                    <form:radiobutton path="statementType" value="2" label="链接" onclick="changeStatementType()"/>
+                </div>
+            </div>
+            <div class="control-group" id="statementContentDiv">
+                <label class="control-label">*内容:</label>
+                <div class="controls">
+                    <form:textarea path="statementContent" htmlEscape="false" rows="4" class="input-xxlarge "/>
+                </div>
+            </div>
+            <div class="control-group" id="statementLinkDiv">
+                <label class="control-label">*链接:</label>
+                <div class="controls">
+                    <form:input path="statementLink" htmlEscape="false" maxlength="255" class="input-xlarge "/>
+                </div>
+            </div>
+        </div>
+
+		<div class="control-group">
+			<label class="control-label">*被授权方:</label>
+			<div class="controls">
+				<form:input path="authorizedParty" htmlEscape="false" maxlength="50" class="input-xlarge "/>
+			</div>
+		</div>
+		<div class="form-actions">
+			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		</div>
+	</form:form>
+<script type = text/javascript>
+    $(function () {
+        $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+        $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+        $('.upload-content .conList').find('.cancel-upload').hide();
+        var observeEle = document.getElementsByClassName('upload-content')[0];
+        var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+        var MutationObserverConfig = {
+            childList: true,
+            subtree: true,
+            characterData: true
+        };
+        var observer = new MutationObserver(function (mutations) {
+            $.each(mutations, function (index, item) {
+                if (item.type === 'childList') {
+                    // 在创建新的 element 时调用
+                    var target = $(item.target),
+                        thisWrapper = target.closest('.conList'),
+                        nextEle = thisWrapper.next();
+                    thisWrapper.find('li').css('z-index', 99);
+                    thisWrapper.find('.cancel-upload').show();
+                    if (nextEle.hasClass('hide-pic')) {
+                        nextEle.removeClass('hide-pic');
+                    }
+                }
+            })
+        });
+        observer.observe(observeEle, MutationObserverConfig);
+
+        $('body').on('click', '.cancel-upload', function () {
+            var wrapper = $(this).closest('.conList');
+            wrapper.find('li').css('z-index', '-1');
+            wrapper.find('input').val('');
+            $(this).hide();
+            wrapper.removeClass("hide-pic");
+            wrapper.parent().append(wrapper.clone());
+            wrapper.remove();
+            $(".conList").each(function (i, ele) {
+                if ($(ele).find("input.input-xlarge").val()) {
+                    $(ele).next().removeClass("hide-pic")
+                }
+            })
+        });
+        $(window).on("load", function () {
+            setTimeout(function () {
+                $("#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);
+        });
+    });
+</script>
+<script type="text/javascript">
+    $(function () {
+		changeAgentFlag();
+		changeStatementType();
+    })
+
+	//修改有无代理商
+    function changeAgentFlag() {
+        var agentFlag = $('input[name="agentFlag"]:checked').val();
+        if (agentFlag == 0) {
+			$("#agentDiv").hide();
+        }else {
+			$("#agentDiv").show();
+		}
+    }
+
+    //修改声明类型
+    function changeStatementType() {
+		var statementType = $('input[name="statementType"]:checked').val();
+		if (statementType == 1) {
+			$("#statementContentDiv").show();
+			$("#statementLinkDiv").hide();
+		} else {
+			$("#statementContentDiv").hide();
+			$("#statementLinkDiv").show();
+		}
+	}
+</script>
+</body>
+</html>

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

@@ -0,0 +1,87 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>品牌授权管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/zplm/cmBrandAuthorization/">品牌授权列表</a></li>
+		<li><a href="${ctx}/zplm/cmBrandAuthorization/form">新增</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmBrandAuthorization" action="${ctx}/zplm/cmBrandAuthorization/" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<div class="ul-form">
+			 <label>品牌:</label>
+				<form:input path="brandName" htmlEscape="false" maxlength="50" class="input-medium"/>
+			<label>代理商名称:</label>
+				<form:input path="agentName" htmlEscape="false" maxlength="50" class="input-medium"/>
+			 <label>被授权方名称:</label>
+				<form:input path="authorizedParty" htmlEscape="false" maxlength="50" class="input-medium"/>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			<div class="clearfix"></div>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>序号</th>
+				<th>品牌</th>
+				<th>代理商</th>
+				<th>被授权方</th>
+				<th>创建时间</th>
+				<th>创建人</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmBrandAuthorization" varStatus="index">
+			<tr>
+				<td>
+					${index.index+1}
+				</a></td>
+				<td>
+					${cmBrandAuthorization.brandName}
+				</td>
+				<td>
+					${cmBrandAuthorization.agentName eq null?'---':cmBrandAuthorization.agentName}
+				</td>
+				<td>
+					${cmBrandAuthorization.authorizedParty}
+				</td>
+				<td>
+					<fmt:formatDate value="${cmBrandAuthorization.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					${cmBrandAuthorization.createUserName}
+				</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>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

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

@@ -0,0 +1,184 @@
+<%@ 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>

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

@@ -0,0 +1,76 @@
+<%@ 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>