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
Expand all
Hide 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 {
...
@@ -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
=
"实物鉴定"
)
@ApiOperation
(
value
=
"实物鉴定"
)
@PostMapping
(
"/identify"
)
@PostMapping
(
"/identify"
)
public
Result
identify
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
public
Result
identify
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
...
@@ -91,10 +106,11 @@ public class ConsignSaleController {
...
@@ -91,10 +106,11 @@ public class ConsignSaleController {
}
}
@ApiOperation
(
value
=
"完成寄售"
)
@PostMapping
(
"/finish"
)
@ApiOperation
(
value
=
"用户商品确认售出"
)
public
Result
finish
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
@PostMapping
(
"/finishSale"
)
logger
.
info
(
"【请求开始】完成寄售,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
public
Result
finishSale
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
logger
.
info
(
"【请求开始】用户商品确认售出,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"saleId"
,
"寄售单号"
).
must
().
string
()
validator
.
set
(
"saleId"
,
"寄售单号"
).
must
().
string
()
.
set
(
"dealPrice"
,
"成交价格"
).
must
().
number
()
.
set
(
"dealPrice"
,
"成交价格"
).
must
().
number
()
...
@@ -105,7 +121,24 @@ public class ConsignSaleController {
...
@@ -105,7 +121,24 @@ public class ConsignSaleController {
if
(
StringUtils
.
isEmpty
(
dto
.
getRemark
()))
{
if
(
StringUtils
.
isEmpty
(
dto
.
getRemark
()))
{
return
Result
.
failed
(
"成交平台必填"
);
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
;
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
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.List
;
...
@@ -31,4 +33,9 @@ public class ConsignSaleDetailVo implements Entity {
...
@@ -31,4 +33,9 @@ public class ConsignSaleDetailVo implements Entity {
* 寄售单信息
* 寄售单信息
*/
*/
private
List
<
ConsignSaleRecordVo
>
consignSaleRecordVoList
;
private
List
<
ConsignSaleRecordVo
>
consignSaleRecordVoList
;
/**
* 发布人信息
*/
private
UserVo
userVo
;
}
}
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/ConsignSaleServiceImpl.java
View file @
d71e4140
This diff is collapsed.
Click to expand it.
ch-admin-api/src/main/java/com/wwdz/ch/admin/service/ConsignSaleService.java
View file @
d71e4140
...
@@ -28,6 +28,12 @@ public interface ConsignSaleService {
...
@@ -28,6 +28,12 @@ public interface ConsignSaleService {
*/
*/
Result
imgValuate
(
ConsignSaleRequestDto
dto
);
Result
imgValuate
(
ConsignSaleRequestDto
dto
);
/**
* 用户寄售商品确认签收
* @param dto
* @return
*/
Result
confirmReceive
(
ConsignSaleRequestDto
dto
);
/**
/**
* 实物鉴定
* 实物鉴定
...
@@ -37,11 +43,18 @@ public interface ConsignSaleService {
...
@@ -37,11 +43,18 @@ public interface ConsignSaleService {
Result
identify
(
ConsignSaleRequestDto
dto
);
Result
identify
(
ConsignSaleRequestDto
dto
);
/**
/**
* 完成寄售
* 货品售出
* @param dto
* @return
*/
Result
finishSale
(
ConsignSaleRequestDto
dto
);
/**
* 完成结款,上传凭证
* @param dto
* @param dto
* @return
* @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 {
...
@@ -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:
...
@@ -21,6 +21,7 @@ dts:
officialaccount-token
:
Uu6GHYOiP1xJ6GaBMyXfnITufAGJTe3Q
officialaccount-token
:
Uu6GHYOiP1xJ6GaBMyXfnITufAGJTe3Q
officialaccount-key
:
noeN1amYRvzrVmE2GnC5VnsIfgPEmv6bhX54wJOARlM
officialaccount-key
:
noeN1amYRvzrVmE2GnC5VnsIfgPEmv6bhX54wJOARlM
get-officialaccount-accesstoken-url
:
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s
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配置
im
:
im
:
...
...
ch-core/src/main/resources/application-prod.yml
View file @
d71e4140
...
@@ -20,6 +20,7 @@ dts:
...
@@ -20,6 +20,7 @@ dts:
officialaccount-token
:
Uu6GHYOiP1xJ6GaBMyXfnITufAGJTe3Q
officialaccount-token
:
Uu6GHYOiP1xJ6GaBMyXfnITufAGJTe3Q
officialaccount-key
:
noeN1amYRvzrVmE2GnC5VnsIfgPEmv6bhX54wJOARlM
officialaccount-key
:
noeN1amYRvzrVmE2GnC5VnsIfgPEmv6bhX54wJOARlM
get-officialaccount-accesstoken-url
:
https://api.weixin.qq.com/cgi-bin/stable_token
get-officialaccount-accesstoken-url
:
https://api.weixin.qq.com/cgi-bin/stable_token
officialaccount-templetId
:
WJkhzyY0_7AYqh19_ujK9yZhj4HohF8ETJvG5NYA9A8
#腾讯IM配置
#腾讯IM配置
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dao/ConsignSaleDao.java
View file @
d71e4140
...
@@ -40,4 +40,21 @@ public interface ConsignSaleDao {
...
@@ -40,4 +40,21 @@ public interface ConsignSaleDao {
* @return
* @return
*/
*/
List
<
ConsignSale
>
findByPage
(
ConsignSaleRequestDto
dto
);
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 {
...
@@ -16,6 +16,11 @@ public interface ConsignSaleRecordDao {
int
insert
(
String
saleId
,
String
content
,
int
type
,
String
remark
);
/**
/**
* 查询记录
* 查询记录
* @param saleId
* @param saleId
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/ConsignSale.java
View file @
d71e4140
...
@@ -10,7 +10,7 @@ import lombok.Data;
...
@@ -10,7 +10,7 @@ import lombok.Data;
/**
/**
* @author shiyu
* @author shiyu
* @date 2023/1
1/2
8
* @date 2023/1
2/1
8
*/
*/
@Data
@Data
public
class
ConsignSale
implements
Entity
{
public
class
ConsignSale
implements
Entity
{
...
@@ -66,6 +66,21 @@ public class ConsignSale implements Entity {
...
@@ -66,6 +66,21 @@ public class ConsignSale implements Entity {
*/
*/
private
Integer
systemState
;
private
Integer
systemState
;
/**
* 快递公司编码
*/
private
String
logisticsCode
;
/**
* 运单号
*/
private
String
waybill
;
/**
* 结款凭证
*/
private
String
credential
;
/**
/**
* 创建时间
* 创建时间
*/
*/
...
@@ -95,6 +110,9 @@ public class ConsignSale implements Entity {
...
@@ -95,6 +110,9 @@ public class ConsignSale implements Entity {
sb
.
append
(
", dealPrice="
).
append
(
dealPrice
);
sb
.
append
(
", dealPrice="
).
append
(
dealPrice
);
sb
.
append
(
", customState="
).
append
(
customState
);
sb
.
append
(
", customState="
).
append
(
customState
);
sb
.
append
(
", systemState="
).
append
(
systemState
);
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
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
...
@@ -125,6 +143,9 @@ public class ConsignSale implements Entity {
...
@@ -125,6 +143,9 @@ public class ConsignSale implements Entity {
&&
(
this
.
getDealPrice
()
==
null
?
other
.
getDealPrice
()
==
null
:
this
.
getDealPrice
().
equals
(
other
.
getDealPrice
()))
&&
(
this
.
getDealPrice
()
==
null
?
other
.
getDealPrice
()
==
null
:
this
.
getDealPrice
().
equals
(
other
.
getDealPrice
()))
&&
(
this
.
getCustomState
()
==
null
?
other
.
getCustomState
()
==
null
:
this
.
getCustomState
().
equals
(
other
.
getCustomState
()))
&&
(
this
.
getCustomState
()
==
null
?
other
.
getCustomState
()
==
null
:
this
.
getCustomState
().
equals
(
other
.
getCustomState
()))
&&
(
this
.
getSystemState
()
==
null
?
other
.
getSystemState
()
==
null
:
this
.
getSystemState
().
equals
(
other
.
getSystemState
()))
&&
(
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
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()));
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()));
}
}
...
@@ -144,6 +165,9 @@ public class ConsignSale implements Entity {
...
@@ -144,6 +165,9 @@ public class ConsignSale implements Entity {
result
=
prime
*
result
+
((
getDealPrice
()
==
null
)
?
0
:
getDealPrice
().
hashCode
());
result
=
prime
*
result
+
((
getDealPrice
()
==
null
)
?
0
:
getDealPrice
().
hashCode
());
result
=
prime
*
result
+
((
getCustomState
()
==
null
)
?
0
:
getCustomState
().
hashCode
());
result
=
prime
*
result
+
((
getCustomState
()
==
null
)
?
0
:
getCustomState
().
hashCode
());
result
=
prime
*
result
+
((
getSystemState
()
==
null
)
?
0
:
getSystemState
().
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
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
return
result
;
return
result
;
...
@@ -168,6 +192,9 @@ public class ConsignSale implements Entity {
...
@@ -168,6 +192,9 @@ public class ConsignSale implements Entity {
dealPrice
(
"deal_price"
,
"dealPrice"
,
"INTEGER"
,
false
),
dealPrice
(
"deal_price"
,
"dealPrice"
,
"INTEGER"
,
false
),
customState
(
"custom_state"
,
"customState"
,
"INTEGER"
,
false
),
customState
(
"custom_state"
,
"customState"
,
"INTEGER"
,
false
),
systemState
(
"system_state"
,
"systemState"
,
"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
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
);
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/ConsignSaleExample.java
View file @
d71e4140
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserVo.java
View file @
d71e4140
package
com.wwdz.ch.db.domain
;
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
nickname
;
private
String
avatar
;
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 {
...
@@ -73,6 +73,11 @@ public class ConsignSaleRequestDto extends BaseRequestDto implements Entity {
*/
*/
private
Integer
systemState
;
private
Integer
systemState
;
/**
* 系统状态
*/
private
List
<
Integer
>
systemStateList
;
/**
/**
* 创建时间
* 创建时间
*/
*/
...
@@ -85,4 +90,23 @@ public class ConsignSaleRequestDto extends BaseRequestDto implements Entity {
...
@@ -85,4 +90,23 @@ public class ConsignSaleRequestDto extends BaseRequestDto implements Entity {
private
String
remark
;
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 {
...
@@ -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;
...
@@ -14,6 +14,7 @@ import com.xxdxxs.db.component.JdbcHelper;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
@Repository
@Repository
...
@@ -28,6 +29,16 @@ public class ConsignSaleRecordDaoImpl implements ConsignSaleRecordDao {
...
@@ -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
@Override
public
List
<
ConsignSaleRecord
>
find
(
String
saleId
)
{
public
List
<
ConsignSaleRecord
>
find
(
String
saleId
)
{
ConsignSaleRecordExample
example
=
new
ConsignSaleRecordExample
();
ConsignSaleRecordExample
example
=
new
ConsignSaleRecordExample
();
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/ConsignSaleMapper.xml
View file @
d71e4140
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
<result
column=
"deal_price"
jdbcType=
"INTEGER"
property=
"dealPrice"
/>
<result
column=
"deal_price"
jdbcType=
"INTEGER"
property=
"dealPrice"
/>
<result
column=
"custom_state"
jdbcType=
"INTEGER"
property=
"customState"
/>
<result
column=
"custom_state"
jdbcType=
"INTEGER"
property=
"customState"
/>
<result
column=
"system_state"
jdbcType=
"INTEGER"
property=
"systemState"
/>
<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=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
</resultMap>
...
@@ -76,7 +79,7 @@
...
@@ -76,7 +79,7 @@
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
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>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.ConsignSaleExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.ConsignSaleExample"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -105,14 +108,15 @@
...
@@ -105,14 +108,15 @@
distinct
distinct
</if>
</if>
<choose>
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
${column.escapedColumnName}
</foreach>
</foreach>
</when>
</when>
<otherwise>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
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>
</otherwise>
</choose>
</choose>
from consign_sale
from consign_sale
...
@@ -137,14 +141,15 @@
...
@@ -137,14 +141,15 @@
-->
-->
select
select
<choose>
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
${column.escapedColumnName}
</foreach>
</foreach>
</when>
</when>
<otherwise>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
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>
</otherwise>
</choose>
</choose>
from consign_sale
from consign_sale
...
@@ -167,12 +172,14 @@
...
@@ -167,12 +172,14 @@
insert into consign_sale (sale_id, item_id, user_id,
insert into consign_sale (sale_id, item_id, user_id,
sale_time, user_price, img_valuation,
sale_time, user_price, img_valuation,
valuation, deal_price, custom_state,
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},
values (#{saleId,jdbcType=VARCHAR}, #{itemId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{saleTime,jdbcType=TIMESTAMP}, #{userPrice,jdbcType=INTEGER}, #{imgValuation,jdbcType=VARCHAR},
#{saleTime,jdbcType=TIMESTAMP}, #{userPrice,jdbcType=INTEGER}, #{imgValuation,jdbcType=VARCHAR},
#{valuation,jdbcType=INTEGER}, #{dealPrice,jdbcType=INTEGER}, #{customState,jdbcType=INTEGER},
#{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>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.ConsignSale"
>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.ConsignSale"
>
...
@@ -211,6 +218,15 @@
...
@@ -211,6 +218,15 @@
<if
test=
"systemState != null"
>
<if
test=
"systemState != null"
>
system_state,
system_state,
</if>
</if>
<if
test=
"logisticsCode != null"
>
logistics_code,
</if>
<if
test=
"waybill != null"
>
waybill,
</if>
<if
test=
"credential != null"
>
credential,
</if>
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
create_time,
create_time,
</if>
</if>
...
@@ -249,6 +265,15 @@
...
@@ -249,6 +265,15 @@
<if
test=
"systemState != null"
>
<if
test=
"systemState != null"
>
#{systemState,jdbcType=INTEGER},
#{systemState,jdbcType=INTEGER},
</if>
</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"
>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -299,6 +324,15 @@
...
@@ -299,6 +324,15 @@
<if
test=
"record.systemState != null"
>
<if
test=
"record.systemState != null"
>
system_state = #{record.systemState,jdbcType=INTEGER},
system_state = #{record.systemState,jdbcType=INTEGER},
</if>
</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"
>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -323,6 +357,9 @@
...
@@ -323,6 +357,9 @@
deal_price = #{record.dealPrice,jdbcType=INTEGER},
deal_price = #{record.dealPrice,jdbcType=INTEGER},
custom_state = #{record.customState,jdbcType=INTEGER},
custom_state = #{record.customState,jdbcType=INTEGER},
system_state = #{record.systemState,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},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
...
@@ -362,6 +399,15 @@
...
@@ -362,6 +399,15 @@
<if
test=
"systemState != null"
>
<if
test=
"systemState != null"
>
system_state = #{systemState,jdbcType=INTEGER},
system_state = #{systemState,jdbcType=INTEGER},
</if>
</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"
>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -383,6 +429,9 @@
...
@@ -383,6 +429,9 @@
deal_price = #{dealPrice,jdbcType=INTEGER},
deal_price = #{dealPrice,jdbcType=INTEGER},
custom_state = #{customState,jdbcType=INTEGER},
custom_state = #{customState,jdbcType=INTEGER},
system_state = #{systemState,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},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
...
@@ -414,14 +463,15 @@
...
@@ -414,14 +463,15 @@
select
select
'true' as QUERYID,
'true' as QUERYID,
<choose>
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
${column.escapedColumnName}
</foreach>
</foreach>
</when>
</when>
<otherwise>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
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>
</otherwise>
</choose>
</choose>
from consign_sale
from consign_sale
...
@@ -433,4 +483,5 @@
...
@@ -433,4 +483,5 @@
</if>
</if>
limit 1
limit 1
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
ch-wx-api/src/main/java/com/wwdz/ch/wx/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;
...
@@ -20,6 +20,7 @@ import com.wwdz.ch.db.domain.Item;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.dto.request.CoinRequestDto
;
import
com.wwdz.ch.db.dto.request.CoinRequestDto
;
import
com.wwdz.ch.db.dto.request.ConsignSaleRequestDto
;
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.ch.wx.service.ConsignSaleService
;
import
com.wwdz.user.api.service.user.UserReadService
;
import
com.wwdz.user.api.service.user.UserReadService
;
import
com.xxdxxs.utils.EntityMapper
;
import
com.xxdxxs.utils.EntityMapper
;
...
@@ -78,8 +79,8 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
...
@@ -78,8 +79,8 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
consignSale
.
setCreateTime
(
now
);
consignSale
.
setCreateTime
(
now
);
consignSale
.
setUpdateTime
(
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
());
consignSale
.
setSystemState
(
ConsignSaleEnum
.
SaleForSysStateEnum
.
WAIT_IMG_VALUATE
.
getCode
());
String
saleId
=
IdUtils
.
getOrderNumber
(
CONSIGN_SALE_ORDER_PREFIX
);
String
saleId
=
IdUtils
.
getOrderNumber
(
CONSIGN_SALE_ORDER_PREFIX
);
consignSale
.
setSaleId
(
saleId
);
consignSale
.
setSaleId
(
saleId
);
...
@@ -177,9 +178,115 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
...
@@ -177,9 +178,115 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
@Override
@Override
public
Result
findDetail
(
ConsignSaleRequestDto
dto
)
{
public
Result
findDetail
(
ConsignSaleRequestDto
dto
)
{
String
saleId
=
dto
.
getSaleId
();
List
<
ConsignSaleRecord
>
consignSaleRecordList
=
consignSaleRecordDao
.
find
(
saleId
);
consignSaleRecordList
.
forEach
(
consignSaleRecord
->
{
AppletStateNodeVo
appletStateNodeVo
=
new
AppletStateNodeVo
();
});
return
null
;
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
@Override
public
Result
customCancel
(
ConsignSaleRequestDto
dto
)
{
public
Result
customCancel
(
ConsignSaleRequestDto
dto
)
{
try
{
try
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/ConsignSaleService.java
View file @
d71e4140
...
@@ -37,6 +37,28 @@ public interface ConsignSaleService {
...
@@ -37,6 +37,28 @@ public interface ConsignSaleService {
Result
findDetail
(
ConsignSaleRequestDto
dto
);
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
* @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;
...
@@ -3,27 +3,23 @@ package com.wwdz.ch.wx.web;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
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.db.dto.request.ConsignSaleRequestDto
;
import
com.wwdz.ch.wx.entity.request.ItemRequestDto
;
import
com.wwdz.ch.wx.entity.request.ItemRequestDto
;
import
com.wwdz.ch.wx.service.ConsignSaleService
;
import
com.wwdz.ch.wx.service.ConsignSaleService
;
import
com.wwdz.ch.wx.service.ItemService
;
import
com.wwdz.ch.wx.service.ItemService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.utils.StringUtils
;
import
com.xxdxxs.validation.Validator
;
import
com.xxdxxs.validation.Validator
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
/**
/**
* 寄售单
* 寄售单
...
@@ -56,7 +52,7 @@ public class ConsignSaleController {
...
@@ -56,7 +52,7 @@ public class ConsignSaleController {
return
Result
.
failed
(
"请至少上传一张图片"
);
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
);
dto
.
setIsOnSale
(
true
);
Result
addItemResult
=
itemService
.
add
(
dto
);
Result
addItemResult
=
itemService
.
add
(
dto
);
if
(!
addItemResult
.
getSuccess
())
{
if
(!
addItemResult
.
getSuccess
())
{
...
@@ -108,6 +104,46 @@ public class ConsignSaleController {
...
@@ -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
=
"用户取消寄售单"
)
@ApiOperation
(
value
=
"用户取消寄售单"
)
@PostMapping
(
"/cancel"
)
@PostMapping
(
"/cancel"
)
public
Result
cancel
(
@RequestBody
ConsignSaleRequestDto
dto
)
{
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