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
1d5445f6
Commit
1d5445f6
authored
Jun 17, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
藏品详情新增藏家二维码
parent
269bb643
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
359 additions
and
21 deletions
+359
-21
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
.../main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
+106
-0
ch-core/src/main/java/com/wwdz/ch/core/api/LogisticsApi.java
ch-core/src/main/java/com/wwdz/ch/core/api/LogisticsApi.java
+1
-2
ch-core/src/main/java/com/wwdz/ch/core/consts/LogisticsStateEnum.java
...main/java/com/wwdz/ch/core/consts/LogisticsStateEnum.java
+42
-0
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
...src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
+10
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrder.java
...com/wwdz/ch/db/domain/distribution/DistributionOrder.java
+11
-2
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/mapper/distribution/DistributionOrderMapper.java
...dz/ch/db/mapper/distribution/DistributionOrderMapper.java
+0
-3
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
...wdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
+23
-8
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+4
-4
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/DistributionOrderVo.java
...wdz/ch/wx/entity/vo/distribution/DistributionOrderVo.java
+7
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributorProfitServiceImpl.java
...ch/wx/impl/distribution/DistributorProfitServiceImpl.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
...om/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+11
-0
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
+1
-0
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/RefreshLogisticsJob.java
0 → 100644
View file @
1d5445f6
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.entity.LogisticsInfo
;
import
com.wwdz.ch.core.entity.LogisticsRequestDto
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.SpecialPerformance
;
import
com.wwdz.ch.db.dto.request.UserRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.StringUtils
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
java.time.Duration
;
import
java.time.Instant
;
import
java.util.Date
;
import
java.util.List
;
@Component
public
class
RefreshLogisticsJob
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RefreshLogisticsJob
.
class
);
private
final
static
String
REFRESH_LOGISTICS_KEY
=
"REFRESH_LOGISTICS_KEY"
;
@Autowired
RedissonClient
redissonClient
;
@Autowired
DistributionOrderDao
distributionOrderDao
;
@Autowired
LogisticsApi
logisticsApi
;
/**
* 隔4小时运行一次
*/
// @Scheduled(fixedDelay = 1000 * 60 * 60 * 4)
public
void
execute
()
{
RLock
lock
=
redissonClient
.
getLock
(
REFRESH_LOGISTICS_KEY
);
if
(!
lock
.
tryLock
())
{
logger
.
warn
(
"更新物流状态,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行"
,
Thread
.
currentThread
().
getId
());
return
;
}
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> 更新物流状态任务,开始执行 <<<<<<<<<<<<<<<<<<<<<"
);
try
{
//查询7天前发货订单
boolean
hasNextPage
=
true
;
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
);
for
(
DistributionOrder
distributionOrder
:
distributionOrderList
)
{
String
orderId
=
distributionOrder
.
getDistributionOrderId
();
LogisticsRequestDto
logisticsRequestDto
=
new
LogisticsRequestDto
();
logisticsRequestDto
.
setLogisticsCode
(
distributionOrder
.
getLogisticsCode
());
logisticsRequestDto
.
setWaybill
(
distributionOrder
.
getWaybill
());
Result
result
=
logisticsApi
.
findTrails
(
logisticsRequestDto
);
if
(!
result
.
getSuccess
())
{
logger
.
error
(
"订单号:{} 查询物流轨迹失败"
,
orderId
);
continue
;
}
LogisticsInfo
logisticsInfo
=
(
LogisticsInfo
)
result
.
getData
();
int
logisticsState
=
Integer
.
parseInt
(
logisticsInfo
.
getState
());
if
(
logisticsState
!=
distributionOrder
.
getLogisticsState
().
intValue
())
{
DistributionOrder
updateDto
=
new
DistributionOrder
();
updateDto
.
setDistributionOrderId
(
orderId
);
updateDto
.
setLogisticsState
(
logisticsState
);
distributionOrderDao
.
update
(
distributionOrder
);
}
}
hasNextPage
=
pageInfo
.
isHasNextPage
();
}
logger
.
info
(
"================更新物流状态任务执行成功 =============="
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"更新物流状态任务 error {}"
,
e
);
}
finally
{
if
(
lock
!=
null
&&
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
logger
.
info
(
"======================== 线程id: {} , 更新物流状态任务执行结束, 释放锁成功 ========================"
,
Thread
.
currentThread
().
getId
());
}
}
}
}
ch-
wx-api/src/main/java/com/wwdz/ch/wx
/api/LogisticsApi.java
→
ch-
core/src/main/java/com/wwdz/ch/core
/api/LogisticsApi.java
View file @
1d5445f6
package
com.wwdz.ch.
wx
.api
;
package
com.wwdz.ch.
core
.api
;
import
com.wwdz.ch.core.consts.CommonEnum
;
import
com.wwdz.ch.core.consts.LogisticsEnum
;
...
...
@@ -80,7 +80,6 @@ public class LogisticsApi {
logisticsInfo
.
setStateName
(
CommonEnum
.
LogisticsStateEnum
.
getNameByCode
(
Integer
.
parseInt
(
state
)));
return
Result
.
success
(
logisticsInfo
);
}
return
Result
.
failed
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询物流轨迹error :{}"
,
e
);
}
...
...
ch-core/src/main/java/com/wwdz/ch/core/consts/LogisticsStateEnum.java
0 → 100644
View file @
1d5445f6
package
com.wwdz.ch.core.consts
;
/**
* 物流状态
*/
public
class
LogisticsStateEnum
{
public
enum
StateEnum
{
NO_TRAIL
(
0
,
"暂无轨迹信息"
),
TAKED
(
1
,
"已揽收"
),
ON_THE_WAY
(
2
,
"在途中"
),
SIGNED
(
3
,
"已签收"
),
PROBLEM
(
4
,
"问题件"
),
;
private
int
code
;
private
String
name
;
StateEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
String
getNameByCode
(
Integer
code
)
{
for
(
LogisticsStateEnum
.
StateEnum
stateEnum
:
LogisticsStateEnum
.
StateEnum
.
values
())
{
if
(
code
!=
null
&&
stateEnum
.
getCode
()
==
code
)
{
return
stateEnum
.
getName
();
}
}
return
null
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
}
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
1d5445f6
...
...
@@ -277,4 +277,14 @@ public class SupplierItemVo implements Entity {
*/
private
Boolean
isHasDiscountOrder
;
/**
* 藏家二维码
*/
private
String
wechatQrCode
;
/**
* 介绍人佣金
*/
private
String
introduceCost
;
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrder.java
View file @
1d5445f6
...
...
@@ -10,7 +10,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/0
2/29
* @date 2024/0
6/17
*/
@Data
public
class
DistributionOrder
implements
Entity
{
...
...
@@ -132,7 +132,12 @@ public class DistributionOrder implements Entity {
private
Integer
state
;
/**
* 订单类型1一口价2竞拍
* 物流状态
*/
private
Integer
logisticsState
;
/**
* 订单类型1一口价2竞拍3藏馆订单4促销订单
*/
private
Integer
type
;
...
...
@@ -168,6 +173,7 @@ public class DistributionOrder implements Entity {
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", shareRecordId="
).
append
(
shareRecordId
);
sb
.
append
(
", state="
).
append
(
state
);
sb
.
append
(
", logisticsState="
).
append
(
logisticsState
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
...
...
@@ -210,6 +216,7 @@ public class DistributionOrder implements Entity {
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getShareRecordId
()
==
null
?
other
.
getShareRecordId
()
==
null
:
this
.
getShareRecordId
().
equals
(
other
.
getShareRecordId
()))
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()))
&&
(
this
.
getLogisticsState
()
==
null
?
other
.
getLogisticsState
()
==
null
:
this
.
getLogisticsState
().
equals
(
other
.
getLogisticsState
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()));
}
...
...
@@ -241,6 +248,7 @@ public class DistributionOrder implements Entity {
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getShareRecordId
()
==
null
)
?
0
:
getShareRecordId
().
hashCode
());
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
result
=
prime
*
result
+
((
getLogisticsState
()
==
null
)
?
0
:
getLogisticsState
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
return
result
;
}
...
...
@@ -277,6 +285,7 @@ public class DistributionOrder implements Entity {
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
shareRecordId
(
"share_record_id"
,
"shareRecordId"
,
"VARCHAR"
,
false
),
state
(
"state"
,
"state"
,
"INTEGER"
,
true
),
logisticsState
(
"logistics_state"
,
"logisticsState"
,
"INTEGER"
,
false
),
type
(
"type"
,
"type"
,
"INTEGER"
,
true
);
/**
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrderExample.java
View file @
1d5445f6
...
...
@@ -3416,6 +3416,138 @@ public class DistributionOrderExample {
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateIsNull
()
{
addCriterion
(
"logistics_state is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateIsNotNull
()
{
addCriterion
(
"logistics_state is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateEqualTo
(
Integer
value
)
{
addCriterion
(
"logistics_state ="
,
value
,
"logisticsState"
);
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
andLogisticsStateEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_state = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateNotEqualTo
(
Integer
value
)
{
addCriterion
(
"logistics_state <>"
,
value
,
"logisticsState"
);
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
andLogisticsStateNotEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_state <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateGreaterThan
(
Integer
value
)
{
addCriterion
(
"logistics_state >"
,
value
,
"logisticsState"
);
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
andLogisticsStateGreaterThanColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_state > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"logistics_state >="
,
value
,
"logisticsState"
);
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
andLogisticsStateGreaterThanOrEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_state >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateLessThan
(
Integer
value
)
{
addCriterion
(
"logistics_state <"
,
value
,
"logisticsState"
);
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
andLogisticsStateLessThanColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_state < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"logistics_state <="
,
value
,
"logisticsState"
);
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
andLogisticsStateLessThanOrEqualToColumn
(
DistributionOrder
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_state <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"logistics_state in"
,
values
,
"logisticsState"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"logistics_state not in"
,
values
,
"logisticsState"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"logistics_state between"
,
value1
,
value2
,
"logisticsState"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsStateNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"logistics_state not between"
,
value1
,
value2
,
"logisticsState"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNull
()
{
addCriterion
(
"`type` is null"
);
return
(
Criteria
)
this
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/DistributionOrderRequestDto.java
View file @
1d5445f6
...
...
@@ -153,6 +153,15 @@ public class DistributionOrderRequestDto extends BaseRequestDto implements Entit
private
Date
endCreateTime
;
private
Date
startDeliveryTime
;
private
Date
endDeliveryTime
;
/**
* 物流状态
*/
private
Integer
logisticsState
;
/**
* 订单类型
* 1 一口价
...
...
ch-dao/src/main/java/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.java
View file @
1d5445f6
...
...
@@ -4,11 +4,8 @@ import com.wwdz.ch.db.bean.DistributionOrderNum;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrderExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
DistributionOrderMapper
{
long
countByExample
(
DistributionOrderExample
example
);
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
View file @
1d5445f6
...
...
@@ -26,6 +26,7 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"share_record_id"
jdbcType=
"VARCHAR"
property=
"shareRecordId"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
<result
column=
"logistics_state"
jdbcType=
"INTEGER"
property=
"logisticsState"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
...
...
@@ -90,7 +91,7 @@
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`, `type`
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
...
...
@@ -128,7 +129,7 @@
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`, `type`
finish_time, update_time, share_record_id, `state`,
logistics_state,
`type`
</otherwise>
</choose>
from distribution_order
...
...
@@ -162,7 +163,7 @@
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`, `type`
finish_time, update_time, share_record_id, `state`,
logistics_state,
`type`
</otherwise>
</choose>
from distribution_order
...
...
@@ -189,8 +190,8 @@
receiver_phone, receiver_address, logistics_code,
waybill, create_time, pay_time,
delivery_time, finish_time, update_time,
share_record_id, `state`,
`type`
)
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},
...
...
@@ -198,8 +199,8 @@
#{receiverPhone,jdbcType=VARCHAR}, #{receiverAddress,jdbcType=VARCHAR}, #{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}, #{
type,jdbcType=INTEGER}
)
#{shareRecordId,jdbcType=VARCHAR}, #{state,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"
>
...
...
@@ -276,6 +277,9 @@
<if
test=
"state != null"
>
`state`,
</if>
<if
test=
"logisticsState != null"
>
logistics_state,
</if>
<if
test=
"type != null"
>
`type`,
</if>
...
...
@@ -350,6 +354,9 @@
<if
test=
"state != null"
>
#{state,jdbcType=INTEGER},
</if>
<if
test=
"logisticsState != null"
>
#{logisticsState,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
...
...
@@ -436,6 +443,9 @@
<if
test=
"record.state != null"
>
`state` = #{record.state,jdbcType=INTEGER},
</if>
<if
test=
"record.logisticsState != null"
>
logistics_state = #{record.logisticsState,jdbcType=INTEGER},
</if>
<if
test=
"record.type != null"
>
`type` = #{record.type,jdbcType=INTEGER},
</if>
...
...
@@ -470,6 +480,7 @@
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
`state` = #{record.state,jdbcType=INTEGER},
logistics_state = #{record.logisticsState,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -547,6 +558,9 @@
<if
test=
"state != null"
>
`state` = #{state,jdbcType=INTEGER},
</if>
<if
test=
"logisticsState != null"
>
logistics_state = #{logisticsState,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
`type` = #{type,jdbcType=INTEGER},
</if>
...
...
@@ -578,6 +592,7 @@
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER},
logistics_state = #{logisticsState,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -617,7 +632,7 @@
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`, `type`
finish_time, update_time, share_record_id, `state`,
logistics_state,
`type`
</otherwise>
</choose>
from distribution_order
...
...
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
1d5445f6
...
...
@@ -63,16 +63,16 @@
<!--生成Model类存放位置-->
<javaModelGenerator
targetPackage=
"com.wwdz.ch.db.domain"
targetProject=
"ch-dao/src/main/java"
>
<javaModelGenerator
targetPackage=
"com.wwdz.ch.db.domain
.distribution
"
targetProject=
"ch-dao/src/main/java"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
<property
name=
"trimStrings"
value=
"true"
/>
</javaModelGenerator>
<sqlMapGenerator
targetPackage=
"com.wwdz.ch.db.mapper"
targetProject=
"ch-dao/src/main/resources"
/>
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper"
<sqlMapGenerator
targetPackage=
"com.wwdz.ch.db.mapper
.distribution
"
targetProject=
"ch-dao/src/main/resources"
/>
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper
.distribution
"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"
us
er"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"
distribution_ord
er"
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/entity/vo/distribution/DistributionOrderVo.java
View file @
1d5445f6
...
...
@@ -144,6 +144,13 @@ public class DistributionOrderVo implements Entity {
*/
private
String
stateName
;
/**
* 物流状态
*/
private
Integer
logisticsState
;
private
Integer
logisticsStateName
;
/**
* 商品单价
*/
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributorProfitServiceImpl.java
View file @
1d5445f6
...
...
@@ -54,7 +54,7 @@ public class DistributorProfitServiceImpl implements DistributorProfitService {
if
(
year
==
1
)
{
rebate
=
0.03
;
}
else
if
(
year
==
2
){
rebate
=
0.0
3
;
rebate
=
0.0
2
;
}
else
if
(
year
==
3
)
{
rebate
=
0.01
;
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/LogisticsServiceImpl.java
View file @
1d5445f6
...
...
@@ -9,7 +9,7 @@ import com.wwdz.ch.db.dao.distribution.DistributionOrderDao;
import
com.wwdz.ch.db.dao.distribution.IdentifyOrderDao
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.IdentifyOrder
;
import
com.wwdz.ch.
wx
.api.LogisticsApi
;
import
com.wwdz.ch.
core
.api.LogisticsApi
;
import
com.wwdz.ch.wx.service.distribution.LogisticsService
;
import
com.xxdxxs.utils.StringUtils
;
import
org.slf4j.Logger
;
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
1d5445f6
...
...
@@ -787,6 +787,11 @@ public class SupplierItemServiceImpl implements SupplierItemService {
logger
.
info
(
"用户id:{} 关注了 用户id为 {}, 介绍人为"
,
dto
.
getUserId
(),
collectionShareRecord
.
getItemUserId
(),
collectionShareRecord
.
getSharerId
());
}
}
//返回用户二维码
User
user
=
cacheUtil
.
appletUserInfoCache
.
get
(
supplierItem
.
getCreatorId
()).
get
();
if
(
user
!=
null
)
{
supplierItemVo
.
setWechatQrCode
(
user
.
getWechatQrCode
());
}
}
else
{
supplierItemVo
.
setIsMine
(
true
);
//查询收藏该商品的最新的五个用户
...
...
@@ -815,6 +820,12 @@ public class SupplierItemServiceImpl implements SupplierItemService {
//查询藏品被收藏的次数
long
countNum
=
itemCollectedRecordDao
.
countByItemId
(
itemId
);
supplierItemVo
.
setCollectedNum
((
int
)
countNum
);
//估算介绍佣金
double
rebate
=
0.03
;
double
introduceCost
=
supplierItem
.
getDistributionPrice
().
doubleValue
()
*
rebate
;
supplierItemVo
.
setIntroduceCost
(
PriceUtil
.
convertDoubleToString
(
introduceCost
));
supplierItemVo
.
setRebate
(
"3%"
);
//查询商品所属标签
List
<
CollectionItemsRelation
>
collectionItemsRelations
=
collectionItemsRelationDao
.
findByItemId
(
itemId
);
List
<
Long
>
collectBookIds
=
collectionItemsRelations
.
stream
().
map
(
CollectionItemsRelation:
:
getCollectionBookId
).
collect
(
Collectors
.
toList
());
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
View file @
1d5445f6
package
com.wwdz.ch.wx.api
;
import
com.wwdz.ch.core.api.LogisticsApi
;
import
com.wwdz.ch.core.entity.LogisticsRequestDto
;
import
com.wwdz.ch.core.type.Result
;
import
org.junit.Test
;
...
...
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