Authored by mali

Merge branch 'dev' into test6.10.2_favorite

... ... @@ -35,7 +35,7 @@ public class WeixinPayConstants {
* 支付主体是殴印
*/
public interface Miniapp{
String APP_PARTNER_CERT = "/.cert/wechatpay/apiclient_cert_ufo.p12";
// String APP_PARTNER_CERT = "/.cert/wechatpay/apiclient_cert_ufo.p12";
String APPID = "wxc677c88385762287";
String MALL_ID = UFO_PARTNER_ID;
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yohoufo.order.service.pay.weixin;
import com.yohoufo.order.config.WeixinPayConstants;
import com.yohoufo.order.service.pay.weixin.config.AbstractWeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.config.UfoWeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.config.UfoMiniPayConfig;
import com.yohoufo.order.service.pay.weixin.ssl.AbstractHttpSslClient;
import com.yohoufo.order.service.pay.weixin.ssl.WxUfoHttpSslClient;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -15,7 +15,7 @@ import org.springframework.stereotype.Service;
public class MiniappWeixinPayService extends AbstractWeixinPayService {
@Autowired
UfoWeixinPayConfig ufoWeixinConfig;
UfoMiniPayConfig ufoMiniPayConfig;
@Autowired
WxUfoHttpSslClient wxUfoHttpSslClient;
... ... @@ -27,7 +27,7 @@ public class MiniappWeixinPayService extends AbstractWeixinPayService {
@Override
protected AbstractWeixinPayConfig abstractWeixinConfig() {
return ufoWeixinConfig;
return ufoMiniPayConfig;
}
@Override
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service.pay.weixin;
import com.yohoufo.order.config.WeixinPayConstants;
import com.yohoufo.order.service.pay.weixin.config.AbstractWeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.config.YoufuMniniPayConfig;
import com.yohoufo.order.service.pay.weixin.config.YoufuWeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.ssl.AbstractHttpSslClient;
import com.yohoufo.order.service.pay.weixin.ssl.YoufuWxHttpSslClient;
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service.pay.weixin;
import com.yohoufo.order.config.WeixinPayConstants;
import com.yohoufo.order.service.pay.weixin.config.AbstractWeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.config.YoufuMniniPayConfig;
import com.yohoufo.order.service.pay.weixin.config.YoufuWeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.ssl.AbstractHttpSslClient;
import com.yohoufo.order.service.pay.weixin.ssl.YoufuWxHttpSslClient;
... ... @@ -16,7 +17,7 @@ public class YoufuMiniappWeixinPayService extends AbstractWeixinPayService {
@Autowired
YoufuWeixinPayConfig youfuWeixinConfig;
YoufuMniniPayConfig youfuMniniPayConfig;
@Autowired
YoufuWxHttpSslClient youfuWxHttpSslClient;
... ... @@ -28,7 +29,7 @@ public class YoufuMiniappWeixinPayService extends AbstractWeixinPayService {
@Override
protected AbstractWeixinPayConfig abstractWeixinConfig() {
return youfuWeixinConfig;
return youfuMniniPayConfig;
}
@Override
... ...
package com.yohoufo.order.service.pay.weixin.config;
import com.yohoufo.order.config.WeixinPayConstants;
import org.springframework.stereotype.Component;
@Component
public class UfoMiniPayConfig extends AbstractWeixinPayConfig {
@Override
public String appId() {
return WeixinPayConstants.Miniapp.APPID;
}
@Override
public String partnerId() {
return WeixinPayConstants.Miniapp.MALL_ID;
}
@Override
public String mchCertPath() {
return WeixinPayConstants.UFO_PARTNER_CERT;
}
}
... ...
package com.yohoufo.order.service.pay.weixin.config;
import com.yohoufo.order.config.WeixinPayConstants;
import org.springframework.stereotype.Component;
@Component
public class YoufuMniniPayConfig extends AbstractWeixinPayConfig {
@Override
public String appId() {
return WeixinPayConstants.YoufuMiniapp.APPID;
}
@Override
public String partnerId() {
return WeixinPayConstants.YoufuMiniapp.MALL_ID;
}
@Override
public String mchCertPath() {
return WeixinPayConstants.YOUFU_UFO_PARTNER_CERT;
}
}
... ...
... ... @@ -165,7 +165,8 @@ public class ProductSearchController {
@IgnoreSession
public ApiResponse searchSaleCalendar(@RequestParam(value = "uid", required = false)Integer uid,
@RequestParam(value = "start_time", required = false)String startTime,
@RequestParam(value = "end_time", required = false)String endTime) {
@RequestParam(value = "end_time", required = false)String endTime,
@RequestParam(value = "app_version", required = false)String appVersion) {
if (StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)) {
return new ApiResponse.ApiResponseBuilder().code(400).message("参数错误!").data(null).build();
}
... ... @@ -176,7 +177,7 @@ public class ProductSearchController {
return new ApiResponse.ApiResponseBuilder().code(400).message("参数错误!").data(null).build();
}
JSONObject productJson = productSearchService.searchSaleCalendar(start, end);
productSearchService.processUserFavoriteProductList(productJson, uid);
productSearchService.processUserFavoriteProductList(productJson, uid, appVersion);
return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.saleCalendar").data(productJson).build();
}
... ... @@ -196,7 +197,8 @@ public class ProductSearchController {
public ApiResponse searchNewSaleCalendar(@RequestParam(value = "uid", required = false)Integer uid,
@RequestParam(value = "start_time", required = false)String startTime,
@RequestParam(value = "end_time", required = false)String endTime,
@RequestParam(value = "type", required = false)String type) {
@RequestParam(value = "type", required = false)String type,
@RequestParam(value = "app_version", required = false)String appVersion) {
if (StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)) {
return new ApiResponse.ApiResponseBuilder().code(400).message("参数错误!").data(null).build();
}
... ... @@ -207,7 +209,7 @@ public class ProductSearchController {
return new ApiResponse.ApiResponseBuilder().code(400).message("参数错误!").data(null).build();
}
JSONObject productJson = productSearchService.searchNewSaleCalendar(start, end, type);
productSearchService.processUserFavoriteProductList(productJson, uid);
productSearchService.processUserFavoriteProductList(productJson, uid, appVersion);
return new ApiResponse.ApiResponseBuilder().code(200).message("product.search.newSaleCalendar").data(productJson).build();
}
... ...
... ... @@ -31,7 +31,7 @@ public interface ProductSearchService {
JSONObject searchHotSale(Integer page, Integer limit, String businessClient);
void processUserFavoriteProductList(JSONObject productJSON, Integer uid);
void processUserFavoriteProductList(JSONObject productJSON, Integer uid, String appVersion);
JSONObject getSaleCalendarCountData();
JSONObject getNewSaleCalendarCountData(String type);
... ...
... ... @@ -142,7 +142,7 @@ public class ProductSearchServiceImpl implements ProductSearchService {
@SuppressWarnings("unchecked")
@Override
public void processUserFavoriteProductList(JSONObject productJSON, Integer uid) {
public void processUserFavoriteProductList(JSONObject productJSON, Integer uid, String appVersion) {
JSONArray productList = productJSON.getJSONArray("product_list");
if (CollectionUtils.isEmpty(productList) || uid == null || uid < 1) {
return;
... ... @@ -162,13 +162,11 @@ public class ProductSearchServiceImpl implements ProductSearchService {
if(org.apache.commons.collections.CollectionUtils.isEmpty(favorite)) {
return;
}
// 遍历商品列表
for (int i = 0; i < productList.size(); i++) {
JSONObject product = productList.getJSONObject(i);
if (null == product) {
continue;
}
// 处理图片,封面图设置
Integer productId = MapUtils.getInteger(product, "id", 0);
if (productId != 0 && favorite.contains(productId)) {
product.put("isFavorite", 1);
... ...