...
|
...
|
@@ -102,6 +102,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
@Autowired
|
|
|
private IdentifyRecordsMapper identifyRecordsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private QualityCheckMapper qualityCheckMapper;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerOrderFeedbackService buyerOrderFeedbackService;
|
...
|
...
|
@@ -189,15 +192,21 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
return null;
|
|
|
}
|
|
|
|
|
|
//查询质检情况
|
|
|
|
|
|
|
|
|
//查询buyer_order_goods
|
|
|
List<String> buyerOrderCodeList = orderList.stream().map(BuyerOrder::getOrderCode).collect(Collectors.toList());
|
|
|
List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(buyerOrderCodeList);
|
|
|
if(CollectionUtils.isEmpty(buyerGoodsList)) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
//查询质检情况
|
|
|
List<QualityCheck> qualityCheckList = qualityCheckMapper.selectByOrderCodeList(buyerOrderCodeList);
|
|
|
Map<Long, QualityCheck> qualityCheckMap = null;
|
|
|
if(CollectionUtils.isNotEmpty(qualityCheckList)){
|
|
|
qualityCheckMap = qualityCheckList.stream().collect(Collectors.toMap(QualityCheck::getOrderCode, b->b));
|
|
|
}
|
|
|
|
|
|
Map<String, BuyerOrderGoods> buyerGoodsMap = buyerGoodsList.stream().collect(Collectors.toMap(BuyerOrderGoods::getOrderCode, b->b));
|
|
|
|
|
|
//查询seller_order_goods
|
...
|
...
|
@@ -240,7 +249,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
List<ExpressCompany> companyList = expressCompanyMapper.selectByIdList(expressCompanyIdList);
|
|
|
companyMap = companyList.stream().collect(Collectors.toMap(ExpressCompany::getId, ExpressCompany::getCompanyName));
|
|
|
}
|
|
|
List<BuyerOrderResp> respList = convertToResp(orderList, buyerGoodsMap, sellerOrderMap, sellerGoodsMap,expressRecordMap, platformExpressRecordMap, companyMap,skupProductCodeMap);
|
|
|
List<BuyerOrderResp> respList = convertToResp(orderList, buyerGoodsMap, sellerOrderMap, sellerGoodsMap,expressRecordMap, platformExpressRecordMap, companyMap,skupProductCodeMap,qualityCheckMap);
|
|
|
|
|
|
completeMp4VedioUrl(respList); // 查询是否有视频连接
|
|
|
|
...
|
...
|
@@ -384,43 +393,75 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
@Override
|
|
|
public JSONObject qualityCheckPass(BuyerOrderReq req){
|
|
|
BuyerOrder buyerOrder = checkParam(req);
|
|
|
|
|
|
String args = "ufo-gateway.qualityCheckPass";
|
|
|
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_CHECK_PASS.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("qualityCheckPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
private BuyerOrder checkParam(BuyerOrderReq req){
|
|
|
if(null == req.getId()) {
|
|
|
return null;
|
|
|
throw new ServiceException(400,"错误:参数错误");
|
|
|
}
|
|
|
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
|
|
|
if(null == buyerOrder) {
|
|
|
return null;
|
|
|
throw new ServiceException(400,"错误:订单为空");
|
|
|
}
|
|
|
|
|
|
if( Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
throw new ServiceException(400,"错误:订单状态变化,不允许开始鉴定,请重新刷新列表");
|
|
|
}
|
|
|
|
|
|
String args = "ufo-gateway.qualityCheckPass";
|
|
|
//检查是否存在质检记录,如果存在,则不允许再次执行
|
|
|
QualityCheck qualityCheck = qualityCheckMapper.selectByOrderCode(Long.valueOf(buyerOrder.getOrderCode()));
|
|
|
if(null != qualityCheck){
|
|
|
LOGGER.warn("checkParam exist quality check info ,buyerOrder = {} ,qualityCheck = {} ",buyerOrder ,qualityCheck);
|
|
|
throw new ServiceException(400,"错误:订单存在质检信息,请重新刷新列表");
|
|
|
}
|
|
|
return buyerOrder;
|
|
|
}
|
|
|
|
|
|
public JSONObject qualityCheckNotPass(BuyerOrderReq req){
|
|
|
BuyerOrder buyerOrder = checkParam(req);
|
|
|
|
|
|
//保存图片
|
|
|
|
|
|
//调用鉴定不通过接口
|
|
|
String args = "orderAppraise.appraiseFailWithoutExpress";
|
|
|
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_BEGIN.getCode();
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_NOT_PASS.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("qualityCheckPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
LOGGER.info("qualityCheckNotPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
public JSONObject qualityCheckNotPass(){
|
|
|
//保存图片
|
|
|
public JSONObject miniFaultConfirm(BuyerOrderReq req){
|
|
|
BuyerOrder buyerOrder = checkParam(req);
|
|
|
|
|
|
//调用鉴定不通过接口
|
|
|
String args = "ufo-gateway.miniFaultConfirm";
|
|
|
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_MINI_FAULT.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("miniFaultConfirm saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
public JSONObject minorFaultConfirm(){
|
|
|
return null;
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
//鉴定通过
|
...
|
...
|
@@ -688,7 +729,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
LOGGER.info("call ufo-gateway enter orderCode is {}, interface is {},result is {}", orderCode, args);
|
|
|
OrderRequest request = new OrderRequest();
|
|
|
request.setOrderCode(Long.valueOf(orderCode));
|
|
|
JSONObject jsonObject = serviceCaller.asyncCall(args, request, JSONObject.class).get(5);
|
|
|
JSONObject jsonObject = serviceCaller.asyncCall(args, request, JSONObject.class).get(5, TimeUnit.SECONDS);
|
|
|
LOGGER.info("call ufo-gateway orderCode is {}, interface is {},result is {}", orderCode, args, jsonObject.toJSONString());
|
|
|
return jsonObject;
|
|
|
}
|
...
|
...
|
@@ -1216,7 +1257,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
private List<BuyerOrderResp> convertToResp(List<BuyerOrder> orderList, Map<String, BuyerOrderGoods> buyerGoodsMap,
|
|
|
Map<Integer, SellerOrder> sellerOrderMap, Map<Integer, SellerOrderGoods> sellerGoodsMap, Map<String, ExpressRecord> expressInfoMap,
|
|
|
Map<String, ExpressRecord> platformExpressRecordMap, Map<Integer, String> companyMap,Map<Integer, String> skupProductCodeMap ){
|
|
|
Map<String, ExpressRecord> platformExpressRecordMap, Map<Integer, String> companyMap,Map<Integer, String> skupProductCodeMap,Map<Long, QualityCheck> qualityCheckMap ){
|
|
|
List<BuyerOrderResp> respList = Lists.newArrayList();
|
|
|
for(BuyerOrder item : orderList) {
|
|
|
if(null == buyerGoodsMap.get(item.getOrderCode())) {
|
...
|
...
|
@@ -1250,6 +1291,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
String companyName = companyMap.get(logisticsType);
|
|
|
resp.setPlatformWaybillCode(platformWaybillCode + "(" + companyName + ")");
|
|
|
}
|
|
|
|
|
|
if(qualityCheckMap!=null&&qualityCheckMap.get(Long.valueOf(item.getOrderCode()))!=null){
|
|
|
QualityCheck qualityCheck = qualityCheckMap.get(Long.valueOf(item.getOrderCode()));
|
|
|
resp.setQualityCheckType(qualityCheck.getType()==null?0:qualityCheck.getType().intValue());
|
|
|
resp.setQualityCheckStatus(qualityCheck.getStatus()==null?0:qualityCheck.getStatus().intValue());
|
|
|
}
|
|
|
|
|
|
respList.add(resp);
|
|
|
}
|
...
|
...
|
@@ -1314,8 +1361,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
);
|
|
|
case 8:
|
|
|
return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal());
|
|
|
case 9:
|
|
|
return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal());
|
|
|
default:
|
|
|
return Lists.newArrayList();
|
|
|
}
|
...
|
...
|
|