|
|
@ -1,6 +1,9 @@ |
|
|
|
package com.hai.config; |
|
|
|
package com.hai.config; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
|
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
|
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
import com.hai.entity.BsProductConfig; |
|
|
|
import com.hai.entity.BsProductConfig; |
|
|
|
import com.hai.entity.BsProductDiscount; |
|
|
|
import com.hai.entity.BsProductDiscount; |
|
|
|
import com.hai.service.ApiProductService; |
|
|
|
import com.hai.service.ApiProductService; |
|
|
@ -43,11 +46,12 @@ public class ThirdProductConfig { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 产品折扣比例
|
|
|
|
// 产品折扣比例
|
|
|
|
public BsProductConfig getProductConfig(Integer productType , Long companyId) { |
|
|
|
public BsProductConfig getProductConfig(Integer productType , Long companyId , Long productId) { |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> listMap = new HashMap<>(); |
|
|
|
Map<String, Object> listMap = new HashMap<>(); |
|
|
|
listMap.put("productType", productType); |
|
|
|
listMap.put("productType", productType); |
|
|
|
listMap.put("companyId", companyId); |
|
|
|
listMap.put("companyId", companyId); |
|
|
|
|
|
|
|
listMap.put("productId", productId); |
|
|
|
|
|
|
|
|
|
|
|
List<BsProductConfig> productConfigs = apiProductService.getProductConfig(listMap); |
|
|
|
List<BsProductConfig> productConfigs = apiProductService.getProductConfig(listMap); |
|
|
|
|
|
|
|
|
|
|
@ -57,8 +61,12 @@ public class ThirdProductConfig { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JSONObject getThirdPartyByDetail(Integer platformId , Integer productType , Long companyId) { |
|
|
|
public JSONObject getThirdPartyByDetail(Integer platformId , Integer productType , Long companyId , Long productId) { |
|
|
|
BsProductConfig productConfig = getProductConfig(productType, companyId); |
|
|
|
BsProductConfig productConfig = getProductConfig(productType, companyId , productId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (productConfig == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未配置当前内容"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JSONObject object = new JSONObject(); |
|
|
|
JSONObject object = new JSONObject(); |
|
|
|
|
|
|
|
|
|
|
|