...
|
...
|
@@ -3,15 +3,18 @@ package com.yoho.ufo.service.impl; |
|
|
import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.order.dal.SellerOrderMapper;
|
|
|
import com.yoho.product.model.ProductNameAndImgReq;
|
|
|
import com.yoho.ufo.dal.model.*;
|
|
|
import com.yohobuy.ufo.model.order.bo.SellerBo;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
...
|
...
|
@@ -26,8 +29,14 @@ import org.springframework.context.ApplicationContextAware; |
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.core.dal.datasource.annotation.Database;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.order.dal.SellerOrderMapper;
|
|
|
import com.yoho.product.dal.ProductOperateRecordMapper;
|
|
|
import com.yoho.product.model.ProductNameAndImgReq;
|
|
|
import com.yoho.product.model.ProductOperateRecord;
|
|
|
import com.yoho.ufo.dal.BrandMapper;
|
|
|
import com.yoho.ufo.dal.GoodsImagesMapper;
|
|
|
import com.yoho.ufo.dal.GoodsMapper;
|
...
|
...
|
@@ -42,6 +51,16 @@ import com.yoho.ufo.dal.StoragePriceMapper; |
|
|
import com.yoho.ufo.dal.UfoBrandSeriesMapper;
|
|
|
import com.yoho.ufo.dal.UfoProductColorMapper;
|
|
|
import com.yoho.ufo.dal.UfoSizeMapper;
|
|
|
import com.yoho.ufo.dal.model.Goods;
|
|
|
import com.yoho.ufo.dal.model.GoodsImages;
|
|
|
import com.yoho.ufo.dal.model.Product;
|
|
|
import com.yoho.ufo.dal.model.ProductAttrImportItem;
|
|
|
import com.yoho.ufo.dal.model.ProductImportTran;
|
|
|
import com.yoho.ufo.dal.model.ProductImportTranItem;
|
|
|
import com.yoho.ufo.dal.model.ProductLimitSale;
|
|
|
import com.yoho.ufo.dal.model.ProductSales;
|
|
|
import com.yoho.ufo.dal.model.Storage;
|
|
|
import com.yoho.ufo.dal.model.StoragePrice;
|
|
|
import com.yoho.ufo.exception.CommonException;
|
|
|
import com.yoho.ufo.exception.PlatformException;
|
|
|
import com.yoho.ufo.model.brand.Brand;
|
...
|
...
|
@@ -56,6 +75,7 @@ import com.yoho.ufo.util.ImagesConstant; |
|
|
import com.yoho.ufo.util.ImagesHelper;
|
|
|
import com.yohobuy.ufo.model.common.ApiResponse;
|
|
|
import com.yohobuy.ufo.model.common.PageResponseBO;
|
|
|
import com.yohobuy.ufo.model.order.bo.SellerBo;
|
|
|
import com.yohobuy.ufo.model.order.req.BatchImportPrdReq;
|
|
|
import com.yohobuy.ufo.model.order.req.SellerReq;
|
|
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
...
|
...
|
@@ -118,6 +138,9 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw |
|
|
@Autowired
|
|
|
private SellerOrderMapper sellerOrderMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ProductOperateRecordMapper productOperateRecordMapper;
|
|
|
|
|
|
private static final Integer NOT_SYN_CALENDER = 0;
|
|
|
|
|
|
@Override
|
...
|
...
|
@@ -813,6 +836,15 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw |
|
|
}
|
|
|
int n = productMapper.updateStatusByPrimaryKey(bo.getId(), bo.getStatus());
|
|
|
if (n == 1) {
|
|
|
if(bo.getStatus().intValue() == 1 || bo.getStatus().intValue() == 2) {//上架或下架,记录操作日志
|
|
|
ProductOperateRecord record = new ProductOperateRecord();
|
|
|
record.setProductId(bo.getId());
|
|
|
record.setOperateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
record.setType(bo.getStatus());
|
|
|
record.setUid(new UserHelper().getUserId());
|
|
|
record.setUserName(new UserHelper().getUserName());
|
|
|
productOperateRecordMapper.insert(record);
|
|
|
}
|
|
|
return new ApiResponse<>(200, "操作成功");
|
|
|
}
|
|
|
return new ApiResponse<>(400, "操作失败!");
|
...
|
...
|
|