|
@@ -16,6 +16,7 @@
|
|
|
*/
|
|
*/
|
|
|
package org.springblade.modules.pl.product.service.impl;
|
|
package org.springblade.modules.pl.product.service.impl;
|
|
|
|
|
|
|
|
|
|
+import liquibase.pro.packaged.E;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springblade.api.utils.FileUtils;
|
|
import org.springblade.api.utils.FileUtils;
|
|
|
import org.springblade.common.utils.PostGet;
|
|
import org.springblade.common.utils.PostGet;
|
|
@@ -27,6 +28,7 @@ import org.springblade.modules.pl.product.excel.ProductExcel;
|
|
|
import org.springblade.modules.pl.product.mapper.ProductMapper;
|
|
import org.springblade.modules.pl.product.mapper.ProductMapper;
|
|
|
import org.springblade.modules.pl.product.service.IProductService;
|
|
import org.springblade.modules.pl.product.service.IProductService;
|
|
|
import org.springblade.modules.pl.productModel.entity.ProductModelEntity;
|
|
import org.springblade.modules.pl.productModel.entity.ProductModelEntity;
|
|
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -63,16 +65,20 @@ public class ProductServiceImpl extends BaseServiceImpl<ProductMapper, ProductEn
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Async
|
|
|
public void pushTripartite(String productCode, String fileUlr, ProductModelEntity productModel ,String result) {
|
|
public void pushTripartite(String productCode, String fileUlr, ProductModelEntity productModel ,String result) {
|
|
|
- File file = FileUtils.getFileByUrl(fileUlr,".jpg");
|
|
|
|
|
- Map<String,Object> param = new HashMap<>();
|
|
|
|
|
- param.put("sn",productCode);
|
|
|
|
|
- param.put("result",result);
|
|
|
|
|
- param.put("file",file);
|
|
|
|
|
- log.info("产品-{}推送三方平台result:{},fileUrl:{}",productCode,result,fileUlr);
|
|
|
|
|
- String postResult = HttpUtil.post(productModel.getTripartiteUrl(), param);
|
|
|
|
|
- log.info("产品-{}推送三方平台结果:{}",productCode,postResult);
|
|
|
|
|
-// HttpUtil.post()
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ File file = FileUtils.getFileByUrl(fileUlr,".jpg");
|
|
|
|
|
+ Map<String,Object> param = new HashMap<>();
|
|
|
|
|
+ param.put("sn",productCode);
|
|
|
|
|
+ param.put("result",result);
|
|
|
|
|
+ param.put("file",file);
|
|
|
|
|
+ log.info("产品-{}推送三方平台result:{},fileUrl:{}",productCode,result,fileUlr);
|
|
|
|
|
+ String postResult = HttpUtil.post(productModel.getTripartiteUrl(), param);
|
|
|
|
|
+ log.info("产品-{}推送三方平台结果:{}",productCode,postResult);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ log.error("产品-{}推送三方平台异常",productCode,e);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|