This commit is contained in:
fengtianyangyang
2022-03-03 18:36:42 +08:00
88 changed files with 64174 additions and 1090 deletions

View File

@@ -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,6 +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 cn.lili.modules.store.service.StoreDetailService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -27,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -171,4 +178,107 @@ 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);
}
mapArrayList.add(map);
goodsOperationDTO.setSkuList(mapArrayList);//sku列表
if (goodsList.size() > 0) {
goodsService.fuLuEditGoods(goodsOperationDTO, goodsList.get(0).getId());
} else {
goodsService.fuLuAddGoods(goodsOperationDTO);
}
i += 1;
break;
}
if (i == 1) {
break;
}
}
}
return ResultUtil.success();
}
}

View File

@@ -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);
}
}

View File

@@ -33,9 +33,9 @@ spring:
type: redis
# Redis
redis:
host: 127.0.0.1
host: 120.71.145.134
port: 6379
password: lilishop
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://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: lilishop
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
@@ -108,8 +108,7 @@ spring:
props:
#是否打印逻辑SQL语句和实际SQL语句建议调试时打印在生产环境关闭
sql:
show: false
show: true
# 忽略鉴权url
ignored:
urls:
@@ -137,15 +136,14 @@ ignored:
# Swagger界面内容配置
swagger:
title: lili API接口文档
description: lili Api Documentation
title: API接口文档
description: Api Documentation
version: 1.0.0
termsOfServiceUrl: https://pickmall.cn
termsOfServiceUrl:
contact:
name: lili
url: https://pickmall.cn
email: admin@pickmall.com
name: rx
url:
email:
# Mybatis-plus
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
@@ -179,7 +177,7 @@ jasypt:
lili:
system:
isDemoSite: true
isDemoSite: false
statistics:
# 在线人数统计 X 小时。这里设置48即统计过去48小时每小时在线人数
onlineMember: 48
@@ -191,17 +189,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: https://zbuyer.sx1788.cn
wap: https://zshop.sx1788.cn
store: https://zseller.sx1788.cn
admin: https://zmanager.sx1788.cn
#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:
# token过期时间分钟
@@ -219,7 +216,7 @@ lili:
data:
elasticsearch:
cluster-name: elasticsearch
cluster-nodes: 127.0.0.1:9200
cluster-nodes: 106.124.130.167:9200
index:
number-of-replicas: 0
number-of-shards: 3
@@ -229,7 +226,7 @@ lili:
# username: elastic
# password: LiLiShopES
logstash:
server: 127.0.0.1:4560
server: 106.124.130.167:4560
rocketmq:
promotion-topic: lili_promotion_topic
promotion-group: lili_promotion_group
@@ -250,7 +247,7 @@ lili:
after-sale-topic: lili_after_sale_topic
after-sale-group: lili_after_sale_group
rocketmq:
name-server: 127.0.0.1:9876
name-server: 106.124.130.167:9876
producer:
group: lili_group
send-message-timeout: 30000