更新,BUG修改
This commit is contained in:
@@ -28,7 +28,7 @@ public class StoreApiApplication {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.setProperty("rocketmq.client.logUseSlf4j","true");
|
||||
System.setProperty("es.set.netty.runtime.available.processors", "false");
|
||||
SpringApplication.run(StoreApiApplication.class, args);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.fulu.core.utils.Test;
|
||||
import cn.lili.common.security.OperationalJudgment;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Goods;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
@@ -16,7 +18,10 @@ import cn.lili.modules.goods.entity.vos.StockWarningVO;
|
||||
import cn.lili.modules.goods.service.GoodsService;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
import cn.lili.modules.store.entity.dos.StoreDetail;
|
||||
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -27,8 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -171,4 +175,113 @@ public class GoodsStoreController {
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "新增商品(minShengLotteryRecordService商品迁移)")
|
||||
@PostMapping(value = "/fuluCreate")
|
||||
public ResultMessage<GoodsOperationDTO> fuluSave() throws Exception {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
GoodsOperationFuLuDTO goodsOperationDTO = new GoodsOperationFuLuDTO();
|
||||
|
||||
FuLuConfigureDTO fuLuConfigureDTO = storeDetailService.getFuLuConfigureDTO();
|
||||
//获取并解析福禄商品数据
|
||||
Map maps = (Map) JSON.parse(Test.getGoodsInfoList(fuLuConfigureDTO));
|
||||
if (!maps.get("code").toString().equals("0")) {
|
||||
return ResultUtil.error(201, "商品不存在或配置参数错误");
|
||||
}
|
||||
int i = 0;
|
||||
List<Map<String, String>> listObjectSec = JSONArray.parseObject(maps.get("result").toString(), List.class);
|
||||
for (Map<String, String> mapList : listObjectSec) {
|
||||
if (listObjectSec.size() <= 0) {
|
||||
break;
|
||||
}
|
||||
for (Map.Entry entry : mapList.entrySet()) {
|
||||
if (entry.getKey().equals("product_id")) {
|
||||
Map map1 = (Map) JSON.parse(Test.productInfoGetTest(fuLuConfigureDTO, entry.getValue().toString()).get("result").toString());
|
||||
if (map1.get("product_type").toString().equals("直充")) {
|
||||
goodsOperationDTO.setCategoryPath("1496301573515636737");//分类path
|
||||
} else if (map1.get("product_type").toString().equals("卡密")) {
|
||||
goodsOperationDTO.setCategoryPath("1496301573515636737");//分类path
|
||||
} else {
|
||||
//不是直充也不是卡密需要修改代码
|
||||
continue;
|
||||
}
|
||||
|
||||
List<Goods> goodsList = goodsService.list(
|
||||
new LambdaQueryWrapper<Goods>()
|
||||
.eq(Goods::getStoreId, storeId)
|
||||
.eq(Goods::getSn, map1.get("product_id").toString())
|
||||
.eq(Goods::getDeleteFlag, false)
|
||||
);
|
||||
|
||||
goodsOperationDTO.setStoreCategoryPath("");//店铺分类id
|
||||
goodsOperationDTO.setBrandId("1496301301183672321");//品牌ID
|
||||
goodsOperationDTO.setGoodsName(map1.get("product_name").toString());//商品名称
|
||||
goodsOperationDTO.setSn(map1.get("product_id").toString());//商品编号
|
||||
goodsOperationDTO.setPrice(Double.valueOf(map1.get("purchase_price").toString()));//商品价格
|
||||
goodsOperationDTO.setCost(Double.valueOf(map1.get("purchase_price").toString()));//市场价格
|
||||
goodsOperationDTO.setWeight(Double.valueOf("0"));//重量
|
||||
goodsOperationDTO.setIntro(map1.get("product_name").toString());//详情
|
||||
goodsOperationDTO.setMobileIntro(map1.get("product_name").toString());//移动端详情
|
||||
goodsOperationDTO.setQuantity(99999999);//库存
|
||||
goodsOperationDTO.setRelease(true);//是否立即发布
|
||||
goodsOperationDTO.setRecommend(true);//是否是推荐商品
|
||||
goodsOperationDTO.setGoodsParamsDTOList(new ArrayList<>());//商品参数
|
||||
List<String> goodsGalleryList = new ArrayList<>();
|
||||
if (map1.containsKey("four_category_icon") && map1.get("four_category_icon") != null) {
|
||||
goodsGalleryList.add(map1.get("four_category_icon").toString());
|
||||
}
|
||||
goodsOperationDTO.setGoodsGalleryList(goodsGalleryList);
|
||||
goodsOperationDTO.setTemplateId("0");//运费模板id,不需要运费模板时值是0
|
||||
goodsOperationDTO.setSellingPoint(map1.get("product_name").toString());
|
||||
goodsOperationDTO.setSalesModel("RETAIL");//销售模式
|
||||
// goodsOperationDTO.setHaveSpec();//是否有规格
|
||||
goodsOperationDTO.setGoodsUnit("个");//销售模式1471044596808024065
|
||||
goodsOperationDTO.setInfo(map1.get("product_name").toString());//商品描述
|
||||
goodsOperationDTO.setGoodsType("VIRTUAL_GOODS");//商品类型
|
||||
|
||||
|
||||
// goodsOperationDTO.setGoodsVideo();//商品视频
|
||||
|
||||
List<Map<String, Object>> mapArrayList = new ArrayList<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sn", goodsOperationDTO.getSn());
|
||||
map.put("price", goodsOperationDTO.getPrice());
|
||||
map.put("cost", goodsOperationDTO.getCost());
|
||||
map.put("weight", goodsOperationDTO.getWeight());
|
||||
map.put("quantity", goodsOperationDTO.getQuantity());
|
||||
map.put("category_path", "1496301573515636737");
|
||||
|
||||
if (map1.containsKey("four_category_icon") && map1.get("four_category_icon") != null) {
|
||||
List<Map<String, String>> images = new ArrayList<>();
|
||||
Map<String,String> map2 = new HashMap<>();
|
||||
map2.put("url",map1.get("four_category_icon").toString());
|
||||
images.add(map2);
|
||||
map.put("images", images);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
mapArrayList.add(map);
|
||||
goodsOperationDTO.setSkuList(mapArrayList);//sku列表
|
||||
|
||||
if (goodsList.size() > 0) {
|
||||
GoodsOperationDTO goodsOperationDTO1 = new GoodsOperationDTO();
|
||||
goodsOperationDTO1.setPrice(Double.valueOf(map1.get("purchase_price").toString()));
|
||||
goodsService.editGoods(goodsOperationDTO1, goodsList.get(0).getId());
|
||||
}else{
|
||||
goodsService.fuLuAddGoods(goodsOperationDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
// if (i == 1) {
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
}
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package cn.lili.controller.settings;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
|
||||
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
|
||||
import cn.lili.modules.store.entity.dto.StoreSettingDTO;
|
||||
import cn.lili.modules.store.entity.vos.StoreVO;
|
||||
@@ -87,4 +88,19 @@ public class StoreSettingsController {
|
||||
boolean result = storeDetailService.editStoreAfterSaleAddressDTO(storeAfterSaleAddressDTO);
|
||||
return ResultUtil.data(result);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家福禄配置")
|
||||
@GetMapping("/fuLuConfigure")
|
||||
public ResultMessage<FuLuConfigureDTO> getFuLuConfigure() {
|
||||
//获取当前登录商家内容
|
||||
return ResultUtil.data(storeDetailService.getFuLuConfigureDTO());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商家福禄配置")
|
||||
@PutMapping("/fuLuConfigure")
|
||||
public ResultMessage<Object> editFuLuConfigure(@Valid FuLuConfigureDTO fuLuConfigureDTO) {
|
||||
//修改商家退货收件地址
|
||||
boolean result = storeDetailService.editFuLuConfigureDTO(fuLuConfigureDTO);
|
||||
return ResultUtil.data(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ spring:
|
||||
type: redis
|
||||
# Redis
|
||||
redis:
|
||||
host: 192.168.2.122
|
||||
host: 120.71.145.134
|
||||
port: 6379
|
||||
password: Gb84505016
|
||||
password: ekLhvPGraSj8DGO0
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池最大连接数(使用负值表示没有限制) 默认 8
|
||||
@@ -64,9 +64,9 @@ spring:
|
||||
default-datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false
|
||||
username: rx-shop
|
||||
password: J2xEZ42HwPXrDXt3
|
||||
url: jdbc:mysql://120.71.183.195:3306/zyt_shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false
|
||||
username: zyt_shop
|
||||
password: Gb84505016@zytshop
|
||||
maxActive: 20
|
||||
initialSize: 5
|
||||
maxWait: 60000
|
||||
@@ -120,6 +120,7 @@ ignored:
|
||||
- /weixin/**
|
||||
- /source/**
|
||||
- /store/passport/login/**
|
||||
- /store/passport/login/refresh/**
|
||||
- /druid/**
|
||||
- /swagger-ui.html
|
||||
- /doc.html
|
||||
@@ -190,16 +191,16 @@ lili:
|
||||
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
|
||||
#域名
|
||||
domain:
|
||||
pc: https://pc.b2b2c.pickmall.cn
|
||||
wap: https://m.b2b2c.pickmall.cn
|
||||
store: https://store.b2b2c.pickmall.cn
|
||||
admin: https://admin.b2b2c.pickmall.cn
|
||||
pc: http://zbuyer.sx1788.cn/buyer
|
||||
wap: http://zshop.sx1788.cn/
|
||||
store: http://zseller.sx1788.cn/login
|
||||
admin: http://zmanager.sx1788.cn/login
|
||||
#api地址
|
||||
api:
|
||||
buyer: https://buyer-api.pickmall.cn
|
||||
common: https://common-api.pickmall.cn
|
||||
manager: https://admin-api.pickmall.cn
|
||||
store: https://store-api.pickmall.cn
|
||||
buyer: https://zshop-api.sx1788.cn/buyer-api
|
||||
common: https://zshop-api.sx1788.cn/common-api
|
||||
manager: https://zshop-api.sx1788.cn/manager-api
|
||||
store: https://zshop-api.sx1788.cn/seller-api
|
||||
|
||||
# jwt 细节设定
|
||||
jwt-setting:
|
||||
@@ -218,7 +219,7 @@ lili:
|
||||
data:
|
||||
elasticsearch:
|
||||
cluster-name: elasticsearch
|
||||
cluster-nodes: 192.168.2.122:9200
|
||||
cluster-nodes: 106.124.130.167:9200
|
||||
index:
|
||||
number-of-replicas: 0
|
||||
number-of-shards: 3
|
||||
@@ -228,7 +229,7 @@ lili:
|
||||
# username: elastic
|
||||
# password: LiLiShopES
|
||||
logstash:
|
||||
server: 192.168.2.122:4560
|
||||
server: 106.124.130.167:4560
|
||||
rocketmq:
|
||||
promotion-topic: lili_promotion_topic
|
||||
promotion-group: lili_promotion_group
|
||||
@@ -249,7 +250,7 @@ lili:
|
||||
after-sale-topic: lili_after_sale_topic
|
||||
after-sale-group: lili_after_sale_group
|
||||
rocketmq:
|
||||
name-server: 192.168.2.122:9876
|
||||
name-server: 106.124.130.167:9876
|
||||
producer:
|
||||
group: lili_group
|
||||
send-message-timeout: 30000
|
||||
@@ -257,7 +258,7 @@ rocketmq:
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://192.168.2.122:9001/xxl-job-admin
|
||||
addresses: http://127.0.0.1:9001/xxl-job-admin
|
||||
executor:
|
||||
appname: xxl-job-executor-lilishop
|
||||
address:
|
||||
|
||||
@@ -20,6 +20,22 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="RocketmqClientAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${LOG_FILE_PATH}/rocketmq.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<maxHistory>30</maxHistory>
|
||||
<totalSizeCap>30MB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<logger name="RocketmqClient" additivity="false">
|
||||
<level value="info" />
|
||||
<appender-ref ref="RocketmqClientAppender"/>
|
||||
</logger>
|
||||
|
||||
<!--输出到elk的LOGSTASH-->
|
||||
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
||||
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
|
||||
|
||||
Reference in New Issue
Block a user