提交 7fbc4716 authored 作者: hzh's avatar hzh

代码优化

上级 ba040b56
package org.dromara.common.ys.exception;
/**
* @author hzh
* @date 2025-06-20
**/
public class YunShangException extends RuntimeException {
public YunShangException(String message) {
super("云上资源方调用失败:" + message);
}
}
...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code; ...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code;
import org.dromara.common.ys.common.PageInfo; import org.dromara.common.ys.common.PageInfo;
import org.dromara.common.ys.enums.DomainEnum; import org.dromara.common.ys.enums.DomainEnum;
import org.dromara.common.ys.enums.bill.BillApiEnum; import org.dromara.common.ys.enums.bill.BillApiEnum;
import org.dromara.common.ys.exception.YunShangException;
import org.dromara.common.ys.model.req.bill.AccountDetailModel; import org.dromara.common.ys.model.req.bill.AccountDetailModel;
import org.dromara.common.ys.model.req.bill.ConfirmReconModel; import org.dromara.common.ys.model.req.bill.ConfirmReconModel;
import org.dromara.common.ys.model.res.bill.*; import org.dromara.common.ys.model.res.bill.*;
...@@ -33,7 +34,7 @@ public class BillServiceImpl implements IBillService { ...@@ -33,7 +34,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), QueryBillModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), QueryBillModel.class);
} }
...@@ -48,7 +49,7 @@ public class BillServiceImpl implements IBillService { ...@@ -48,7 +49,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), QueryBillAllModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), QueryBillAllModel.class);
} }
...@@ -63,7 +64,7 @@ public class BillServiceImpl implements IBillService { ...@@ -63,7 +64,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return PageInfo.<AccountDetailBeanModel>builder().build() return PageInfo.<AccountDetailBeanModel>builder().build()
...@@ -94,7 +95,7 @@ public class BillServiceImpl implements IBillService { ...@@ -94,7 +95,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), ConsTicketListModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), ConsTicketListModel.class);
} }
...@@ -109,7 +110,7 @@ public class BillServiceImpl implements IBillService { ...@@ -109,7 +110,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), TravelBillPushStatementModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), TravelBillPushStatementModel.class);
} }
...@@ -124,7 +125,7 @@ public class BillServiceImpl implements IBillService { ...@@ -124,7 +125,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), TravelBillGetCompareResultModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), TravelBillGetCompareResultModel.class);
} }
...@@ -139,7 +140,7 @@ public class BillServiceImpl implements IBillService { ...@@ -139,7 +140,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), EditBxjlModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), EditBxjlModel.class);
} }
...@@ -154,7 +155,7 @@ public class BillServiceImpl implements IBillService { ...@@ -154,7 +155,7 @@ public class BillServiceImpl implements IBillService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
} }
} }
...@@ -7,6 +7,7 @@ import org.dromara.common.ys.common.ApiHttpResponse; ...@@ -7,6 +7,7 @@ import org.dromara.common.ys.common.ApiHttpResponse;
import org.dromara.common.ys.common.Code; import org.dromara.common.ys.common.Code;
import org.dromara.common.ys.enums.DomainEnum; import org.dromara.common.ys.enums.DomainEnum;
import org.dromara.common.ys.enums.resource.CommonResourceApiEnum; import org.dromara.common.ys.enums.resource.CommonResourceApiEnum;
import org.dromara.common.ys.exception.YunShangException;
import org.dromara.common.ys.model.req.commonResource.*; import org.dromara.common.ys.model.req.commonResource.*;
import org.dromara.common.ys.service.ICommonResourceService; import org.dromara.common.ys.service.ICommonResourceService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -32,7 +33,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService { ...@@ -32,7 +33,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService {
JSON.toJSONString(new CountryModel()) JSON.toJSONString(new CountryModel())
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseArray(JSON.parseObject(res.getData()).getString("countryDataList"), org.dromara.common.ys.model.res.comomResource.CountryModel.class); return JSON.parseArray(JSON.parseObject(res.getData()).getString("countryDataList"), org.dromara.common.ys.model.res.comomResource.CountryModel.class);
} }
...@@ -47,7 +48,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService { ...@@ -47,7 +48,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService {
JSON.toJSONString(new ProvinceModel()) JSON.toJSONString(new ProvinceModel())
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseArray(JSON.parseObject(res.getData()).getString("provinceDataList"), org.dromara.common.ys.model.res.comomResource.ProvinceModel.class); return JSON.parseArray(JSON.parseObject(res.getData()).getString("provinceDataList"), org.dromara.common.ys.model.res.comomResource.ProvinceModel.class);
} }
...@@ -62,7 +63,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService { ...@@ -62,7 +63,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService {
JSON.toJSONString(new CityModel()) JSON.toJSONString(new CityModel())
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -80,7 +81,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService { ...@@ -80,7 +81,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService {
JSON.toJSONString(new AirportModel()) JSON.toJSONString(new AirportModel())
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -99,7 +100,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService { ...@@ -99,7 +100,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService {
JSON.toJSONString(new StationModel()) JSON.toJSONString(new StationModel())
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -118,7 +119,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService { ...@@ -118,7 +119,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService {
JSON.toJSONString(new TrainBaseModel()) JSON.toJSONString(new TrainBaseModel())
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -138,7 +139,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService { ...@@ -138,7 +139,7 @@ public class CommonResourceServiceImpl implements ICommonResourceService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return new ArrayList<>(); return new ArrayList<>();
......
...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code; ...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code;
import org.dromara.common.ys.common.PageInfo; import org.dromara.common.ys.common.PageInfo;
import org.dromara.common.ys.enums.DomainEnum; import org.dromara.common.ys.enums.DomainEnum;
import org.dromara.common.ys.enums.hotel.HotelApiEnum; import org.dromara.common.ys.enums.hotel.HotelApiEnum;
import org.dromara.common.ys.exception.YunShangException;
import org.dromara.common.ys.model.req.hotel.HotelQueryOrderModel; import org.dromara.common.ys.model.req.hotel.HotelQueryOrderModel;
import org.dromara.common.ys.model.req.hotel.HotelQueryRefundOrderModel; import org.dromara.common.ys.model.req.hotel.HotelQueryRefundOrderModel;
import org.dromara.common.ys.model.req.hotel.PayOrderModel; import org.dromara.common.ys.model.req.hotel.PayOrderModel;
...@@ -37,7 +38,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -37,7 +38,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return null; return null;
...@@ -55,7 +56,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -55,7 +56,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return Optional.ofNullable(res.getData()).map(data->JSON.parseObject(JSON.parseObject(data).toJSONString(), HotelShoppingPricePlanModel.class)).orElse(null); return Optional.ofNullable(res.getData()).map(data->JSON.parseObject(JSON.parseObject(data).toJSONString(), HotelShoppingPricePlanModel.class)).orElse(null);
} }
...@@ -70,7 +71,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -70,7 +71,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return PageInfo.<HotelShoppingBaseListModel>builder().build() return PageInfo.<HotelShoppingBaseListModel>builder().build()
...@@ -101,7 +102,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -101,7 +102,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), HotelOrderBookModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), HotelOrderBookModel.class);
} }
...@@ -116,7 +117,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -116,7 +117,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), CancelOrderModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), CancelOrderModel.class);
} }
...@@ -131,7 +132,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -131,7 +132,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return true; return true;
} }
...@@ -146,7 +147,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -146,7 +147,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), HotelOrderQueryDetailModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), HotelOrderQueryDetailModel.class);
} }
...@@ -161,7 +162,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -161,7 +162,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return PageInfo.<HotelOrderQueryListModel>builder().build() return PageInfo.<HotelOrderQueryListModel>builder().build()
...@@ -192,7 +193,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -192,7 +193,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseArray(JSON.parseObject(res.getData()).getString("orderGather"), HtOrderInfoModel.class); return JSON.parseArray(JSON.parseObject(res.getData()).getString("orderGather"), HtOrderInfoModel.class);
} }
...@@ -207,7 +208,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -207,7 +208,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseArray(JSON.parseObject(res.getData()).getString("orderGather"), HtRefundInfoModel.class); return JSON.parseArray(JSON.parseObject(res.getData()).getString("orderGather"), HtRefundInfoModel.class);
} }
...@@ -222,7 +223,7 @@ public class HotelServiceImpl implements IHotelService { ...@@ -222,7 +223,7 @@ public class HotelServiceImpl implements IHotelService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), HotelOrderXjdModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), HotelOrderXjdModel.class);
} }
......
...@@ -7,6 +7,7 @@ import org.dromara.common.ys.common.ApiHttpResponse; ...@@ -7,6 +7,7 @@ import org.dromara.common.ys.common.ApiHttpResponse;
import org.dromara.common.ys.common.Code; import org.dromara.common.ys.common.Code;
import org.dromara.common.ys.enums.DomainEnum; import org.dromara.common.ys.enums.DomainEnum;
import org.dromara.common.ys.enums.insurance.InsuranceApiEnum; import org.dromara.common.ys.enums.insurance.InsuranceApiEnum;
import org.dromara.common.ys.exception.YunShangException;
import org.dromara.common.ys.model.req.insurance.BxcpModel; import org.dromara.common.ys.model.req.insurance.BxcpModel;
import org.dromara.common.ys.service.IInsuranceService; import org.dromara.common.ys.service.IInsuranceService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -31,7 +32,7 @@ public class InsuranceServiceImpl implements IInsuranceService { ...@@ -31,7 +32,7 @@ public class InsuranceServiceImpl implements IInsuranceService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseArray(JSON.parseObject(res.getData()).getString("cpList"), org.dromara.common.ys.model.res.insurance.BxcpModel.class); return JSON.parseArray(JSON.parseObject(res.getData()).getString("cpList"), org.dromara.common.ys.model.res.insurance.BxcpModel.class);
} }
......
...@@ -7,8 +7,9 @@ import org.dromara.common.ys.common.ApiHttpResponse; ...@@ -7,8 +7,9 @@ import org.dromara.common.ys.common.ApiHttpResponse;
import org.dromara.common.ys.common.Code; import org.dromara.common.ys.common.Code;
import org.dromara.common.ys.enums.DomainEnum; import org.dromara.common.ys.enums.DomainEnum;
import org.dromara.common.ys.enums.org.OrgApiEnum; import org.dromara.common.ys.enums.org.OrgApiEnum;
import org.dromara.common.ys.service.IOrgService; import org.dromara.common.ys.exception.YunShangException;
import org.dromara.common.ys.model.req.org.EditEmployeeModel; import org.dromara.common.ys.model.req.org.EditEmployeeModel;
import org.dromara.common.ys.service.IOrgService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -29,7 +30,7 @@ public class OrgServiceImpl implements IOrgService { ...@@ -29,7 +30,7 @@ public class OrgServiceImpl implements IOrgService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return true; return true;
} }
......
...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code; ...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code;
import org.dromara.common.ys.common.PageInfo; import org.dromara.common.ys.common.PageInfo;
import org.dromara.common.ys.enums.DomainEnum; import org.dromara.common.ys.enums.DomainEnum;
import org.dromara.common.ys.enums.qz.QzApiEnum; import org.dromara.common.ys.enums.qz.QzApiEnum;
import org.dromara.common.ys.exception.YunShangException;
import org.dromara.common.ys.model.req.qz.*; import org.dromara.common.ys.model.req.qz.*;
import org.dromara.common.ys.model.res.qz.GetAssociatDetailModel; import org.dromara.common.ys.model.res.qz.GetAssociatDetailModel;
import org.dromara.common.ys.model.res.qz.GetProdDetailModel; import org.dromara.common.ys.model.res.qz.GetProdDetailModel;
...@@ -36,7 +37,7 @@ public class QzServiceImpl implements IQzService { ...@@ -36,7 +37,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return PageInfo.<VisaProdBeanModel>builder().build() return PageInfo.<VisaProdBeanModel>builder().build()
...@@ -67,7 +68,7 @@ public class QzServiceImpl implements IQzService { ...@@ -67,7 +68,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return PageInfo.<AssocitionBeanModel>builder().build() return PageInfo.<AssocitionBeanModel>builder().build()
...@@ -98,7 +99,7 @@ public class QzServiceImpl implements IQzService { ...@@ -98,7 +99,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return PageInfo.<OrderListBeanModel>builder().build() return PageInfo.<OrderListBeanModel>builder().build()
...@@ -129,7 +130,7 @@ public class QzServiceImpl implements IQzService { ...@@ -129,7 +130,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), GetProdDetailModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), GetProdDetailModel.class);
} }
...@@ -144,7 +145,7 @@ public class QzServiceImpl implements IQzService { ...@@ -144,7 +145,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), QzOrderGetDetailModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), QzOrderGetDetailModel.class);
} }
...@@ -159,7 +160,7 @@ public class QzServiceImpl implements IQzService { ...@@ -159,7 +160,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
} }
...@@ -173,7 +174,7 @@ public class QzServiceImpl implements IQzService { ...@@ -173,7 +174,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), GetAssociatDetailModel.class); return JSON.parseObject(JSON.parseObject(res.getData()).toJSONString(), GetAssociatDetailModel.class);
} }
...@@ -188,7 +189,7 @@ public class QzServiceImpl implements IQzService { ...@@ -188,7 +189,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseArray(JSON.parseObject(res.getData()).getString("newAppointmentBeans"), NewAppointmentBeanModel.class); return JSON.parseArray(JSON.parseObject(res.getData()).getString("newAppointmentBeans"), NewAppointmentBeanModel.class);
} }
...@@ -203,7 +204,7 @@ public class QzServiceImpl implements IQzService { ...@@ -203,7 +204,7 @@ public class QzServiceImpl implements IQzService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
} }
} }
...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code; ...@@ -8,6 +8,7 @@ import org.dromara.common.ys.common.Code;
import org.dromara.common.ys.common.PageInfo; import org.dromara.common.ys.common.PageInfo;
import org.dromara.common.ys.enums.DomainEnum; import org.dromara.common.ys.enums.DomainEnum;
import org.dromara.common.ys.enums.vehicles.VehiclesApiEnum; import org.dromara.common.ys.enums.vehicles.VehiclesApiEnum;
import org.dromara.common.ys.exception.YunShangException;
import org.dromara.common.ys.model.req.vehicles.ConfirmPayApiModel; import org.dromara.common.ys.model.req.vehicles.ConfirmPayApiModel;
import org.dromara.common.ys.model.req.vehicles.EstimateJsycPriceModel; import org.dromara.common.ys.model.req.vehicles.EstimateJsycPriceModel;
import org.dromara.common.ys.model.req.vehicles.EstimateYyycPriceModel; import org.dromara.common.ys.model.req.vehicles.EstimateYyycPriceModel;
...@@ -37,7 +38,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -37,7 +38,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), org.dromara.common.ys.model.res.vehicles.EstimateYyycPriceModel.class); return JSON.parseObject(res.getData(), org.dromara.common.ys.model.res.vehicles.EstimateYyycPriceModel.class);
} }
...@@ -53,7 +54,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -53,7 +54,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), org.dromara.common.ys.model.res.vehicles.EstimateJsycPriceModel.class); return JSON.parseObject(res.getData(), org.dromara.common.ys.model.res.vehicles.EstimateJsycPriceModel.class);
} }
...@@ -69,7 +70,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -69,7 +70,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), OrderDetailModel.class); return JSON.parseObject(res.getData(), OrderDetailModel.class);
} }
...@@ -85,7 +86,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -85,7 +86,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
if (res.getData() == null) { if (res.getData() == null) {
return PageInfo.<OrderListModel>builder().build() return PageInfo.<OrderListModel>builder().build()
...@@ -117,7 +118,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -117,7 +118,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), OrderBookJsycModel.class); return JSON.parseObject(res.getData(), OrderBookJsycModel.class);
} }
...@@ -133,7 +134,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -133,7 +134,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), OrderBookYyycModel.class); return JSON.parseObject(res.getData(), OrderBookYyycModel.class);
} }
...@@ -149,7 +150,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -149,7 +150,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), DriverLocationModel.class); return JSON.parseObject(res.getData(), DriverLocationModel.class);
} }
...@@ -165,7 +166,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -165,7 +166,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), CancelFeeModel.class); return JSON.parseObject(res.getData(), CancelFeeModel.class);
} }
...@@ -181,7 +182,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -181,7 +182,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseObject(res.getData(), OrderCancelModel.class); return JSON.parseObject(res.getData(), OrderCancelModel.class);
} }
...@@ -197,7 +198,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -197,7 +198,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(model) JSON.toJSONString(model)
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
} }
...@@ -212,7 +213,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -212,7 +213,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
JSON.toJSONString(new HashMap<>(8)) JSON.toJSONString(new HashMap<>(8))
); );
if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) { if (!CharSequenceUtil.equals(res.getErrCode(), Code.SUCCESS.getCode())) {
throw new RuntimeException(res.getTips()); throw new YunShangException(res.getTips());
} }
return JSON.parseArray(JSON.parseObject(res.getData()).getString("qxyyList"), OrderGetQxyyModel.class); return JSON.parseArray(JSON.parseObject(res.getData()).getString("qxyyList"), OrderGetQxyyModel.class);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论