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
23e82386
Commit
23e82386
authored
Apr 29, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增是否可售字段
parent
45bbe603
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
184 additions
and
40 deletions
+184
-40
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
...va/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
+3
-23
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
...src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
+1
-2
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItem.java
...java/com/wwdz/ch/db/domain/distribution/SupplierItem.java
+10
-1
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItemExample.java
...m/wwdz/ch/db/domain/distribution/SupplierItemExample.java
+132
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
...h/db/dto/request/distribution/SupplierItemRequestDto.java
+5
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
...com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
+27
-10
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+6
-4
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
View file @
23e82386
...
@@ -116,6 +116,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -116,6 +116,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItem
.
setCreateTime
(
now
);
supplierItem
.
setCreateTime
(
now
);
supplierItem
.
setUpdateTime
(
now
);
supplierItem
.
setUpdateTime
(
now
);
supplierItem
.
setIsOnSale
(
true
);
supplierItem
.
setIsOnSale
(
true
);
supplierItem
.
setIsAbleSale
(
true
);
supplierItem
.
setIsDeleted
(
false
);
supplierItem
.
setIsDeleted
(
false
);
supplierItem
.
setStatus
(
SupplierItemEnum
.
StatusEnum
.
COMMON
.
getCode
());
supplierItem
.
setStatus
(
SupplierItemEnum
.
StatusEnum
.
COMMON
.
getCode
());
if
(
dto
.
getStock
()
==
null
)
{
if
(
dto
.
getStock
()
==
null
)
{
...
@@ -178,22 +179,6 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -178,22 +179,6 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
//售出数量
//售出数量
Long
selledNum
=
distributionOrderDao
.
countSelledNum
(
supplierItem
.
getId
());
Long
selledNum
=
distributionOrderDao
.
countSelledNum
(
supplierItem
.
getId
());
supplierItemVo
.
setSelledNum
(
selledNum
==
null
?
0
:
selledNum
);
supplierItemVo
.
setSelledNum
(
selledNum
==
null
?
0
:
selledNum
);
if
(
dto
.
getType
()
!=
null
&&
dto
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
())
{
if
(
supplierItem
.
getStock
()
==
0
)
{
//库存为0,标识是可售的商品售罄了
supplierItemVo
.
setIsAbleSale
(
true
);
}
else
if
(
supplierItem
.
getIsOnSale
()
&&
supplierItem
.
getStock
()
>
0
)
{
supplierItemVo
.
setIsAbleSale
(
true
);
}
else
{
supplierItemVo
.
setIsAbleSale
(
false
);
}
}
else
{
if
(
supplierItem
.
getIsOnSale
())
{
supplierItemVo
.
setIsAbleSale
(
true
);
}
else
{
supplierItemVo
.
setIsAbleSale
(
false
);
}
}
});
});
return
Result
.
success
(
PageSearchResult
.
of
(
pageInfo
,
supplierItemVos
));
return
Result
.
success
(
PageSearchResult
.
of
(
pageInfo
,
supplierItemVos
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -226,11 +211,6 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -226,11 +211,6 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItemVo
.
setStartPrice
(
PriceUtil
.
convertPriceFenToYuan
(
auctionConfig
.
getStartPrice
()));
supplierItemVo
.
setStartPrice
(
PriceUtil
.
convertPriceFenToYuan
(
auctionConfig
.
getStartPrice
()));
supplierItemVo
.
setAddExtent
(
PriceUtil
.
convertPriceFenToYuan
(
auctionConfig
.
getAddExtent
()));
supplierItemVo
.
setAddExtent
(
PriceUtil
.
convertPriceFenToYuan
(
auctionConfig
.
getAddExtent
()));
}
}
if
(
supplierItem
.
getStock
()
==
0
||
supplierItem
.
getIsOnSale
())
{
supplierItemVo
.
setIsAbleSale
(
true
);
}
else
{
supplierItemVo
.
setIsAbleSale
(
false
);
}
return
Result
.
success
(
supplierItemVo
);
return
Result
.
success
(
supplierItemVo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"商品详情查询失败 error : {}"
,
e
);
logger
.
error
(
"商品详情查询失败 error : {}"
,
e
);
...
@@ -319,7 +299,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -319,7 +299,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
if
(!
dto
.
getIsOnSale
()
&&
oldItem
.
getType
().
intValue
()
==
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
())
{
if
(!
dto
.
getIsOnSale
()
&&
oldItem
.
getType
().
intValue
()
==
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
())
{
//下架用户商品,短信通知,跳转到藏品详情页
//下架用户商品,短信通知,跳转到藏品详情页
String
url
=
wxAppletApi
.
getUrlLink
(
"/pages/detail/index"
,
"itemId="
+
dto
.
getId
()
+
"&shareRecordId="
);
String
url
=
wxAppletApi
.
getUrlLink
(
"/pages/detail/index"
,
"itemId="
+
dto
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您正在出售的
藏品名称藏品…藏品名称
,根据平台规定不得售卖该类藏品,平台已为您关闭出售,请前往"
+
url
+
"查看"
;
String
msg
=
"您正在出售的
"
+
supplierItem
.
getName
()
+
"
,根据平台规定不得售卖该类藏品,平台已为您关闭出售,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendSms
(
oldItem
.
getCreatorId
(),
msg
);
aliSmsSender
.
sendSms
(
oldItem
.
getCreatorId
(),
msg
);
}
}
return
Result
.
success
();
return
Result
.
success
();
...
@@ -360,7 +340,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -360,7 +340,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItemDao
.
update
(
supplierItem
);
supplierItemDao
.
update
(
supplierItem
);
//发送短息通知用户商品违规被下架,跳转到个人藏馆
//发送短息通知用户商品违规被下架,跳转到个人藏馆
String
url
=
wxAppletApi
.
getUrlLink
(
"/pages/saleSelf/index"
,
"userId="
+
oldItem
.
getCreatorId
()
+
"&shareRecordId="
);
String
url
=
wxAppletApi
.
getUrlLink
(
"/pages/saleSelf/index"
,
"userId="
+
oldItem
.
getCreatorId
()
+
"&shareRecordId="
);
String
msg
=
"您发布的
藏品名称藏品…藏品名称
内容涉嫌违反平台规定,已被平台下架,请前往"
+
url
+
"查看"
;
String
msg
=
"您发布的
"
+
supplierItem
.
getName
()
+
",
内容涉嫌违反平台规定,已被平台下架,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendSms
(
oldItem
.
getCreatorId
(),
msg
);
aliSmsSender
.
sendSms
(
oldItem
.
getCreatorId
(),
msg
);
return
Result
.
success
();
return
Result
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
23e82386
package
com.wwdz.ch.core.entity
;
package
com.wwdz.ch.core.entity
;
import
com.wwdz.ch.db.domain.distribution.CollectionBook
;
import
com.wwdz.ch.db.domain.distribution.CollectionItemsRelation
;
import
com.xxdxxs.entity.Entity
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -268,4 +266,5 @@ public class SupplierItemVo implements Entity {
...
@@ -268,4 +266,5 @@ public class SupplierItemVo implements Entity {
private
Integer
status
;
private
Integer
status
;
private
String
statusName
;
private
String
statusName
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItem.java
View file @
23e82386
...
@@ -11,7 +11,7 @@ import lombok.Data;
...
@@ -11,7 +11,7 @@ import lombok.Data;
/**
/**
* @author shiyu
* @author shiyu
* @date 2024/04/2
6
* @date 2024/04/2
9
*/
*/
@Data
@Data
public
class
SupplierItem
implements
Entity
{
public
class
SupplierItem
implements
Entity
{
...
@@ -97,6 +97,11 @@ public class SupplierItem implements Entity {
...
@@ -97,6 +97,11 @@ public class SupplierItem implements Entity {
*/
*/
private
Integer
status
;
private
Integer
status
;
/**
* 是否可以售卖
*/
private
Boolean
isAbleSale
;
/**
/**
* 商品图片,分号分隔
* 商品图片,分号分隔
*/
*/
...
@@ -137,6 +142,7 @@ public class SupplierItem implements Entity {
...
@@ -137,6 +142,7 @@ public class SupplierItem implements Entity {
sb
.
append
(
", rebate="
).
append
(
rebate
);
sb
.
append
(
", rebate="
).
append
(
rebate
);
sb
.
append
(
", creatorId="
).
append
(
creatorId
);
sb
.
append
(
", creatorId="
).
append
(
creatorId
);
sb
.
append
(
", status="
).
append
(
status
);
sb
.
append
(
", status="
).
append
(
status
);
sb
.
append
(
", isAbleSale="
).
append
(
isAbleSale
);
sb
.
append
(
", images="
).
append
(
images
);
sb
.
append
(
", images="
).
append
(
images
);
sb
.
append
(
", videos="
).
append
(
videos
);
sb
.
append
(
", videos="
).
append
(
videos
);
sb
.
append
(
", description="
).
append
(
description
);
sb
.
append
(
", description="
).
append
(
description
);
...
@@ -174,6 +180,7 @@ public class SupplierItem implements Entity {
...
@@ -174,6 +180,7 @@ public class SupplierItem implements Entity {
&&
(
this
.
getRebate
()
==
null
?
other
.
getRebate
()
==
null
:
this
.
getRebate
().
equals
(
other
.
getRebate
()))
&&
(
this
.
getRebate
()
==
null
?
other
.
getRebate
()
==
null
:
this
.
getRebate
().
equals
(
other
.
getRebate
()))
&&
(
this
.
getCreatorId
()
==
null
?
other
.
getCreatorId
()
==
null
:
this
.
getCreatorId
().
equals
(
other
.
getCreatorId
()))
&&
(
this
.
getCreatorId
()
==
null
?
other
.
getCreatorId
()
==
null
:
this
.
getCreatorId
().
equals
(
other
.
getCreatorId
()))
&&
(
this
.
getStatus
()
==
null
?
other
.
getStatus
()
==
null
:
this
.
getStatus
().
equals
(
other
.
getStatus
()))
&&
(
this
.
getStatus
()
==
null
?
other
.
getStatus
()
==
null
:
this
.
getStatus
().
equals
(
other
.
getStatus
()))
&&
(
this
.
getIsAbleSale
()
==
null
?
other
.
getIsAbleSale
()
==
null
:
this
.
getIsAbleSale
().
equals
(
other
.
getIsAbleSale
()))
&&
(
this
.
getImages
()
==
null
?
other
.
getImages
()
==
null
:
this
.
getImages
().
equals
(
other
.
getImages
()))
&&
(
this
.
getImages
()
==
null
?
other
.
getImages
()
==
null
:
this
.
getImages
().
equals
(
other
.
getImages
()))
&&
(
this
.
getVideos
()
==
null
?
other
.
getVideos
()
==
null
:
this
.
getVideos
().
equals
(
other
.
getVideos
()))
&&
(
this
.
getVideos
()
==
null
?
other
.
getVideos
()
==
null
:
this
.
getVideos
().
equals
(
other
.
getVideos
()))
&&
(
this
.
getDescription
()
==
null
?
other
.
getDescription
()
==
null
:
this
.
getDescription
().
equals
(
other
.
getDescription
()));
&&
(
this
.
getDescription
()
==
null
?
other
.
getDescription
()
==
null
:
this
.
getDescription
().
equals
(
other
.
getDescription
()));
...
@@ -200,6 +207,7 @@ public class SupplierItem implements Entity {
...
@@ -200,6 +207,7 @@ public class SupplierItem implements Entity {
result
=
prime
*
result
+
((
getRebate
()
==
null
)
?
0
:
getRebate
().
hashCode
());
result
=
prime
*
result
+
((
getRebate
()
==
null
)
?
0
:
getRebate
().
hashCode
());
result
=
prime
*
result
+
((
getCreatorId
()
==
null
)
?
0
:
getCreatorId
().
hashCode
());
result
=
prime
*
result
+
((
getCreatorId
()
==
null
)
?
0
:
getCreatorId
().
hashCode
());
result
=
prime
*
result
+
((
getStatus
()
==
null
)
?
0
:
getStatus
().
hashCode
());
result
=
prime
*
result
+
((
getStatus
()
==
null
)
?
0
:
getStatus
().
hashCode
());
result
=
prime
*
result
+
((
getIsAbleSale
()
==
null
)
?
0
:
getIsAbleSale
().
hashCode
());
result
=
prime
*
result
+
((
getImages
()
==
null
)
?
0
:
getImages
().
hashCode
());
result
=
prime
*
result
+
((
getImages
()
==
null
)
?
0
:
getImages
().
hashCode
());
result
=
prime
*
result
+
((
getVideos
()
==
null
)
?
0
:
getVideos
().
hashCode
());
result
=
prime
*
result
+
((
getVideos
()
==
null
)
?
0
:
getVideos
().
hashCode
());
result
=
prime
*
result
+
((
getDescription
()
==
null
)
?
0
:
getDescription
().
hashCode
());
result
=
prime
*
result
+
((
getDescription
()
==
null
)
?
0
:
getDescription
().
hashCode
());
...
@@ -231,6 +239,7 @@ public class SupplierItem implements Entity {
...
@@ -231,6 +239,7 @@ public class SupplierItem implements Entity {
rebate
(
"rebate"
,
"rebate"
,
"DECIMAL"
,
false
),
rebate
(
"rebate"
,
"rebate"
,
"DECIMAL"
,
false
),
creatorId
(
"creator_id"
,
"creatorId"
,
"BIGINT"
,
false
),
creatorId
(
"creator_id"
,
"creatorId"
,
"BIGINT"
,
false
),
status
(
"status"
,
"status"
,
"INTEGER"
,
true
),
status
(
"status"
,
"status"
,
"INTEGER"
,
true
),
isAbleSale
(
"is_able_sale"
,
"isAbleSale"
,
"BIT"
,
false
),
images
(
"images"
,
"images"
,
"LONGVARCHAR"
,
false
),
images
(
"images"
,
"images"
,
"LONGVARCHAR"
,
false
),
videos
(
"videos"
,
"videos"
,
"LONGVARCHAR"
,
false
),
videos
(
"videos"
,
"videos"
,
"LONGVARCHAR"
,
false
),
description
(
"description"
,
"description"
,
"LONGVARCHAR"
,
false
);
description
(
"description"
,
"description"
,
"LONGVARCHAR"
,
false
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SupplierItemExample.java
View file @
23e82386
...
@@ -2412,6 +2412,138 @@ public class SupplierItemExample {
...
@@ -2412,6 +2412,138 @@ public class SupplierItemExample {
addCriterion
(
"`status` not between"
,
value1
,
value2
,
"status"
);
addCriterion
(
"`status` not between"
,
value1
,
value2
,
"status"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andIsAbleSaleIsNull
()
{
addCriterion
(
"is_able_sale is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleIsNotNull
()
{
addCriterion
(
"is_able_sale is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_able_sale ="
,
value
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIsAbleSaleEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"is_able_sale = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleNotEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_able_sale <>"
,
value
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIsAbleSaleNotEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"is_able_sale <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleGreaterThan
(
Boolean
value
)
{
addCriterion
(
"is_able_sale >"
,
value
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIsAbleSaleGreaterThanColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"is_able_sale > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleGreaterThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_able_sale >="
,
value
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIsAbleSaleGreaterThanOrEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"is_able_sale >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleLessThan
(
Boolean
value
)
{
addCriterion
(
"is_able_sale <"
,
value
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIsAbleSaleLessThanColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"is_able_sale < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleLessThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_able_sale <="
,
value
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIsAbleSaleLessThanOrEqualToColumn
(
SupplierItem
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"is_able_sale <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"is_able_sale in"
,
values
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleNotIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"is_able_sale not in"
,
values
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"is_able_sale between"
,
value1
,
value2
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsAbleSaleNotBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"is_able_sale not between"
,
value1
,
value2
,
"isAbleSale"
);
return
(
Criteria
)
this
;
}
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SupplierItemRequestDto.java
View file @
23e82386
...
@@ -51,6 +51,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
...
@@ -51,6 +51,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/
*/
private
Integer
status
;
private
Integer
status
;
/**
* 是否可以售卖
*/
private
Boolean
isAbleSale
;
/**
/**
* 置顶图片
* 置顶图片
*/
*/
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SupplierItemMapper.xml
View file @
23e82386
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
<result
column=
"rebate"
jdbcType=
"DECIMAL"
property=
"rebate"
/>
<result
column=
"rebate"
jdbcType=
"DECIMAL"
property=
"rebate"
/>
<result
column=
"creator_id"
jdbcType=
"BIGINT"
property=
"creatorId"
/>
<result
column=
"creator_id"
jdbcType=
"BIGINT"
property=
"creatorId"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"is_able_sale"
jdbcType=
"BIT"
property=
"isAbleSale"
/>
</resultMap>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.wwdz.ch.db.domain.distribution.SupplierItem"
>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.wwdz.ch.db.domain.distribution.SupplierItem"
>
<result
column=
"images"
jdbcType=
"LONGVARCHAR"
property=
"images"
/>
<result
column=
"images"
jdbcType=
"LONGVARCHAR"
property=
"images"
/>
...
@@ -86,7 +87,7 @@
...
@@ -86,7 +87,7 @@
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`status`
`status`
, is_able_sale
</sql>
</sql>
<sql
id=
"Blob_Column_List"
>
<sql
id=
"Blob_Column_List"
>
images, videos, description
images, videos, description
...
@@ -143,7 +144,7 @@
...
@@ -143,7 +144,7 @@
<otherwise>
<otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`status`, images, videos, description
`status`, i
s_able_sale, i
mages, videos, description
</otherwise>
</otherwise>
</choose>
</choose>
from supplier_item
from supplier_item
...
@@ -178,7 +179,7 @@
...
@@ -178,7 +179,7 @@
<otherwise>
<otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`status`, images, videos, description
`status`, i
s_able_sale, i
mages, videos, description
</otherwise>
</otherwise>
</choose>
</choose>
from supplier_item
from supplier_item
...
@@ -203,15 +204,15 @@
...
@@ -203,15 +204,15 @@
supply_price, stock, create_time,
supply_price, stock, create_time,
update_time, is_deleted, buy_limit_num,
update_time, is_deleted, buy_limit_num,
`type`, rebate, creator_id,
`type`, rebate, creator_id,
`status`, i
mages, video
s,
`status`, i
s_able_sale, image
s,
description)
videos,
description)
values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT},
values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT},
#{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT},
#{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT},
#{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER},
#{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{creatorId,jdbcType=BIGINT},
#{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{creatorId,jdbcType=BIGINT},
#{status,jdbcType=INTEGER}, #{i
mages,jdbcType=LONGVARCHAR}, #{video
s,jdbcType=LONGVARCHAR},
#{status,jdbcType=INTEGER}, #{i
sAbleSale,jdbcType=BIT}, #{image
s,jdbcType=LONGVARCHAR},
#{description,jdbcType=LONGVARCHAR})
#{
videos,jdbcType=LONGVARCHAR}, #{
description,jdbcType=LONGVARCHAR})
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.SupplierItem"
>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.SupplierItem"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
...
@@ -267,6 +268,9 @@
...
@@ -267,6 +268,9 @@
<if
test=
"status != null"
>
<if
test=
"status != null"
>
`status`,
`status`,
</if>
</if>
<if
test=
"isAbleSale != null"
>
is_able_sale,
</if>
<if
test=
"images != null"
>
<if
test=
"images != null"
>
images,
images,
</if>
</if>
...
@@ -326,6 +330,9 @@
...
@@ -326,6 +330,9 @@
<if
test=
"status != null"
>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
#{status,jdbcType=INTEGER},
</if>
</if>
<if
test=
"isAbleSale != null"
>
#{isAbleSale,jdbcType=BIT},
</if>
<if
test=
"images != null"
>
<if
test=
"images != null"
>
#{images,jdbcType=LONGVARCHAR},
#{images,jdbcType=LONGVARCHAR},
</if>
</if>
...
@@ -397,6 +404,9 @@
...
@@ -397,6 +404,9 @@
<if
test=
"record.status != null"
>
<if
test=
"record.status != null"
>
`status` = #{record.status,jdbcType=INTEGER},
`status` = #{record.status,jdbcType=INTEGER},
</if>
</if>
<if
test=
"record.isAbleSale != null"
>
is_able_sale = #{record.isAbleSale,jdbcType=BIT},
</if>
<if
test=
"record.images != null"
>
<if
test=
"record.images != null"
>
images = #{record.images,jdbcType=LONGVARCHAR},
images = #{record.images,jdbcType=LONGVARCHAR},
</if>
</if>
...
@@ -430,6 +440,7 @@
...
@@ -430,6 +440,7 @@
rebate = #{record.rebate,jdbcType=DECIMAL},
rebate = #{record.rebate,jdbcType=DECIMAL},
creator_id = #{record.creatorId,jdbcType=BIGINT},
creator_id = #{record.creatorId,jdbcType=BIGINT},
`status` = #{record.status,jdbcType=INTEGER},
`status` = #{record.status,jdbcType=INTEGER},
is_able_sale = #{record.isAbleSale,jdbcType=BIT},
images = #{record.images,jdbcType=LONGVARCHAR},
images = #{record.images,jdbcType=LONGVARCHAR},
videos = #{record.videos,jdbcType=LONGVARCHAR},
videos = #{record.videos,jdbcType=LONGVARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR}
description = #{record.description,jdbcType=LONGVARCHAR}
...
@@ -455,7 +466,8 @@
...
@@ -455,7 +466,8 @@
`type` = #{record.type,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER},
rebate = #{record.rebate,jdbcType=DECIMAL},
rebate = #{record.rebate,jdbcType=DECIMAL},
creator_id = #{record.creatorId,jdbcType=BIGINT},
creator_id = #{record.creatorId,jdbcType=BIGINT},
`status` = #{record.status,jdbcType=INTEGER}
`status` = #{record.status,jdbcType=INTEGER},
is_able_sale = #{record.isAbleSale,jdbcType=BIT}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
...
@@ -511,6 +523,9 @@
...
@@ -511,6 +523,9 @@
<if
test=
"status != null"
>
<if
test=
"status != null"
>
`status` = #{status,jdbcType=INTEGER},
`status` = #{status,jdbcType=INTEGER},
</if>
</if>
<if
test=
"isAbleSale != null"
>
is_able_sale = #{isAbleSale,jdbcType=BIT},
</if>
<if
test=
"images != null"
>
<if
test=
"images != null"
>
images = #{images,jdbcType=LONGVARCHAR},
images = #{images,jdbcType=LONGVARCHAR},
</if>
</if>
...
@@ -541,6 +556,7 @@
...
@@ -541,6 +556,7 @@
rebate = #{rebate,jdbcType=DECIMAL},
rebate = #{rebate,jdbcType=DECIMAL},
creator_id = #{creatorId,jdbcType=BIGINT},
creator_id = #{creatorId,jdbcType=BIGINT},
`status` = #{status,jdbcType=INTEGER},
`status` = #{status,jdbcType=INTEGER},
is_able_sale = #{isAbleSale,jdbcType=BIT},
images = #{images,jdbcType=LONGVARCHAR},
images = #{images,jdbcType=LONGVARCHAR},
videos = #{videos,jdbcType=LONGVARCHAR},
videos = #{videos,jdbcType=LONGVARCHAR},
description = #{description,jdbcType=LONGVARCHAR}
description = #{description,jdbcType=LONGVARCHAR}
...
@@ -563,7 +579,8 @@
...
@@ -563,7 +579,8 @@
`type` = #{type,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER},
rebate = #{rebate,jdbcType=DECIMAL},
rebate = #{rebate,jdbcType=DECIMAL},
creator_id = #{creatorId,jdbcType=BIGINT},
creator_id = #{creatorId,jdbcType=BIGINT},
`status` = #{status,jdbcType=INTEGER}
`status` = #{status,jdbcType=INTEGER},
is_able_sale = #{isAbleSale,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SupplierItemExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SupplierItemExample"
resultMap=
"BaseResultMap"
>
...
@@ -621,7 +638,7 @@
...
@@ -621,7 +638,7 @@
<otherwise>
<otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`status`, images, videos, description
`status`, i
s_able_sale, i
mages, videos, description
</otherwise>
</otherwise>
</choose>
</choose>
from supplier_item
from supplier_item
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
23e82386
...
@@ -572,12 +572,13 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -572,12 +572,13 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
}
supplierItem
.
setSort
(
1
);
supplierItem
.
setSort
(
1
);
supplierItem
.
setBuyLimitNum
(-
1
);
supplierItem
.
setBuyLimitNum
(-
1
);
if
(
dto
.
getIsOnSale
())
{
if
(
dto
.
getIsAbleSale
())
{
supplierItem
.
setIsOnSale
(
true
);
supplierItem
.
setStock
(
dto
.
getStock
());
supplierItem
.
setStock
(
dto
.
getStock
());
}
else
{
}
else
{
supplierItem
.
setStock
(
1
);
supplierItem
.
setStock
(
1
);
supplierItem
.
setIsOnSale
(
false
);
}
}
supplierItem
.
setIsOnSale
(
dto
.
getIsOnSale
());
Date
now
=
new
Date
();
Date
now
=
new
Date
();
supplierItem
.
setCreateTime
(
now
);
supplierItem
.
setCreateTime
(
now
);
supplierItem
.
setUpdateTime
(
now
);
supplierItem
.
setUpdateTime
(
now
);
...
@@ -612,13 +613,14 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -612,13 +613,14 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if
(
StringUtils
.
hasLength
(
dto
.
getVideos
()))
{
if
(
StringUtils
.
hasLength
(
dto
.
getVideos
()))
{
supplierItem
.
setVideos
(
getVideosImage
(
dto
.
getVideos
()));
supplierItem
.
setVideos
(
getVideosImage
(
dto
.
getVideos
()));
}
}
if
(
dto
.
getIsOnSale
())
{
if
(
dto
.
getIsAbleSale
())
{
supplierItem
.
setIsOnSale
(
true
);
supplierItem
.
setStock
(
dto
.
getStock
());
supplierItem
.
setStock
(
dto
.
getStock
());
}
else
{
}
else
{
supplierItem
.
setStock
(
1
);
supplierItem
.
setStock
(
1
);
supplierItem
.
setIsOnSale
(
false
);
}
}
supplierItemDao
.
update
(
supplierItem
);
supplierItemDao
.
update
(
supplierItem
);
//更新相关的收藏册
//更新相关的收藏册
if
(
StringUtils
.
hasLength
(
dto
.
getCollectionBookId
()))
{
if
(
StringUtils
.
hasLength
(
dto
.
getCollectionBookId
()))
{
CollectionItemsRelationRequestDto
collectionItemsRelationRequestDto
=
new
CollectionItemsRelationRequestDto
();
CollectionItemsRelationRequestDto
collectionItemsRelationRequestDto
=
new
CollectionItemsRelationRequestDto
();
...
...
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