Authored by LUOXC

refactor

... ... @@ -15,6 +15,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Objects;
import static com.yohoufo.order.utils.ServiceExceptions.throwServiceExceptionIf;
/**
* @author kun.wang
* @date 2018/9/25
... ... @@ -88,13 +92,13 @@ public class ExpressInfoController {
@RequestMapping(params = "method=ufo.order.appraiseAddress")
public ApiResponse queryAppraiseAddress(@RequestParam("uid") Integer uid,
@RequestParam(value="skup", required=false)Integer skup,
// from version 6.9.3
@RequestParam(value="orderCode", required=false)Long orderCode) {
LOG.info("method=ufo.order.appraiseAddress in, uid is {}, skup is {} orderCode {}", uid, skup, orderCode);
if (null == uid) {
if (Objects.isNull(uid)) {
throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
}
throwServiceExceptionIf(Objects.isNull(orderCode),500,"请升级至最新版本");
AppraiseAddressResp appraiseAddressResp = expressInfoService.queryAppraiseAddress(uid, orderCode, skup);
return new ApiResponse.ApiResponseBuilder().code(200).data(appraiseAddressResp).build();
}
... ...
... ... @@ -10,6 +10,7 @@ import com.yohoufo.dal.order.model.ExpressRecord;
import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.model.OperateTransferExpressInfo;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import lombok.NonNull;
import java.util.ArrayList;
import java.util.Arrays;
... ... @@ -109,7 +110,7 @@ public interface IExpressInfoService {
* @param uid
* @return
*/
AppraiseAddressResp queryAppraiseAddress(Integer uid, Long orderCode, Integer skup);
AppraiseAddressResp queryAppraiseAddress(@NonNull Integer uid, @NonNull Long orderCode, Integer skup);
AppraiseAddressResp forceNoticeAppraiseAddress(Integer uid, Long orderCode);
... ...
... ... @@ -48,6 +48,7 @@ import com.yohoufo.order.service.seller.setting.SellerWrapper;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.utils.BuyerOrderUtils;
import lombok.NonNull;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -1331,14 +1332,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
* 根据用户默认地址的省份定位到鉴定中心的地址返回 *
*
* @param uid
* @param orderCode from version 6.9.3
* @param orderCode
* @param skup
* @return
*/
@Override
public AppraiseAddressResp queryAppraiseAddress(Integer uid, Long orderCode, Integer skup) {
throwServiceExceptionIf(Objects.isNull(orderCode),"请升级到最新版本");
public AppraiseAddressResp queryAppraiseAddress(@NonNull Integer uid, @NonNull Long orderCode, Integer skup) {
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
... ...