品牌维度货到付款接口服务定义
查询品牌货到付款状态和品牌审核状态
根据品牌状态、品牌名称、货到付款状态查询品牌列表 OR 根据品牌状态、品牌名称、审核状态、货到付款状态查询品牌审核列表
接口名:/payDelivery/queryTotalBrandPayDelivery
入参
{
"brandId":1,
"brandName":"test",
"isPayDelivery":1,
"checkStatus":100,
"page":1,
"size":10
}
属性名称 |
类型 |
例子 |
说明 |
brandId |
int |
12 |
品牌ID(可选) |
brandName |
String |
"test" |
品牌名(可选) |
isPayDelivery |
int |
1 |
是否支持货到付款(可选),0:不支持货到付款/1:支持 |
checkStatus |
int |
100 |
审核状态(可选,400: 全部 100:待审核 300:驳回,没有默认为400) |
page |
int |
1 |
分页 |
size |
int |
10 |
页大小 |
1. 对应SQL的操作库表(数据库 yh_shops, 表brand, 字段is_pay_delivery=(0,1,null) )
<select id="selectPayDeliveryBrandPayDelivery" resultMap="BrandPayDeliveryResultMap">
select
<include refid="BrandPayDelivery_Column_List"/>
from brand
<where>
<if test="brandId!=null">
id =#{brandId}
</if>
<if test="brandName!=null">
AND brand_name =#{brandName}
</if>
<if test="isPayDelivery!=null">
AND is_pay_delivery =#{isPayDelivery}
</if>
</where>
order by id
<if test="isLimit!=null and isLimit==true">
limit #{startIndex}, #{limit}
</if>
</select>
2. 对应SQL的操作库表(数据库 erp_product, 表brand_pay_delivery_check)
<select id="selectPayDeliveryBrandPayDelivery" resultMap="BrandPayDeliveryResultMap">
select
<include refid="BrandPayDelivery_Column_List"/>
from brand
<where>
<if test="brandId!=null">
id =#{brandId}
</if>
<if test="brandName!=null">
AND brand_name =#{brandName}
</if>
<if test="isPayDelivery!=null">
AND is_pay_delivery =#{isPayDelivery}
</if>
</where>
order by id
<if test="isLimit!=null and isLimit==true">
limit #{startIndex}, #{limit}
</if>
</select>
涉及字段 brand_name, brand_id, is_pay_delivery, check_status
错误编码
错误码code |
消息 |
说明 |
500 |
查询失败 |
|
200 |
查询成功 |
|
返回
1.品牌列表(checkStatus=400或null)
{
"code": 200,
"data": {
"list": [
{
"brandId": 1,
"brandName": "004",
"isPayDelivery": 1
},
{
"brandId": 2,
"brandName": "10x1",
"isPayDelivery": 1
}
],
"page": 1,
"size": 2,
"total": 1461,
"totalPage": 731
},
"message": "获取品牌列表成功"
}
2.品牌审核列表(checkStatus=100,300)
{
"code": 200,
"data": {
"list": [
{
"applicant": "frw1111",
"applicantPid": 11,
"brandId": 12,
"brandName": "test111",
"checkStatus": 200,
"createTime": 1460189176,
"id": 1,
"isPayDelivery": 1,
"rejectReason": "12121212",
"updateTime": 1460193604
}
],
"page": 1,
"size": 2,
"total": 1,
"totalPage": 1
},
"message": "获取品牌审核列表成功"
}
查询审核个数、驳回个数、全部总数
接口名:/payDelivery/queryCountBrandPayDelivery
入参
{
"brandId":1,
"isPayDelivery":1,
}
属性名称 |
类型 |
例子 |
说明 |
brandId |
int |
12 |
品牌ID(可选) |
isPayDelivery |
int |
1 |
是否支持货到付款(可选),0:不支持货到付款/1:支持 |
1. 对应SQL的操作库表(数据库 yh_shops, 表brand)
<select id="selectCountByBrandPayDelivery" resultType="java.lang.Integer">
select count(1)
from brand
<where>
<if test="brandId!=null">
id =#{brandId}
</if>
<if test="brandName!=null">
AND brand_name =#{brandName}
</if>
<if test="isPayDelivery!=null">
AND is_pay_delivery =#{isPayDelivery}
</if>
</where>
</select>
2. 对应SQL的操作库表对应SQL的操作库表(数据库 erp_product, 表brand_pay_delivery_check)
<select id="selectCountByBrandCheckInfo" resultType="java.lang.Integer" >
select count(1)
from brand_pay_delivery_check
<where>
<if test="brandId!=null">
brand_id =#{brandId}
</if>
<if test="brandName!=null">
AND brand_name =#{brandName}
</if>
<if test="isPayDelivery!=null">
AND is_pay_delivery =#{isPayDelivery}
</if>
<if test="checkStatus!=null">
AND check_status =#{checkStatus}
</if>
</where>
</select>
涉及字段 brand_name, brand_id, is_pay_delivery, check_status
错误编码
错误码code |
消息 |
说明 |
500 |
查询失败 |
|
200 |
查询成功 |
|
返回
{
"code": 200,
"data": {
"100": 7,
"300": 0,
"400": 1460
},
"md5": "b08f3462d34c1f483bde1069a84e6019",
"message": "数量查询成功"
}
打开关闭品牌货到付款
接口名:/payDelivery/addPayDeliveryCheck
入参
{
"brandName":"test111",
"brandId":12,
"ispaydelivery":1
}
公共参数
{
"x-user-id":12,
"x-user-name":"frw"
}
属性名称 |
类型 |
例子 |
说明 |
brandId |
int |
12 |
品牌ID(必须) |
brandName |
String |
"test" |
品牌名(必须) |
isPayDelivery |
int |
1 |
是否支持货到付款(必须,0:不支持货到付款/1:支持) |
1. 对应SQL的操作库表(数据库 yh_shops, 表product)
<update id="updateByPrimaryKey" parameterType="com.yohobuy.platform.dal.frontDB.model.YhShopsBrand" >
update brand
...
2. 对应SQL的操作库表对应SQL的操作库表(数据库 erp_product, 表brand_pay_delivery_check)
<insert id="insertSelective" parameterType="com.yohobuy.platform.dal.product.model.BrandPayDeliveryCheck" >
insert into brand_pay_delivery_check
....
错误编码
错误码code |
消息 |
说明 |
500 |
操作失败 |
数据库没有插入数据或已有重复审核请求 |
200 |
操作成功 |
|
返回
{
"code": 200,
"data": {
"applicant": "frw",
"applicantPid": 12,
"brandId": 12,
"brandName": "test111",
"checkStatus": 100,
"isPayDelivery": 1,
"rejectReason": ""
},
"md5": "5260752908ee4f536e4cedfb1aef8535",
"message": "品牌请求成功."
}
操作品牌货到付款审核请求,驳回或者同意
接口名:/payDelivery/reviewPayDeliveryCheck
入参
{
"id":1,
"brandId":12,
"rejectReason":"12121212",
"isPayDelivery":1,
"checkStatus":300
}
公共参数
{
"x-user-id":12,
"x-user-name":"frw"
}
属性名称 |
类型 |
例子 |
说明 |
id |
int |
12 |
审核记录ID(必须) |
brandId |
int |
12 |
品牌ID(必须) |
rejectReason |
String |
"test" |
拒绝原因(拒绝时需要) |
isPayDelivery |
int |
1 |
是否支持货到付款(必选,0:不支持货到付款/1:支持) |
checkStatus |
int |
100 |
审核状态(必选,200:通过/300:驳回) |
1. 对应SQL的操作库表(数据库 yh_shops, 表product)
<update id="updateByPrimaryKey" parameterType="com.yohobuy.platform.dal.frontDB.model.YhShopsBrand" >
update brand
...
2. 对应SQL的操作库表对应SQL的操作库表(数据库 erp_product, 表brand_pay_delivery_check)
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.product.model.BrandPayDeliveryCheck" >
update brand_pay_delivery_check
...
错误编码
错误码code |
消息 |
说明 |
500 |
操作失败 |
参数不正确或数据库修改失败 |
200 |
操作成功 |
|
返回
{
"code": 200,
"data": {
"applicant": "frw1111",
"applicantPid": 11,
"auditor": "frw",
"auditorPid": 12,
"brandId": 12,
"brandName": "test111",
"checkStatus": 300,
"id": 1,
"isPayDelivery": 1,
"rejectReason": ""
},
"md5": "f36580baa99719be692a43eea8d20c39",
"message": "品牌审核成功."
}
导出品牌货到付款状态 xls
接口名:/batch/export
入参
{
"type":"brandPayDeliveryExport",
"queryConf":"{
'brandId':12,
'brandName':'test',
'isPayDelivery':1
}"
}
属性名称 |
类型 |
例子 |
说明 |
type |
String |
"brandPayDeliveryExport" |
导出数据(必须) |
queryConf |
String |
"{...}" |
查询条件(必须) |
brandId |
int |
12 |
品牌ID(可选) |
brandName |
String |
"test" |
品牌名(可选) |
isPayDelivery |
int |
1 |
是否支持货到付款(可选,0:不支持货到付款/1:支持) |
1. 对应SQL的操作库表(数据库 yh_shops, 表product, 字段is_pay_delivery=1 )
<select id="selectByBrandCheckInfo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from brand_pay_delivery_check
<where>
<if test="brandId!=null">
brand_id =#{brandId}
</if>
<if test="brandName!=null">
AND brand_name =#{brandName}
</if>
<if test="isPayDelivery!=null">
AND is_pay_delivery =#{isPayDelivery}
</if>
<if test="checkStatus!=null">
AND check_status =#{checkStatus}
</if>
</where>
order by id
<if test="isLimit!=null and isLimit==true">
limit #{startIndex}, #{limit}
</if>
</select>
错误编码
错误码code |
消息 |
说明 |
500 |
导出失败 |
|
200 |
导出成功 |
|
返回 xls表格
品牌 |
状态(0 关闭,1 开启) |
test111 |
0 |
test112 |
1 |
导出商品货到付款状态xls
接口名:/batch/export
入参
{
"type":"productPayDeliveryExport",
"queryConf":"{
'brandId':12,
'sknId':12,
'isPayDelivery':1
}"
}
属性名称 |
类型 |
例子 |
说明 |
type |
String |
"productPayDeliveryExport" |
导出数据(必须) |
queryConf |
String |
"{...}" |
查询条件(必须) |
brandId |
int |
12 |
品牌ID(可选) |
isPayDelivery |
int |
1 |
是否支持货到付款(可选,0:不支持货到付款/1:支持) |
sknId |
int |
100 |
skn(可选) |
1. 对应SQL的操作库表(数据库 yh_shops, 表product, 字段is_pay_delivery=1 )
<!-- 根据产品ID和货到付款状态查询,必须要有productSkn
1.isPayDelivery==null:不区分状态,直接查询所有的
2.isNeedDefault表示当前查询的货到付款状态和品牌的货到付款状态是否相同,如果相同,需要查询is_pay_delivery=2的商品
-->
<select id="selectPayDeliveryBySkn" resultMap="ProductPayDeliveryResultMap">
select
<include refid="ProductPayDelivery_Column_List" />
from product where erp_product_id=#{productSkn}
<if test="brandId != null">
and brand_id=#{brandId}
</if>
<if test="isPayDelivery!=null and isNeedDefault!=null">
and (is_pay_delivery=#{isPayDelivery} or is_pay_delivery=2)
</if>
<if test="isPayDelivery!=null and isNeedDefault==null">
and is_pay_delivery=#{isPayDelivery}
</if>
<if test="isLimit!=null and isLimit==true">
limit #{startIndex}, #{limit}
</if>
</select>
<!-- 根据品牌ID和货到付款状态查询,必须要有brand_id
1.isPayDelivery==null:不区分状态,直接查询所有的
2.isNeedDefault表示当前查询的货到付款状态和品牌的货到付款状态是否相同,如果相同,需要查询is_pay_delivery=2的商品
-->
<select id="selectPayDeliveryByBrandId" resultMap="ProductPayDeliveryResultMap">
select
<include refid="ProductPayDelivery_Column_List" />
from product where brand_id=#{brandId}
<if test="isPayDelivery!=null and isNeedDefault!=null">
and (is_pay_delivery=#{isPayDelivery} or is_pay_delivery=2)
</if>
<if test="isPayDelivery!=null and isNeedDefault==null">
and is_pay_delivery=#{isPayDelivery}
</if>
<if test="isLimit!=null and isLimit==true">
limit #{startIndex}, #{limit}
</if>
</select>
<!-- 这种情况不会有产品和品牌id
1.isPayDelivery==null:不区分状态,直接查询所有的
2.isPayDelivery!=null,brandIdList==null,直接根据查询is_pay_delivery
2.isPayDelivery!=null,brandIdList!=null,查询is_pay_delivery,并对吗,默认为2的需要检查brand_id是否在brandIdList中
-->
<select id="selectPayDeliveryByIsPayDelivery" resultMap="ProductPayDeliveryResultMap">
select
<include refid="ProductPayDelivery_Column_List" />
from product where 1=1
<if test="isPayDelivery!=null and brandIdList!=null">
and (is_pay_delivery=#{isPayDelivery}
or ( is_pay_delivery=2
and brand_id in
<foreach item="item" collection="brandIdList" open="(" separator="," close=")">#{item}
</foreach>)
)
</if>
<if test="isPayDelivery!=null and brandIdList==null">
and is_pay_delivery=#{isPayDelivery}
</if>
<if test="isLimit!=null and isLimit==true">
limit #{startIndex}, #{limit}
</if>
</select>
错误编码
错误码code |
消息 |
说明 |
500 |
导出失败 |
|
200 |
导出成功 |
|
返回 xls表格
SKN |
品牌 |
状态(0 关闭,1 开启) |
50000010 |
test111 |
0 |
50000011 |
test112 |
1 |