Commit a90373c5 authored by shiyu's avatar shiyu

批量转拍卖返回新商品id

parent 321e7237
......@@ -575,6 +575,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
try {
Date now = new Date();
List<String> idList = Arrays.asList(dto.getItemIdsStr().split(","));
List<Long> newItemIdList = new ArrayList<>();
for (String id : idList) {
long itemId = Long.valueOf(id);
SupplierItem oldItem = supplierItemDao.findById(itemId);
......@@ -595,6 +596,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItem.setType(DistributionEnum.DistributionTypeEnum.AUCTION.getCode());
supplierItem.setIsAbleSale(true);
long newItemId = supplierItemDao.insert(supplierItem);
newItemIdList.add(newItemId);
//新增默认拍卖配置
AuctionConfig auctionConfig = new AuctionConfig();
auctionConfig.setState(AuctionEnum.StateEnum.WAIT_ON_SALE.getCode());
......@@ -618,7 +620,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
auctionConfig.setUpdateTime(now);
auctionConfigDao.insert(auctionConfig);
}
return Result.success();
return Result.success(newItemIdList);
} catch (Exception e) {
logger.error("藏品上拍失败 error : {}", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......
......@@ -27,7 +27,6 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer container, NativeWebRequest request,
WebDataBinderFactory factory) throws Exception {
// return new Integer(1);
String token = request.getHeader(LOGIN_TOKEN_KEY);
if (token == null || token.isEmpty()) {
......
......@@ -29,7 +29,7 @@ public class UserTokenManager {
private static final String TOKEN_ID_PREFIX = "cjxc:wx:token:token_id_prefix:";
private static Map<String, UserToken> tokenMap = new HashMap<>();
private static Map<Long, UserToken> idMap = new HashMap<>();
private static long SURVIVAL_TIME = 86400*7;
private static long SURVIVAL_TIME = 86400*7*365;
public Long getUserId(String token) {
String key = TOKEN_PREFIX + token;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment