Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
1651acbb
Commit
1651acbb
authored
Jan 26, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享记录
parent
27912fa3
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
935 additions
and
33 deletions
+935
-33
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
+2
-2
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrder.java
...com/wwdz/ch/db/domain/distribution/DistributionOrder.java
+28
-1
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrderExample.java
...z/ch/db/domain/distribution/DistributionOrderExample.java
+396
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/DistributionOrderRequestDto.java
...dto/request/distribution/DistributionOrderRequestDto.java
+6
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
...wdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
+56
-8
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
.../main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/DistributionOrderDetailVo.java
.../wx/entity/vo/distribution/DistributionOrderDetailVo.java
+149
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/DistributionOrderVo.java
...wdz/ch/wx/entity/vo/distribution/DistributionOrderVo.java
+15
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
...ch/wx/impl/distribution/DistributionOrderServiceImpl.java
+79
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributorShareRecordServiceImpl.java
.../impl/distribution/DistributorShareRecordServiceImpl.java
+4
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+0
-4
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/DistributionOrderService.java
.../ch/wx/service/distribution/DistributionOrderService.java
+31
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SupplierItemService.java
.../wwdz/ch/wx/service/distribution/SupplierItemService.java
+1
-6
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/DistributionOrderController.java
...z/ch/wx/web/distribution/DistributionOrderController.java
+119
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/DistributorShareRecordController.java
...wx/web/distribution/DistributorShareRecordController.java
+48
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
...m/wwdz/ch/wx/web/distribution/SupplierItemController.java
+0
-7
No files found.
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
View file @
1651acbb
...
@@ -6,7 +6,7 @@ import java.text.DecimalFormat;
...
@@ -6,7 +6,7 @@ import java.text.DecimalFormat;
public
class
PriceUtil
{
public
class
PriceUtil
{
public
static
String
convertPrice
(
Long
rawPrice
)
{
public
static
String
convertPrice
(
Long
rawPrice
)
{
BigDecimal
price
=
new
BigDecimal
(
rawPrice
/
100
);
BigDecimal
price
=
new
BigDecimal
(
(
rawPrice
.
doubleValue
()
/
100
)
);
price
=
price
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
price
=
price
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
return
price
.
toString
();
return
price
.
toString
();
}
}
...
@@ -32,6 +32,6 @@ public class PriceUtil {
...
@@ -32,6 +32,6 @@ public class PriceUtil {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
convertPrice
FromStr
(
"19.9"
));
System
.
out
.
println
(
convertPrice
(
3980L
));
}
}
}
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrder.java
View file @
1651acbb
...
@@ -10,7 +10,7 @@ import lombok.Data;
...
@@ -10,7 +10,7 @@ import lombok.Data;
/**
/**
* @author shiyu
* @author shiyu
* @date 2024/01/2
5
* @date 2024/01/2
6
*/
*/
@Data
@Data
public
class
DistributionOrder
implements
Entity
{
public
class
DistributionOrder
implements
Entity
{
...
@@ -76,6 +76,21 @@ public class DistributionOrder implements Entity {
...
@@ -76,6 +76,21 @@ public class DistributionOrder implements Entity {
*/
*/
private
Date
createTime
;
private
Date
createTime
;
/**
* 支付时间
*/
private
Date
payTime
;
/**
* 发货时间
*/
private
Date
deliveryTime
;
/**
* 完成时间
*/
private
Date
finishTime
;
/**
/**
* 更新时间
* 更新时间
*/
*/
...
@@ -112,6 +127,9 @@ public class DistributionOrder implements Entity {
...
@@ -112,6 +127,9 @@ public class DistributionOrder implements Entity {
sb
.
append
(
", logisticsCode="
).
append
(
logisticsCode
);
sb
.
append
(
", logisticsCode="
).
append
(
logisticsCode
);
sb
.
append
(
", waybill="
).
append
(
waybill
);
sb
.
append
(
", waybill="
).
append
(
waybill
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", payTime="
).
append
(
payTime
);
sb
.
append
(
", deliveryTime="
).
append
(
deliveryTime
);
sb
.
append
(
", finishTime="
).
append
(
finishTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", shareRecordId="
).
append
(
shareRecordId
);
sb
.
append
(
", shareRecordId="
).
append
(
shareRecordId
);
sb
.
append
(
", state="
).
append
(
state
);
sb
.
append
(
", state="
).
append
(
state
);
...
@@ -145,6 +163,9 @@ public class DistributionOrder implements Entity {
...
@@ -145,6 +163,9 @@ public class DistributionOrder implements Entity {
&&
(
this
.
getLogisticsCode
()
==
null
?
other
.
getLogisticsCode
()
==
null
:
this
.
getLogisticsCode
().
equals
(
other
.
getLogisticsCode
()))
&&
(
this
.
getLogisticsCode
()
==
null
?
other
.
getLogisticsCode
()
==
null
:
this
.
getLogisticsCode
().
equals
(
other
.
getLogisticsCode
()))
&&
(
this
.
getWaybill
()
==
null
?
other
.
getWaybill
()
==
null
:
this
.
getWaybill
().
equals
(
other
.
getWaybill
()))
&&
(
this
.
getWaybill
()
==
null
?
other
.
getWaybill
()
==
null
:
this
.
getWaybill
().
equals
(
other
.
getWaybill
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getPayTime
()
==
null
?
other
.
getPayTime
()
==
null
:
this
.
getPayTime
().
equals
(
other
.
getPayTime
()))
&&
(
this
.
getDeliveryTime
()
==
null
?
other
.
getDeliveryTime
()
==
null
:
this
.
getDeliveryTime
().
equals
(
other
.
getDeliveryTime
()))
&&
(
this
.
getFinishTime
()
==
null
?
other
.
getFinishTime
()
==
null
:
this
.
getFinishTime
().
equals
(
other
.
getFinishTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getShareRecordId
()
==
null
?
other
.
getShareRecordId
()
==
null
:
this
.
getShareRecordId
().
equals
(
other
.
getShareRecordId
()))
&&
(
this
.
getShareRecordId
()
==
null
?
other
.
getShareRecordId
()
==
null
:
this
.
getShareRecordId
().
equals
(
other
.
getShareRecordId
()))
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()));
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()));
...
@@ -167,6 +188,9 @@ public class DistributionOrder implements Entity {
...
@@ -167,6 +188,9 @@ public class DistributionOrder implements Entity {
result
=
prime
*
result
+
((
getLogisticsCode
()
==
null
)
?
0
:
getLogisticsCode
().
hashCode
());
result
=
prime
*
result
+
((
getLogisticsCode
()
==
null
)
?
0
:
getLogisticsCode
().
hashCode
());
result
=
prime
*
result
+
((
getWaybill
()
==
null
)
?
0
:
getWaybill
().
hashCode
());
result
=
prime
*
result
+
((
getWaybill
()
==
null
)
?
0
:
getWaybill
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getPayTime
()
==
null
)
?
0
:
getPayTime
().
hashCode
());
result
=
prime
*
result
+
((
getDeliveryTime
()
==
null
)
?
0
:
getDeliveryTime
().
hashCode
());
result
=
prime
*
result
+
((
getFinishTime
()
==
null
)
?
0
:
getFinishTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getShareRecordId
()
==
null
)
?
0
:
getShareRecordId
().
hashCode
());
result
=
prime
*
result
+
((
getShareRecordId
()
==
null
)
?
0
:
getShareRecordId
().
hashCode
());
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
...
@@ -194,6 +218,9 @@ public class DistributionOrder implements Entity {
...
@@ -194,6 +218,9 @@ public class DistributionOrder implements Entity {
logisticsCode
(
"logistics_code"
,
"logisticsCode"
,
"VARCHAR"
,
false
),
logisticsCode
(
"logistics_code"
,
"logisticsCode"
,
"VARCHAR"
,
false
),
waybill
(
"waybill"
,
"waybill"
,
"VARCHAR"
,
false
),
waybill
(
"waybill"
,
"waybill"
,
"VARCHAR"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
payTime
(
"pay_time"
,
"payTime"
,
"TIMESTAMP"
,
false
),
deliveryTime
(
"delivery_time"
,
"deliveryTime"
,
"TIMESTAMP"
,
false
),
finishTime
(
"finish_time"
,
"finishTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
shareRecordId
(
"share_record_id"
,
"shareRecordId"
,
"VARCHAR"
,
false
),
shareRecordId
(
"share_record_id"
,
"shareRecordId"
,
"VARCHAR"
,
false
),
state
(
"state"
,
"state"
,
"INTEGER"
,
true
);
state
(
"state"
,
"state"
,
"INTEGER"
,
true
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrderExample.java
View file @
1651acbb
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/DistributionOrderRequestDto.java
View file @
1651acbb
...
@@ -22,6 +22,12 @@ public class DistributionOrderRequestDto extends BaseRequestDto implements Entit
...
@@ -22,6 +22,12 @@ public class DistributionOrderRequestDto extends BaseRequestDto implements Entit
*/
*/
private
Long
itemId
;
private
Long
itemId
;
/**
* 商品名称
* 模糊查询
*/
private
String
itemName
;
/**
/**
* 商品数量
* 商品数量
*/
*/
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
View file @
1651acbb
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
<result
column=
"logistics_code"
jdbcType=
"VARCHAR"
property=
"logisticsCode"
/>
<result
column=
"logistics_code"
jdbcType=
"VARCHAR"
property=
"logisticsCode"
/>
<result
column=
"waybill"
jdbcType=
"VARCHAR"
property=
"waybill"
/>
<result
column=
"waybill"
jdbcType=
"VARCHAR"
property=
"waybill"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"pay_time"
jdbcType=
"TIMESTAMP"
property=
"payTime"
/>
<result
column=
"delivery_time"
jdbcType=
"TIMESTAMP"
property=
"deliveryTime"
/>
<result
column=
"finish_time"
jdbcType=
"TIMESTAMP"
property=
"finishTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"share_record_id"
jdbcType=
"VARCHAR"
property=
"shareRecordId"
/>
<result
column=
"share_record_id"
jdbcType=
"VARCHAR"
property=
"shareRecordId"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
...
@@ -79,8 +82,8 @@
...
@@ -79,8 +82,8 @@
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
address_id, address, logistics_code, waybill, create_time,
update_time, share_record_id
,
address_id, address, logistics_code, waybill, create_time,
pay_time, delivery_time
,
`state`
finish_time, update_time, share_record_id,
`state`
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrderExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrderExample"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -116,8 +119,8 @@
...
@@ -116,8 +119,8 @@
</when>
</when>
<otherwise>
<otherwise>
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
address_id, address, logistics_code, waybill, create_time,
update_time, share_record_id
,
address_id, address, logistics_code, waybill, create_time,
pay_time, delivery_time
,
`state`
finish_time, update_time, share_record_id,
`state`
</otherwise>
</otherwise>
</choose>
</choose>
from distribution_order
from distribution_order
...
@@ -149,8 +152,8 @@
...
@@ -149,8 +152,8 @@
</when>
</when>
<otherwise>
<otherwise>
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
address_id, address, logistics_code, waybill, create_time,
update_time, share_record_id
,
address_id, address, logistics_code, waybill, create_time,
pay_time, delivery_time
,
`state`
finish_time, update_time, share_record_id,
`state`
</otherwise>
</otherwise>
</choose>
</choose>
from distribution_order
from distribution_order
...
@@ -174,12 +177,14 @@
...
@@ -174,12 +177,14 @@
buyer_id, shop_id, seller_id,
buyer_id, shop_id, seller_id,
amount, address_id, address,
amount, address_id, address,
logistics_code, waybill, create_time,
logistics_code, waybill, create_time,
pay_time, delivery_time, finish_time,
update_time, share_record_id, `state`
update_time, share_record_id, `state`
)
)
values (#{distributionOrderId,jdbcType=VARCHAR}, #{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER},
values (#{distributionOrderId,jdbcType=VARCHAR}, #{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER},
#{buyerId,jdbcType=BIGINT}, #{shopId,jdbcType=BIGINT}, #{sellerId,jdbcType=BIGINT},
#{buyerId,jdbcType=BIGINT}, #{shopId,jdbcType=BIGINT}, #{sellerId,jdbcType=BIGINT},
#{amount,jdbcType=BIGINT}, #{addressId,jdbcType=BIGINT}, #{address,jdbcType=VARCHAR},
#{amount,jdbcType=BIGINT}, #{addressId,jdbcType=BIGINT}, #{address,jdbcType=VARCHAR},
#{logisticsCode,jdbcType=VARCHAR}, #{waybill,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{logisticsCode,jdbcType=VARCHAR}, #{waybill,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{payTime,jdbcType=TIMESTAMP}, #{deliveryTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{shareRecordId,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}
#{updateTime,jdbcType=TIMESTAMP}, #{shareRecordId,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}
)
)
</insert>
</insert>
...
@@ -225,6 +230,15 @@
...
@@ -225,6 +230,15 @@
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
create_time,
create_time,
</if>
</if>
<if
test=
"payTime != null"
>
pay_time,
</if>
<if
test=
"deliveryTime != null"
>
delivery_time,
</if>
<if
test=
"finishTime != null"
>
finish_time,
</if>
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time,
update_time,
</if>
</if>
...
@@ -272,6 +286,15 @@
...
@@ -272,6 +286,15 @@
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"payTime != null"
>
#{payTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deliveryTime != null"
>
#{deliveryTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"finishTime != null"
>
#{finishTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -331,6 +354,15 @@
...
@@ -331,6 +354,15 @@
<if
test=
"record.createTime != null"
>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"record.payTime != null"
>
pay_time = #{record.payTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.deliveryTime != null"
>
delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.finishTime != null"
>
finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.updateTime != null"
>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -360,6 +392,9 @@
...
@@ -360,6 +392,9 @@
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
waybill = #{record.waybill,jdbcType=VARCHAR},
waybill = #{record.waybill,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
pay_time = #{record.payTime,jdbcType=TIMESTAMP},
delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
`state` = #{record.state,jdbcType=INTEGER}
`state` = #{record.state,jdbcType=INTEGER}
...
@@ -406,6 +441,15 @@
...
@@ -406,6 +441,15 @@
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"payTime != null"
>
pay_time = #{payTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deliveryTime != null"
>
delivery_time = #{deliveryTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"finishTime != null"
>
finish_time = #{finishTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -432,6 +476,9 @@
...
@@ -432,6 +476,9 @@
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
waybill = #{waybill,jdbcType=VARCHAR},
waybill = #{waybill,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
pay_time = #{payTime,jdbcType=TIMESTAMP},
delivery_time = #{deliveryTime,jdbcType=TIMESTAMP},
finish_time = #{finishTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER}
`state` = #{state,jdbcType=INTEGER}
...
@@ -471,8 +518,8 @@
...
@@ -471,8 +518,8 @@
</when>
</when>
<otherwise>
<otherwise>
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
id, distribution_order_id, item_id, item_num, buyer_id, shop_id, seller_id, amount,
address_id, address, logistics_code, waybill, create_time,
update_time, share_record_id
,
address_id, address, logistics_code, waybill, create_time,
pay_time, delivery_time
,
`state`
finish_time, update_time, share_record_id,
`state`
</otherwise>
</otherwise>
</choose>
</choose>
from distribution_order
from distribution_order
...
@@ -484,4 +531,5 @@
...
@@ -484,4 +531,5 @@
</if>
</if>
limit 1
limit 1
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
View file @
1651acbb
...
@@ -42,7 +42,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
...
@@ -42,7 +42,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/officialAccountCallback/**"
,
"/officialAccountCallback/**"
,
"/imCallback/**"
,
"/wx/category/**"
,
"/imCallback/**"
,
"/wx/category/**"
,
"/wx/consignSale/**"
,
"/wx/item/**"
,
"/wx/consignSale/**"
,
"/wx/item/**"
,
"/wx/returnOrder/**"
,
"/wx/supplierItem/**"
"/wx/returnOrder/**"
,
"/wx/supplierItem/**"
,
"/wx/shareRecord/**"
,
"/wx/distributionOrder/**"
/* "/wx/officialAccount/**",
/* "/wx/officialAccount/**",
"/wx/item/**",
"/wx/item/**",
"/wx/aiAssistant/**",
"/wx/aiAssistant/**",
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/DistributionOrderDetailVo.java
0 → 100644
View file @
1651acbb
package
com.wwdz.ch.wx.entity.vo.distribution
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.Map
;
@Data
public
class
DistributionOrderDetailVo
implements
Entity
{
/**
* 分销订单号
*/
private
String
distributionOrderId
;
/**
* 商品id
*/
private
Long
itemId
;
/**
* 用于列表展示的图片对象
*/
private
Map
<
String
,
Object
>
homePageImage
;
/**
* 商品名称
*/
private
String
itemName
;
/**
* 买方id
*/
private
Long
buyerId
;
/**
* 买家名称
*/
private
String
buyerName
;
/**
* 店铺id
*/
private
Long
shopId
;
/**
* 店铺名称
*/
private
String
shopName
;
/**
* 卖方id
*/
private
Long
sellerId
;
/**
* 卖家名称
*/
private
String
sellerName
;
/**
* 订单金额,要除以100
*/
private
String
amount
;
/**
* 供货价(给分销商的价格)
*/
private
String
distributionPrice
;
/**
* 通道费
*/
private
String
channelCost
;
/**
* 盈利
*/
private
String
profit
;
/**
* 买家收货地址id
*/
private
Long
addressId
;
/**
* 买家收货地址
*/
private
String
address
;
/**
* 快递公司编码
*/
private
String
logisticsCode
;
private
String
logisticsName
;
/**
* 运单号
*/
private
String
waybill
;
/**
* 创建时间(下单时间)
*/
private
Date
createTime
;
/**
* 支付时间
*/
private
Date
payTime
;
/**
* 发货时间
*/
private
Date
deliveryTime
;
/**
* 完成时间
*/
private
Date
finishTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 分享记录id
*/
private
String
shareRecordId
;
/**
* 分销订单状态
*/
private
Integer
state
;
/**
* 订单状态
*/
private
String
stateName
;
/**
* 商品单价
*/
private
String
itemPrice
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/DistributionOrderVo.java
View file @
1651acbb
...
@@ -89,6 +89,21 @@ public class DistributionOrderVo implements Entity {
...
@@ -89,6 +89,21 @@ public class DistributionOrderVo implements Entity {
*/
*/
private
Date
createTime
;
private
Date
createTime
;
/**
* 支付时间
*/
private
Date
payTime
;
/**
* 发货时间
*/
private
Date
deliveryTime
;
/**
* 完成时间
*/
private
Date
finishTime
;
/**
/**
* 更新时间
* 更新时间
*/
*/
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
View file @
1651acbb
...
@@ -2,13 +2,14 @@ package com.wwdz.ch.wx.impl.distribution;
...
@@ -2,13 +2,14 @@ package com.wwdz.ch.wx.impl.distribution;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.consts.ConsignSaleEnum
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.consts.LogisticsEnum
;
import
com.wwdz.ch.core.type.PageSearchResult
;
import
com.wwdz.ch.core.type.PageSearchResult
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.IdUtils
;
import
com.wwdz.ch.core.util.IdUtils
;
import
com.wwdz.ch.core.util.MediaUtil
;
import
com.wwdz.ch.core.util.MediaUtil
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.db.dao.ItemDao
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.dao.distribution.DistributorShareRecordDao
;
import
com.wwdz.ch.db.dao.distribution.DistributorShareRecordDao
;
import
com.wwdz.ch.db.dao.distribution.SupplierItemDao
;
import
com.wwdz.ch.db.dao.distribution.SupplierItemDao
;
...
@@ -16,6 +17,7 @@ import com.wwdz.ch.db.domain.distribution.DistributionOrder;
...
@@ -16,6 +17,7 @@ import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import
com.wwdz.ch.db.domain.distribution.DistributorShareRecord
;
import
com.wwdz.ch.db.domain.distribution.DistributorShareRecord
;
import
com.wwdz.ch.db.domain.distribution.SupplierItem
;
import
com.wwdz.ch.db.domain.distribution.SupplierItem
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.wx.entity.vo.distribution.DistributionOrderDetailVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.DistributionOrderVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.DistributionOrderVo
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
...
@@ -26,7 +28,6 @@ import org.slf4j.Logger;
...
@@ -26,7 +28,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -86,6 +87,23 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -86,6 +87,23 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
return
null
;
return
null
;
}
}
@Override
public
Result
getParamForPay
(
DistributionOrderRequestDto
dto
)
{
return
null
;
}
@Override
public
Result
cancel
(
DistributionOrderRequestDto
dto
)
{
try
{
distributionOrderDao
.
updateState
(
dto
.
getDistributionOrderId
(),
DistributionEnum
.
DistributionOrderStateEnum
.
CANCEL
.
getCode
());
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"用户取消订单失败 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
@Override
public
Result
delivery
(
DistributionOrderRequestDto
dto
)
{
public
Result
delivery
(
DistributionOrderRequestDto
dto
)
{
return
null
;
return
null
;
...
@@ -126,6 +144,41 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -126,6 +144,41 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
return
Result
.
failed
();
return
Result
.
failed
();
}
}
@Override
public
Result
findOrderDetailOfDistributor
(
DistributionOrderRequestDto
dto
)
{
try
{
DistributionOrder
distributionOrder
=
distributionOrderDao
.
findById
(
dto
.
getDistributionOrderId
());
DistributionOrderDetailVo
distributionOrderDetailVo
=
new
DistributionOrderDetailVo
();
EntityMapper
.
copyAttribute
(
distributionOrder
,
distributionOrderDetailVo
);
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
distributionOrder
.
getItemId
());
distributionOrderDetailVo
.
setItemName
(
supplierItem
.
getName
());
long
itemPrice
=
distributionOrder
.
getAmount
()
/
distributionOrder
.
getItemNum
();
distributionOrderDetailVo
.
setAmount
(
PriceUtil
.
convertPrice
(
distributionOrder
.
getAmount
()));
distributionOrderDetailVo
.
setItemPrice
(
PriceUtil
.
convertPrice
(
itemPrice
));
distributionOrderDetailVo
.
setStateName
(
DistributionEnum
.
DistributionOrderStateEnum
.
getNameByCode
(
distributionOrder
.
getState
()));
distributionOrderDetailVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
distributionOrderDetailVo
.
setLogisticsName
(
LogisticsEnum
.
getNameByCode
(
distributionOrder
.
getLogisticsCode
()));
//供货价
Long
distributionTotalPrice
=
supplierItem
.
getDistributionPrice
()
*
distributionOrder
.
getItemNum
();
distributionOrderDetailVo
.
setDistributionPrice
(
PriceUtil
.
convertPrice
(
distributionTotalPrice
));
distributionOrderDetailVo
.
setChannelCost
(
"千分之6"
);
//通道费
double
channelCost
=
distributionOrder
.
getAmount
().
doubleValue
()
*
0.006
;
if
(
channelCost
<
1
)
{
channelCost
=
0
;
}
distributionOrderDetailVo
.
setChannelCost
(
String
.
valueOf
(
channelCost
));
//利润
Double
profit
=
distributionOrder
.
getAmount
().
doubleValue
()
-
distributionTotalPrice
.
doubleValue
()
-
channelCost
;
distributionOrderDetailVo
.
setProfit
(
PriceUtil
.
convertPriceFromStr
(
profit
.
toString
()).
toString
());
return
Result
.
success
(
distributionOrderDetailVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询分销商订单详情失败 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
@Override
public
Result
findOrderOfUser
(
DistributionOrderRequestDto
dto
)
{
public
Result
findOrderOfUser
(
DistributionOrderRequestDto
dto
)
{
try
{
try
{
...
@@ -139,6 +192,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -139,6 +192,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
EntityMapper
.
copyAttribute
(
distributionOrder
,
distributionOrderVo
);
EntityMapper
.
copyAttribute
(
distributionOrder
,
distributionOrderVo
);
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
distributionOrder
.
getItemId
());
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
distributionOrder
.
getItemId
());
distributionOrderVo
.
setItemName
(
supplierItem
.
getName
());
distributionOrderVo
.
setItemName
(
supplierItem
.
getName
());
long
itemPrice
=
distributionOrder
.
getAmount
()
/
distributionOrder
.
getItemNum
();
distributionOrderVo
.
setItemPrice
(
PriceUtil
.
convertPrice
(
itemPrice
));
distributionOrderVo
.
setStateName
(
DistributionEnum
.
DistributionOrderStateEnum
.
getNameByCode
(
distributionOrder
.
getState
()));
distributionOrderVo
.
setStateName
(
DistributionEnum
.
DistributionOrderStateEnum
.
getNameByCode
(
distributionOrder
.
getState
()));
distributionOrderVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
distributionOrderVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
distributionOrderVoList
.
add
(
distributionOrderVo
);
distributionOrderVoList
.
add
(
distributionOrderVo
);
...
@@ -148,6 +203,28 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -148,6 +203,28 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
logger
.
error
(
"查询分销商订单列表失败 error : {}"
,
e
);
logger
.
error
(
"查询分销商订单列表失败 error : {}"
,
e
);
}
}
return
Result
.
failed
();
return
Result
.
failed
();
}
@Override
public
Result
findOrderDetailOfUser
(
DistributionOrderRequestDto
dto
)
{
try
{
DistributionOrder
distributionOrder
=
distributionOrderDao
.
findById
(
dto
.
getDistributionOrderId
());
DistributionOrderDetailVo
distributionOrderDetailVo
=
new
DistributionOrderDetailVo
();
EntityMapper
.
copyAttribute
(
distributionOrder
,
distributionOrderDetailVo
);
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
distributionOrder
.
getItemId
());
distributionOrderDetailVo
.
setItemName
(
supplierItem
.
getName
());
long
itemPrice
=
distributionOrder
.
getAmount
()
/
distributionOrder
.
getItemNum
();
distributionOrderDetailVo
.
setAmount
(
PriceUtil
.
convertPrice
(
distributionOrder
.
getAmount
()));
distributionOrderDetailVo
.
setItemPrice
(
PriceUtil
.
convertPrice
(
itemPrice
));
distributionOrderDetailVo
.
setStateName
(
DistributionEnum
.
DistributionOrderStateEnum
.
getNameByCode
(
distributionOrder
.
getState
()));
distributionOrderDetailVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
distributionOrderDetailVo
.
setLogisticsName
(
LogisticsEnum
.
getNameByCode
(
distributionOrder
.
getLogisticsCode
()));
return
Result
.
success
(
distributionOrderDetailVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询分销商订单详情失败 error : {}"
,
e
);
}
return
Result
.
failed
();
}
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributorShareRecordServiceImpl.java
View file @
1651acbb
...
@@ -10,12 +10,14 @@ import com.wwdz.ch.db.domain.distribution.DistributorShareRecord;
...
@@ -10,12 +10,14 @@ import com.wwdz.ch.db.domain.distribution.DistributorShareRecord;
import
com.wwdz.ch.db.domain.distribution.SupplierItem
;
import
com.wwdz.ch.db.domain.distribution.SupplierItem
;
import
com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto
;
import
com.wwdz.ch.wx.service.distribution.DistributorShareRecordService
;
import
com.wwdz.ch.wx.service.distribution.DistributorShareRecordService
;
import
org.apache.commons.collections4.Put
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
@Service
@Service
public
class
DistributorShareRecordServiceImpl
implements
DistributorShareRecordService
{
public
class
DistributorShareRecordServiceImpl
implements
DistributorShareRecordService
{
...
@@ -42,12 +44,12 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord
...
@@ -42,12 +44,12 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord
distributorShareRecord
.
setShareId
(
shareRecordId
);
distributorShareRecord
.
setShareId
(
shareRecordId
);
distributorShareRecord
.
setItemId
(
dto
.
getItemId
());
distributorShareRecord
.
setItemId
(
dto
.
getItemId
());
distributorShareRecord
.
setPrice
(
PriceUtil
.
convertPriceFromStr
(
dto
.
getPrice
()));
distributorShareRecord
.
setPrice
(
PriceUtil
.
convertPriceFromStr
(
dto
.
getPrice
()));
distributorShareRecord
.
setDistributorId
(
d
istributorShareRecord
.
getDistributorId
());
distributorShareRecord
.
setDistributorId
(
d
to
.
getDistributorId
());
distributorShareRecord
.
setShopId
(
dto
.
getShopId
());
distributorShareRecord
.
setShopId
(
dto
.
getShopId
());
distributorShareRecord
.
setCreateTime
(
new
Date
());
distributorShareRecord
.
setCreateTime
(
new
Date
());
distributorShareRecord
.
setEnabled
(
true
);
distributorShareRecord
.
setEnabled
(
true
);
distributorShareRecordDao
.
insert
(
distributorShareRecord
);
distributorShareRecordDao
.
insert
(
distributorShareRecord
);
return
Result
.
success
();
return
Result
.
success
(
new
HashMap
<
String
,
String
>(){{
put
(
"shareId"
,
shareRecordId
);}}
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"创建分销分享链接失败 error: {}"
,
e
);
logger
.
error
(
"创建分销分享链接失败 error: {}"
,
e
);
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
1651acbb
...
@@ -64,8 +64,4 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -64,8 +64,4 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
}
@Override
public
Result
createShareLink
(
SupplierItemRequestDto
dto
)
{
return
null
;
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/DistributionOrderService.java
View file @
1651acbb
...
@@ -12,6 +12,15 @@ public interface DistributionOrderService {
...
@@ -12,6 +12,15 @@ public interface DistributionOrderService {
*/
*/
Result
createDistributionOrder
(
DistributionOrderRequestDto
dto
);
Result
createDistributionOrder
(
DistributionOrderRequestDto
dto
);
/**
* 支付接口需要的参数:签名等
* @param dto
* @return
*/
Result
getParamForPay
(
DistributionOrderRequestDto
dto
);
/**
/**
* 完成支付后修改订单状态
* 完成支付后修改订单状态
* @param dto
* @param dto
...
@@ -19,6 +28,11 @@ public interface DistributionOrderService {
...
@@ -19,6 +28,11 @@ public interface DistributionOrderService {
*/
*/
Result
finishPay
(
DistributionOrderRequestDto
dto
);
Result
finishPay
(
DistributionOrderRequestDto
dto
);
/**
* 用户取消订单
*/
Result
cancel
(
DistributionOrderRequestDto
dto
);
/**
/**
* 订单发货
* 订单发货
* @param dto
* @param dto
...
@@ -31,9 +45,26 @@ public interface DistributionOrderService {
...
@@ -31,9 +45,26 @@ public interface DistributionOrderService {
*/
*/
Result
findOrderOfDistributor
(
DistributionOrderRequestDto
dto
);
Result
findOrderOfDistributor
(
DistributionOrderRequestDto
dto
);
/**
* 查询分销商订单详情
* @param dto
* @return
*/
Result
findOrderDetailOfDistributor
(
DistributionOrderRequestDto
dto
);
/**
/**
* 用户订单列表查询
* 用户订单列表查询
*/
*/
Result
findOrderOfUser
(
DistributionOrderRequestDto
dto
);
Result
findOrderOfUser
(
DistributionOrderRequestDto
dto
);
/**
* 查询用户订单详情
* @param dto
* @return
*/
Result
findOrderDetailOfUser
(
DistributionOrderRequestDto
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SupplierItemService.java
View file @
1651acbb
...
@@ -21,10 +21,5 @@ public interface SupplierItemService {
...
@@ -21,10 +21,5 @@ public interface SupplierItemService {
Result
findDetail
(
SupplierItemRequestDto
dto
);
Result
findDetail
(
SupplierItemRequestDto
dto
);
/**
* 创建商品分享链接
* @param dto
* @return
*/
Result
createShareLink
(
SupplierItemRequestDto
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/DistributionOrderController.java
0 → 100644
View file @
1651acbb
package
com.wwdz.ch.wx.web.distribution
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.validation.Validator
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 分销订单
*/
@RestController
@RequestMapping
(
"/wx/distributionOrder"
)
public
class
DistributionOrderController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DistributionOrderController
.
class
);
@Autowired
DistributionOrderService
distributionOrderService
;
@ApiOperation
(
value
=
"分销单下单,尚未付款"
)
@PostMapping
(
"/create"
)
public
Result
createDistributionOrder
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
logger
.
info
(
"分销单下单,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"shareRecordId"
,
"分销分享记录id"
).
must
().
string
()
.
set
(
"buyerId"
,
"买方id"
).
must
().
number
()
.
set
(
"distributorId"
,
"分销商id"
).
must
().
number
()
.
set
(
"shopId"
,
"分销商店铺id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
distributionOrderService
.
createDistributionOrder
(
dto
);
}
@ApiOperation
(
value
=
"用户取消订单"
)
@PostMapping
(
"/cancel"
)
public
Result
cancel
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
logger
.
info
(
"用户取消订单,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"distributionOrderId"
,
"分销订单号"
).
must
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
distributionOrderService
.
cancel
(
dto
);
}
@ApiOperation
(
value
=
"查询分销商订单列表"
)
@PostMapping
(
"/findOrderOfDistributor"
)
public
Result
findOrderOfDistributor
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
logger
.
info
(
"查询分销商订单列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"sellerId"
,
"分销商id"
).
must
().
number
()
.
set
(
"distributionOrderId"
,
"分销订单号"
).
sometimes
().
string
()
.
set
(
"itemName"
,
"商品名称"
).
sometimes
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
distributionOrderService
.
findOrderOfDistributor
(
dto
);
}
@ApiOperation
(
value
=
"查询分销商订单详情"
)
@PostMapping
(
"/findOrderDetailOfDistributor"
)
public
Result
findOrderDetailOfDistributor
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
logger
.
info
(
"查询分销商订单详情,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"distributionOrderId"
,
"分销订单号"
).
must
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
distributionOrderService
.
findOrderDetailOfDistributor
(
dto
);
}
@ApiOperation
(
value
=
"查询用户订单列表"
)
@PostMapping
(
"/findOrderOfUser"
)
public
Result
findOrderOfUser
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
logger
.
info
(
"查询用户订单列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"buyerId"
,
"买方id"
).
must
().
number
()
.
set
(
"distributionOrderId"
,
"分销订单号"
).
sometimes
().
string
()
.
set
(
"itemName"
,
"商品名称"
).
sometimes
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
distributionOrderService
.
findOrderOfUser
(
dto
);
}
@ApiOperation
(
value
=
"查询用户订单详情"
)
@PostMapping
(
"/findOrderDetailOfUser"
)
public
Result
findOrderDetailOfUser
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
logger
.
info
(
"查询用户订单详情,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"distributionOrderId"
,
"分销订单号"
).
must
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
distributionOrderService
.
findOrderDetailOfUser
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/DistributorShareRecordController.java
0 → 100644
View file @
1651acbb
package
com.wwdz.ch.wx.web.distribution
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.wx.service.distribution.DistributorShareRecordService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.validation.Validator
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 分销分享记录
*/
@RestController
@RequestMapping
(
"/wx/shareRecord"
)
public
class
DistributorShareRecordController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SupplierItemController
.
class
);
@Autowired
DistributorShareRecordService
distributorShareRecordService
;
@ApiOperation
(
value
=
"创建分销分享记录"
)
@PostMapping
(
"/create"
)
public
Result
createShareRecord
(
@RequestBody
DistributorShareRecordRequestDto
dto
)
{
logger
.
info
(
"创建分销分享记录,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"itemId"
,
"商品id"
).
must
().
number
()
.
set
(
"price"
,
"商品销售价"
).
must
().
string
()
.
set
(
"distributorId"
,
"分销商id"
).
must
().
number
()
.
set
(
"shopId"
,
"分销商店铺id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
distributorShareRecordService
.
createShareRecord
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
View file @
1651acbb
...
@@ -39,11 +39,4 @@ public class SupplierItemController {
...
@@ -39,11 +39,4 @@ public class SupplierItemController {
return
supplierItemService
.
findDetail
(
dto
);
return
supplierItemService
.
findDetail
(
dto
);
}
}
@ApiOperation
(
value
=
"创建商品分享链接"
)
@PostMapping
(
"/createShareLink"
)
public
Result
createShareLink
(
@RequestBody
SupplierItemRequestDto
dto
)
{
logger
.
info
(
"创建商品分享链接,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
return
supplierItemService
.
findDetail
(
dto
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment