Просмотр исходного кода

解决海博添加商品问题

fubojin 2 дней назад
Родитель
Сommit
3961d376d1

+ 0 - 1
yami-shop-api/src/main/java/com/yami/shop/api/controller/MyOrderController.java

@@ -368,7 +368,6 @@ public class MyOrderController {
     @ApiOperation(value = "根据订单号确认收货", notes = "根据订单号确认收货")
     public ResponseEntity<String> receipt(@PathVariable("orderNumber") String orderNumber) {
         String userId = SecurityUtils.getUser().getUserId();
-//        String userId = "36726893042d492aba446439c5f00584";
         Order order = orderService.getOrderByOrderNumberAndUserId(orderNumber, userId, true);
         if (Objects.equals(order.getDvyType(), 1)) {
             CullenUtils.validateDataThrowException(Objects.equals(order.getHbOrderStatus(), 0), "订单未支付");

+ 5 - 0
yami-shop-api/src/main/resources/application-dev.yml

@@ -25,3 +25,8 @@ hb:
   host: https://p-open.hiboos.com
   appId: 5347a7077e65428bb9a87510ca7e1ea1
   secret: 67899367b17e4a8d8a7d10ebe8449b90
+smqjh:
+  #  pms-url: http://47.109.39.185:8080/smqjh-pms/api/v1/sync
+  #  pms-url: http://192.168.1.242:8080/smqjh-pms/api/v1/sync
+  pms-url: https://smqjh.api.zswlgz.com/smqjh-pms/api/v1/sync
+  omsBaseUrl: https://smqjh.api.zswlgz.com/smqjh-oms

+ 5 - 0
yami-shop-api/src/main/resources/application-prod.yml

@@ -25,3 +25,8 @@ hb:
   appId: 71ad2626c0124ca1a5c07cf5ca818c43
   secret: f655f69f962f427db1f0436fd34cd998
 
+smqjh:
+  #  pms-url: http://47.109.39.185:8080/smqjh-pms/api/v1/sync
+  #  pms-url: http://192.168.1.242:8080/smqjh-pms/api/v1/sync
+  pms-url: https://smqjh.api.zswlgz.com/smqjh-pms/api/v1/sync
+  omsBaseUrl: https://smqjh.api.zswlgz.com/smqjh-oms

+ 2 - 2
yami-shop-api/src/main/resources/application.yml

@@ -2,8 +2,8 @@
 spring:
   # 环境 dev|prod|docker
   profiles:
-    active: dev
-#    active: prod
+#    active: dev
+    active: prod
   #文件上传设置
   servlet:
     multipart:

+ 14 - 7
yami-shop-bean/src/main/java/com/yami/shop/bean/vo/ChannelProdImportVO.java

@@ -17,36 +17,43 @@ import java.math.BigDecimal;
 @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 9) // 内容背景色(9=淡黄色)
 public class ChannelProdImportVO {
 
-    @ExcelProperty(value = "海博商品ID*", index = 0)
+
+    @ExcelProperty(value = "海博商品ID", index = 0)
     @ColumnWidth(20) // 列宽
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) // 居中对齐
     private String skuId;
 
-    @ExcelProperty(value = "商品名称", index = 1)
+    @ExcelProperty(value = "海博商品编码", index = 1)
+    @ColumnWidth(20) // 列宽
+    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) // 居中对齐
+    private String skuCode;
+
+    @ExcelProperty(value = "商品名称", index = 2)
     @ColumnWidth(40)
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
     private String skuName;
 
-    @ExcelProperty(value = "销售渠道*", index = 2)
+    @ExcelProperty(value = "销售渠道*", index = 3)
     @ColumnWidth(20)
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
     private String channelName;
 
-    @ExcelProperty(value = "门店名称*", index = 3)
+    @ExcelProperty(value = "门店名称*", index = 4)
     @ColumnWidth(20)
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
     private String shopName;
 
-    @ExcelProperty(value = "进货价(元)", index = 4)
+    @ExcelProperty(value = "进货价(元)", index = 5)
     @ColumnWidth(20)
     private BigDecimal purchasePrice;
 
-    @ExcelProperty(value = "出货价(元)", index = 5)
+    @ExcelProperty(value = "出货价(元)", index = 6)
     @ColumnWidth(20)
     private BigDecimal deliveryPrice;
 
-    @ExcelProperty(value = "渠道售价(元)*", index = 6)
+    @ExcelProperty(value = "渠道售价(元)*", index = 7)
     @ColumnWidth(20)
     private BigDecimal channelProdPrice;
 
+
 }

+ 0 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderController.java

