|
@@ -3,15 +3,18 @@ package com.yoho.ufo.service.impl; |
|
@@ -3,15 +3,18 @@ package com.yoho.ufo.service.impl; |
3
|
import java.math.BigDecimal;
|
3
|
import java.math.BigDecimal;
|
4
|
import java.text.ParseException;
|
4
|
import java.text.ParseException;
|
5
|
import java.text.SimpleDateFormat;
|
5
|
import java.text.SimpleDateFormat;
|
6
|
-import java.util.*;
|
6
|
+import java.util.ArrayList;
|
|
|
7
|
+import java.util.Arrays;
|
|
|
8
|
+import java.util.Calendar;
|
|
|
9
|
+import java.util.Collections;
|
|
|
10
|
+import java.util.HashMap;
|
|
|
11
|
+import java.util.HashSet;
|
|
|
12
|
+import java.util.List;
|
|
|
13
|
+import java.util.Map;
|
|
|
14
|
+import java.util.Objects;
|
|
|
15
|
+import java.util.Set;
|
7
|
import java.util.stream.Collectors;
|
16
|
import java.util.stream.Collectors;
|
8
|
|
17
|
|
9
|
-import com.alibaba.fastjson.JSON;
|
|
|
10
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
11
|
-import com.yoho.order.dal.SellerOrderMapper;
|
|
|
12
|
-import com.yoho.product.model.ProductNameAndImgReq;
|
|
|
13
|
-import com.yoho.ufo.dal.model.*;
|
|
|
14
|
-import com.yohobuy.ufo.model.order.bo.SellerBo;
|
|
|
15
|
import org.apache.commons.collections.CollectionUtils;
|
18
|
import org.apache.commons.collections.CollectionUtils;
|
16
|
import org.apache.commons.collections.map.HashedMap;
|
19
|
import org.apache.commons.collections.map.HashedMap;
|
17
|
import org.apache.commons.lang3.StringUtils;
|
20
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -26,8 +29,14 @@ import org.springframework.context.ApplicationContextAware; |
|
@@ -26,8 +29,14 @@ import org.springframework.context.ApplicationContextAware; |
26
|
import org.springframework.stereotype.Service;
|
29
|
import org.springframework.stereotype.Service;
|
27
|
import org.springframework.web.multipart.MultipartFile;
|
30
|
import org.springframework.web.multipart.MultipartFile;
|
28
|
|
31
|
|
|
|
32
|
+import com.alibaba.fastjson.JSON;
|
|
|
33
|
+import com.alibaba.fastjson.JSONObject;
|
29
|
import com.yoho.core.dal.datasource.annotation.Database;
|
34
|
import com.yoho.core.dal.datasource.annotation.Database;
|
30
|
import com.yoho.core.rest.client.ServiceCaller;
|
35
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
36
|
+import com.yoho.order.dal.SellerOrderMapper;
|
|
|
37
|
+import com.yoho.product.dal.ProductOperateRecordMapper;
|
|
|
38
|
+import com.yoho.product.model.ProductNameAndImgReq;
|
|
|
39
|
+import com.yoho.product.model.ProductOperateRecord;
|
31
|
import com.yoho.ufo.dal.BrandMapper;
|
40
|
import com.yoho.ufo.dal.BrandMapper;
|
32
|
import com.yoho.ufo.dal.GoodsImagesMapper;
|
41
|
import com.yoho.ufo.dal.GoodsImagesMapper;
|
33
|
import com.yoho.ufo.dal.GoodsMapper;
|
42
|
import com.yoho.ufo.dal.GoodsMapper;
|
|
@@ -42,6 +51,16 @@ import com.yoho.ufo.dal.StoragePriceMapper; |
|
@@ -42,6 +51,16 @@ import com.yoho.ufo.dal.StoragePriceMapper; |
42
|
import com.yoho.ufo.dal.UfoBrandSeriesMapper;
|
51
|
import com.yoho.ufo.dal.UfoBrandSeriesMapper;
|
43
|
import com.yoho.ufo.dal.UfoProductColorMapper;
|
52
|
import com.yoho.ufo.dal.UfoProductColorMapper;
|
44
|
import com.yoho.ufo.dal.UfoSizeMapper;
|
53
|
import com.yoho.ufo.dal.UfoSizeMapper;
|
|
|
54
|
+import com.yoho.ufo.dal.model.Goods;
|
|
|
55
|
+import com.yoho.ufo.dal.model.GoodsImages;
|
|
|
56
|
+import com.yoho.ufo.dal.model.Product;
|
|
|
57
|
+import com.yoho.ufo.dal.model.ProductAttrImportItem;
|
|
|
58
|
+import com.yoho.ufo.dal.model.ProductImportTran;
|
|
|
59
|
+import com.yoho.ufo.dal.model.ProductImportTranItem;
|
|
|
60
|
+import com.yoho.ufo.dal.model.ProductLimitSale;
|
|
|
61
|
+import com.yoho.ufo.dal.model.ProductSales;
|
|
|
62
|
+import com.yoho.ufo.dal.model.Storage;
|
|
|
63
|
+import com.yoho.ufo.dal.model.StoragePrice;
|
45
|
import com.yoho.ufo.exception.CommonException;
|
64
|
import com.yoho.ufo.exception.CommonException;
|
46
|
import com.yoho.ufo.exception.PlatformException;
|
65
|
import com.yoho.ufo.exception.PlatformException;
|
47
|
import com.yoho.ufo.model.brand.Brand;
|
66
|
import com.yoho.ufo.model.brand.Brand;
|
|
@@ -56,6 +75,7 @@ import com.yoho.ufo.util.ImagesConstant; |
|
@@ -56,6 +75,7 @@ import com.yoho.ufo.util.ImagesConstant; |
56
|
import com.yoho.ufo.util.ImagesHelper;
|
75
|
import com.yoho.ufo.util.ImagesHelper;
|
57
|
import com.yohobuy.ufo.model.common.ApiResponse;
|
76
|
import com.yohobuy.ufo.model.common.ApiResponse;
|
58
|
import com.yohobuy.ufo.model.common.PageResponseBO;
|
77
|
import com.yohobuy.ufo.model.common.PageResponseBO;
|
|
|
78
|
+import com.yohobuy.ufo.model.order.bo.SellerBo;
|
59
|
import com.yohobuy.ufo.model.order.req.BatchImportPrdReq;
|
79
|
import com.yohobuy.ufo.model.order.req.BatchImportPrdReq;
|
60
|
import com.yohobuy.ufo.model.order.req.SellerReq;
|
80
|
import com.yohobuy.ufo.model.order.req.SellerReq;
|
61
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
81
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
|
@@ -118,6 +138,9 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw |
|
@@ -118,6 +138,9 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw |
118
|
@Autowired
|
138
|
@Autowired
|
119
|
private SellerOrderMapper sellerOrderMapper;
|
139
|
private SellerOrderMapper sellerOrderMapper;
|
120
|
|
140
|
|
|
|
141
|
+ @Autowired
|
|
|
142
|
+ private ProductOperateRecordMapper productOperateRecordMapper;
|
|
|
143
|
+
|
121
|
private static final Integer NOT_SYN_CALENDER = 0;
|
144
|
private static final Integer NOT_SYN_CALENDER = 0;
|
122
|
|
145
|
|
123
|
@Override
|
146
|
@Override
|
|
@@ -813,6 +836,15 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw |
|
@@ -813,6 +836,15 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw |
813
|
}
|
836
|
}
|
814
|
int n = productMapper.updateStatusByPrimaryKey(bo.getId(), bo.getStatus());
|
837
|
int n = productMapper.updateStatusByPrimaryKey(bo.getId(), bo.getStatus());
|
815
|
if (n == 1) {
|
838
|
if (n == 1) {
|
|
|
839
|
+ if(bo.getStatus().intValue() == 1 || bo.getStatus().intValue() == 2) {//上架或下架,记录操作日志
|
|
|
840
|
+ ProductOperateRecord record = new ProductOperateRecord();
|
|
|
841
|
+ record.setProductId(bo.getId());
|
|
|
842
|
+ record.setOperateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
843
|
+ record.setType(bo.getStatus());
|
|
|
844
|
+ record.setUid(new UserHelper().getUserId());
|
|
|
845
|
+ record.setUserName(new UserHelper().getUserName());
|
|
|
846
|
+ productOperateRecordMapper.insert(record);
|
|
|
847
|
+ }
|
816
|
return new ApiResponse<>(200, "操作成功");
|
848
|
return new ApiResponse<>(200, "操作成功");
|
817
|
}
|
849
|
}
|
818
|
return new ApiResponse<>(400, "操作失败!");
|
850
|
return new ApiResponse<>(400, "操作失败!");
|