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
d71e4140
Commit
d71e4140
authored
Dec 19, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
寄售单流程修改
parent
f4af76be
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1070 additions
and
69 deletions
+1070
-69
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/ConsignSaleController.java
...a/com/wwdz/ch/admin/controller/ConsignSaleController.java
+38
-5
ch-admin-api/src/main/java/com/wwdz/ch/admin/entity/vo/ConsignSaleDetailVo.java
...java/com/wwdz/ch/admin/entity/vo/ConsignSaleDetailVo.java
+7
-0
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/ConsignSaleServiceImpl.java
...n/java/com/wwdz/ch/admin/impl/ConsignSaleServiceImpl.java
+94
-27
ch-admin-api/src/main/java/com/wwdz/ch/admin/service/ConsignSaleService.java
...in/java/com/wwdz/ch/admin/service/ConsignSaleService.java
+15
-2
ch-core/src/main/java/com/wwdz/ch/core/consts/ConsignSaleEnum.java
...rc/main/java/com/wwdz/ch/core/consts/ConsignSaleEnum.java
+46
-0
ch-core/src/main/resources/application-dev.yml
ch-core/src/main/resources/application-dev.yml
+1
-0
ch-core/src/main/resources/application-prod.yml
ch-core/src/main/resources/application-prod.yml
+1
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/ConsignSaleDao.java
ch-dao/src/main/java/com/wwdz/ch/db/dao/ConsignSaleDao.java
+17
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/ConsignSaleRecordDao.java
...rc/main/java/com/wwdz/ch/db/dao/ConsignSaleRecordDao.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/ConsignSale.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/ConsignSale.java
+28
-1
ch-dao/src/main/java/com/wwdz/ch/db/domain/ConsignSaleExample.java
...c/main/java/com/wwdz/ch/db/domain/ConsignSaleExample.java
+426
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserVo.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserVo.java
+6
-16
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/ConsignSaleRequestDto.java
...ava/com/wwdz/ch/db/dto/request/ConsignSaleRequestDto.java
+24
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/ConsignSaleDaoImpl.java
...src/main/java/com/wwdz/ch/db/impl/ConsignSaleDaoImpl.java
+22
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/ConsignSaleRecordDaoImpl.java
...in/java/com/wwdz/ch/db/impl/ConsignSaleRecordDaoImpl.java
+11
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/ConsignSaleMapper.xml
...ain/resources/com/wwdz/ch/db/mapper/ConsignSaleMapper.xml
+60
-9
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/AppletStateNodeVo.java
...main/java/com/wwdz/ch/wx/entity/vo/AppletStateNodeVo.java
+21
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/ConsignSaleAppletVo.java
...in/java/com/wwdz/ch/wx/entity/vo/ConsignSaleAppletVo.java
+74
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ConsignSaleServiceImpl.java
...main/java/com/wwdz/ch/wx/impl/ConsignSaleServiceImpl.java
+109
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/ConsignSaleService.java
.../main/java/com/wwdz/ch/wx/service/ConsignSaleService.java
+22
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/ConsignSaleController.java
...c/main/java/com/wwdz/ch/wx/web/ConsignSaleController.java
+43
-7
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/ConsignSaleController.java
View file @
d71e4140
...
...
@@ -73,6 +73,21 @@ public class ConsignSaleController {
}
@ApiOperation
(
value
=
"用户寄售商品确认签收"
)
@PostMapping
(
"/confirmReceive"
)
public
Result
confirmReceive
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】用户寄售商品确认签收,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"saleId"
,
"寄售单号"
).
must
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
.
getCode
(),
validator
.
getErrorInfo
());
}
return
consignSaleService
.
confirmReceive
(
dto
);
}
@ApiOperation
(
value
=
"实物鉴定"
)
@PostMapping
(
"/identify"
)
public
Result
identify
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
...
...
@@ -91,10 +106,11 @@ public class ConsignSaleController {
}
@ApiOperation
(
value
=
"完成寄售"
)
@PostMapping
(
"/finish"
)
public
Result
finish
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】完成寄售,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
@ApiOperation
(
value
=
"用户商品确认售出"
)
@PostMapping
(
"/finishSale"
)
public
Result
finishSale
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】用户商品确认售出,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"saleId"
,
"寄售单号"
).
must
().
string
()
.
set
(
"dealPrice"
,
"成交价格"
).
must
().
number
()
...
...
@@ -105,7 +121,24 @@ public class ConsignSaleController {
if
(
StringUtils
.
isEmpty
(
dto
.
getRemark
()))
{
return
Result
.
failed
(
"成交平台必填"
);
}
return
consignSaleService
.
finish
(
dto
);
return
consignSaleService
.
finishSale
(
dto
);
}
@ApiOperation
(
value
=
"完成用户结款,上传凭证"
)
@PostMapping
(
"/finishSettlement"
)
public
Result
finishSettlement
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】完成用户结款,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"saleId"
,
"寄售单号"
).
must
().
string
()
.
set
(
"credential"
,
"结款凭证"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
.
getCode
(),
validator
.
getErrorInfo
());
}
if
(
StringUtils
.
isEmpty
(
dto
.
getRemark
()))
{
return
Result
.
failed
(
"成交平台必填"
);
}
return
consignSaleService
.
finishSettlement
(
dto
);
}
...
...
ch-admin-api/src/main/java/com/wwdz/ch/admin/entity/vo/ConsignSaleDetailVo.java
View file @
d71e4140
package
com.wwdz.ch.admin.entity.vo
;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.UserVo
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.List
;
...
...
@@ -31,4 +33,9 @@ public class ConsignSaleDetailVo implements Entity {
* 寄售单信息
*/
private
List
<
ConsignSaleRecordVo
>
consignSaleRecordVoList
;
/**
* 发布人信息
*/
private
UserVo
userVo
;
}
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/ConsignSaleServiceImpl.java
View file @
d71e4140
...
...
@@ -12,13 +12,12 @@ import com.wwdz.ch.core.consts.ItemStateEnum;
import
com.wwdz.ch.core.entity.ConsignSaleVo
;
import
com.wwdz.ch.core.type.PageSearchResult
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.CacheUtil
;
import
com.wwdz.ch.core.util.MediaUtil
;
import
com.wwdz.ch.db.dao.ConsignSaleDao
;
import
com.wwdz.ch.db.dao.ConsignSaleRecordDao
;
import
com.wwdz.ch.db.dao.ItemDao
;
import
com.wwdz.ch.db.domain.ConsignSale
;
import
com.wwdz.ch.db.domain.ConsignSaleRecord
;
import
com.wwdz.ch.db.domain.Item
;
import
com.wwdz.ch.db.domain.*
;
import
com.wwdz.ch.db.dto.request.CoinRequestDto
;
import
com.wwdz.ch.db.dto.request.ConsignSaleRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.ConsignSaleRequestDto
;
...
...
@@ -28,6 +27,8 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -56,6 +57,9 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
@Autowired
ItemService
itemService
;
@Autowired
CacheUtil
cacheUtil
;
@Override
public
Result
findList
(
ConsignSaleRequestDto
dto
)
{
...
...
@@ -122,6 +126,13 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
if
(!
itemResult
.
getSuccess
())
{
return
itemResult
;
}
long
userId
=
consignSale
.
getUserId
();
User
user
=
cacheUtil
.
getAppletUsers
(
userId
);
UserVo
userVo
=
new
UserVo
();
userVo
.
setNickname
(
user
.
getNickname
());
userVo
.
setPhone
(
userVo
.
getPhone
());
consignSaleDetailVo
.
setUserVo
(
userVo
);
consignSaleDetailVo
.
setConsignSaledId
(
dto
.
getSaleId
());
consignSaleDetailVo
.
setSystemState
(
consignSale
.
getSystemState
());
consignSaleDetailVo
.
setSystemStateName
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
getNameByCode
(
consignSale
.
getSystemState
()));
...
...
@@ -152,12 +163,8 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
@Override
public
Result
imgValuate
(
ConsignSaleRequestDto
dto
)
{
try
{
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setImgValuation
(
dto
.
getImgValuation
());
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
IDENTIFY
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//插入操作记录
//估价完状态不变等待用户确认之后变更状态
//插入操作记录,图文估价
ConsignSaleRecord
consignSaleRecord
=
new
ConsignSaleRecord
();
consignSaleRecord
.
setSaleId
(
dto
.
getSaleId
());
consignSaleRecord
.
setCreateTime
(
new
Date
());
...
...
@@ -165,6 +172,16 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
consignSaleRecord
.
setRemark
(
dto
.
getRemark
());
consignSaleRecord
.
setType
(
ConsignSaleEnum
.
OperateTypeEnum
.
VALUATE
.
getCode
());
consignSaleRecordDao
.
insert
(
consignSaleRecord
);
//插入操作记录, 初步估价待用户确认
ConsignSaleRecord
waitConsignSaleRecord
=
new
ConsignSaleRecord
();
waitConsignSaleRecord
.
setSaleId
(
dto
.
getSaleId
());
waitConsignSaleRecord
.
setCreateTime
(
new
Date
());
waitConsignSaleRecord
.
setContent
(
"等待用户确认估价,超时默认用户不满意估价,取消寄售"
);
waitConsignSaleRecord
.
setRemark
(
dto
.
getRemark
());
waitConsignSaleRecord
.
setType
(
ConsignSaleEnum
.
OperateTypeEnum
.
WAIT_USER_CONFIRM_VALUATE
.
getCode
());
consignSaleRecordDao
.
insert
(
waitConsignSaleRecord
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"图文估价error:{}"
,
e
);
...
...
@@ -172,29 +189,45 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
return
Result
.
failed
();
}
@Override
public
Result
identify
(
ConsignSaleRequestDto
dto
)
{
public
Result
confirmReceive
(
ConsignSaleRequestDto
dto
)
{
try
{
//平台确认签收,前端状态改为已寄出,后台为实物鉴定
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setValuation
(
dto
.
getValuation
());
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
CONSIGN_SALEING
.
getCode
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
CONSIGNED
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
IDENTIFY
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//插入操作记录
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
""
,
ConsignSaleEnum
.
OperateTypeEnum
.
CONFIRM_RECEIVE
.
getCode
(),
null
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
info
(
"用户寄出商品 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
identify
(
ConsignSaleRequestDto
dto
)
{
try
{
//鉴定完状态不变等待用户确认之后变更状态
//插入操作记录,平台鉴定并估价
ConsignSaleRecord
consignSaleRecord
=
new
ConsignSaleRecord
();
consignSaleRecord
.
setSaleId
(
dto
.
getSaleId
());
consignSaleRecord
.
setCreateTime
(
new
Date
());
consignSaleRecord
.
setContent
(
"
实物鉴定
: "
+
dto
.
getValuation
()
+
" 元"
);
consignSaleRecord
.
setContent
(
"
建议寄售价
: "
+
dto
.
getValuation
()
+
" 元"
);
consignSaleRecord
.
setRemark
(
dto
.
getRemark
());
consignSaleRecord
.
setType
(
ConsignSaleEnum
.
OperateTypeEnum
.
IDENTIFY
.
getCode
());
consignSaleRecordDao
.
insert
(
consignSaleRecord
);
//平台寄售中
ConsignSaleRecord
saleRecord
=
new
ConsignSaleRecord
();
saleRecord
.
setSaleId
(
dto
.
getSaleId
());
saleRecord
.
setCreateTime
(
new
Date
());
saleRecord
.
setType
(
ConsignSaleEnum
.
OperateTypeEnum
.
SALEING
.
getCode
());
consignSaleRecordDao
.
insert
(
saleRecord
);
//插入操作记录, 建议寄售价待用户确认
ConsignSaleRecord
waitConsignSaleRecord
=
new
ConsignSaleRecord
();
waitConsignSaleRecord
.
setSaleId
(
dto
.
getSaleId
());
waitConsignSaleRecord
.
setCreateTime
(
new
Date
());
waitConsignSaleRecord
.
setContent
(
"等待用户确认价格,超时默认用户不满意价格,取消寄售"
);
waitConsignSaleRecord
.
setRemark
(
dto
.
getRemark
());
waitConsignSaleRecord
.
setType
(
ConsignSaleEnum
.
OperateTypeEnum
.
WAIT_USER_CONFIRM_IDENTIFY
.
getCode
());
consignSaleRecordDao
.
insert
(
waitConsignSaleRecord
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"实物鉴定 error:{}"
,
e
);
...
...
@@ -202,8 +235,9 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
return
Result
.
failed
();
}
@Transactional
@Override
public
Result
finish
(
ConsignSaleRequestDto
dto
)
{
public
Result
finish
Sale
(
ConsignSaleRequestDto
dto
)
{
try
{
ConsignSale
consignSaleInfo
=
consignSaleDao
.
findById
(
dto
.
getSaleId
());
long
itemId
=
consignSaleInfo
.
getItemId
();
...
...
@@ -211,27 +245,47 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setDealPrice
(
dto
.
getDealPrice
());
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
FINISH
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
FINISH
.
getCode
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
PRE_PAY
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
PRE_PAY
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//卖出后商品下架
itemDao
.
updateOnSale
(
itemId
,
ItemStateEnum
.
SALED
.
getCode
());
//插入操作记录
//插入操作记录
,货品售出待结款
ConsignSaleRecord
consignSaleRecord
=
new
ConsignSaleRecord
();
consignSaleRecord
.
setSaleId
(
dto
.
getSaleId
());
consignSaleRecord
.
setCreateTime
(
new
Date
());
consignSaleRecord
.
setContent
(
"成交金额: "
+
dto
.
getDealPrice
()
+
" 元"
);
consignSaleRecord
.
setRemark
(
"成交平台: "
+
(
dto
.
getRemark
()
==
null
?
""
:
dto
.
getRemark
()));
consignSaleRecord
.
setType
(
ConsignSaleEnum
.
OperateTypeEnum
.
FINISH
.
getCode
());
consignSaleRecord
.
setType
(
ConsignSaleEnum
.
OperateTypeEnum
.
SALED
.
getCode
());
consignSaleRecordDao
.
insert
(
consignSaleRecord
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"实物鉴定 error:{}"
,
e
);
logger
.
error
(
"货品确认售出 error:{}"
,
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
return
Result
.
failed
();
}
@Override
public
Result
finishSettlement
(
ConsignSaleRequestDto
dto
)
{
try
{
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setDealPrice
(
dto
.
getDealPrice
());
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
FINISH
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
FINISH
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//插入操作记录,完成结款
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
"完成结款"
,
ConsignSaleEnum
.
OperateTypeEnum
.
FINISH
.
getCode
(),
null
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"完成结款 error:{}"
,
e
);
}
return
Result
.
failed
();
}
@Transactional
@Override
public
Result
cancel
(
ConsignSaleRecordRequestDto
dto
)
{
try
{
...
...
@@ -256,8 +310,21 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
consignSaleRecordDao
.
insert
(
consignSaleRecord
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"取消寄售单error : {}"
,
e
);
logger
.
error
(
"平台取消寄售单 error : {}"
,
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
return
Result
.
failed
();
}
/**
* 用户确认超时默认取消寄售
* 检查处于图文鉴定和实物鉴定状态的订单,用户是否超出24小时确认的时间范围
*/
private
void
checkTimeOutForCancel
(){
//查询图文估计待用户确认的订单
ConsignSaleRequestDto
consignSaleRequestDto
=
new
ConsignSaleRequestDto
();
consignSaleRequestDto
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
WAIT_IMG_VALUATE
.
getCode
());
List
<
ConsignSale
>
list
=
consignSaleDao
.
findImgValuateConfirmOrdersByPage
(
consignSaleRequestDto
);
}
}
ch-admin-api/src/main/java/com/wwdz/ch/admin/service/ConsignSaleService.java
View file @
d71e4140
...
...
@@ -28,6 +28,12 @@ public interface ConsignSaleService {
*/
Result
imgValuate
(
ConsignSaleRequestDto
dto
);
/**
* 用户寄售商品确认签收
* @param dto
* @return
*/
Result
confirmReceive
(
ConsignSaleRequestDto
dto
);
/**
* 实物鉴定
...
...
@@ -37,11 +43,18 @@ public interface ConsignSaleService {
Result
identify
(
ConsignSaleRequestDto
dto
);
/**
* 完成寄售
* 货品售出
* @param dto
* @return
*/
Result
finishSale
(
ConsignSaleRequestDto
dto
);
/**
* 完成结款,上传凭证
* @param dto
* @return
*/
Result
finish
(
ConsignSaleRequestDto
dto
);
Result
finish
Settlement
(
ConsignSaleRequestDto
dto
);
/**
* 取消寄售
...
...
ch-core/src/main/java/com/wwdz/ch/core/consts/ConsignSaleEnum.java
View file @
d71e4140
...
...
@@ -132,4 +132,50 @@ public class ConsignSaleEnum {
}
public
enum
AppletNodeDescEnum
{
CREATE_ORDER
(
"下单成功"
,
""
,
"0"
),
VALUATE
(
"平台依据图文估价"
,
"等待平台进行初步估价,一般在2小时以内完成。"
,
"10,15,20,23"
),
SEND
(
"送货至平台"
,
""
,
"30"
),
IDENTIFY
(
"平台实物鉴定并定价"
,
"平台签收后,会在1~3天完成货品的鉴定和估价"
,
"40,50,53,60"
),
CONSIGN_SALEING
(
"平台寄售中"
,
""
,
"70"
),
PRE_PAY
(
"货品售出,待结款"
,
"货品售出后,平台会在20天内完成打款。如果实际的售出价低于预估价,则会在售出后由客服通知您具体情况。"
,
"80"
),
FINISH_PAT
(
"平台完成结款"
,
""
,
"90"
),
CANCEL
(
"取消寄售"
,
""
,
"100,101"
),
;
private
String
node
;
private
String
des
;
private
String
targetOperateType
;
AppletNodeDescEnum
(
String
node
,
String
des
,
String
targetOperateType
)
{
this
.
node
=
node
;
this
.
des
=
des
;
this
.
targetOperateType
=
targetOperateType
;
}
public
static
ConsignSaleEnum
.
AppletNodeDescEnum
getNameByCode
(
String
targetOperateType
)
{
for
(
ConsignSaleEnum
.
AppletNodeDescEnum
appletNodeDescEnum
:
ConsignSaleEnum
.
AppletNodeDescEnum
.
values
())
{
if
(
appletNodeDescEnum
.
getTargetOperateType
().
contains
(
targetOperateType
))
{
return
appletNodeDescEnum
;
}
}
return
null
;
}
public
String
getNode
()
{
return
node
;
}
public
String
getDes
()
{
return
des
;
}
public
String
getTargetOperateType
()
{
return
targetOperateType
;
}
}
}
ch-core/src/main/resources/application-dev.yml
View file @
d71e4140
...
...
@@ -21,6 +21,7 @@ dts:
officialaccount-token
:
Uu6GHYOiP1xJ6GaBMyXfnITufAGJTe3Q
officialaccount-key
:
noeN1amYRvzrVmE2GnC5VnsIfgPEmv6bhX54wJOARlM
get-officialaccount-accesstoken-url
:
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s
officialaccount-templetId
:
WJkhzyY0_7AYqh19_ujK9yZhj4HohF8ETJvG5NYA9A8
#腾讯IM配置
im
:
...
...
ch-core/src/main/resources/application-prod.yml
View file @
d71e4140
...
...
@@ -20,6 +20,7 @@ dts:
officialaccount-token
:
Uu6GHYOiP1xJ6GaBMyXfnITufAGJTe3Q
officialaccount-key
:
noeN1amYRvzrVmE2GnC5VnsIfgPEmv6bhX54wJOARlM
get-officialaccount-accesstoken-url
:
https://api.weixin.qq.com/cgi-bin/stable_token
officialaccount-templetId
:
WJkhzyY0_7AYqh19_ujK9yZhj4HohF8ETJvG5NYA9A8
#腾讯IM配置
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dao/ConsignSaleDao.java
View file @
d71e4140
...
...
@@ -40,4 +40,21 @@ public interface ConsignSaleDao {
* @return
*/
List
<
ConsignSale
>
findByPage
(
ConsignSaleRequestDto
dto
);
/**
* 查询图文鉴定状态待用户确认的寄售单
* @param dto
* @return
*/
List
<
ConsignSale
>
findImgValuateConfirmOrdersByPage
(
ConsignSaleRequestDto
dto
);
/**
* 查询实物鉴定状态待用户确认的寄售单
* @param dto
* @return
*/
List
<
ConsignSale
>
findValuateConfirmOrdersByPage
(
ConsignSaleRequestDto
dto
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/ConsignSaleRecordDao.java
View file @
d71e4140
...
...
@@ -16,6 +16,11 @@ public interface ConsignSaleRecordDao {
int
insert
(
String
saleId
,
String
content
,
int
type
,
String
remark
);
/**
* 查询记录
* @param saleId
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/ConsignSale.java
View file @
d71e4140
...
...
@@ -10,7 +10,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2023/1
1/2
8
* @date 2023/1
2/1
8
*/
@Data
public
class
ConsignSale
implements
Entity
{
...
...
@@ -66,6 +66,21 @@ public class ConsignSale implements Entity {
*/
private
Integer
systemState
;
/**
* 快递公司编码
*/
private
String
logisticsCode
;
/**
* 运单号
*/
private
String
waybill
;
/**
* 结款凭证
*/
private
String
credential
;
/**
* 创建时间
*/
...
...
@@ -95,6 +110,9 @@ public class ConsignSale implements Entity {
sb
.
append
(
", dealPrice="
).
append
(
dealPrice
);
sb
.
append
(
", customState="
).
append
(
customState
);
sb
.
append
(
", systemState="
).
append
(
systemState
);
sb
.
append
(
", logisticsCode="
).
append
(
logisticsCode
);
sb
.
append
(
", waybill="
).
append
(
waybill
);
sb
.
append
(
", credential="
).
append
(
credential
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
...
...
@@ -125,6 +143,9 @@ public class ConsignSale implements Entity {
&&
(
this
.
getDealPrice
()
==
null
?
other
.
getDealPrice
()
==
null
:
this
.
getDealPrice
().
equals
(
other
.
getDealPrice
()))
&&
(
this
.
getCustomState
()
==
null
?
other
.
getCustomState
()
==
null
:
this
.
getCustomState
().
equals
(
other
.
getCustomState
()))
&&
(
this
.
getSystemState
()
==
null
?
other
.
getSystemState
()
==
null
:
this
.
getSystemState
().
equals
(
other
.
getSystemState
()))
&&
(
this
.
getLogisticsCode
()
==
null
?
other
.
getLogisticsCode
()
==
null
:
this
.
getLogisticsCode
().
equals
(
other
.
getLogisticsCode
()))
&&
(
this
.
getWaybill
()
==
null
?
other
.
getWaybill
()
==
null
:
this
.
getWaybill
().
equals
(
other
.
getWaybill
()))
&&
(
this
.
getCredential
()
==
null
?
other
.
getCredential
()
==
null
:
this
.
getCredential
().
equals
(
other
.
getCredential
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()));
}
...
...
@@ -144,6 +165,9 @@ public class ConsignSale implements Entity {
result
=
prime
*
result
+
((
getDealPrice
()
==
null
)
?
0
:
getDealPrice
().
hashCode
());
result
=
prime
*
result
+
((
getCustomState
()
==
null
)
?
0
:
getCustomState
().
hashCode
());
result
=
prime
*
result
+
((
getSystemState
()
==
null
)
?
0
:
getSystemState
().
hashCode
());
result
=
prime
*
result
+
((
getLogisticsCode
()
==
null
)
?
0
:
getLogisticsCode
().
hashCode
());
result
=
prime
*
result
+
((
getWaybill
()
==
null
)
?
0
:
getWaybill
().
hashCode
());
result
=
prime
*
result
+
((
getCredential
()
==
null
)
?
0
:
getCredential
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
return
result
;
...
...
@@ -168,6 +192,9 @@ public class ConsignSale implements Entity {
dealPrice
(
"deal_price"
,
"dealPrice"
,
"INTEGER"
,
false
),
customState
(
"custom_state"
,
"customState"
,
"INTEGER"
,
false
),
systemState
(
"system_state"
,
"systemState"
,
"INTEGER"
,
false
),
logisticsCode
(
"logistics_code"
,
"logisticsCode"
,
"VARCHAR"
,
false
),
waybill
(
"waybill"
,
"waybill"
,
"VARCHAR"
,
false
),
credential
(
"credential"
,
"credential"
,
"VARCHAR"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/ConsignSaleExample.java
View file @
d71e4140
...
...
@@ -1620,6 +1620,432 @@ public class ConsignSaleExample {
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeIsNull
()
{
addCriterion
(
"logistics_code is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeIsNotNull
()
{
addCriterion
(
"logistics_code is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeEqualTo
(
String
value
)
{
addCriterion
(
"logistics_code ="
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLogisticsCodeEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_code = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeNotEqualTo
(
String
value
)
{
addCriterion
(
"logistics_code <>"
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLogisticsCodeNotEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_code <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeGreaterThan
(
String
value
)
{
addCriterion
(
"logistics_code >"
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLogisticsCodeGreaterThanColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_code > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"logistics_code >="
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLogisticsCodeGreaterThanOrEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_code >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeLessThan
(
String
value
)
{
addCriterion
(
"logistics_code <"
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLogisticsCodeLessThanColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_code < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"logistics_code <="
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLogisticsCodeLessThanOrEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"logistics_code <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeLike
(
String
value
)
{
addCriterion
(
"logistics_code like"
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeNotLike
(
String
value
)
{
addCriterion
(
"logistics_code not like"
,
value
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeIn
(
List
<
String
>
values
)
{
addCriterion
(
"logistics_code in"
,
values
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"logistics_code not in"
,
values
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"logistics_code between"
,
value1
,
value2
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLogisticsCodeNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"logistics_code not between"
,
value1
,
value2
,
"logisticsCode"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillIsNull
()
{
addCriterion
(
"waybill is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillIsNotNull
()
{
addCriterion
(
"waybill is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillEqualTo
(
String
value
)
{
addCriterion
(
"waybill ="
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andWaybillEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"waybill = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillNotEqualTo
(
String
value
)
{
addCriterion
(
"waybill <>"
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andWaybillNotEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"waybill <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillGreaterThan
(
String
value
)
{
addCriterion
(
"waybill >"
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andWaybillGreaterThanColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"waybill > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"waybill >="
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andWaybillGreaterThanOrEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"waybill >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillLessThan
(
String
value
)
{
addCriterion
(
"waybill <"
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andWaybillLessThanColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"waybill < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"waybill <="
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andWaybillLessThanOrEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"waybill <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillLike
(
String
value
)
{
addCriterion
(
"waybill like"
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillNotLike
(
String
value
)
{
addCriterion
(
"waybill not like"
,
value
,
"waybill"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillIn
(
List
<
String
>
values
)
{
addCriterion
(
"waybill in"
,
values
,
"waybill"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"waybill not in"
,
values
,
"waybill"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"waybill between"
,
value1
,
value2
,
"waybill"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWaybillNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"waybill not between"
,
value1
,
value2
,
"waybill"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialIsNull
()
{
addCriterion
(
"credential is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialIsNotNull
()
{
addCriterion
(
"credential is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialEqualTo
(
String
value
)
{
addCriterion
(
"credential ="
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCredentialEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"credential = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialNotEqualTo
(
String
value
)
{
addCriterion
(
"credential <>"
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCredentialNotEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"credential <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialGreaterThan
(
String
value
)
{
addCriterion
(
"credential >"
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCredentialGreaterThanColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"credential > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"credential >="
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCredentialGreaterThanOrEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"credential >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialLessThan
(
String
value
)
{
addCriterion
(
"credential <"
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCredentialLessThanColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"credential < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"credential <="
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCredentialLessThanOrEqualToColumn
(
ConsignSale
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"credential <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialLike
(
String
value
)
{
addCriterion
(
"credential like"
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialNotLike
(
String
value
)
{
addCriterion
(
"credential not like"
,
value
,
"credential"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialIn
(
List
<
String
>
values
)
{
addCriterion
(
"credential in"
,
values
,
"credential"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"credential not in"
,
values
,
"credential"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"credential between"
,
value1
,
value2
,
"credential"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCredentialNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"credential not between"
,
value1
,
value2
,
"credential"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserVo.java
View file @
d71e4140
package
com.wwdz.ch.db.domain
;
public
class
UserVo
{
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
@Data
public
class
UserVo
implements
Entity
{
private
String
nickname
;
private
String
avatar
;
private
String
phone
;
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/ConsignSaleRequestDto.java
View file @
d71e4140
...
...
@@ -73,6 +73,11 @@ public class ConsignSaleRequestDto extends BaseRequestDto implements Entity {
*/
private
Integer
systemState
;
/**
* 系统状态
*/
private
List
<
Integer
>
systemStateList
;
/**
* 创建时间
*/
...
...
@@ -85,4 +90,23 @@ public class ConsignSaleRequestDto extends BaseRequestDto implements Entity {
private
String
remark
;
/**
* 快递公司编码
*/
private
String
logisticsCode
;
/**
* 运单号
*/
private
String
waybill
;
/**
* 用户是否同意寄售
*/
private
Boolean
agree
;
/**
* 结款凭证
*/
private
String
credential
;
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/ConsignSaleDaoImpl.java
View file @
d71e4140
...
...
@@ -68,5 +68,27 @@ public class ConsignSaleDaoImpl implements ConsignSaleDao {
}
@Override
public
List
<
ConsignSale
>
findImgValuateConfirmOrdersByPage
(
ConsignSaleRequestDto
dto
)
{
ConsignSaleExample
example
=
new
ConsignSaleExample
();
ConsignSaleExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getUserId
(),
criteria:
:
andUserIdEqualTo
);
criteria
.
andSystemStateEqualTo
(
dto
.
getSystemState
());
criteria
.
andImgValuationIsNotNull
();
example
.
orderBy
(
" sale_time asc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
consignSaleMapper
.
selectByExample
(
example
);
}
@Override
public
List
<
ConsignSale
>
findValuateConfirmOrdersByPage
(
ConsignSaleRequestDto
dto
)
{
ConsignSaleExample
example
=
new
ConsignSaleExample
();
ConsignSaleExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getUserId
(),
criteria:
:
andUserIdEqualTo
);
criteria
.
andSystemStateEqualTo
(
dto
.
getSystemState
());
criteria
.
andImgValuationIsNotNull
();
example
.
orderBy
(
" sale_time asc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
consignSaleMapper
.
selectByExample
(
example
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/ConsignSaleRecordDaoImpl.java
View file @
d71e4140
...
...
@@ -14,6 +14,7 @@ import com.xxdxxs.db.component.JdbcHelper;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
@Repository
...
...
@@ -28,6 +29,16 @@ public class ConsignSaleRecordDaoImpl implements ConsignSaleRecordDao {
}
@Override
public
int
insert
(
String
saleId
,
String
content
,
int
type
,
String
remark
)
{
ConsignSaleRecord
cancelConsignSaleRecord
=
new
ConsignSaleRecord
();
cancelConsignSaleRecord
.
setSaleId
(
saleId
);
cancelConsignSaleRecord
.
setCreateTime
(
new
Date
());
cancelConsignSaleRecord
.
setContent
(
content
);
cancelConsignSaleRecord
.
setType
(
type
);
return
consignSaleRecordMapper
.
insert
(
cancelConsignSaleRecord
);
}
@Override
public
List
<
ConsignSaleRecord
>
find
(
String
saleId
)
{
ConsignSaleRecordExample
example
=
new
ConsignSaleRecordExample
();
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/ConsignSaleMapper.xml
View file @
d71e4140
...
...
@@ -13,6 +13,9 @@
<result
column=
"deal_price"
jdbcType=
"INTEGER"
property=
"dealPrice"
/>
<result
column=
"custom_state"
jdbcType=
"INTEGER"
property=
"customState"
/>
<result
column=
"system_state"
jdbcType=
"INTEGER"
property=
"systemState"
/>
<result
column=
"logistics_code"
jdbcType=
"VARCHAR"
property=
"logisticsCode"
/>
<result
column=
"waybill"
jdbcType=
"VARCHAR"
property=
"waybill"
/>
<result
column=
"credential"
jdbcType=
"VARCHAR"
property=
"credential"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
...
...
@@ -76,7 +79,7 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
custom_state, system_state, create_time, update_time
custom_state, system_state,
logistics_code, waybill, credential,
create_time, update_time
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.ConsignSaleExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -105,14 +108,15 @@
distinct
</if>
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
custom_state, system_state, create_time, update_time
custom_state, system_state, logistics_code, waybill, credential, create_time, update_time
</otherwise>
</choose>
from consign_sale
...
...
@@ -137,14 +141,15 @@
-->
select
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
custom_state, system_state, create_time, update_time
custom_state, system_state, logistics_code, waybill, credential, create_time, update_time
</otherwise>
</choose>
from consign_sale
...
...
@@ -167,12 +172,14 @@
insert into consign_sale (sale_id, item_id, user_id,
sale_time, user_price, img_valuation,
valuation, deal_price, custom_state,
system_state, create_time, update_time
system_state, logistics_code, waybill,
credential, create_time, update_time
)
values (#{saleId,jdbcType=VARCHAR}, #{itemId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{saleTime,jdbcType=TIMESTAMP}, #{userPrice,jdbcType=INTEGER}, #{imgValuation,jdbcType=VARCHAR},
#{valuation,jdbcType=INTEGER}, #{dealPrice,jdbcType=INTEGER}, #{customState,jdbcType=INTEGER},
#{systemState,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
#{systemState,jdbcType=INTEGER}, #{logisticsCode,jdbcType=VARCHAR}, #{waybill,jdbcType=VARCHAR},
#{credential,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.ConsignSale"
>
...
...
@@ -211,6 +218,15 @@
<if
test=
"systemState != null"
>
system_state,
</if>
<if
test=
"logisticsCode != null"
>
logistics_code,
</if>
<if
test=
"waybill != null"
>
waybill,
</if>
<if
test=
"credential != null"
>
credential,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -249,6 +265,15 @@
<if
test=
"systemState != null"
>
#{systemState,jdbcType=INTEGER},
</if>
<if
test=
"logisticsCode != null"
>
#{logisticsCode,jdbcType=VARCHAR},
</if>
<if
test=
"waybill != null"
>
#{waybill,jdbcType=VARCHAR},
</if>
<if
test=
"credential != null"
>
#{credential,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -299,6 +324,15 @@
<if
test=
"record.systemState != null"
>
system_state = #{record.systemState,jdbcType=INTEGER},
</if>
<if
test=
"record.logisticsCode != null"
>
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
</if>
<if
test=
"record.waybill != null"
>
waybill = #{record.waybill,jdbcType=VARCHAR},
</if>
<if
test=
"record.credential != null"
>
credential = #{record.credential,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -323,6 +357,9 @@
deal_price = #{record.dealPrice,jdbcType=INTEGER},
custom_state = #{record.customState,jdbcType=INTEGER},
system_state = #{record.systemState,jdbcType=INTEGER},
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
waybill = #{record.waybill,jdbcType=VARCHAR},
credential = #{record.credential,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
...
...
@@ -362,6 +399,15 @@
<if
test=
"systemState != null"
>
system_state = #{systemState,jdbcType=INTEGER},
</if>
<if
test=
"logisticsCode != null"
>
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
</if>
<if
test=
"waybill != null"
>
waybill = #{waybill,jdbcType=VARCHAR},
</if>
<if
test=
"credential != null"
>
credential = #{credential,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -383,6 +429,9 @@
deal_price = #{dealPrice,jdbcType=INTEGER},
custom_state = #{customState,jdbcType=INTEGER},
system_state = #{systemState,jdbcType=INTEGER},
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
waybill = #{waybill,jdbcType=VARCHAR},
credential = #{credential,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
...
...
@@ -414,14 +463,15 @@
select
'true' as QUERYID,
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
custom_state, system_state, create_time, update_time
custom_state, system_state, logistics_code, waybill, credential, create_time, update_time
</otherwise>
</choose>
from consign_sale
...
...
@@ -433,4 +483,5 @@
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/AppletStateNodeVo.java
0 → 100644
View file @
d71e4140
package
com.wwdz.ch.wx.entity.vo
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 小程序展示寄售单节点时间线
*/
@Data
public
class
AppletStateNodeVo
implements
Entity
{
private
String
node
;
private
String
desc
;
private
Date
time
;
private
Boolean
passed
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/ConsignSaleAppletVo.java
0 → 100644
View file @
d71e4140
package
com.wwdz.ch.wx.entity.vo
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
ConsignSaleAppletVo
implements
Entity
{
/**
* 商品图片
*/
private
String
image
;
/**
* 商品id
*/
private
String
itemId
;
/**
* 商品名称
*/
private
String
name
;
/**
* 寄售单号
*/
private
String
saleId
;
/**
* 下单时间
*/
private
Date
saleTime
;
/**
* 寄出时间
*/
private
Date
sendTime
;
/**
* 送货方式:自行寄出
*/
private
String
sendType
;
/**
* 物流公司
*/
private
String
logisticsCode
;
/**
* 物流公司名称
*/
private
String
logisticsName
;
/**
* 快递单号
*/
private
String
waybill
;
/**
* 完成时间
*/
private
Date
finishTime
;
/**
* 寄售单状态时间线
*/
private
List
<
AppletStateNodeVo
>
nodeVoList
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ConsignSaleServiceImpl.java
View file @
d71e4140
...
...
@@ -20,6 +20,7 @@ import com.wwdz.ch.db.domain.Item;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.dto.request.CoinRequestDto
;
import
com.wwdz.ch.db.dto.request.ConsignSaleRequestDto
;
import
com.wwdz.ch.wx.entity.vo.AppletStateNodeVo
;
import
com.wwdz.ch.wx.service.ConsignSaleService
;
import
com.wwdz.user.api.service.user.UserReadService
;
import
com.xxdxxs.utils.EntityMapper
;
...
...
@@ -78,8 +79,8 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
consignSale
.
setCreateTime
(
now
);
consignSale
.
setUpdateTime
(
now
);
//
目前创建了寄售单客户显示的状态就是寄售中
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
CONSIGN_SALEING
.
getCode
());
//
创建了寄售单客户显示的状态是待寄出
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
PRE_CONSIGN
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
WAIT_IMG_VALUATE
.
getCode
());
String
saleId
=
IdUtils
.
getOrderNumber
(
CONSIGN_SALE_ORDER_PREFIX
);
consignSale
.
setSaleId
(
saleId
);
...
...
@@ -177,9 +178,115 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
@Override
public
Result
findDetail
(
ConsignSaleRequestDto
dto
)
{
String
saleId
=
dto
.
getSaleId
();
List
<
ConsignSaleRecord
>
consignSaleRecordList
=
consignSaleRecordDao
.
find
(
saleId
);
consignSaleRecordList
.
forEach
(
consignSaleRecord
->
{
AppletStateNodeVo
appletStateNodeVo
=
new
AppletStateNodeVo
();
});
return
null
;
}
@Override
public
Result
confirmForImgValuate
(
ConsignSaleRequestDto
dto
)
{
try
{
//满意初步估价
if
(
dto
.
getAgree
())
{
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
PRE_CONSIGN
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
WAIT_CONSIGN
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//插入操作记录,用户满意初步估价
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
"满意,继续寄售"
,
ConsignSaleEnum
.
OperateTypeEnum
.
USER_CONFIRM_VALUATE
.
getCode
(),
null
);
//插入操作记录,待用户寄出
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
""
,
ConsignSaleEnum
.
OperateTypeEnum
.
WAIT_USER_SEND
.
getCode
(),
null
);
}
else
{
//不满意初步估价,取消寄售
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
CANCEL
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
CANCEL
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//商品下架
itemDao
.
updateOnSale
(
dto
.
getItemId
(),
ItemStateEnum
.
SHELVE
.
getCode
());
//插入操作记录,用户不满意初步估价
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
"不满意,取消寄售"
,
ConsignSaleEnum
.
OperateTypeEnum
.
USER_CONFIRM_VALUATE
.
getCode
(),
null
);
//插入操作记录,用户主动取消
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
"用户主动取消"
,
ConsignSaleEnum
.
OperateTypeEnum
.
CUSTOM_CANCEL
.
getCode
(),
null
);
}
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
info
(
"图文鉴定后用户确认 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
userSend
(
ConsignSaleRequestDto
dto
)
{
try
{
//用户寄出商品,状态改为已寄出,后台为待收货
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
CONSIGNED
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
WAIT_TAKE
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//插入操作记录,平台待收货
StringBuffer
stringBuffer
=
new
StringBuffer
();
stringBuffer
.
append
(
"物流公司:"
);
stringBuffer
.
append
(
dto
.
getLogisticsCode
()
+
"; "
);
stringBuffer
.
append
(
"快递单号:"
);
stringBuffer
.
append
(
dto
.
getWaybill
());
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
stringBuffer
.
toString
(),
ConsignSaleEnum
.
OperateTypeEnum
.
USER_SEND
.
getCode
(),
null
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
info
(
"用户寄出商品 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
confirmForIdentify
(
ConsignSaleRequestDto
dto
)
{
try
{
//满意建议零售价估价
if
(
dto
.
getAgree
())
{
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
CONSIGN_SALEING
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
CONSIGN_SALEING
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//插入操作记录,用户满意建议零售价
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
"满意,继续寄售"
,
ConsignSaleEnum
.
OperateTypeEnum
.
USER_CONFIRM_IDENTIFY
.
getCode
(),
null
);
//插入操作记录,待用户寄出
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
""
,
ConsignSaleEnum
.
OperateTypeEnum
.
SALEING
.
getCode
(),
null
);
}
else
{
//不满意建议零售价,取消寄售
ConsignSale
consignSale
=
new
ConsignSale
();
consignSale
.
setSaleId
(
dto
.
getSaleId
());
consignSale
.
setCustomState
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
CANCEL
.
getCode
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
CANCEL
.
getCode
());
consignSaleDao
.
update
(
consignSale
);
//商品下架
itemDao
.
updateOnSale
(
dto
.
getItemId
(),
ItemStateEnum
.
SHELVE
.
getCode
());
//插入操作记录,用户不满意建议零售价
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
"不满意,取消寄售"
,
ConsignSaleEnum
.
OperateTypeEnum
.
USER_CONFIRM_IDENTIFY
.
getCode
(),
null
);
//插入操作记录,用户主动取消
consignSaleRecordDao
.
insert
(
dto
.
getSaleId
(),
"用户主动取消"
,
ConsignSaleEnum
.
OperateTypeEnum
.
CUSTOM_CANCEL
.
getCode
(),
null
);
}
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
info
(
"图文鉴定后用户确认 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
customCancel
(
ConsignSaleRequestDto
dto
)
{
try
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/ConsignSaleService.java
View file @
d71e4140
...
...
@@ -37,6 +37,28 @@ public interface ConsignSaleService {
Result
findDetail
(
ConsignSaleRequestDto
dto
);
/**
* 图文鉴定后用户确认
* @param dto
* @return
*/
Result
confirmForImgValuate
(
ConsignSaleRequestDto
dto
);
/**
* 用户寄出商品
* @param dto
* @return
*/
Result
userSend
(
ConsignSaleRequestDto
dto
);
/**
* 实物鉴定后用户确认
* @param dto
* @return
*/
Result
confirmForIdentify
(
ConsignSaleRequestDto
dto
);
/**
* 客户取消寄售
* @param dto
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/ConsignSaleController.java
View file @
d71e4140
...
...
@@ -3,27 +3,23 @@ package com.wwdz.ch.wx.web;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.domain.ConsignSale
;
import
com.wwdz.ch.db.dto.request.AiAssistantRequestDto
;
import
com.wwdz.ch.db.dto.request.ConsignSaleRequestDto
;
import
com.wwdz.ch.wx.entity.request.ItemRequestDto
;
import
com.wwdz.ch.wx.service.ConsignSaleService
;
import
com.wwdz.ch.wx.service.ItemService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.utils.StringUtils
;
import
com.xxdxxs.validation.Validator
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
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
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
/**
* 寄售单
...
...
@@ -56,7 +52,7 @@ public class ConsignSaleController {
return
Result
.
failed
(
"请至少上传一张图片"
);
}
//先发布商品
dto
.
setPrice
(
StringUtils
.
is
Blank
(
dto
.
getPrice
())
?
"0"
:
dto
.
getPrice
());
dto
.
setPrice
(
StringUtils
.
is
Empty
(
dto
.
getPrice
())
?
"0"
:
dto
.
getPrice
());
dto
.
setIsOnSale
(
true
);
Result
addItemResult
=
itemService
.
add
(
dto
);
if
(!
addItemResult
.
getSuccess
())
{
...
...
@@ -108,6 +104,46 @@ public class ConsignSaleController {
}
@ApiOperation
(
value
=
"图文鉴定后用户确认"
)
@PostMapping
(
"/confirmForImgValuate"
)
public
Result
confirmForImgValuate
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】图文鉴定后用户确认,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
StringUtils
.
isEmpty
(
dto
.
getSaleId
())
||
StringUtils
.
isEmpty
(
dto
.
getItemId
())
||
ObjectUtils
.
isEmpty
(
dto
.
getAgree
()))
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
.
getMessage
());
}
return
consignSaleService
.
confirmForImgValuate
(
dto
);
}
@ApiOperation
(
value
=
"用户寄出商品"
)
@PostMapping
(
"/userSend"
)
public
Result
userSend
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】用户寄出商品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"logisticsCode"
,
"快递公司编码"
).
must
().
string
()
.
set
(
"waybill"
,
"运单号"
).
must
().
string
()
.
set
(
"saleId"
,
"寄售单号"
).
must
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
.
getCode
(),
validator
.
getErrorInfo
());
}
return
consignSaleService
.
userSend
(
dto
);
}
@ApiOperation
(
value
=
"实物鉴定后用户确认"
)
@PostMapping
(
"/confirmForIdentify"
)
public
Result
confirmForIdentify
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】实物鉴定后用户确认,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
StringUtils
.
isEmpty
(
dto
.
getSaleId
())
||
StringUtils
.
isEmpty
(
dto
.
getItemId
())||
ObjectUtils
.
isEmpty
(
dto
.
getAgree
()))
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
.
getMessage
());
}
return
consignSaleService
.
confirmForIdentify
(
dto
);
}
@ApiOperation
(
value
=
"用户取消寄售单"
)
@PostMapping
(
"/cancel"
)
public
Result
cancel
(
@RequestBody
ConsignSaleRequestDto
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