|
|
@@ -45,7 +45,7 @@ public class HBGoodsService implements IHBGoodsService {
|
|
|
|
|
|
private final FrontCategoryMapper frontCategoryMapper;
|
|
|
private final ShopCategoryMapper shopCategoryMapper;
|
|
|
- private final CategoryProdMapper categoryProdMapper;
|
|
|
+ private final CategoryProdHbMapper categoryProdHbMapper;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -163,26 +163,12 @@ public class HBGoodsService implements IHBGoodsService {
|
|
|
return HBR.success();
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public HBR updateGoods(JSONObject hbRequest) {
|
|
|
- try {
|
|
|
- String bodyStr = hbRequest.getString("body");
|
|
|
- log.info("商品,body:{}", bodyStr);
|
|
|
- JSONObject bodyJson = JSON.parseObject(bodyStr); // 使用Fastjson的解析方法
|
|
|
- String outStationNo = bodyJson.getString("outStationNo");
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("商品失败:{}", e.getMessage(), e);
|
|
|
- return HBR.error("未知异常");
|
|
|
-
|
|
|
- }
|
|
|
- return HBR.success();
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public HBR updateGoodsStatus(JSONObject hbRequest) {
|
|
|
try {
|
|
|
JSONObject bodyStr = hbRequest.getJSONObject("body");
|
|
|
- log.info("商品,body:{}", bodyStr);
|
|
|
+ log.info("商品可售状态,body:{}", bodyStr);
|
|
|
|
|
|
JSONArray data = bodyStr.getJSONArray("data");// 使用Fastjson的解析方法
|
|
|
String selfSkuStatus = getSelfSkuStatus(data);
|
|
|
@@ -206,10 +192,10 @@ public class HBGoodsService implements IHBGoodsService {
|
|
|
.eq(ShopSku::getShopId, shopDetail.getShopId()));
|
|
|
|
|
|
//处理门店-分类管理
|
|
|
- List<CategoryProd> categoryProds = categoryProdMapper.selectList(new LambdaQueryWrapper<CategoryProd>()
|
|
|
- .eq(CategoryProd::getProdId, sku.getProdId())
|
|
|
- .eq(CategoryProd::getIsDelete, 0));
|
|
|
- for (CategoryProd categoryProd : categoryProds) {
|
|
|
+ List<CategoryProdHb> categoryProds = categoryProdHbMapper.selectList(new LambdaQueryWrapper<CategoryProdHb>()
|
|
|
+ .eq(CategoryProdHb::getProdId, sku.getProdId())
|
|
|
+ .eq(CategoryProdHb::getIsDelete, 0));
|
|
|
+ for (CategoryProdHb categoryProd : categoryProds) {
|
|
|
FrontCategory frontCategory = frontCategoryMapper.selectOne(new LambdaQueryWrapper<FrontCategory>()
|
|
|
.eq(FrontCategory::getCode, categoryProd.getCode()));
|
|
|
addShopCategory(frontCategory, shopDetail.getShopId(), shopDetail.getHbStationId());
|
|
|
@@ -617,10 +603,6 @@ public class HBGoodsService implements IHBGoodsService {
|
|
|
String ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCodeLevel2");
|
|
|
if (StringUtils.isEmpty(ztFrontCategoryCodeLevel)) {
|
|
|
ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCode");
|
|
|
-// } else {
|
|
|
-// //如果是二级,一级对应商品不存在也需要添加
|
|
|
-// addCategoryProd(spuId, ztFrontCategoryCodeLevel);
|
|
|
-// ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCode");
|
|
|
}
|
|
|
addCategoryProd(spuId, ztFrontCategoryCodeLevel);
|
|
|
|
|
|
@@ -629,17 +611,16 @@ public class HBGoodsService implements IHBGoodsService {
|
|
|
}
|
|
|
|
|
|
private void addCategoryProd(Long spuId, String ztFrontCategoryCodeLevel) {
|
|
|
- CategoryProd categoryProd = new CategoryProd();
|
|
|
+ CategoryProdHb categoryProd = new CategoryProdHb();
|
|
|
categoryProd.setCode(ztFrontCategoryCodeLevel);
|
|
|
categoryProd.setProdId(spuId);
|
|
|
categoryProd.setIsDelete(0);
|
|
|
- CategoryProd integer = categoryProdMapper.selectOne(new LambdaQueryWrapper<CategoryProd>()
|
|
|
- .eq(CategoryProd::getProdId, spuId)
|
|
|
- .eq(CategoryProd::getIsDelete, 0)
|
|
|
- .eq(CategoryProd::getCode, ztFrontCategoryCodeLevel));
|
|
|
+ CategoryProdHb integer = categoryProdHbMapper.selectOne(new LambdaQueryWrapper<CategoryProdHb>()
|
|
|
+ .eq(CategoryProdHb::getProdId, spuId)
|
|
|
+ .eq(CategoryProdHb::getIsDelete, 0)
|
|
|
+ .eq(CategoryProdHb::getCode, ztFrontCategoryCodeLevel));
|
|
|
if (integer == null) {
|
|
|
- categoryProdMapper.insert(categoryProd);
|
|
|
-
|
|
|
+ categoryProdHbMapper.insert(categoryProd);
|
|
|
}
|
|
|
//门店分类处理
|
|
|
List<ShopSku> shopCategoryList = shopSkuMapper.selectList(new LambdaQueryWrapper<ShopSku>()
|