Commit a1226c0f by zhouhaibao

[+]新增销售品类查询

1 parent acb91c70
......@@ -10,6 +10,8 @@ import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreApproveBaseRequest;
import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreApproveDTORequest;
import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreApproveQueryRop;
import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreApproveUpdateDTORequest;
import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreProductCategoryRequest;
import cn.com.glsx.dj.oaapproval.response.StoreProductCategoryResponse;
import cn.com.glsx.dj.oaapproval.service.StoreApproveService;
import cn.com.glsx.dj.oaapproval.utils.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
......@@ -83,4 +85,18 @@ public class StoreApproveController {
return RopResponse.error(rpcResponse.getError(), rpcResponse.getMessage());
}
@ServiceMethod(method = "dj.api.oaapproval.store.approve.queryProductTypes", needInSession = NeedInSessionType.YES)
@ApiOperation("查询销售范围类型列表")
public RopResponse<StoreProductCategoryResponse> queryProductTypes(StoreProductCategoryRequest request) {
log.info("查询销售范围类型列表,业务场景编码:{}", request.getBaseSceneCode());
return storeApproveService.queryProductTypes(request);
}
@ServiceMethod(method = "dj.api.oaapproval.store.approve.queryProductCategories", needInSession = NeedInSessionType.YES)
@ApiOperation("查询销售品类列表")
public RopResponse<StoreProductCategoryResponse> queryProductCategories(StoreProductCategoryRequest request) {
log.info("查询销售品类列表,业务场景编码:{},类型:{}", request.getBaseSceneCode(), request.getProductType());
return storeApproveService.queryProductCategories(request);
}
}
\ No newline at end of file
package cn.com.glsx.dj.oaapproval.request.stroreapp;
import cn.com.glsx.rop.core.RopRequest;
import lombok.Data;
/**
* 查询销售品类配置请求
*/
@Data
public class StoreProductCategoryRequest extends RopRequest {
/**
* 业务场景编码
*/
private String baseSceneCode;
/**
* 类型(查询销售品类时必填)
*/
private String productType;
}
\ No newline at end of file
package cn.com.glsx.dj.oaapproval.response;
import lombok.Data;
import java.util.List;
/**
* 查询销售品类配置响应
*/
@Data
public class StoreProductCategoryResponse {
/**
* 类型/销售品类列表
*/
private List<String> items;
}
\ No newline at end of file
......@@ -11,11 +11,14 @@ import cn.com.glsx.dj.oaapproval.listener.CreateBusinessApproveExcelListener;
import cn.com.glsx.dj.oaapproval.remote.StoreCreateBusinessApproveRemote;
import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreApproveDTORequest;
import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreApproveUpdateDTORequest;
import cn.com.glsx.dj.oaapproval.request.stroreapp.StoreProductCategoryRequest;
import cn.com.glsx.dj.oaapproval.response.StoreProductCategoryResponse;
import cn.com.glsx.dj.oaapproval.utils.CommonUtil;
import cn.com.glsx.dj.oaapproval.utils.EasyExcelUtil;
import cn.com.glsx.dj.oaapproval.utils.UploadFileService;
import cn.com.glsx.dj.oaapproval.vo.CreateBusinessApproveImportExcelContext;
import cn.com.glsx.dj.smartcarlife.dto.LoginUserDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
......@@ -186,4 +189,34 @@ public class StoreApproveService {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
public RopResponse<StoreProductCategoryResponse> queryProductTypes(StoreProductCategoryRequest request) {
try {
RpcResponse<List<String>> rpcResponse = storeCreateBusinessApproveRemote.queryProductTypes(request.getBaseSceneCode());
if (rpcResponse.isSuccess()) {
StoreProductCategoryResponse response = new StoreProductCategoryResponse();
response.setItems(rpcResponse.getResult());
return RopResponse.success(response);
}
return RopResponse.error(rpcResponse.getError(), rpcResponse.getMessage());
} catch (Exception e) {
log.error("查询销售范围类型列表失败:{}", e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
public RopResponse<StoreProductCategoryResponse> queryProductCategories(StoreProductCategoryRequest request) {
try {
RpcResponse<java.util.List<String>> rpcResponse = storeCreateBusinessApproveRemote.queryProductCategories(request.getBaseSceneCode(), request.getProductType());
if (rpcResponse.isSuccess()) {
StoreProductCategoryResponse response = new StoreProductCategoryResponse();
response.setItems(rpcResponse.getResult());
return RopResponse.success(response);
}
return RopResponse.error(rpcResponse.getError(), rpcResponse.getMessage());
} catch (Exception e) {
log.error("查询销售品类列表失败:{}", e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!