@@ -156,10 +156,8 @@ public class OrderController {
         //子订单数据处理
         List<Order> list = orderService.list(new LambdaUpdateWrapper<Order>().eq(Order::getParentOrderNumber, orderNumber)
                 .eq(Order::getDeleteStatus, 0));
-
         if (ObjectUtil.isNotEmpty(list)) {
             for (Order order1 : list) {
-
                 List<OrderItem> orderItems2 = orderItemService.getOrderItemsByOrderNumber(orderNumber);
                 if (!orderItems2.isEmpty()) {
                     orderItems2.forEach(c -> {

+ 2 - 2
yami-shop-platform/src/main/resources/application.yml

@@ -1,8 +1,8 @@
 spring:
   # 环境 dev|prod|docker quartz定时任务
   profiles:
-    active: dev
-#    active: prod
+#    active: dev
+    active: prod
   #文件上传设置
   servlet:
 

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBFrontCategoryService.java

@@ -211,7 +211,7 @@ public class HBFrontCategoryService implements IHBFrontCategoryService {
     public void deleteFrontCategory(JSONObject hbRequest) {
         JSONObject body = hbRequest.getJSONObject("body");
         JSONArray codeList = body.getJSONArray("codeList");
-        for (Object codeObject : codeList) {
+        for (Object codeObject : codeList) {    
             String code = codeObject.toString();
             log.info("前台类目删除,body:{}", code);
             FrontCategory frontCategory = frontCategoryMapper.selectOne(new LambdaQueryWrapper<FrontCategory>()

+ 0 - 2
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java

@@ -284,8 +284,6 @@ public class HBGoodsService implements IHBGoodsService {
                             .eq(FrontCategory::getCode, categoryProd.getCode()).eq(FrontCategory::getIsDelete, 0));
                     addShopCategory(frontCategory, categoryProd.getProdId(), shopDetail.getShopId(), shopDetail.getHbStationId());
                 }
-
-
             }
         } catch (Exception e) {
             log.error("商品失败:{}", e.getMessage(), e);

+ 0 - 66
yami-shop-service/src/main/java/com/yami/shop/service/impl/ExportTaskServiceImpl.java

@@ -1,90 +1,31 @@
-/*
- * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
- *
- * https://www.gz-yami.com/
- *
- * 未经允许,不可做商业用途!
- *
- * 版权所有,侵权必究!
- */
 
 package com.yami.shop.service.impl;
 
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.date.DateTime;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.io.IORuntimeException;
-import cn.hutool.core.lang.Snowflake;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.RandomUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.poi.excel.ExcelUtil;
-import cn.hutool.poi.excel.ExcelWriter;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import com.google.gson.JsonObject;
-import com.google.gson.internal.LinkedTreeMap;
-import com.yami.shop.bean.app.dto.OrderCountData;
-import com.yami.shop.bean.app.dto.ShopCartOrderMergerDto;
-import com.yami.shop.bean.dto.hb.HBBaseReq;
 import com.yami.shop.bean.enums.*;
-import com.yami.shop.bean.event.CancelOrderEvent;
-import com.yami.shop.bean.event.ReceiptOrderEvent;
-import com.yami.shop.bean.event.SubmitOrderEvent;
-import com.yami.shop.bean.event.SubmitScoreOrderEvent;
 import com.yami.shop.bean.model.*;
 import com.yami.shop.bean.param.*;
 import com.yami.shop.bean.vo.ExportContext;
 import com.yami.shop.bean.vo.ExportTaskVo;
-import com.yami.shop.bean.vo.OrderCountVo;
-import com.yami.shop.common.config.Constant;
 import com.yami.shop.common.exception.GlobalException;
-import com.yami.shop.common.util.Arith;
-import com.yami.shop.common.util.PageAdapter;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.R;
 import com.yami.shop.dao.*;
 import com.yami.shop.service.ExportTaskService;
-import com.yami.shop.service.OrderItemService;
-import com.yami.shop.service.OrderService;
-import com.yami.shop.service.OrderSettlementService;
-import com.yami.shop.utils.CullenUtils;
 import com.yami.shop.utils.ExportUtils;
-import com.yami.shop.utils.HBSignUtil;
-import com.yami.shop.wx.po.RefundInfoPo;
-import com.yami.shop.wx.service.WxProviderService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.cache.annotation.CachePut;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.support.TransactionTemplate;
 
-import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.net.URLEncoder;
 import java.nio.ByteBuffer;
 import java.nio.channels.Channels;
@@ -94,17 +35,10 @@ import java.nio.channels.WritableByteChannel;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.text.SimpleDateFormat;
 import java.time.Instant;
-import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.stream.Collectors;
-
-import static com.yami.shop.common.util.HttpUtil.post;
 
 /**
  * @author lgh on 2018/09/15.

+ 1 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderServiceImpl.java

@@ -868,6 +868,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     @Transactional(rollbackFor = Exception.class)
     public void receiptOrder(List<Order> orders) {
         orderMapper.receiptOrder(orders);
+        log.info("用户确认收货,订单号:{}", orders.stream().map(Order::getOrderNumber).collect(Collectors.joining(",")));
         for (Order order : orders) {
             eventPublisher.publishEvent(new ReceiptOrderEvent(order));
         }

+ 1 - 1
yami-shop-service/src/main/resources/mapper/OrderMapper.xml

@@ -253,7 +253,7 @@
     </select>
 
     <update id="cancelOrders">
-        update tz_order set `hb_order_status`=60,close_type = 1,cancel_reason = #{cancelReason}, cancel_time =
+        update tz_order set `hb_order_status`=60,cancel_reason = #{cancelReason}, cancel_time =
         NOW(),update_time=NOW(),close_type=4 where order_id in
         <foreach collection="orders" item="order" open="(" close=")" separator=",">
             #{order.orderId}