Prechádzať zdrojové kódy

小需求优化V1.3.14

kaick 1 rok pred
rodič
commit
5148fcc77b

+ 30 - 0
src/main/java/com/caimei/modules/landing/domain/CmBrandLanding.java

@@ -94,6 +94,8 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
 
     /** 商品Id */
     private Integer productId;
+    /** 供应商名称 */
+    private String shopName;
 
     /** 上架方式:1立即上架,2预约上架 */
     private Integer bookStatus;
@@ -118,6 +120,10 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
 
     /** 文章发布来源:1采美365网,2供应商 */
     private Integer publishSource;
+    /** 商品名称 */
+    private String productName;
+    /** 商品图片 */
+    private String productImage;
 
 
     //点击量统计
@@ -130,6 +136,30 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
     /** 统计分类*/
     private String statisticsType;
 
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getProductImage() {
+        return productImage;
+    }
+
+    public void setProductImage(String productImage) {
+        this.productImage = productImage;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
     public String getStatisticsType() {
         return statisticsType;
     }

+ 20 - 0
src/main/java/com/caimei/modules/newhome/entity/NewPageHomeimage.java

@@ -55,6 +55,10 @@ public class NewPageHomeimage extends DataEntity<NewPageHomeimage> {
 	private Integer shopId;
 	/** 供应商名称 */
 	private String shopName;
+	/** 商品名称 */
+	private String productName;
+	/** 商品图片 */
+	private String productImage;
 
 	//点击量统计
 	/** 开始点击量时间 */
@@ -77,6 +81,22 @@ public class NewPageHomeimage extends DataEntity<NewPageHomeimage> {
 		return endPvCreateTime;
 	}
 
+	public String getProductName() {
+		return productName;
+	}
+
+	public void setProductName(String productName) {
+		this.productName = productName;
+	}
+
+	public String getProductImage() {
+		return productImage;
+	}
+
+	public void setProductImage(String productImage) {
+		this.productImage = productImage;
+	}
+
 	public void setEndPvCreateTime(Date endPvCreateTime) {
 		this.endPvCreateTime = endPvCreateTime;
 	}

+ 4 - 1
src/main/resources/mappings/modules/landing/CmBrandLandingMapper.xml

@@ -98,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="statisticsType != null  and statisticsType != ''">
             ,IFNULL((select sum(c.pv) from cm_praise_statistics c where  c.delFlag = 0 and c.type = #{statisticsType} and a.id = c.authorId  <if test="startPvCreateTime != null ">AND c.createTime >= #{startPvCreateTime} </if><if test="endPvCreateTime != null ">AND c.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>), 0) as pv
         </if>
+        ,(select s.name  from shop s where s.userId=a.authUserId) as shopName
         from cm_brand_landing a
         <where>delFlag = 0
             <if test="id != null  and id != ''">and id = #{id}</if>
@@ -127,7 +128,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCmBrandLandingById" parameterType="String" resultMap="CmBrandLandingResult">
         <include refid="selectCmBrandLandingVo"/>
-        from cm_brand_landing a
+        ,p.name productName,p.mainImage productImage
+        FROM cm_brand_landing a
+        left join product p on  p.productId=a.productId
         where id = #{id} and delFlag = 0
     </select>
 

+ 5 - 3
src/main/resources/mappings/modules/newhome/NewPageHomeimageMapper.xml

@@ -24,14 +24,16 @@
         a.auditStatus,
         a.auditTime,
         a.failReason,
-        a.shopId,
+        a.userId,
         a.publishSource
     </sql>
 
     <select id="get" resultType="NewPageHomeimage">
         SELECT
         <include refid="newPageHomeimageColumns"/>
+        ,p.name productName,p.mainImage productImage
         FROM new_page_homeimage a
+        left join product p on  p.productId=a.productId
         WHERE a.id = #{id}
     </select>
 
@@ -39,7 +41,7 @@
         SELECT
         <include refid="newPageHomeimageColumns"/>,s.name as shopName
         FROM new_page_homeimage a
-        left join shop s on s.shopID=a.shopId
+        left join shop s on s.userId=a.userId
         <where>
             <if test="id != null and id != ''">
                 AND a.id = #{id}
@@ -60,7 +62,7 @@
                 AND a.publishSource = #{publishSource}
             </if>
         </where>
-        ORDER BY a.sort desc,a.createDate desc
+        ORDER BY a.wwwEnabledStatus desc,a.sort desc,a.createDate desc
     </select>
     <select id="getBannerStatistics" resultType="com.caimei.modules.newhome.entity.cmStatisticsType">
         SELECT COUNT(statisticsId) as count, ifnull(bannerId, 0) as bannerId  FROM cm_statistics_type WHERE typeId = 1

+ 6 - 0
src/main/webapp/WEB-INF/views/modules/info/infoTypeLandingList.jsp

@@ -160,6 +160,9 @@
 				<th>上架时间</th>
 				<th>下架时间</th>
 				<th>添加时间</th>
+				<c:if test="${publishSource eq 2 }">
+					<th>供应商</th>
+				</c:if>
 				<th>操作</th>
 			</tr>
 		</thead>
@@ -201,6 +204,9 @@
 				<td><fmt:formatDate value="${item.bookStartDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td><fmt:formatDate value="${item.bookEndDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td><fmt:formatDate value="${item.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+				<c:if test="${publishSource eq 2 }">
+					<td>${item.shopName}</td>
+				</c:if>
 				<td>
 					<c:if test="${item.pcStatus ne 2 }">
 						<a href="#" onclick="updateEnabledStatus('${item.pcStatus eq 1?0:3}','${item.id}')">${item.pcStatus eq 1?"下架":"上架" }</a>

+ 7 - 4
src/main/webapp/WEB-INF/views/modules/landing/newPageCmbrandLandingForm.jsp

@@ -341,11 +341,14 @@
 	<div class="control-group crmstatus" style="" >
 		<label class="control-label"><font color="red">*</font>广告跳转:</label>
 		<div class="controls">
-			<div><input type="radio" name="productId" value="" ${empty newPageHomeimage.productId ?'checked':''} >店铺首页</div>
+			<div><input type="radio" name="productId" value="" ${empty cmBrandLanding.productId ?'checked':''} >店铺首页</div>
 			<br>
-			<div><input type="radio" name="productId" value="${newPageHomeimage.productId}" ${null != newPageHomeimage.productId ?'checked':''} >商品详情
-				<div>
-					<img style="margin:20px;width:50px;height: 50px" src="${newPageHomeimage.image}"/>${newPageHomeimage.title}</div>
+			<div><input type="radio" name="productId" value="${cmBrandLanding.productId}" ${null != cmBrandLanding.productId ?'checked':''} >商品详情
+				<c:if test="${not empty cmBrandLanding.productId}">
+					<div>
+						<img style="margin:20px;width:50px;height: 50px" src="${cmBrandLanding.productImage}"/>${cmBrandLanding.productName}
+					</div>
+				</c:if>
 			</div>
 		</div>
 	</div>

+ 4 - 1
src/main/webapp/WEB-INF/views/modules/newhome/newPageHomeimageForm.jsp

@@ -120,8 +120,11 @@
 				<div><input type="radio" name="productId" value="" ${empty newPageHomeimage.productId ?'checked':''} >店铺首页</div>
 				<br>
 				<div><input type="radio" name="productId" value="${newPageHomeimage.productId}" ${null != newPageHomeimage.productId ?'checked':''} >商品详情
+					<c:if test="${not empty newPageHomeimage.productId}">
 					<div>
-						<img style="margin:20px;width:50px;height: 50px" src="${newPageHomeimage.image}"/>${newPageHomeimage.title}</div>
+						<img style="margin:20px;width:50px;height: 50px" src="${newPageHomeimage.productImage}"/>${newPageHomeimage.productName}
+					</div>
+					</c:if>
 				</div>
 			</div>
 		</div>