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
6d0028ca
Commit
6d0028ca
authored
Feb 05, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
0fb417cc
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
8 deletions
+45
-8
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
+16
-7
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
...h/db/dto/request/distribution/SupplierItemRequestDto.java
+10
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/DistributionOrderDaoImpl.java
...wdz/ch/db/impl/distribution/DistributionOrderDaoImpl.java
+1
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
...com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
+2
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/SupplierItemVo.java
...com/wwdz/ch/wx/entity/vo/distribution/SupplierItemVo.java
+6
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
+3
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+5
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SupplierItemService.java
.../wwdz/ch/wx/service/distribution/SupplierItemService.java
+1
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
...m/wwdz/ch/wx/web/distribution/SupplierItemController.java
+1
-0
No files found.
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
View file @
6d0028ca
...
@@ -6,16 +6,18 @@ import java.text.DecimalFormat;
...
@@ -6,16 +6,18 @@ import java.text.DecimalFormat;
public
class
PriceUtil
{
public
class
PriceUtil
{
public
static
String
convertPriceFenToYuan
(
Long
rawPrice
)
{
public
static
String
convertPriceFenToYuan
(
Long
rawPrice
)
{
BigDecimal
price
=
new
BigDecimal
((
rawPrice
.
doubleValue
()
/
100
));
BigDecimal
price
=
new
BigDecimal
(
String
.
valueOf
(
rawPrice
.
doubleValue
()
/
100
));
price
=
price
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
return
price
.
toString
();
String
str
=
df
.
format
(
price
);
return
new
BigDecimal
(
str
).
stripTrailingZeros
().
toString
();
}
}
public
static
String
convertPriceByTwo
(
int
price
){
public
static
String
convertPriceByTwo
(
int
price
){
double
num
=
(
double
)
price
/
100
;
double
num
=
(
double
)
price
/
100
;
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
num
));
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
num
));
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
return
df
.
format
(
bigDecimal
);
String
str
=
df
.
format
(
bigDecimal
);
return
new
BigDecimal
(
str
).
stripTrailingZeros
().
toString
();
}
}
public
static
Long
convertPriceFromStr
(
String
price
){
public
static
Long
convertPriceFromStr
(
String
price
){
...
@@ -27,7 +29,8 @@ public class PriceUtil {
...
@@ -27,7 +29,8 @@ public class PriceUtil {
public
static
String
convertDoubleToString
(
Double
price
){
public
static
String
convertDoubleToString
(
Double
price
){
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
price
/
100
));
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
price
/
100
));
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
return
df
.
format
(
bigDecimal
);
String
str
=
df
.
format
(
bigDecimal
);
return
new
BigDecimal
(
str
).
stripTrailingZeros
().
toString
();
}
}
...
@@ -38,7 +41,13 @@ public class PriceUtil {
...
@@ -38,7 +41,13 @@ public class PriceUtil {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
convertPriceFenToYuan
(
3980L
));
String
num
=
"3.0000"
;
System
.
out
.
println
(
UUID
.
fastUUID
().
toString
(
true
));
BigDecimal
bigDecimal
=
new
BigDecimal
(
num
);
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
String
a
=
df
.
format
(
bigDecimal
);
System
.
out
.
println
(
new
BigDecimal
(
a
).
stripTrailingZeros
().
toString
());
}
}
}
}
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
View file @
6d0028ca
...
@@ -21,6 +21,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
...
@@ -21,6 +21,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/
*/
private
Long
supplierId
;
private
Long
supplierId
;
/**
* 库存
*/
private
Integer
stock
;
/**
/**
* 商品名称
* 商品名称
*/
*/
...
@@ -47,4 +52,9 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
...
@@ -47,4 +52,9 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
* 逻辑删除
* 逻辑删除
*/
*/
private
Boolean
isDeleted
;
private
Boolean
isDeleted
;
/**
* 分销分享记录id
*/
private
String
shareRecordId
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/DistributionOrderDaoImpl.java
View file @
6d0028ca
...
@@ -70,6 +70,7 @@ public class DistributionOrderDaoImpl implements DistributionOrderDao {
...
@@ -70,6 +70,7 @@ public class DistributionOrderDaoImpl implements DistributionOrderDao {
JdbcHelper
.
ifPresent
(
dto
.
getSellerId
(),
criteria:
:
andSellerIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getSellerId
(),
criteria:
:
andSellerIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getState
(),
criteria:
:
andStateEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getState
(),
criteria:
:
andStateEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getDistributionOrderId
(),
criteria:
:
andDistributionOrderIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getDistributionOrderId
(),
criteria:
:
andDistributionOrderIdEqualTo
);
example
.
setOrderByClause
(
"create_time desc"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
distributionOrderMapper
.
selectByExample
(
example
);
return
distributionOrderMapper
.
selectByExample
(
example
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
View file @
6d0028ca
...
@@ -29,12 +29,14 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
...
@@ -29,12 +29,14 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
if
(
StringUtils
.
hasLength
(
dto
.
getName
()))
{
if
(
StringUtils
.
hasLength
(
dto
.
getName
()))
{
criteria
.
andNameLike
(
"%"
+
dto
.
getName
()
+
"%"
);
criteria
.
andNameLike
(
"%"
+
dto
.
getName
()
+
"%"
);
}
}
JdbcHelper
.
ifPresent
(
dto
.
getStock
(),
criteria:
:
andStockGreaterThan
);
JdbcHelper
.
ifPresent
(
dto
.
getIsOnSale
(),
criteria:
:
andIsOnSaleEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIsOnSale
(),
criteria:
:
andIsOnSaleEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIsDeleted
(),
criteria:
:
andIsDeletedEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIsDeleted
(),
criteria:
:
andIsDeletedEqualTo
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
supplierItemMapper
.
selectByExampleWithBLOBs
(
supplierItemExample
);
return
supplierItemMapper
.
selectByExampleWithBLOBs
(
supplierItemExample
);
}
}
@Override
@Override
public
SupplierItem
findById
(
long
itemId
)
{
public
SupplierItem
findById
(
long
itemId
)
{
SupplierItemExample
supplierItemExample
=
new
SupplierItemExample
();
SupplierItemExample
supplierItemExample
=
new
SupplierItemExample
();
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/SupplierItemVo.java
View file @
6d0028ca
...
@@ -39,6 +39,7 @@ public class SupplierItemVo implements Entity {
...
@@ -39,6 +39,7 @@ public class SupplierItemVo implements Entity {
/**
/**
* 分销价格,要除以100
* 分销价格,要除以100
* 给分销商的价格
*/
*/
private
String
distributionPrice
;
private
String
distributionPrice
;
...
@@ -47,6 +48,11 @@ public class SupplierItemVo implements Entity {
...
@@ -47,6 +48,11 @@ public class SupplierItemVo implements Entity {
*/
*/
private
String
supplyPrice
;
private
String
supplyPrice
;
/**
* 售价,要除以100
*/
private
String
salePrice
;
/**
/**
* 库存
* 库存
*/
*/
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
View file @
6d0028ca
...
@@ -563,8 +563,10 @@ public class UserServiceImpl implements UserService {
...
@@ -563,8 +563,10 @@ public class UserServiceImpl implements UserService {
try
{
try
{
CloudServerResponse
<
CommunityUserAttributeDO
>
response
=
communityAttributeReadService
.
getCommunityUserAttributeByUserId
(
dto
.
getUserId
());
CloudServerResponse
<
CommunityUserAttributeDO
>
response
=
communityAttributeReadService
.
getCommunityUserAttributeByUserId
(
dto
.
getUserId
());
if
(
response
.
isSuccess
())
{
if
(
response
.
isSuccess
())
{
if
(
response
.
getResult
()
!=
null
)
{
user
.
setProfile
(
response
.
getResult
().
getSignature
());
user
.
setProfile
(
response
.
getResult
().
getSignature
());
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}"
,
e
);
logger
.
error
(
">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}"
,
e
);
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
6d0028ca
...
@@ -13,6 +13,7 @@ import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
...
@@ -13,6 +13,7 @@ import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import
com.wwdz.ch.wx.entity.vo.distribution.SupplierItemVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.SupplierItemVo
;
import
com.wwdz.ch.wx.service.distribution.SupplierItemService
;
import
com.wwdz.ch.wx.service.distribution.SupplierItemService
;
import
com.xxdxxs.utils.EntityMapper
;
import
com.xxdxxs.utils.EntityMapper
;
import
com.xxdxxs.utils.StringUtils
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -73,6 +74,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -73,6 +74,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
if
(
StringUtils
.
hasLength
(
dto
.
getShareRecordId
()))
{
DistributorShareRecord
distributorShareRecord
=
distributorShareRecordDao
.
findById
(
dto
.
getShareRecordId
());
supplierItemVo
.
setSalePrice
(
PriceUtil
.
convertPriceFenToYuan
(
distributorShareRecord
.
getPrice
()));
}
return
Result
.
success
(
supplierItemVo
);
return
Result
.
success
(
supplierItemVo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"供应商商品详情查询失败 error : {}"
,
e
);
logger
.
error
(
"供应商商品详情查询失败 error : {}"
,
e
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SupplierItemService.java
View file @
6d0028ca
...
@@ -29,4 +29,5 @@ public interface SupplierItemService {
...
@@ -29,4 +29,5 @@ public interface SupplierItemService {
*/
*/
Result
reduceStock
(
long
itemId
,
int
stock
);
Result
reduceStock
(
long
itemId
,
int
stock
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
View file @
6d0028ca
...
@@ -39,4 +39,5 @@ public class SupplierItemController {
...
@@ -39,4 +39,5 @@ public class SupplierItemController {
return
supplierItemService
.
findDetail
(
dto
);
return
supplierItemService
.
findDetail
(
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