yzc 2 роки тому
батько
коміт
7b24b1af6b

+ 1 - 1
hx-item/src/main/java/com/fjhx/item/entity/product/po/ProductInfoEhsdJson.java

@@ -129,7 +129,7 @@ public class ProductInfoEhsdJson {
     /**
      * 客户id
      */
-    private Long customerId;
+    private String customerId;
     /**
      * 客户名称
      */

+ 3 - 3
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -208,7 +208,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         List<Long> customerIds = new ArrayList<>();
         for (ProductInfoVo record : records) {
             ProductInfoEhsdJson productInfoEhsdJson = JSONObject.parseObject(record.getEhsdJson(), ProductInfoEhsdJson.class);
-            customerIds.add(productInfoEhsdJson.getCustomerId());
+            customerIds.add(Long.parseLong(productInfoEhsdJson.getCustomerId()));
         }
         if (ObjectUtil.isNotEmpty(customerIds)) {
             Map<Long, String> customerMap = customerService.mapKV(Customer::getId, Customer::getName, q -> q.in(Customer::getId, customerIds));
@@ -249,7 +249,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         ProductInfoEhsdJson productInfoEhsdJson = JSONObject.parseObject(productInfoDto.getEhsdJson(), ProductInfoEhsdJson.class);
         if (ObjectUtil.isEmpty(productInfoEhsdJson.getCustomerId())) {
             //如果客户id为空就赋值为0 公司产品
-            productInfoEhsdJson.setCustomerId(0l);
+            productInfoEhsdJson.setCustomerId("0");
             productInfoEhsdJson.setType("1");//默认公司产品
         }
         productInfoDto.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson));
@@ -340,7 +340,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             }
             ProductInfoEhsdJson productInfoEhsdJson = BeanUtil.copyProperties(productInfoEhsdExcel, ProductInfoEhsdJson.class);
             productInfoEhsdJson.setType("1");//公司产品
-            productInfoEhsdJson.setCustomerId(0l);//客户id为0 公司产品
+            productInfoEhsdJson.setCustomerId("0");//客户id为0 公司产品
             //内外包装方式名称转字典key
             String innerPackMethod = productInfoEhsdJson.getInnerPackMethod();
             if (ObjectUtil.isNotEmpty(innerPackMethod)) {

+ 9 - 4
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/stock/impl/StockTransferServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.victoriatourist.entity.abnormal.po.AbnormalInfo;
+import com.fjhx.victoriatourist.entity.jd.vo.JdBackVo;
 import com.fjhx.victoriatourist.entity.stock.dto.StockTransferDto;
 import com.fjhx.victoriatourist.entity.stock.dto.StockTransferSelectDto;
 import com.fjhx.victoriatourist.entity.stock.po.StockTransfer;
@@ -37,10 +38,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -99,6 +97,13 @@ public class StockTransferServiceImpl extends ServiceImpl<StockTransferMapper, S
     public StockTransferVo detail(Long id) {
         StockTransfer StockTransfer = this.getById(id);
         StockTransferVo result = BeanUtil.toBean(StockTransfer, StockTransferVo.class);
+        //赋值仓库名称信息
+        warehouseService.attributeAssign(Arrays.asList(result), StockTransferVo::getInWarehouseId, (item, warehouse) -> {
+            item.setInWarehouseName(warehouse.getName());
+        });
+        warehouseService.attributeAssign(Arrays.asList(result), StockTransferVo::getOutWarehouseId, (item, warehouse) -> {
+            item.setOutWarehouseName(warehouse.getName());
+        });
         List<StockTransferDetails> list = stockTransferDetailsService.list(q -> q.eq(StockTransferDetails::getStockTransferId, id));
         List<StockTransferDetailsVo> stockTransferDetailsVos = BeanUtil.copyToList(list, StockTransferDetailsVo.class);
         //赋值明细产品信息