Merge branch 'master' of codeup.aliyun.com:64d9c5feeceb191898f636d7/honor-dd-light-ds-java

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
commit 2273150252

@ -46,6 +46,8 @@ public class RsyncDdOrdersAndPurchaseOrdersService extends SPIBaseService implem
public BaseResponse<Ret> handle(BaseRequest<RsyncDdOrdersAndPurchaseOrdersRequestDTO> req) {
initHandle(req);
Map retMap = new HashMap();
try {
String orderIdsStr = req.getData().getOrderIds();
String sourceOrderIdsStr = req.getData().getSourceOrderIds();
@ -82,8 +84,10 @@ public class RsyncDdOrdersAndPurchaseOrdersService extends SPIBaseService implem
if (!StringUtils.isEmpty(orderIdsStr)) {
RsyncOpOrderByOrderIdsResultDTO reynsRet = opOrderService.rsyncOpOrderByOrderIds(shopId, orderIds);
if (reynsRet.getOrderIdAndFailReasonMap().size() > 0) {
String reason = String.join(";", reynsRet.getOrderIdAndFailReasonMap().values());
return R.ok(Ret.fail(reason));
// String reason = String.join(";", reynsRet.getOrderIdAndFailReasonMap().values());
// return R.ok(Ret.fail(reason));
retMap.put("orderIdAndErrorMap", reynsRet.getOrderIdAndFailReasonMap());
return R.ok(Ret.success(retMap));
}
}
@ -124,8 +128,7 @@ public class RsyncDdOrdersAndPurchaseOrdersService extends SPIBaseService implem
}
}
Map retMap = new HashMap();
retMap.put("rsyncPurchaseOrderInfo", purchaseOrderListMap);
retMap.put("orderIdAndPurchaseOrderListMap", purchaseOrderListMap);
return R.ok(Ret.success(retMap));
} catch (Exception e) {
log.error("同步分销采购单失败,原因:" + e.getMessage());

@ -0,0 +1,46 @@
package com.ms.config;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.ms.api.common.R;
import com.ms.api.common.Ret;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
/**
*
* * @author admin
*/
@Slf4j
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {
/**
*
*/
@ExceptionHandler(value = RuntimeException.class)
public BaseResponse<Ret> bizExceptionHandler(RuntimeException e) {
log.error("发生业务异常! msg: -> ", e);
return R.ok(Ret.fail(e.getMessage()));
}
/**
*
*/
@ExceptionHandler(value = NullPointerException.class)
public BaseResponse<Ret> exceptionHandler(NullPointerException e) {
log.error("发生空指针异常! msg: -> ", e);
return R.ok(Ret.fail(e.getMessage()));
}
/**
*
*/
@ExceptionHandler(Exception.class)
public BaseResponse<Ret> exception(Exception e) {
log.error("服务器异常! msg: -> ", e);
return R.ok(Ret.fail(e.getMessage()));
}
}
Loading…
Cancel
Save