...
|
...
|
@@ -9,11 +9,15 @@ import java.util.List; |
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.yoho.ufo.order.request.OrderOperateTask;
|
|
|
import com.yoho.ufo.util.*;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
...
|
...
|
@@ -100,11 +104,6 @@ import com.yoho.ufo.order.service.IBuyerOrderService; |
|
|
import com.yoho.ufo.service.impl.UfoServiceCaller;
|
|
|
import com.yoho.ufo.service.impl.UserHelper;
|
|
|
import com.yoho.ufo.service.model.PageResponseBO;
|
|
|
import com.yoho.ufo.util.DateUtil;
|
|
|
import com.yoho.ufo.util.ImagesConstant;
|
|
|
import com.yoho.ufo.util.ImagesHelper;
|
|
|
import com.yoho.ufo.util.MobileHelper;
|
|
|
import com.yoho.ufo.util.OrderVideoUrlUtil;
|
|
|
import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
|
|
|
import com.yohobuy.ufo.model.order.common.EnumExpressType;
|
|
|
import com.yohobuy.ufo.model.order.common.EnumQualityCheckStatus;
|
...
|
...
|
@@ -130,6 +129,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(BuyerOrderServiceImpl.class);
|
|
|
|
|
|
private final static ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2);
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerOrderMapper buyerOrderMapper;
|
|
|
|
...
|
...
|
@@ -859,9 +860,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
}
|
|
|
|
|
|
String[] orderCodeArr = orderCodes.split(",");
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_CONFIRM_RECEIVE.getCode();
|
|
|
|
|
|
List<Long> orderCodeList = ListUtil.convertList(orderCodes, ",");
|
|
|
List<BuyerOrder> buyerOrders = buyerOrderMapper.selectBatchByOrderCode(orderCodeList);
|
|
|
Map<String, BuyerOrder> orderMap = buyerOrders.stream().collect(Collectors.toMap(BuyerOrder::getOrderCode, item -> item));
|
|
|
|
|
|
for(int i=0; i<orderCodeArr.length; i++) {
|
|
|
String orderCode = orderCodeArr[i];
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
BuyerOrder buyerOrder = orderMap.get(orderCode);//buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
if( Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单"+orderCode +"状态变化,不允许确认收货,请重新刷新列表");
|
|
|
}
|
...
|
...
|
@@ -869,14 +877,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
String args = "ufo-gateway.confirmReceive";
|
|
|
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
if(jsonObject!=null&&jsonObject.getIntValue("code") == 200) {
|
|
|
if(jsonObject == null || jsonObject.getIntValue("code") != 200) {
|
|
|
throw new ServiceException(400,"错误:订单"+orderCode +"确认收货失败");
|
|
|
}
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_CONFIRM_RECEIVE.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(),userHelper, operateType, "");
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(),userHelper, operateType, ""); //记录操作日志
|
|
|
LOGGER.info("confirmReceive saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -2523,14 +2527,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
}
|
|
|
|
|
|
private void saveOrderOperateRecord(String orderCode, UserHelper userInfo, int operateType, String oldInfo) {
|
|
|
OrderOperateRecord optRecord = new OrderOperateRecord();
|
|
|
executorService.submit(new OrderOperateTask(orderCode, operateType, userInfo.getUserId(), userInfo.getUserName(), oldInfo, DateUtil.getCurrentTimeSeconds()));
|
|
|
/*OrderOperateRecord optRecord = new OrderOperateRecord();
|
|
|
optRecord.setOrderCode(orderCode);
|
|
|
optRecord.setType(operateType);
|
|
|
optRecord.setUid(userInfo.getUserId());
|
|
|
optRecord.setUserName(userInfo.getUserName());
|
|
|
optRecord.setUpdateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
optRecord.setOldInfo(oldInfo);
|
|
|
orderOperateRecordMapper.insert(optRecord);
|
|
|
orderOperateRecordMapper.insert(optRecord);*/
|
|
|
}
|
|
|
|
|
|
/*private String getAddressInfo(String areaCode) {
|
...
|
...
|
|