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
ad75f67c
Commit
ad75f67c
authored
Jun 17, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
藏品详情新增是否是藏家的判断
parent
7a300c2e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
262 additions
and
26 deletions
+262
-26
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
.../main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
+48
-16
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/domain/distribution/DistributionOrder.java
...com/wwdz/ch/db/domain/distribution/DistributionOrder.java
+9
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrderExample.java
...z/ch/db/domain/distribution/DistributionOrderExample.java
+132
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/DistributionOrderRequestDto.java
...dto/request/distribution/DistributionOrderRequestDto.java
+9
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/DistributionOrderDaoImpl.java
...wdz/ch/db/impl/distribution/DistributionOrderDaoImpl.java
+4
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
...wdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
+29
-10
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+29
-0
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
View file @
ad75f67c
...
...
@@ -3,8 +3,10 @@ package com.wwdz.ch.admin.job;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.api.LogisticsApi
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.consts.LogisticsStateEnum
;
import
com.wwdz.ch.core.entity.LogisticsInfo
;
import
com.wwdz.ch.core.entity.LogisticsRequestDto
;
import
com.wwdz.ch.core.entity.TrailInfo
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.domain.User
;
...
...
@@ -48,7 +50,7 @@ public class RefreshLogisticsJob {
/**
* 隔4小时运行一次
*/
//
@Scheduled(fixedDelay = 1000 * 60 * 60 * 4)
@Scheduled
(
fixedDelay
=
1000
*
60
*
60
*
4
)
public
void
execute
()
{
RLock
lock
=
redissonClient
.
getLock
(
REFRESH_LOGISTICS_KEY
);
if
(!
lock
.
tryLock
())
{
...
...
@@ -57,21 +59,22 @@ public class RefreshLogisticsJob {
}
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> 更新物流状态任务,开始执行 <<<<<<<<<<<<<<<<<<<<<"
);
try
{
//查询7天前发货订单
//查询7天前发货订单
未签收的订单
boolean
hasNextPage
=
true
;
DistributionOrderRequestDto
distributionOrderRequestDto
=
new
DistributionOrderRequestDto
();
Date
now
=
new
Date
();
Instant
startInstant
=
now
.
toInstant
().
minus
(
Duration
.
ofDays
(
7
));
Date
startTime
=
Date
.
from
(
startInstant
);
distributionOrderRequestDto
.
setStartDeliveryTime
(
startTime
);
distributionOrderRequestDto
.
setEndDeliveryTime
(
now
);
distributionOrderRequestDto
.
setNotFilterLogisticsState
(
LogisticsStateEnum
.
StateEnum
.
SIGNED
.
getCode
());
int
page
=
0
;
while
(
hasNextPage
)
{
page
=
page
+
1
;
DistributionOrderRequestDto
distributionOrderRequestDto
=
new
DistributionOrderRequestDto
();
distributionOrderRequestDto
.
setPage
(
page
);
distributionOrderRequestDto
.
setState
(
DistributionEnum
.
DistributionOrderStateEnum
.
PRE_SIGNED
.
getCode
());
Date
now
=
new
Date
();
Instant
startInstant
=
now
.
toInstant
().
minus
(
Duration
.
ofDays
(
7
));
Date
startTime
=
Date
.
from
(
startInstant
);
distributionOrderRequestDto
.
setStartDeliveryTime
(
startTime
);
distributionOrderRequestDto
.
setEndDeliveryTime
(
now
);
List
<
DistributionOrder
>
distributionOrderList
=
distributionOrderDao
.
findByPage
(
distributionOrderRequestDto
);
PageInfo
pageInfo
=
new
PageInfo
(
distributionOrderList
);
logger
.
info
(
"================ 七天内发货订单总页数为: {}, 当前查询第 {} 页 ================"
,
pageInfo
.
getPages
(),
pageInfo
.
getPageNum
());
for
(
DistributionOrder
distributionOrder
:
distributionOrderList
)
{
String
orderId
=
distributionOrder
.
getDistributionOrderId
();
LogisticsRequestDto
logisticsRequestDto
=
new
LogisticsRequestDto
();
...
...
@@ -88,23 +91,52 @@ public class RefreshLogisticsJob {
DistributionOrder
updateDto
=
new
DistributionOrder
();
updateDto
.
setDistributionOrderId
(
orderId
);
updateDto
.
setLogisticsState
(
logisticsState
);
distributionOrderDao
.
update
(
distributionOrder
);
if
(
logisticsState
==
LogisticsStateEnum
.
StateEnum
.
SIGNED
.
getCode
())
{
List
<
TrailInfo
>
trailInfoList
=
logisticsInfo
.
getTrailInfoList
();
TrailInfo
lastInfo
=
trailInfoList
.
get
(
0
);
updateDto
.
setSignedTime
(
DateUtils
.
parseString
(
lastInfo
.
getCreateTime
()));
}
distributionOrderDao
.
update
(
updateDto
);
}
}
hasNextPage
=
pageInfo
.
isHasNextPage
();
}
logger
.
info
(
"================ 更新物流状态任务执行成功 =============="
);
//物流签收后7天检测自动确认收货
logger
.
info
(
"================ 更新物流状态任务执行成功 ================"
);
//物流签收超过7天订单自动确认收货
checkAutoSigned
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"更新物流状态任务 error {}"
,
e
);
}
finally
{
if
(
lock
!=
null
&&
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
logger
.
info
(
"======================== 线程id: {} , 更新物流状态任务执行结束, 释放锁成功 ========================"
,
Thread
.
currentThread
().
getId
());
logger
.
info
(
"======================== 线程id: {} , 更新物流状态、自动确认收货检测任务执行结束, 释放锁成功 ========================"
,
Thread
.
currentThread
().
getId
());
}
}
}
public
void
checkAutoSigned
()
{
//物流签收后7天检测自动确认收货
boolean
hasNextPage
=
true
;
DistributionOrderRequestDto
distributionOrderRequestDto
=
new
DistributionOrderRequestDto
();
Date
now
=
new
Date
();
Instant
startInstant
=
now
.
toInstant
().
minus
(
Duration
.
ofDays
(
7
));
Date
endTime
=
Date
.
from
(
startInstant
);
distributionOrderRequestDto
.
setEndSignedTime
(
endTime
);
distributionOrderRequestDto
.
setState
(
DistributionEnum
.
DistributionOrderStateEnum
.
PRE_SIGNED
.
getCode
());
distributionOrderRequestDto
.
setLogisticsState
(
LogisticsStateEnum
.
StateEnum
.
SIGNED
.
getCode
());
int
page
=
0
;
while
(
hasNextPage
)
{
page
=
page
+
1
;
distributionOrderRequestDto
.
setPage
(
page
);
List
<
DistributionOrder
>
distributionOrderList
=
distributionOrderDao
.
findByPage
(
distributionOrderRequestDto
);
PageInfo
pageInfo
=
new
PageInfo
(
distributionOrderList
);
logger
.
info
(
"================ 签收时间超过七天未确认收货的订单总页数为: {}, 当前查询第 {} 页 ================"
,
pageInfo
.
getPages
(),
pageInfo
.
getPageNum
());
for
(
DistributionOrder
distributionOrder
:
distributionOrderList
)
{
distributionOrderDao
.
updateState
(
distributionOrder
.
getDistributionOrderId
(),
DistributionEnum
.
DistributionOrderStateEnum
.
FINISH
.
getCode
());
logger
.
info
(
">>>>>>>>>>>>>> 订单号:{}, 签收时间超过七天系统自动确认收货 <<<<<<<<<<<<<<<"
);
}
hasNextPage
=
pageInfo
.
isHasNextPage
();
}
logger
.
info
(
">>>>>>>>>>>>>> 系统自动确认收货任务执行成功 <<<<<<<<<<<<<<<"
);
}
}
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
ad75f67c
...
...
@@ -287,4 +287,6 @@ public class SupplierItemVo implements Entity {
*/
private
String
introduceCost
;
private
Boolean
isCollector
;
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrder.java
View file @
ad75f67c
...
...
@@ -111,6 +111,11 @@ public class DistributionOrder implements Entity {
*/
private
Date
deliveryTime
;
/**
* 签收时间
*/
private
Date
signedTime
;
/**
* 完成时间
*/
...
...
@@ -169,6 +174,7 @@ public class DistributionOrder implements Entity {
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", payTime="
).
append
(
payTime
);
sb
.
append
(
", deliveryTime="
).
append
(
deliveryTime
);
sb
.
append
(
", signedTime="
).
append
(
signedTime
);
sb
.
append
(
", finishTime="
).
append
(
finishTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", shareRecordId="
).
append
(
shareRecordId
);
...
...
@@ -212,6 +218,7 @@ public class DistributionOrder implements Entity {
&&
(
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
.
getSignedTime
()
==
null
?
other
.
getSignedTime
()
==
null
:
this
.
getSignedTime
().
equals
(
other
.
getSignedTime
()))
&&
(
this
.
getFinishTime
()
==
null
?
other
.
getFinishTime
()
==
null
:
this
.
getFinishTime
().
equals
(
other
.
getFinishTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getShareRecordId
()
==
null
?
other
.
getShareRecordId
()
==
null
:
this
.
getShareRecordId
().
equals
(
other
.
getShareRecordId
()))
...
...
@@ -244,6 +251,7 @@ public class DistributionOrder implements Entity {
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
+
((
getSignedTime
()
==
null
)
?
0
:
getSignedTime
().
hashCode
());
result
=
prime
*
result
+
((
getFinishTime
()
==
null
)
?
0
:
getFinishTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getShareRecordId
()
==
null
)
?
0
:
getShareRecordId
().
hashCode
());
...
...
@@ -281,6 +289,7 @@ public class DistributionOrder implements Entity {
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
payTime
(
"pay_time"
,
"payTime"
,
"TIMESTAMP"
,
false
),
deliveryTime
(
"delivery_time"
,
"deliveryTime"
,
"TIMESTAMP"
,
false
),
signedTime
(
"signed_time"
,
"signedTime"
,
"TIMESTAMP"
,
false
),
finishTime
(
"finish_time"
,
"finishTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
shareRecordId
(
"share_record_id"
,
"shareRecordId"
,
"VARCHAR"
,
false
),
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrderExample.java
View file @
ad75f67c
...
...
@@ -2878,6 +2878,138 @@ public class DistributionOrderExample {
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeIsNull
()
{
addCriterion
(
"signed_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeIsNotNull
()
{
addCriterion
(
"signed_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeEqualTo
(
Date
value
)
{
addCriterion
(
"signed_time ="
,
value
,
"signedTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distribution_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSignedTimeEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signed_time = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"signed_time <>"
,
value
,
"signedTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distribution_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSignedTimeNotEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signed_time <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"signed_time >"
,
value
,
"signedTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distribution_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSignedTimeGreaterThanColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signed_time > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"signed_time >="
,
value
,
"signedTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distribution_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSignedTimeGreaterThanOrEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signed_time >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeLessThan
(
Date
value
)
{
addCriterion
(
"signed_time <"
,
value
,
"signedTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distribution_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSignedTimeLessThanColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signed_time < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"signed_time <="
,
value
,
"signedTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distribution_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSignedTimeLessThanOrEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signed_time <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"signed_time in"
,
values
,
"signedTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"signed_time not in"
,
values
,
"signedTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"signed_time between"
,
value1
,
value2
,
"signedTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignedTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"signed_time not between"
,
value1
,
value2
,
"signedTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFinishTimeIsNull
()
{
addCriterion
(
"finish_time is null"
);
return
(
Criteria
)
this
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/DistributionOrderRequestDto.java
View file @
ad75f67c
...
...
@@ -157,11 +157,20 @@ public class DistributionOrderRequestDto extends BaseRequestDto implements Entit
private
Date
endDeliveryTime
;
private
Date
startSignedTime
;
private
Date
endSignedTime
;
/**
* 物流状态
*/
private
Integer
logisticsState
;
/**
* 物流状态
*/
private
Integer
notFilterLogisticsState
;
/**
* 订单类型
* 1 一口价
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/DistributionOrderDaoImpl.java
View file @
ad75f67c
...
...
@@ -116,8 +116,12 @@ public class DistributionOrderDaoImpl implements DistributionOrderDao {
JdbcHelper
.
ifPresent
(
dto
.
getSellerIdList
(),
criteria:
:
andSellerIdIn
);
JdbcHelper
.
ifPresent
(
dto
.
getState
(),
criteria:
:
andStateEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getLogisticsState
(),
criteria:
:
andLogisticsStateEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getNotFilterLogisticsState
(),
criteria:
:
andLogisticsStateNotEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getType
(),
criteria:
:
andTypeEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getTypeList
(),
criteria:
:
andTypeIn
);
JdbcHelper
.
ifPresent
(
dto
.
getStartDeliveryTime
(),
criteria:
:
andDeliveryTimeGreaterThanOrEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getEndDeliveryTime
(),
criteria:
:
andDeliveryTimeLessThanOrEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getEndSignedTime
(),
criteria:
:
andSignedTimeLessThanOrEqualTo
);
example
.
setOrderByClause
(
"create_time desc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
distributionOrderMapper
.
selectByExample
(
example
);
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
View file @
ad75f67c
...
...
@@ -22,6 +22,7 @@
<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=
"signed_time"
jdbcType=
"TIMESTAMP"
property=
"signedTime"
/>
<result
column=
"finish_time"
jdbcType=
"TIMESTAMP"
property=
"finishTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"share_record_id"
jdbcType=
"VARCHAR"
property=
"shareRecordId"
/>
...
...
@@ -91,7 +92,8 @@
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`, logistics_state, `type`
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrderExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -129,7 +131,8 @@
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`, logistics_state, `type`
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
</otherwise>
</choose>
from distribution_order
...
...
@@ -163,7 +166,8 @@
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`, logistics_state, `type`
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
</otherwise>
</choose>
from distribution_order
...
...
@@ -189,18 +193,18 @@
amount, address_id, receiver_name,
receiver_phone, receiver_address, logistics_code,
waybill, create_time, pay_time,
delivery_time,
finish_time, update
_time,
share_record_id, `state`, logistics_state
,
`type`)
delivery_time,
signed_time, finish
_time,
update_time, share_record_id, `state`
,
logistics_state,
`type`)
values (#{distributionOrderId,jdbcType=VARCHAR}, #{prepayId,jdbcType=VARCHAR}, #{transactionId,jdbcType=VARCHAR},
#{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER}, #{buyerId,jdbcType=BIGINT},
#{buyerOpenid,jdbcType=VARCHAR}, #{shopId,jdbcType=BIGINT}, #{sellerId,jdbcType=BIGINT},
#{amount,jdbcType=BIGINT}, #{addressId,jdbcType=BIGINT}, #{receiverName,jdbcType=VARCHAR},
#{receiverPhone,jdbcType=VARCHAR}, #{receiverAddress,jdbcType=VARCHAR}, #{logisticsCode,jdbcType=VARCHAR},
#{waybill,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP},
#{deliveryTime,jdbcType=TIMESTAMP}, #{
finishTime,jdbcType=TIMESTAMP}, #{update
Time,jdbcType=TIMESTAMP},
#{
shareRecordId,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{logisticsS
tate,jdbcType=INTEGER},
#{type,jdbcType=INTEGER})
#{deliveryTime,jdbcType=TIMESTAMP}, #{
signedTime,jdbcType=TIMESTAMP}, #{finish
Time,jdbcType=TIMESTAMP},
#{
updateTime,jdbcType=TIMESTAMP}, #{shareRecordId,jdbcType=VARCHAR}, #{s
tate,jdbcType=INTEGER},
#{
logisticsState,jdbcType=INTEGER}, #{
type,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrder"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
...
...
@@ -265,6 +269,9 @@
<if
test=
"deliveryTime != null"
>
delivery_time,
</if>
<if
test=
"signedTime != null"
>
signed_time,
</if>
<if
test=
"finishTime != null"
>
finish_time,
</if>
...
...
@@ -342,6 +349,9 @@
<if
test=
"deliveryTime != null"
>
#{deliveryTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"signedTime != null"
>
#{signedTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"finishTime != null"
>
#{finishTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -431,6 +441,9 @@
<if
test=
"record.deliveryTime != null"
>
delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.signedTime != null"
>
signed_time = #{record.signedTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.finishTime != null"
>
finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -476,6 +489,7 @@
create_time = #{record.createTime,jdbcType=TIMESTAMP},
pay_time = #{record.payTime,jdbcType=TIMESTAMP},
delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
signed_time = #{record.signedTime,jdbcType=TIMESTAMP},
finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
...
...
@@ -546,6 +560,9 @@
<if
test=
"deliveryTime != null"
>
delivery_time = #{deliveryTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"signedTime != null"
>
signed_time = #{signedTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"finishTime != null"
>
finish_time = #{finishTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -588,6 +605,7 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
pay_time = #{payTime,jdbcType=TIMESTAMP},
delivery_time = #{deliveryTime,jdbcType=TIMESTAMP},
signed_time = #{signedTime,jdbcType=TIMESTAMP},
finish_time = #{finishTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
...
...
@@ -632,7 +650,8 @@
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`, logistics_state, `type`
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
</otherwise>
</choose>
from distribution_order
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
ad75f67c
package
com.wwdz.ch.wx.impl.distribution
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.consts.*
;
import
com.wwdz.ch.core.storage.QiniuStorage
;
...
...
@@ -29,6 +30,10 @@ import com.wwdz.ch.wx.service.FollowFansRecordService;
import
com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.SupplierItemService
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.wwdz.shop.api.DTO.ShopDTO
;
import
com.wwdz.shop.api.query.ShopQueryOption
;
import
com.wwdz.shop.api.service.ShopReadService
;
import
com.xxdxxs.utils.*
;
import
javafx.beans.binding.ObjectExpression
;
import
org.redisson.api.RLock
;
...
...
@@ -123,6 +128,12 @@ public class SupplierItemServiceImpl implements SupplierItemService {
@Autowired
SpecialPerformanceConfigDao
specialPerformanceConfigDao
;
@Reference
ShopReadService
shopReadService
;
@Autowired
ShopWhiteListDao
shopWhiteListDao
;
@Override
public
Result
findList
(
SupplierItemRequestDto
dto
)
{
...
...
@@ -811,6 +822,24 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if
(
user
!=
null
)
{
supplierItemVo
.
setWechatQrCode
(
user
.
getWechatQrCode
());
}
//判断是否是藏家
if
(
shopWhiteListDao
.
isExisted
(
supplierItem
.
getCreatorId
()))
{
supplierItemVo
.
setIsCollected
(
true
);
}
else
{
supplierItemVo
.
setIsCollected
(
false
);
try
{
CloudServerResponse
<
ShopDTO
>
cloudServerResponse
=
shopReadService
.
getShopByUserId
(
supplierItem
.
getCreatorId
(),
new
ShopQueryOption
());
if
(
cloudServerResponse
.
isSuccess
())
{
ShopDTO
shopDTO
=
cloudServerResponse
.
getResult
();
if
(
shopDTO
!=
null
&&
!
ObjectUtils
.
isEmpty
(
shopDTO
.
getShopId
())
&&
shopDTO
.
getPayStatus
()
==
1
&&
shopDTO
.
getCheckStatus
()
==
1
&&
shopDTO
.
getType
()
==
4
)
{
supplierItemVo
.
setIsCollected
(
true
);
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"根据用户id查询店铺信息失败error:{}"
,
e
);
supplierItemVo
.
setIsCollected
(
false
);
}
}
}
else
{
supplierItemVo
.
setIsMine
(
true
);
//查询收藏该商品的最新的五个用户
...
...
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