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
44abce69
Commit
44abce69
authored
Sep 03, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
以物换物
parent
02fa1ab7
Changes
24
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
4225 additions
and
20 deletions
+4225
-20
ch-core/src/main/java/com/wwdz/ch/core/consts/CommConsts.java
...ore/src/main/java/com/wwdz/ch/core/consts/CommConsts.java
+5
-0
ch-core/src/main/java/com/wwdz/ch/core/consts/DistributionEnum.java
...c/main/java/com/wwdz/ch/core/consts/DistributionEnum.java
+4
-0
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
...src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
+2
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/ExchangeOrderSnapshotDao.java
...wwdz/ch/db/dao/distribution/ExchangeOrderSnapshotDao.java
+14
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ExchangeOrderSnapshot.java
...wwdz/ch/db/domain/distribution/ExchangeOrderSnapshot.java
+392
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ExchangeOrderSnapshotExample.java
.../db/domain/distribution/ExchangeOrderSnapshotExample.java
+2455
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
...h/db/dto/request/distribution/SupplierItemRequestDto.java
+6
-1
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/ExchangeOrderSnapshotDaoImpl.java
...ch/db/impl/distribution/ExchangeOrderSnapshotDaoImpl.java
+39
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
...com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
+6
-1
ch-dao/src/main/java/com/wwdz/ch/db/mapper/distribution/ExchangeOrderSnapshotMapper.java
...h/db/mapper/distribution/ExchangeOrderSnapshotMapper.java
+85
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/ExchangeOrderSnapshotMapper.xml
...ch/db/mapper/distribution/ExchangeOrderSnapshotMapper.xml
+622
-0
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
.../main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
+5
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/ExchangeRequestDto.java
...ava/com/wwdz/ch/wx/entity/request/ExchangeRequestDto.java
+79
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/ItemSimpleDto.java
...ain/java/com/wwdz/ch/wx/entity/request/ItemSimpleDto.java
+19
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/DistributionOrderDetailVo.java
.../wx/entity/vo/distribution/DistributionOrderDetailVo.java
+10
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/UserExchangeInfo.java
...m/wwdz/ch/wx/entity/vo/distribution/UserExchangeInfo.java
+22
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
...impl/distribution/CollectionItemsRelationServiceImpl.java
+13
-11
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
...ch/wx/impl/distribution/DistributionOrderServiceImpl.java
+36
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/ExchangeServiceImpl.java
...com/wwdz/ch/wx/impl/distribution/ExchangeServiceImpl.java
+275
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+1
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/ExchangeService.java
.../com/wwdz/ch/wx/service/distribution/ExchangeService.java
+38
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/ExchangeController.java
...a/com/wwdz/ch/wx/web/distribution/ExchangeController.java
+93
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SelfPageController.java
...a/com/wwdz/ch/wx/web/distribution/SelfPageController.java
+3
-5
No files found.
ch-core/src/main/java/com/wwdz/ch/core/consts/CommConsts.java
View file @
44abce69
...
...
@@ -49,6 +49,11 @@ public interface CommConsts {
public
static
final
Long
SYSTEM_ACCOUNT
=
8888888888L
;
/**
* 平台自营店铺账号
*/
public
static
final
Long
SELF_SUPPORT_ACCOUNT
=
6666666666L
;
/**
* 用户未登录的默认账号
*/
...
...
ch-core/src/main/java/com/wwdz/ch/core/consts/DistributionEnum.java
View file @
44abce69
...
...
@@ -8,6 +8,8 @@ public class DistributionEnum {
public
enum
DistributionOrderStateEnum
{
PRE_PAY
(
1
,
"待付款"
),
PRE_SALE
(
5
,
"众筹中"
),
PRE_EXCHANGE
(
6
,
"待换货"
),
PRE_INSPECTION
(
8
,
"待验货"
),
PRE_SEND
(
10
,
"待发货"
),
PRE_SIGNED
(
20
,
"待收货"
),
AFTER_SALE
(
30
,
"售后中"
),
...
...
@@ -57,6 +59,7 @@ public class DistributionEnum {
DISCOUNT
(
4
,
"折扣品"
),
AUCTION_PERFORMANCE
(
5
,
"竞拍专场"
),
GROUP_PURCHASE
(
6
,
"团购"
),
EXCHANGE
(
7
,
"交换"
),
;
private
int
code
;
...
...
@@ -172,6 +175,7 @@ public class DistributionEnum {
SYSTEM_ITEM
(
3
,
"平台藏品"
),
COLLECTOR_AUCTION_ITEM
(
4
,
"藏家拍卖品"
),
GROUPPURASE_ITEM
(
5
,
"团购商品"
),
EXCHANGE_ITEM
(
6
,
"可交换商品"
),
;
private
int
code
;
...
...
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
44abce69
...
...
@@ -14,6 +14,8 @@ public class SupplierItemVo implements Entity {
private
Long
itemId
;
private
Integer
itemNum
;
/**
* 商品名称
*/
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/ExchangeOrderSnapshotDao.java
0 → 100644
View file @
44abce69
package
com.wwdz.ch.db.dao.distribution
;
import
com.wwdz.ch.db.domain.distribution.ExchangeOrderSnapshot
;
import
java.util.List
;
public
interface
ExchangeOrderSnapshotDao
{
boolean
insert
(
ExchangeOrderSnapshot
exchangeOrderSnapshot
);
boolean
update
(
ExchangeOrderSnapshot
exchangeOrderSnapshot
);
List
<
ExchangeOrderSnapshot
>
findByOrderId
(
String
orderId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ExchangeOrderSnapshot.java
0 → 100644
View file @
44abce69
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ExchangeOrderSnapshotExample.java
0 → 100644
View file @
44abce69
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
View file @
44abce69
...
...
@@ -159,7 +159,7 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
private
String
rebate
;
/**
* 商品类型1一口价2竞拍3用户上传4折扣商品
* 商品类型1一口价2竞拍3用户上传4折扣商品
7换藏商品
*/
private
Integer
type
;
...
...
@@ -275,4 +275,9 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/
private
Long
introducerId
;
/**
* 官方估价是否可以为空
*/
private
Boolean
officialEstimatedPriceNotNull
;
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/ExchangeOrderSnapshotDaoImpl.java
0 → 100644
View file @
44abce69
package
com.wwdz.ch.db.impl.distribution
;
import
com.wwdz.ch.db.dao.distribution.ExchangeOrderSnapshotDao
;
import
com.wwdz.ch.db.domain.distribution.ExchangeOrderSnapshot
;
import
com.wwdz.ch.db.domain.distribution.ExchangeOrderSnapshotExample
;
import
com.wwdz.ch.db.mapper.distribution.ExchangeOrderSnapshotMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
class
ExchangeOrderSnapshotDaoImpl
implements
ExchangeOrderSnapshotDao
{
@Autowired
ExchangeOrderSnapshotMapper
exchangeOrderSnapshotMapper
;
@Override
public
boolean
insert
(
ExchangeOrderSnapshot
exchangeOrderSnapshot
)
{
return
exchangeOrderSnapshotMapper
.
insert
(
exchangeOrderSnapshot
)
>
0
;
}
@Override
public
boolean
update
(
ExchangeOrderSnapshot
exchangeOrderSnapshot
)
{
ExchangeOrderSnapshotExample
example
=
new
ExchangeOrderSnapshotExample
();
ExchangeOrderSnapshotExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andDistributionOrderIdEqualTo
(
exchangeOrderSnapshot
.
getDistributionOrderId
());
return
exchangeOrderSnapshotMapper
.
updateByExampleSelective
(
exchangeOrderSnapshot
,
example
)
>
0
;
}
@Override
public
List
<
ExchangeOrderSnapshot
>
findByOrderId
(
String
orderId
)
{
ExchangeOrderSnapshotExample
example
=
new
ExchangeOrderSnapshotExample
();
ExchangeOrderSnapshotExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andDistributionOrderIdEqualTo
(
orderId
);
return
exchangeOrderSnapshotMapper
.
selectByExampleWithBLOBs
(
example
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
View file @
44abce69
...
...
@@ -45,6 +45,9 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
JdbcHelper
.
ifPresent
(
dto
.
getIsAbleSale
(),
criteria:
:
andIsAbleSaleEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIsDeleted
(),
criteria:
:
andIsDeletedEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getCreatorId
(),
criteria:
:
andCreatorIdEqualTo
);
if
(
dto
.
getOfficialEstimatedPriceNotNull
()
!=
null
&&
dto
.
getOfficialEstimatedPriceNotNull
())
{
criteria
.
andOfficialEstimatedPriceIsNotNull
();
}
supplierItemExample
.
setOrderByClause
(
" create_time desc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
supplierItemMapper
.
selectByExampleWithBLOBs
(
supplierItemExample
);
...
...
@@ -62,9 +65,11 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
criteria
.
andNameLike
(
"%"
+
dto
.
getName
()
+
"%"
);
}
JdbcHelper
.
ifPresent
(
dto
.
getType
(),
criteria:
:
andTypeEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getFilterType
(),
criteria:
:
andTypeNotIn
);
JdbcHelper
.
ifPresent
(
dto
.
getStock
(),
criteria:
:
andStockGreaterThan
);
JdbcHelper
.
ifPresent
(
dto
.
getIsOnSale
(),
criteria:
:
andIsOnSaleEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIsDeleted
(),
criteria:
:
andIsDeletedEqualTo
);
// JdbcHelper.ifPresent(dto.getIsDeleted(), criteria::andIsDeletedEqualTo);
criteria
.
andIsDeletedEqualTo
(
false
);
supplierItemExample
.
setOrderByClause
(
" is_on_sale desc, stock desc, create_time desc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
supplierItemMapper
.
selectByExampleWithBLOBs
(
supplierItemExample
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/mapper/distribution/ExchangeOrderSnapshotMapper.java
0 → 100644
View file @
44abce69
package
com.wwdz.ch.db.mapper.distribution
;
import
com.wwdz.ch.db.domain.distribution.ExchangeOrderSnapshot
;
import
com.wwdz.ch.db.domain.distribution.ExchangeOrderSnapshotExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
ExchangeOrderSnapshotMapper
{
long
countByExample
(
ExchangeOrderSnapshotExample
example
);
int
deleteByExample
(
ExchangeOrderSnapshotExample
example
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
ExchangeOrderSnapshot
record
);
int
insertSelective
(
ExchangeOrderSnapshot
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table exchange_order_snapshot
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ExchangeOrderSnapshot
selectOneByExample
(
ExchangeOrderSnapshotExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table exchange_order_snapshot
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ExchangeOrderSnapshot
selectOneByExampleSelective
(
@Param
(
"example"
)
ExchangeOrderSnapshotExample
example
,
@Param
(
"selective"
)
ExchangeOrderSnapshot
.
Column
...
selective
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table exchange_order_snapshot
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ExchangeOrderSnapshot
selectOneByExampleWithBLOBs
(
ExchangeOrderSnapshotExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table exchange_order_snapshot
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List
<
ExchangeOrderSnapshot
>
selectByExampleSelective
(
@Param
(
"example"
)
ExchangeOrderSnapshotExample
example
,
@Param
(
"selective"
)
ExchangeOrderSnapshot
.
Column
...
selective
);
List
<
ExchangeOrderSnapshot
>
selectByExampleWithBLOBs
(
ExchangeOrderSnapshotExample
example
);
List
<
ExchangeOrderSnapshot
>
selectByExample
(
ExchangeOrderSnapshotExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table exchange_order_snapshot
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ExchangeOrderSnapshot
selectByPrimaryKeySelective
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"selective"
)
ExchangeOrderSnapshot
.
Column
...
selective
);
ExchangeOrderSnapshot
selectByPrimaryKey
(
Integer
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
ExchangeOrderSnapshot
record
,
@Param
(
"example"
)
ExchangeOrderSnapshotExample
example
);
int
updateByExampleWithBLOBs
(
@Param
(
"record"
)
ExchangeOrderSnapshot
record
,
@Param
(
"example"
)
ExchangeOrderSnapshotExample
example
);
int
updateByExample
(
@Param
(
"record"
)
ExchangeOrderSnapshot
record
,
@Param
(
"example"
)
ExchangeOrderSnapshotExample
example
);
int
updateByPrimaryKeySelective
(
ExchangeOrderSnapshot
record
);
int
updateByPrimaryKeyWithBLOBs
(
ExchangeOrderSnapshot
record
);
int
updateByPrimaryKey
(
ExchangeOrderSnapshot
record
);
}
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/ExchangeOrderSnapshotMapper.xml
0 → 100644
View file @
44abce69
This diff is collapsed.
Click to expand it.
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
44abce69
...
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper.distribution"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"
supplier_item
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"
exchange_order_snapshot
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
View file @
44abce69
...
...
@@ -46,7 +46,11 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/distributionOrder/refund"
,
"/wx/collectionBook/findList"
,
"/wx/collectionItemsRelation/findInfos"
,
"/wx/collectionItemsRelation/findList"
,
"/wx/supplierItem/findItemsOfCurrentDistributor"
,
"/wx/selfPage/updateSwitch"
,
"/wx/selfPage/checkIsMine"
,
"/wx/specialPerformance/sendMsg"
,
"/wx/specialPerformance/sendMsgTest"
,
"/wx/groupPurchase/systemAddRecord"
,
"/wx/officialAccount/**"
,
"/wx/supplierItem/**"
,
"/wx/specialPerformance/**"
,
"/wx/groupPurchase/**"
,
"/wx/disposableSubscribeRecord/**"
,
"/wx/auctionRecord/findList"
"/wx/supplierItem/**"
,
"/wx/specialPerformance/**"
,
"/wx/groupPurchase/**"
,
"/wx/disposableSubscribeRecord/**"
,
"/wx/auctionRecord/findList"
,
"/wx/selfPage/countIntroduceAmount"
,
"/wx/exchange/**"
//下列路径上线注释
/* ,"/wx/specialPerformance/**"
, "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**",
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/ExchangeRequestDto.java
0 → 100644
View file @
44abce69
package
com.wwdz.ch.wx.entity.request
;
import
com.wwdz.ch.db.dto.request.BaseRequestDto
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
ExchangeRequestDto
extends
BaseRequestDto
implements
Entity
{
/**
* 商品id
*/
private
Long
userId
;
private
String
userOpenId
;
/**
* 被交换的商品id
*/
private
Long
exchangeItemId
;
/**
* 被交换的商品数量
*/
private
Integer
exchangeItemNum
;
private
List
<
ItemSimpleDto
>
itemList
;
/**
* 用户收货地址
*/
private
Long
addressId
;
/**
* 用户名称
*/
private
String
receiverName
;
/**
* 用户电话
*/
private
String
receiverPhone
;
/**
* 用户收货地址
*/
private
String
receiverAddress
;
/**
* 收藏册id
*/
private
Long
collectionBookId
;
/**
* 用户发出的快递公司编码
*/
private
String
logisticsCode
;
/**
* 运单号
*/
private
String
waybill
;
/**
* 用户发货时间
*/
private
Date
deliveryTime
;
/**
* 平台签收时间
*/
private
Date
signedTime
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/ItemSimpleDto.java
0 → 100644
View file @
44abce69
package
com.wwdz.ch.wx.entity.request
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
@Data
public
class
ItemSimpleDto
implements
Entity
{
/**
* 商品id
*/
private
Long
itemId
;
/**
* 商品数量
*/
private
Integer
itemNum
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/DistributionOrderDetailVo.java
View file @
44abce69
package
com.wwdz.ch.wx.entity.vo.distribution
;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.wwdz.ch.wx.entity.GroupPurchaseInfo
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
@Data
...
...
@@ -278,4 +280,12 @@ public class DistributionOrderDetailVo implements Entity {
private
String
groupPurchaseStateName
;
private
GroupPurchaseInfo
groupPurchaseInfo
;
/**
* 以物换物场景
* 用户用来交换的商品的信息
*/
private
UserExchangeInfo
userExchangeInfo
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/UserExchangeInfo.java
0 → 100644
View file @
44abce69
package
com.wwdz.ch.wx.entity.vo.distribution
;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
UserExchangeInfo
implements
Entity
{
private
List
<
SupplierItemVo
>
list
;
private
String
fromLogisticsCode
;
private
String
fromLogisticsName
;
private
String
fromWaybill
;
private
String
content
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
View file @
44abce69
...
...
@@ -247,9 +247,10 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
if
(
dto
.
getCollectionBookId
().
longValue
()
==
CollectionBookConstants
.
DefaultBookEnum
.
AUCTIONING
.
getId
()){
if
(
dto
.
getCollectionBookId
()
!=
null
)
{
if
(
dto
.
getCollectionBookId
().
longValue
()
==
CollectionBookConstants
.
DefaultBookEnum
.
AUCTIONING
.
getId
())
{
List
<
AuctionConfig
>
auctionConfigList
=
pageInfo
.
getList
();
Map
<
Long
,
AuctionConfig
>
map
=
auctionConfigList
.
stream
().
collect
(
Collectors
.
toMap
(
AuctionConfig:
:
getItemId
,
Function
.
identity
()
,
(
k1
,
k2
)
->
k2
));
Map
<
Long
,
AuctionConfig
>
map
=
auctionConfigList
.
stream
().
collect
(
Collectors
.
toMap
(
AuctionConfig:
:
getItemId
,
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
supplierItemVo
.
setRealEndTime
(
map
.
get
(
supplierItem
.
getId
()).
getRealEndTime
());
AuctionRecord
auctionRecord
=
auctionRecordDao
.
findLastedRecord
(
supplierItem
.
getId
());
if
(
auctionRecord
!=
null
)
{
...
...
@@ -260,6 +261,7 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
supplierItemVo
.
setState
(
AuctionEnum
.
StateEnum
.
AUCTIONING
.
getCode
());
supplierItemVo
.
setStateName
(
AuctionEnum
.
StateEnum
.
AUCTIONING
.
getDes
());
}
}
list
.
add
(
supplierItemVo
);
}
logger
.
info
(
"查询标签下的藏品数目:{}"
,
list
.
size
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
View file @
44abce69
...
...
@@ -6,6 +6,7 @@ import com.wechat.pay.java.service.refund.model.Refund;
import
com.wechat.pay.java.service.refund.model.Status
;
import
com.wwdz.ch.core.api.wxpay.WxPayServiceApi
;
import
com.wwdz.ch.core.consts.*
;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.wwdz.ch.core.entity.wxPay.DistributionOrderRefundRequestDto
;
import
com.wwdz.ch.core.notify.AliSmsSender
;
import
com.wwdz.ch.core.type.PageSearchResult
;
...
...
@@ -27,6 +28,7 @@ import com.wwdz.ch.core.entity.SignedNoticeMsg;
import
com.wwdz.ch.wx.entity.GroupPurchaseInfo
;
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.UserExchangeInfo
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.DistributorProfitService
;
import
com.wwdz.ch.core.service.SendMsgService
;
...
...
@@ -139,6 +141,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
@Autowired
IntroduceRecordDao
introduceRecordDao
;
@Autowired
ExchangeOrderSnapshotDao
exchangeOrderSnapshotDao
;
@Transactional
@Override
public
Result
createDistributionOrder
(
DistributionOrderRequestDto
dto
)
{
...
...
@@ -1072,6 +1077,37 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
distributionOrderDetailVo
.
setIdentifyOrderId
(
identifyOrder
.
getIdentifyOrderId
());
}
}
//以物换物的订单
if
(
distributionOrder
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
EXCHANGE
.
getCode
())
{
UserExchangeInfo
userExchangeInfo
=
new
UserExchangeInfo
();
List
<
ExchangeOrderSnapshot
>
exchangeOrderSnapshotList
=
exchangeOrderSnapshotDao
.
findByOrderId
(
dto
.
getDistributionOrderId
());
if
(!
CollectionUtils
.
isEmpty
(
exchangeOrderSnapshotList
))
{
userExchangeInfo
.
setFromWaybill
(
exchangeOrderSnapshotList
.
get
(
0
).
getWaybill
());
userExchangeInfo
.
setFromLogisticsCode
(
exchangeOrderSnapshotList
.
get
(
0
).
getLogisticsCode
());
userExchangeInfo
.
setFromLogisticsName
(
LogisticsEnum
.
getNameByCode
(
exchangeOrderSnapshotList
.
get
(
0
).
getLogisticsCode
()));
String
content
;
if
(
StringUtils
.
hasLength
(
exchangeOrderSnapshotList
.
get
(
0
).
getWaybill
()))
{
content
=
"商品已寄出,快递信息:"
+
LogisticsEnum
.
getNameByCode
(
exchangeOrderSnapshotList
.
get
(
0
).
getLogisticsCode
())
+
","
+
exchangeOrderSnapshotList
.
get
(
0
).
getWaybill
();
}
else
{
content
=
"商品未寄出"
;
}
userExchangeInfo
.
setContent
(
content
);
}
List
<
SupplierItemVo
>
supplierItemVos
=
new
ArrayList
<>();
for
(
ExchangeOrderSnapshot
exchangeOrderSnapshot
:
exchangeOrderSnapshotList
)
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
supplierItemVo
.
setItemId
(
exchangeOrderSnapshot
.
getItemId
());
supplierItemVo
.
setName
(
exchangeOrderSnapshot
.
getItemName
());
supplierItemVo
.
setItemNum
(
exchangeOrderSnapshot
.
getItemNum
());
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
exchangeOrderSnapshot
.
getDistributionPrice
()));
supplierItemVo
.
setOfficialEstimatedPrice
(
PriceUtil
.
convertPriceFenToYuan
(
exchangeOrderSnapshot
.
getOfficialEstimatedPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
exchangeOrderSnapshot
.
getImages
(),
exchangeOrderSnapshot
.
getVideos
()));
supplierItemVos
.
add
(
supplierItemVo
);
}
userExchangeInfo
.
setList
(
supplierItemVos
);
distributionOrderDetailVo
.
setUserExchangeInfo
(
userExchangeInfo
);
}
//一口价支付截止时间为下单半小时后,竞拍为24小时
Date
date
=
distributionOrder
.
getCreateTime
();
if
(
type
==
DistributionEnum
.
DistributionTypeEnum
.
FIXED_PRICE
.
getCode
()
||
type
==
DistributionEnum
.
DistributionTypeEnum
.
GROUP_PURCHASE
.
getCode
())
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/ExchangeServiceImpl.java
0 → 100644
View file @
44abce69
This diff is collapsed.
Click to expand it.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
44abce69
...
...
@@ -220,6 +220,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo
.
setItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setOfficialEstimatedPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getOfficialEstimatedPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
supplierItemVos
.
add
(
supplierItemVo
);
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/ExchangeService.java
0 → 100644
View file @
44abce69
package
com.wwdz.ch.wx.service.distribution
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.wx.entity.request.ExchangeRequestDto
;
public
interface
ExchangeService
{
/**
* 检测用户是否有足够的商品
* @param dto
* @return
*/
Result
checkEnoughItem
(
ExchangeRequestDto
dto
);
/**
* 查询用户可交换的商品列表
* @param dto
* @return
*/
Result
findItemList
(
ExchangeRequestDto
dto
);
/**
* 以物换物
* @param dto
* @return
*/
Result
exchange
(
ExchangeRequestDto
dto
);
/**
* 用户换藏发货
* @param dto
* @return
*/
Result
delivery
(
DistributionOrderRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/ExchangeController.java
0 → 100644
View file @
44abce69
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.entity.request.ExchangeRequestDto
;
import
com.wwdz.ch.wx.service.distribution.ExchangeService
;
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/exchange"
)
public
class
ExchangeController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ExchangeController
.
class
);
@Autowired
ExchangeService
exchangeService
;
@ApiOperation
(
value
=
"检测用户是否有足够的商品"
)
@PostMapping
(
"/checkEnoughItem"
)
public
Result
checkEnoughItem
(
@RequestBody
ExchangeRequestDto
dto
)
{
logger
.
info
(
"检测用户是否有足够的商品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
exchangeService
.
checkEnoughItem
(
dto
);
}
@ApiOperation
(
value
=
"查询用户可交换的商品列表"
)
@PostMapping
(
"/findItemList"
)
public
Result
findItemList
(
@RequestBody
ExchangeRequestDto
dto
)
{
logger
.
info
(
"查询用户可交换的商品列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
exchangeService
.
findItemList
(
dto
);
}
@ApiOperation
(
value
=
"以物换物"
)
@PostMapping
(
"/exchange"
)
public
Result
exchange
(
@RequestBody
ExchangeRequestDto
dto
)
{
logger
.
info
(
"以物换物,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
set
(
"userOpenId"
,
"用户微信openid"
).
must
().
string
()
.
set
(
"exchangeItemId"
,
"被交换的商品id"
).
must
().
number
()
.
set
(
"exchangeItemNum"
,
"被交换的商品数量"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
exchangeService
.
exchange
(
dto
);
}
@ApiOperation
(
value
=
"用户换藏发货"
)
@PostMapping
(
"/delivery"
)
public
Result
delivery
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
logger
.
info
(
"藏家发货,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"distributionOrderId"
,
"订单号"
).
must
().
string
()
.
set
(
"logisticsCode"
,
"快递公司编码"
).
must
().
string
()
.
set
(
"waybill"
,
"运单号"
).
must
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
exchangeService
.
delivery
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SelfPageController.java
View file @
44abce69
package
com.wwdz.ch.wx.web.distribution
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.wx.entity.request.SelfPageRequestDto
;
import
com.wwdz.ch.wx.service.distribution.SelfPageService
;
...
...
@@ -99,11 +100,8 @@ public class SelfPageController {
@PostMapping
(
"/countIntroduceAmount"
)
public
Result
countIntroduceAmount
(
@RequestBody
SelfPageRequestDto
dto
)
{
logger
.
info
(
"查询介绍佣金,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
if
(
dto
.
getUserId
()
==
null
)
{
dto
.
setUserId
(
CommConsts
.
SYSTEM_ACCOUNT_FOR_UNLOGIN
);
}
return
userAccountDetailService
.
countIntroduceAmount
(
dto
.
getUserId
());
}
...
...
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