瀏覽代碼

bugfix-百科/颜选

Aslee 2 年之前
父節點
當前提交
581f2f67d3

+ 5 - 5
src/main/java/com/caimei/modules/baike/entity/CmBaikeProduct.java

@@ -71,7 +71,7 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 	private Integer auditFlag;		// 是否审核保存,1是
 	private String fileIds;			// 文件id,以,隔开
 	private String productIds;		// 产品/仪器id,以,隔开
-	private String recommendJson;	// 相关推荐产品/仪器json数据
+	private String[] recommendParams;	// 相关推荐产品/仪器json数据
 
 	public CmBaikeProduct() {
 		super();
@@ -499,11 +499,11 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 		this.productIds = productIds;
 	}
 
-	public String getRecommendJson() {
-		return recommendJson;
+	public String[] getRecommendParams() {
+		return recommendParams;
 	}
 
-	public void setRecommendJson(String recommendJson) {
-		this.recommendJson = recommendJson;
+	public void setRecommendParams(String[] recommendParams) {
+		this.recommendParams = recommendParams;
 	}
 }

+ 12 - 7
src/main/java/com/caimei/modules/baike/service/CmBaikeProductService.java

@@ -375,13 +375,18 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
 		// 清除原来的推荐数据
 		if (1 == cmBaikeProduct.getRecommendType()) {
 			cmBaikeProductRecommendDao.clearRecommendData(cmBaikeProduct.getId());
-			List<CmBaikeProductRecommend> recommendList;
-			if (StringUtils.isNotEmpty(cmBaikeProduct.getRecommendJson())) {
-				recommendList = JSONObject.parseArray(cmBaikeProduct.getRecommendJson(), CmBaikeProductRecommend.class);
-				recommendList.forEach(recommond->{
-					recommond.setProductId(Integer.parseInt(cmBaikeProduct.getId()));
-					cmBaikeProductRecommendDao.insert(recommond);
-				});
+			String[] recommendParams = cmBaikeProduct.getRecommendParams();
+			int productId = Integer.parseInt(cmBaikeProduct.getId());
+			if (null != recommendParams && recommendParams.length > 0) {
+				for (int i = 0; i < recommendParams.length; i++) {
+					String recommendParam = recommendParams[i];
+					String[] split = recommendParam.split(":");
+					CmBaikeProductRecommend recommend = new CmBaikeProductRecommend();
+					recommend.setProductId(productId);
+					recommend.setRecommendProductId(Integer.parseInt(split[0]) );
+					recommend.setSort(Integer.parseInt(split[1]));
+					cmBaikeProductRecommendDao.insert(recommend);
+				}
 			}
 		}
 	}

+ 4 - 3
src/main/java/com/caimei/modules/baike/web/CmBaikeProductController.java

@@ -122,7 +122,7 @@ public class CmBaikeProductController extends BaseController {
 		List<CmBaikeProductFile> videoList = cmBaikeProductDao.findFileList(cmBaikeProduct.getId());
 		StringBuilder fileIds = new StringBuilder();
 		videoList.forEach(video->{
-			OSSUtils.getOssUrl(video.getOssName());
+			video.setOssUrl(OSSUtils.getOssUrl(video.getOssName()));
 			fileIds.append(video.getId()).append(",");
 		});
 		cmBaikeProduct.setVideoList(videoList);
@@ -249,7 +249,7 @@ public class CmBaikeProductController extends BaseController {
 		// 视频列表
 		List<CmBaikeProductFile> videoList = cmBaikeProductDao.findFileList(cmBaikeProduct.getId());
 		videoList.forEach(video->{
-			OSSUtils.getOssUrl(video.getOssName());
+			video.setOssUrl(OSSUtils.getOssUrl(video.getOssName()));
 		});
 		cmBaikeProduct.setVideoList(videoList);
 		model.addAttribute("commodityType", commodityType);
@@ -295,7 +295,8 @@ public class CmBaikeProductController extends BaseController {
 		List<CmBaikeProductFile> videoList = cmBaikeProductDao.findFileList(cmBaikeProduct.getId());
 		StringBuilder fileIds = new StringBuilder();
 		videoList.forEach(video->{
-			OSSUtils.getOssUrl(video.getOssName());
+			String ossUrl = OSSUtils.getOssUrl(video.getOssName());
+			video.setOssUrl(ossUrl);
 			fileIds.append(video.getId()).append(",");
 		});
 		cmBaikeProduct.setVideoList(videoList);

+ 4 - 0
src/main/java/com/caimei/modules/hehe/service/CmHeheImageService.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.modules.miniprogram.utils.UploadPicUtils;
 import com.caimei.modules.sys.utils.UploadImageUtils;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.utils.Encodes;
@@ -58,6 +59,9 @@ public class CmHeheImageService extends CrudService<CmHeheImageDao, CmHeheImage>
                 logger.error("图片上传错误:" + e.toString(), e);
             }
         }
+        if (StringUtils.isNotBlank(cmHeheImage.getJumpImage()) && !cmHeheImage.getJumpImage().contains("http")) {
+            cmHeheImage.setJumpImage(UploadPicUtils.saveImageToServer(cmHeheImage.getJumpImage()));
+        }
         super.save(cmHeheImage);
     }
 

+ 1 - 1
src/main/resources/mappings/modules/baike/CmBaikeProductRecommendMapper.xml

@@ -61,7 +61,7 @@
 	<select id="findAutoRecommendList" resultType="com.caimei.modules.baike.entity.CmBaikeProductRecommend">
 		select id as recommendProductId, name as recommendProductName
 		from cm_baike_product
-		where typeId = #{productTypeId} and delFlag = 0 and onlineStatus = 2 and status = 1
+		where typeId = #{productTypeId} and publishSource = 1 and delFlag = 0 and onlineStatus = 2 and status = 1 and id != #{productId}
 		order by addTime desc
 		limit 15
 	</select>

+ 3 - 0
src/main/resources/mappings/modules/hehe/HeHeNewOrderMapper.xml

@@ -204,6 +204,9 @@
                     co.refundType = '2'
                 </if>
             </if>
+            <if test="productName != null and productName != ''">
+                and p.name like CONCAT('%',#{productName},'%')
+            </if>
             <if test="orderRefundType != null and orderRefundType != ''">
                 <if test="orderRefundType == 0">
                     AND (select count(1) from cm_returned_purchase crp where co.orderID = crp.orderID  and crp.delFlag = 0) = 0

+ 16 - 2
src/main/webapp/WEB-INF/views/modules/baikePage/cmBaikeProductForm.jsp

@@ -385,6 +385,7 @@
 					var filterSync = '';
 					var touchWords = '';
 					var touchNum = 0;
+					debugger
 					propertyMap.forEach(function (value,key,map) {
 						filterSync = mint.filterSync(value);
 						filterSync.words.forEach(word=>{
@@ -420,8 +421,21 @@
 							}
 						}, {buttonsFocus: 1, persistent: true});
 					} else {
-						loading('正在提交,请稍等...');
-						form.submit();
+						if (touchNum > 0) {
+							var msg = 1 == status?"当前发布内容存在敏感词,已为您标记在输入框下方," +
+									"请修改后,再进行保存发布,强行保存发布将会导致审核不通过!":
+									"当前内容存在敏感词,已为您标记在输入框下方,建议修改后再进行保存!否则," +
+									"将会影响发布时审核不通过!";
+							top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
+								if (v == 'ok') {
+									loading('正在提交,请稍等...');
+									form.submit();
+								}
+							}, {buttonsFocus: 1, persistent: true});
+						} else{
+							loading('正在提交,请稍等...');
+							form.submit();
+						}
 					}
 				},
 				errorContainer: "#messageBox",

+ 6 - 2
src/main/webapp/WEB-INF/views/modules/baikePage/recommendForm.jsp

@@ -69,6 +69,7 @@
 	var productIds = '';
 	var recommendCount = 0;
 	var recommendType = ${cmBaikeProduct.recommendType};
+	var productId = ${cmBaikeProduct.id};
 
 	$(function () {
 		//数据填充
@@ -149,6 +150,7 @@
 		var html = '';
 		productIds = '';
 		recommendCount = 0;
+		productIds += productId + ",";
 		productImageList.forEach(function (item, index) {
 			recommendCount++;
 			html += appendProductHtml(item, index);
@@ -211,8 +213,10 @@
 		var url = "${ctx}/baike/cmBaikeProduct/recommend/save?id=" + ${cmBaikeProduct.id} + "&recommendType=" + recommendType;
 		if (recommendType == 1) {
 			//只有选择了手动推荐相关商品单选框才修改相关商品数据
-			var recommendJson = JSON.stringify(manualImageList);
-			url += "&recommendJson=" + recommendJson;
+			// var recommendJson = JSON.stringify(manualImageList);
+			for (var i = 0; i < manualImageList.length; i++) {
+				url += "&recommendParams=" + manualImageList[i].recommendProductId + ":" + manualImageList[i].sort;
+			}
 		}
 		//保留搜索条件
 		<%--url += "&searchName=${product.searchName}&searchShopID=${product.searchShopID}&searchShopName=${product.searchShopName}&searchBigTypeID=${product.searchBigTypeID}&searchSmallTypeID=${product.searchSmallTypeID}&searchTinyTypeID=${product.searchTinyTypeID}&searchValidFlag=${product.searchValidFlag}&searchActStatus=${product.searchActStatus}&searchProductType=${product.searchProductType}&searchBrandID=${product.searchBrandID}&searchPreferredFlag=${product.searchPreferredFlag}";--%>

+ 4 - 0
src/main/webapp/WEB-INF/views/modules/hehe/heheNewOrderList.jsp

@@ -707,6 +707,10 @@
                 <label>收货人:</label>
                 <form:input path="receiver" maxlength="20" class="input-medium"/>
             </div>
+            <div class="item">
+                <label>商品名称:</label>
+                <form:input path="productName" class="input-large"/>
+            </div>
             <div class="item">
                 <label>订单状态:</label>
                 <form:select path="status" class="select-ele input-medium required">