Feat: 湖南ApiFix 2
This commit is contained in:
parent
225618ba14
commit
90e99a3654
|
|
@ -6,10 +6,21 @@ import lombok.Getter;
|
|||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ApiFrom {
|
||||
LianTong(1L,"联通Api"),
|
||||
GuangZhouDX(2L,"广州电信Api"),
|
||||
HaiNanDX(3L,"海南电信Api"),
|
||||
HuNanDX(4L,"湖南电信Api");
|
||||
Unknown(0L, "未知道接口"),
|
||||
LianTong(1L, "联通Api"),
|
||||
GuangZhouDX(2L, "广州电信Api"),
|
||||
HaiNanDX(3L, "海南电信Api"),
|
||||
HuNanDX(4L, "湖南电信Api");
|
||||
private final Long id;
|
||||
private final String name;
|
||||
|
||||
public static ApiFrom fromId(Long id) {
|
||||
ApiFrom[] values = values();
|
||||
for (ApiFrom value : values) {
|
||||
if (value.id.equals(id)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return Unknown;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
|
@ -27,6 +28,7 @@ public class AddressAreaController {
|
|||
private HaoKaAddressService haoKaAddressService;
|
||||
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得区县")
|
||||
@Parameter(name = "code", description = "编号", required = true, example = "1024")
|
||||
|
|
@ -36,6 +38,7 @@ public class AddressAreaController {
|
|||
}
|
||||
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/getAllAddress")
|
||||
@Operation(summary = "获得省市县")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.mashape.unirest.http.exceptions.UnirestException;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -21,6 +22,7 @@ public class HaokaApiHaiNanDXController {
|
|||
@Resource
|
||||
private ApiHaiNanDXService apiHaiNanDXService;
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/qryNbrList")
|
||||
@Operation(summary = "海南电信-选号接口")
|
||||
public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.QryNbrListResponse>>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.haoka.api.liantong.model.response.*;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -27,6 +28,7 @@ public class HaokaApiLianTongController {
|
|||
@Resource
|
||||
private ApiLianTongService haokaAllSuperiorApiService;
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/select-number")
|
||||
@Operation(summary = "联通选号接口")
|
||||
public CommonResult<KingNumSelectResponse> lianTongSelectNumber(@RequestBody KingNumSelectRequest kingNumSelectRequest) {
|
||||
|
|
@ -76,6 +78,7 @@ public class HaokaApiLianTongController {
|
|||
return success(response);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/post-info-query")
|
||||
@Operation(summary = "联通收货地址和号码信息查询接口")
|
||||
public CommonResult<KingPostInfoResponse> lianTongPostInfoQuery(@RequestBody KingPostInfoRequest request) {
|
||||
|
|
@ -90,6 +93,7 @@ public class HaokaApiLianTongController {
|
|||
return success(response);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/select-area")
|
||||
@Operation(summary = "联通-地址-归属地查询")
|
||||
public CommonResult<List<LianTongAreaVo>> lianTongAreaInfo(@RequestParam(required = false, defaultValue = "1") String code) {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.haoka.api.hunandianxin.HaiNanDxInfo;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
@ -58,6 +59,7 @@ public class HaokaHuNanDXController {
|
|||
return success(apiHuNanDXService.verifySmsCode(param));
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/queryPhoneNumber")
|
||||
@Operation(summary = "湖南电信-查询号码")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryPhoneNumberResp>>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
package cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.product.vo.HaoKaProductRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.product.HaoKaProductDO;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO;
|
||||
import cn.iocoder.yudao.module.haoka.service.product.HaoKaProductService;
|
||||
import cn.iocoder.yudao.module.haoka.service.superiorproductconfig.SuperiorProductConfigService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -49,6 +56,9 @@ public class OnSaleProductController {
|
|||
@Resource
|
||||
private HaoKaProductService haoKaProductService;
|
||||
|
||||
@Resource
|
||||
private SuperiorProductConfigService superiorProductConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建在售产品")
|
||||
@PreAuthorize("@ss.hasPermission('haoka:on-sale-product:create')")
|
||||
|
|
@ -79,7 +89,25 @@ public class OnSaleProductController {
|
|||
@PreAuthorize("@ss.hasPermission('haoka:on-sale-product:query')")
|
||||
public CommonResult<OnSaleProductRespVO> getOnSaleProduct(@RequestParam("id") Long id) {
|
||||
OnSaleProductDO onSaleProduct = onSaleProductService.getOnSaleProduct(id);
|
||||
return success(BeanUtils.toBean(onSaleProduct, OnSaleProductRespVO.class));
|
||||
if (onSaleProduct == null || onSaleProduct.getParentProductId() == null) {
|
||||
return success(null);
|
||||
}
|
||||
HaoKaProductDO productServiceById = haoKaProductService.getById(onSaleProduct.getParentProductId());
|
||||
OnSaleProductRespVO bean = BeanUtils.toBean(onSaleProduct, OnSaleProductRespVO.class);
|
||||
bean.setParentProduct(BeanUtils.toBean(productServiceById, HaoKaProductRespVO.class));
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/sale-product")
|
||||
@Operation(summary = "获得在售产品")
|
||||
@Parameter(name = "productId", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<OnSaleProductPreOrderRespVO>
|
||||
getOnSaleProductPreOrder(
|
||||
@RequestParam("saleProductId") Long saleProductId
|
||||
) {
|
||||
OnSaleProductPreOrderRespVO onSaleProduct = onSaleProductService.getOnSaleProductPreOrder(saleProductId);
|
||||
return success(onSaleProduct);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
|
|
@ -103,6 +131,7 @@ public class OnSaleProductController {
|
|||
return success(bean);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出在售产品 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('haoka:on-sale-product:export')")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,104 @@
|
|||
package cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.product.vo.HaoKaProductRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 在售产品 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OnSaleProductPreOrderRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10064")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "17875")
|
||||
@ExcelProperty("产品")
|
||||
private Long parentProductId;
|
||||
|
||||
private SuperiorProductConfigRespVO superiorProductConfigRespVO;
|
||||
|
||||
private ApiFrom apiFrom;
|
||||
|
||||
@ExcelIgnore
|
||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private HaoKaProductRespVO parentProduct;
|
||||
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("商品名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "商家编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("商家编码")
|
||||
private String sku;
|
||||
|
||||
@Schema(description = "商品注意点")
|
||||
@ExcelProperty("商品注意点")
|
||||
private String precautions;
|
||||
|
||||
@Schema(description = "卖点,使用逗号隔开")
|
||||
@ExcelProperty("卖点,使用逗号隔开")
|
||||
private String sellingPoints;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "产品主图")
|
||||
@ExcelProperty("产品主图")
|
||||
private String mainImg;
|
||||
|
||||
@Schema(description = "商品分享图")
|
||||
@ExcelProperty("商品分享图")
|
||||
private String shareImg;
|
||||
|
||||
@Schema(description = "商品详情")
|
||||
@ExcelProperty("商品详情")
|
||||
private String detail;
|
||||
|
||||
@Schema(description = "其他备注")
|
||||
@ExcelProperty("其他备注")
|
||||
private String otherNote;
|
||||
|
||||
@Schema(description = "月租")
|
||||
@ExcelProperty("月租")
|
||||
private String monthlyRent;
|
||||
|
||||
@Schema(description = "语言通话")
|
||||
@ExcelProperty("语言通话")
|
||||
private String voiceCall;
|
||||
|
||||
@Schema(description = "通用流量")
|
||||
@ExcelProperty("通用流量")
|
||||
private String universalTraffic;
|
||||
|
||||
@Schema(description = "定向流量")
|
||||
@ExcelProperty("定向流量")
|
||||
private String targetedTraffic;
|
||||
|
||||
@Schema(description = "归属地")
|
||||
@ExcelProperty("归属地")
|
||||
private String belongArea;
|
||||
|
||||
@Schema(description = "套餐详情")
|
||||
@ExcelProperty("套餐详情")
|
||||
private String packageDetails;
|
||||
|
||||
@Schema(description = "套餐优惠期")
|
||||
@ExcelProperty("套餐优惠期")
|
||||
private Integer packageDiscountPeriod;
|
||||
|
||||
@Schema(description = "优惠期起始时间:当月,次月,三月")
|
||||
@ExcelProperty("优惠期起始时间:当月,次月,三月")
|
||||
private Integer packageDiscountPeriodStart;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.iocoder.yudao.module.haoka.service.onsaleproduct;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.*;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.onsaleproduct.OnSaleProductDO;
|
||||
|
|
@ -52,4 +53,5 @@ public interface OnSaleProductService {
|
|||
*/
|
||||
PageResult<OnSaleProductDO> getOnSaleProductPage(OnSaleProductPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
OnSaleProductPreOrderRespVO getOnSaleProductPreOrder(Long saleProductId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,15 @@
|
|||
package cn.iocoder.yudao.module.haoka.service.onsaleproduct;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.product.vo.HaoKaProductRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.product.vo.HaoKaProductSaveReqVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.product.HaoKaProductDO;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO;
|
||||
import cn.iocoder.yudao.module.haoka.enums.LogRecordConstants;
|
||||
import cn.iocoder.yudao.module.haoka.service.product.HaoKaProductService;
|
||||
import cn.iocoder.yudao.module.haoka.service.superiorproductconfig.SuperiorProductConfigService;
|
||||
import cn.iocoder.yudao.module.haoka.utils.SnowflakeId;
|
||||
import com.mzt.logapi.context.LogRecordContext;
|
||||
import com.mzt.logapi.service.impl.DiffParseFunction;
|
||||
|
|
@ -12,6 +20,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.*;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.onsaleproduct.OnSaleProductDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
|
@ -35,6 +44,12 @@ public class OnSaleProductServiceImpl implements OnSaleProductService {
|
|||
@Resource
|
||||
private OnSaleProductMapper onSaleProductMapper;
|
||||
|
||||
@Resource
|
||||
private HaoKaProductService haoKaProductService;
|
||||
|
||||
@Resource
|
||||
private SuperiorProductConfigService superiorProductConfigService;
|
||||
|
||||
@Override
|
||||
@LogRecord(type = LogRecordConstants.HAOKA_SALE_PRODUCT,
|
||||
subType = LogRecordConstants.HAOKA_UPDATE,
|
||||
|
|
@ -47,7 +62,7 @@ public class OnSaleProductServiceImpl implements OnSaleProductService {
|
|||
onSaleProduct.setId(SnowflakeId.generate());
|
||||
|
||||
// 日志
|
||||
LogRecordContext.putVariable("create",onSaleProduct);
|
||||
LogRecordContext.putVariable("create", onSaleProduct);
|
||||
|
||||
// 返回
|
||||
return onSaleProduct.getId();
|
||||
|
|
@ -93,4 +108,26 @@ public class OnSaleProductServiceImpl implements OnSaleProductService {
|
|||
return onSaleProductMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnSaleProductPreOrderRespVO getOnSaleProductPreOrder(Long saleProductId) {
|
||||
OnSaleProductDO onSaleProduct = this.getOnSaleProduct(saleProductId);
|
||||
if (onSaleProduct == null || onSaleProduct.getParentProductId() == null) {
|
||||
return null;
|
||||
}
|
||||
HaoKaProductDO productServiceById = haoKaProductService.getById(onSaleProduct.getParentProductId());
|
||||
OnSaleProductPreOrderRespVO bean = BeanUtils.toBean(onSaleProduct, OnSaleProductPreOrderRespVO.class);
|
||||
bean.setParentProduct(BeanUtils.toBean(productServiceById, HaoKaProductRespVO.class));
|
||||
|
||||
List<SuperiorProductConfigDO> list = superiorProductConfigService.list(new LambdaQueryWrapperX<SuperiorProductConfigDO>()
|
||||
.eqIfPresent(SuperiorProductConfigDO::getHaokaProductId, bean.getParentProductId()));
|
||||
if (!list.isEmpty()) {
|
||||
SuperiorProductConfigDO first = list.get(0);
|
||||
Long haokaSuperiorApiId = first.getHaokaSuperiorApiId();
|
||||
ApiFrom apiFrom = ApiFrom.fromId(haokaSuperiorApiId);
|
||||
bean.setApiFrom(apiFrom);
|
||||
bean.setSuperiorProductConfigRespVO(BeanUtils.toBean(first, SuperiorProductConfigRespVO.class));
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package cn.iocoder.yudao.module.haoka.service.superiorproductconfig;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.haoka.dal.mysql.superiorproductconfig.SuperiorProductConfigMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO;
|
||||
|
|
@ -12,7 +16,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SuperiorProductConfigService {
|
||||
public interface SuperiorProductConfigService extends IService<SuperiorProductConfigDO> {
|
||||
|
||||
/**
|
||||
* 创建产品对接上游配置
|
||||
|
|
@ -52,4 +56,4 @@ public interface SuperiorProductConfigService {
|
|||
*/
|
||||
PageResult<SuperiorProductConfigDO> getSuperiorProductConfigPage(SuperiorProductConfigPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue