Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-simple-operation
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guokunkun
spring-simple-operation
Commits
da13073c
Commit
da13073c
authored
Feb 06, 2025
by
kk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导数据
parent
a6e13935
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1399 additions
and
308 deletions
+1399
-308
pom.xml
pom.xml
+7
-0
CodeGenerator.java
...ain/java/cn/kk/spring_simple_operation/CodeGenerator.java
+1
-1
SyncProductAuditController.java
...mple_operation/controller/SyncProductAuditController.java
+20
-0
SyncProductPublishController.java
...le_operation/controller/SyncProductPublishController.java
+0
-85
SyncProductAudit.java
...n/kk/spring_simple_operation/entity/SyncProductAudit.java
+582
-0
SyncProductAuditMapper.java
...pring_simple_operation/mapper/SyncProductAuditMapper.java
+23
-0
SyncProductPublishMapper.java
...ing_simple_operation/mapper/SyncProductPublishMapper.java
+8
-3
VideoProductMapper.java
...kk/spring_simple_operation/mapper/VideoProductMapper.java
+2
-1
SkuVideoVO.java
.../java/cn/kk/spring_simple_operation/model/SkuVideoVO.java
+77
-0
SyncProductAuditService.java
...ing_simple_operation/service/SyncProductAuditService.java
+16
-0
SyncProductAuditServiceImpl.java
...e_operation/service/impl/SyncProductAuditServiceImpl.java
+20
-0
application.yml
src/main/resources/application.yml
+7
-3
SyncProductAuditMapper.xml
src/main/resources/mapper/SyncProductAuditMapper.xml
+48
-0
SyncProductPublishMapper.xml
src/main/resources/mapper/SyncProductPublishMapper.xml
+77
-14
VideoProductMapper.xml
src/main/resources/mapper/VideoProductMapper.xml
+4
-0
ExcelTest.java
src/test/java/cn/kk/spring_simple_operation/ExcelTest.java
+51
-0
SpringSimpleOperationApplicationTests.java
...mple_operation/SpringSimpleOperationApplicationTests.java
+201
-201
SpringSimpleOperationApplicationTests2.java
...ple_operation/SpringSimpleOperationApplicationTests2.java
+255
-0
No files found.
pom.xml
View file @
da13073c
...
...
@@ -92,6 +92,13 @@
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
easyexcel-core
</artifactId>
<version>
4.0.3
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/cn/kk/spring_simple_operation/CodeGenerator.java
View file @
da13073c
...
...
@@ -54,7 +54,7 @@ public class CodeGenerator {
.
strategyConfig
(
builder
->
{
builder
// 设置需要生成的表名
.
addInclude
(
"
photo_progress"
,
"photo_progress_person"
,
"video_product"
,
"visual_video_plan"
,
"sync_product_publish"
,
"sync_solar_term_info
"
)
.
addInclude
(
"
sync_product_audit
"
)
//entity策略配置
.
entityBuilder
()
...
...
src/main/java/cn/kk/spring_simple_operation/controller/SyncProductAuditController.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 对应inv 产品审核表 前端控制器
* </p>
*
* @author guokunkun
* @since 2025-01-02
*/
@RestController
@RequestMapping
(
"/spring_simple_operation/sync-product-audit"
)
public
class
SyncProductAuditController
{
}
src/main/java/cn/kk/spring_simple_operation/controller/SyncProductPublishController.java
deleted
100644 → 0
View file @
a6e13935
package
cn
.
kk
.
spring_simple_operation
.
controller
;
import
cn.kk.spring_simple_operation.entity.SyncProductPublish
;
import
cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper
;
import
cn.kk.spring_simple_operation.mapper.VideoProductMapper
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* <p>
* sku销量详情 前端控制器
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@RestController
@RequestMapping
(
"/productPublish"
)
public
class
SyncProductPublishController
{
private
static
final
BigDecimal
TWENTY
=
new
BigDecimal
(
"20"
);
private
static
final
BigDecimal
FORTY
=
new
BigDecimal
(
"40"
);
@Resource
private
SyncProductPublishMapper
syncProductPublishMapper
;
@Resource
private
VideoProductMapper
videoProductMapper
;
@RequestMapping
(
"/syncProductPublish"
)
public
String
syncProductPublish
()
{
Map
<
String
,
Integer
>
salesMap
=
new
HashMap
<>();
salesMap
.
put
(
"<20"
,
0
);
salesMap
.
put
(
"20~40"
,
0
);
salesMap
.
put
(
">40"
,
0
);
Set
<
String
>
haveSkuSet
=
new
HashSet
<>();
// 母体sku
List
<
SyncProductPublish
>
syncProductPublishes
=
syncProductPublishMapper
.
selectMotherSku
();
syncProductPublishes
.
forEach
(
item
->
{
List
<
SyncProductPublish
>
subList
=
syncProductPublishMapper
.
selectList
(
Wrappers
.<
SyncProductPublish
>
lambdaQuery
().
eq
(
SyncProductPublish:
:
getParentAsin
,
item
.
getRelationKey
()).
select
(
SyncProductPublish:
:
getSku
,
SyncProductPublish:
:
getThirtyDaySales
));
subList
.
add
(
item
);
String
s
=
checkPriceAndSales
(
subList
,
item
.
getLowestPrice
());
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap
.
put
(
s
,
salesMap
.
get
(
s
)
+
1
);
haveSkuSet
.
addAll
(
subList
.
stream
().
map
(
SyncProductPublish:
:
getSku
).
collect
(
Collectors
.
toList
()));
});
System
.
out
.
println
(
JSONObject
.
toJSONString
(
salesMap
));
return
JSONObject
.
toJSONString
(
salesMap
);
}
private
String
checkPriceAndSales
(
List
<
SyncProductPublish
>
subList
,
BigDecimal
lowestPrice
)
{
if
(
CollectionUtils
.
isEmpty
(
subList
)
||
lowestPrice
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
return
null
;
}
int
sum
=
subList
.
stream
().
map
(
SyncProductPublish:
:
getThirtyDaySales
).
reduce
(
Integer:
:
sum
).
get
();
if
(
lowestPrice
.
compareTo
(
TWENTY
)
<=
0
&&
sum
>=
100
)
{
return
"<20"
;
}
else
if
(
lowestPrice
.
compareTo
(
TWENTY
)
>
0
&&
lowestPrice
.
compareTo
(
FORTY
)
<=
0
&&
sum
>=
80
)
{
return
"20~40"
;
}
else
if
(
lowestPrice
.
compareTo
(
FORTY
)
>
0
&&
sum
>=
50
)
{
return
">40"
;
}
return
null
;
}
}
src/main/java/cn/kk/spring_simple_operation/entity/SyncProductAudit.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
/**
* <p>
* 对应inv 产品审核表
* </p>
*
* @author guokunkun
* @since 2025-01-02
*/
@Getter
@Setter
@Accessors
(
chain
=
true
)
@TableName
(
"sync_product_audit"
)
@ApiModel
(
value
=
"SyncProductAudit对象"
,
description
=
"对应inv 产品审核表"
)
public
class
SyncProductAudit
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"id"
)
@TableId
(
"id"
)
private
Long
id
;
@ApiModelProperty
(
"亚马逊账号"
)
@TableField
(
"`account`"
)
private
String
account
;
@ApiModelProperty
(
" 旧sku"
)
@TableField
(
"old_sku"
)
private
String
oldSku
;
@ApiModelProperty
(
"产品sku"
)
@TableField
(
"sku"
)
private
String
sku
;
@ApiModelProperty
(
"产品开发人员"
)
@TableField
(
"developer_num"
)
private
String
developerNum
;
@ApiModelProperty
(
"图片链接"
)
@TableField
(
"raw_pic_url"
)
private
String
rawPicUrl
;
@ApiModelProperty
(
"根据竞品标题中解析出来的asin"
)
@TableField
(
"competitor_asin"
)
private
String
competitorAsin
;
@ApiModelProperty
(
"产品类型"
)
@TableField
(
"product_type"
)
private
Integer
productType
;
@ApiModelProperty
(
"关联sku"
)
@TableField
(
"relative_sku"
)
private
String
relativeSku
;
@ApiModelProperty
(
"关联sku id"
)
@TableField
(
"relative_id"
)
private
String
relativeId
;
@ApiModelProperty
(
"变体主题"
)
@TableField
(
"variant_subject"
)
private
Integer
variantSubject
;
@ApiModelProperty
(
"变体个数"
)
@TableField
(
"variant_amount"
)
private
Integer
variantAmount
;
@ApiModelProperty
(
"创建时间"
)
@TableField
(
"create_at"
)
private
Integer
createAt
;
@ApiModelProperty
(
"修改时间"
)
@TableField
(
"update_at"
)
private
Integer
updateAt
;
@ApiModelProperty
(
" 节气, 1=>'常规产品', 2=>'婚礼季', 3=>'复活节', 4=>'万圣节', 5=>'感恩节', 6=>'圣诞节', // 7=>'黑色星期五(11月第四个周五)', 8=>'母亲节', 9=>'父亲节', 10=>'开学季', 11=>'毕业季', 12=>'夏季产品', 13=>'冬季产品', 14=>'其他节气', 15=>'春节', 16=>'情人节', 17=>'爱尔兰节', 18=>'独立日'"
)
@TableField
(
"solar_term"
)
private
Integer
solarTerm
;
@ApiModelProperty
(
"是否组合变体,1是,0不是"
)
@TableField
(
"is_comb_variant"
)
private
Integer
isCombVariant
;
@ApiModelProperty
(
"组合父id"
)
@TableField
(
"comb_parent_id"
)
private
Integer
combParentId
;
@ApiModelProperty
(
"组合父sku"
)
@TableField
(
"comb_parent_sku"
)
private
String
combParentSku
;
@ApiModelProperty
(
"销售编号"
)
@TableField
(
"seller_num"
)
private
String
sellerNum
;
@ApiModelProperty
(
"中文简称"
)
@TableField
(
"short_title_ch"
)
private
String
shortTitleCh
;
@ApiModelProperty
(
"英文简称"
)
@TableField
(
"short_title_en"
)
private
String
shortTitleEn
;
@ApiModelProperty
(
"欧洲站sku"
)
@TableField
(
"eu_product_sku"
)
private
String
euProductSku
;
@ApiModelProperty
(
"开发标题"
)
@TableField
(
"developer_title"
)
private
String
developerTitle
;
@ApiModelProperty
(
"小图片链接"
)
@TableField
(
"small_pic_url"
)
private
String
smallPicUrl
;
@ApiModelProperty
(
"同步时间"
)
@TableField
(
"sync_time"
)
private
Integer
syncTime
;
@ApiModelProperty
(
"审核状态"
)
@TableField
(
"product_audit_status"
)
private
String
productAuditStatus
;
@ApiModelProperty
(
"是否只做简易视频 (0 1是 2否)"
)
@TableField
(
"is_make_simple_video"
)
private
Integer
isMakeSimpleVideo
;
@ApiModelProperty
(
"开发填写备注"
)
@TableField
(
"develop_remark"
)
private
String
developRemark
;
@ApiModelProperty
(
"产品等级"
)
@TableField
(
"product_level"
)
private
String
productLevel
;
@ApiModelProperty
(
"list_audit_time list审核时间"
)
@TableField
(
"list_audit_time"
)
private
Integer
listAuditTime
;
@ApiModelProperty
(
"商标风险"
)
@TableField
(
"trademark_risk"
)
private
String
trademarkRisk
;
@ApiModelProperty
(
"精简文案"
)
@TableField
(
"simple_wa"
)
private
String
simpleWa
;
@ApiModelProperty
(
"文案优化人员"
)
@TableField
(
"copywriting_optimization_user"
)
private
String
copywritingOptimizationUser
;
@ApiModelProperty
(
"品牌名"
)
@TableField
(
"brand_name"
)
private
String
brandName
;
@ApiModelProperty
(
"成本价"
)
@TableField
(
"cost_price"
)
private
BigDecimal
costPrice
;
@ApiModelProperty
(
"首批采购数量"
)
@TableField
(
"purchase_quantity"
)
private
Integer
purchaseQuantity
;
@ApiModelProperty
(
"是否潜力产品,0-否,1-是"
)
@TableField
(
"maintain_level"
)
private
Integer
maintainLevel
;
@ApiModelProperty
(
"销售填写备注"
)
@TableField
(
"sale_remark"
)
private
String
saleRemark
;
@ApiModelProperty
(
"US上传分类"
)
@TableField
(
"us_upload_type"
)
private
Integer
usUploadType
;
@ApiModelProperty
(
"us一级类目"
)
@TableField
(
"us_root_type"
)
private
String
usRootType
;
@ApiModelProperty
(
"商标类别"
)
@TableField
(
"register_type"
)
private
String
registerType
;
@ApiModelProperty
(
"是否鼓励政策"
)
@TableField
(
"is_cheer_policy"
)
private
Integer
isCheerPolicy
;
@ApiModelProperty
(
"专项类型"
)
@TableField
(
"special_type"
)
private
Integer
specialType
;
@ApiModelProperty
(
"供应商链接"
)
@TableField
(
"supplier_url"
)
private
String
supplierUrl
;
@ApiModelProperty
(
"审核时间"
)
@TableField
(
"audit_time"
)
private
Integer
auditTime
;
@ApiModelProperty
(
"审核备注"
)
@TableField
(
"audit_remark"
)
private
String
auditRemark
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getAccount
()
{
return
account
;
}
public
void
setAccount
(
String
account
)
{
this
.
account
=
account
;
}
public
String
getOldSku
()
{
return
oldSku
;
}
public
void
setOldSku
(
String
oldSku
)
{
this
.
oldSku
=
oldSku
;
}
public
String
getSku
()
{
return
sku
;
}
public
void
setSku
(
String
sku
)
{
this
.
sku
=
sku
;
}
public
String
getDeveloperNum
()
{
return
developerNum
;
}
public
void
setDeveloperNum
(
String
developerNum
)
{
this
.
developerNum
=
developerNum
;
}
public
String
getRawPicUrl
()
{
return
rawPicUrl
;
}
public
void
setRawPicUrl
(
String
rawPicUrl
)
{
this
.
rawPicUrl
=
rawPicUrl
;
}
public
String
getCompetitorAsin
()
{
return
competitorAsin
;
}
public
void
setCompetitorAsin
(
String
competitorAsin
)
{
this
.
competitorAsin
=
competitorAsin
;
}
public
Integer
getProductType
()
{
return
productType
;
}
public
void
setProductType
(
Integer
productType
)
{
this
.
productType
=
productType
;
}
public
String
getRelativeSku
()
{
return
relativeSku
;
}
public
void
setRelativeSku
(
String
relativeSku
)
{
this
.
relativeSku
=
relativeSku
;
}
public
String
getRelativeId
()
{
return
relativeId
;
}
public
void
setRelativeId
(
String
relativeId
)
{
this
.
relativeId
=
relativeId
;
}
public
Integer
getVariantSubject
()
{
return
variantSubject
;
}
public
void
setVariantSubject
(
Integer
variantSubject
)
{
this
.
variantSubject
=
variantSubject
;
}
public
Integer
getVariantAmount
()
{
return
variantAmount
;
}
public
void
setVariantAmount
(
Integer
variantAmount
)
{
this
.
variantAmount
=
variantAmount
;
}
public
Integer
getCreateAt
()
{
return
createAt
;
}
public
void
setCreateAt
(
Integer
createAt
)
{
this
.
createAt
=
createAt
;
}
public
Integer
getUpdateAt
()
{
return
updateAt
;
}
public
void
setUpdateAt
(
Integer
updateAt
)
{
this
.
updateAt
=
updateAt
;
}
public
Integer
getSolarTerm
()
{
return
solarTerm
;
}
public
void
setSolarTerm
(
Integer
solarTerm
)
{
this
.
solarTerm
=
solarTerm
;
}
public
Integer
getIsCombVariant
()
{
return
isCombVariant
;
}
public
void
setIsCombVariant
(
Integer
isCombVariant
)
{
this
.
isCombVariant
=
isCombVariant
;
}
public
Integer
getCombParentId
()
{
return
combParentId
;
}
public
void
setCombParentId
(
Integer
combParentId
)
{
this
.
combParentId
=
combParentId
;
}
public
String
getCombParentSku
()
{
return
combParentSku
;
}
public
void
setCombParentSku
(
String
combParentSku
)
{
this
.
combParentSku
=
combParentSku
;
}
public
String
getSellerNum
()
{
return
sellerNum
;
}
public
void
setSellerNum
(
String
sellerNum
)
{
this
.
sellerNum
=
sellerNum
;
}
public
String
getShortTitleCh
()
{
return
shortTitleCh
;
}
public
void
setShortTitleCh
(
String
shortTitleCh
)
{
this
.
shortTitleCh
=
shortTitleCh
;
}
public
String
getShortTitleEn
()
{
return
shortTitleEn
;
}
public
void
setShortTitleEn
(
String
shortTitleEn
)
{
this
.
shortTitleEn
=
shortTitleEn
;
}
public
String
getEuProductSku
()
{
return
euProductSku
;
}
public
void
setEuProductSku
(
String
euProductSku
)
{
this
.
euProductSku
=
euProductSku
;
}
public
String
getDeveloperTitle
()
{
return
developerTitle
;
}
public
void
setDeveloperTitle
(
String
developerTitle
)
{
this
.
developerTitle
=
developerTitle
;
}
public
String
getSmallPicUrl
()
{
return
smallPicUrl
;
}
public
void
setSmallPicUrl
(
String
smallPicUrl
)
{
this
.
smallPicUrl
=
smallPicUrl
;
}
public
Integer
getSyncTime
()
{
return
syncTime
;
}
public
void
setSyncTime
(
Integer
syncTime
)
{
this
.
syncTime
=
syncTime
;
}
public
String
getProductAuditStatus
()
{
return
productAuditStatus
;
}
public
void
setProductAuditStatus
(
String
productAuditStatus
)
{
this
.
productAuditStatus
=
productAuditStatus
;
}
public
Integer
getIsMakeSimpleVideo
()
{
return
isMakeSimpleVideo
;
}
public
void
setIsMakeSimpleVideo
(
Integer
isMakeSimpleVideo
)
{
this
.
isMakeSimpleVideo
=
isMakeSimpleVideo
;
}
public
String
getDevelopRemark
()
{
return
developRemark
;
}
public
void
setDevelopRemark
(
String
developRemark
)
{
this
.
developRemark
=
developRemark
;
}
public
String
getProductLevel
()
{
return
productLevel
;
}
public
void
setProductLevel
(
String
productLevel
)
{
this
.
productLevel
=
productLevel
;
}
public
Integer
getListAuditTime
()
{
return
listAuditTime
;
}
public
void
setListAuditTime
(
Integer
listAuditTime
)
{
this
.
listAuditTime
=
listAuditTime
;
}
public
String
getTrademarkRisk
()
{
return
trademarkRisk
;
}
public
void
setTrademarkRisk
(
String
trademarkRisk
)
{
this
.
trademarkRisk
=
trademarkRisk
;
}
public
String
getSimpleWa
()
{
return
simpleWa
;
}
public
void
setSimpleWa
(
String
simpleWa
)
{
this
.
simpleWa
=
simpleWa
;
}
public
String
getCopywritingOptimizationUser
()
{
return
copywritingOptimizationUser
;
}
public
void
setCopywritingOptimizationUser
(
String
copywritingOptimizationUser
)
{
this
.
copywritingOptimizationUser
=
copywritingOptimizationUser
;
}
public
String
getBrandName
()
{
return
brandName
;
}
public
void
setBrandName
(
String
brandName
)
{
this
.
brandName
=
brandName
;
}
public
BigDecimal
getCostPrice
()
{
return
costPrice
;
}
public
void
setCostPrice
(
BigDecimal
costPrice
)
{
this
.
costPrice
=
costPrice
;
}
public
Integer
getPurchaseQuantity
()
{
return
purchaseQuantity
;
}
public
void
setPurchaseQuantity
(
Integer
purchaseQuantity
)
{
this
.
purchaseQuantity
=
purchaseQuantity
;
}
public
Integer
getMaintainLevel
()
{
return
maintainLevel
;
}
public
void
setMaintainLevel
(
Integer
maintainLevel
)
{
this
.
maintainLevel
=
maintainLevel
;
}
public
String
getSaleRemark
()
{
return
saleRemark
;
}
public
void
setSaleRemark
(
String
saleRemark
)
{
this
.
saleRemark
=
saleRemark
;
}
public
Integer
getUsUploadType
()
{
return
usUploadType
;
}
public
void
setUsUploadType
(
Integer
usUploadType
)
{
this
.
usUploadType
=
usUploadType
;
}
public
String
getUsRootType
()
{
return
usRootType
;
}
public
void
setUsRootType
(
String
usRootType
)
{
this
.
usRootType
=
usRootType
;
}
public
String
getRegisterType
()
{
return
registerType
;
}
public
void
setRegisterType
(
String
registerType
)
{
this
.
registerType
=
registerType
;
}
public
Integer
getIsCheerPolicy
()
{
return
isCheerPolicy
;
}
public
void
setIsCheerPolicy
(
Integer
isCheerPolicy
)
{
this
.
isCheerPolicy
=
isCheerPolicy
;
}
public
Integer
getSpecialType
()
{
return
specialType
;
}
public
void
setSpecialType
(
Integer
specialType
)
{
this
.
specialType
=
specialType
;
}
public
String
getSupplierUrl
()
{
return
supplierUrl
;
}
public
void
setSupplierUrl
(
String
supplierUrl
)
{
this
.
supplierUrl
=
supplierUrl
;
}
public
Integer
getAuditTime
()
{
return
auditTime
;
}
public
void
setAuditTime
(
Integer
auditTime
)
{
this
.
auditTime
=
auditTime
;
}
public
String
getAuditRemark
()
{
return
auditRemark
;
}
public
void
setAuditRemark
(
String
auditRemark
)
{
this
.
auditRemark
=
auditRemark
;
}
}
src/main/java/cn/kk/spring_simple_operation/mapper/SyncProductAuditMapper.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
.
mapper
;
import
cn.kk.spring_simple_operation.entity.SyncProductAudit
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* <p>
* 对应inv 产品审核表 Mapper 接口
* </p>
*
* @author guokunkun
* @since 2025-01-02
*/
@Mapper
public
interface
SyncProductAuditMapper
extends
BaseMapper
<
SyncProductAudit
>
{
List
<
String
>
groupSkuSolarTerm_1
();
List
<
String
>
groupSkuSolarTerm_Q1Q2
();
}
src/main/java/cn/kk/spring_simple_operation/mapper/SyncProductPublishMapper.java
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
.
mapper
;
import
cn.kk.spring_simple_operation.entity.SyncProductPublish
;
import
cn.kk.spring_simple_operation.model.SkuVideoVO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -18,11 +19,15 @@ import java.util.List;
@Mapper
public
interface
SyncProductPublishMapper
extends
BaseMapper
<
SyncProductPublish
>
{
List
<
S
yncProductPublish
>
selectMotherSku
();
List
<
S
kuVideoVO
>
selectMotherSku
();
List
<
S
yncProductPublish
>
selectChildSku
();
List
<
S
kuVideoVO
>
selectChildSku
();
List
<
SyncProductPublish
>
selectMotherSku_2
();
List
<
SyncProductPublish
>
selectChildSku_2
();
List
<
SkuVideoVO
>
selectChildSku_2
();
List
<
SkuVideoVO
>
groupSkuSolarTerm_1
(
@Param
(
"sku"
)
String
sku
);
List
<
SkuVideoVO
>
groupSkuSolarTerm_Q1Q2
(
@Param
(
"sku"
)
String
sku
);
}
src/main/java/cn/kk/spring_simple_operation/mapper/VideoProductMapper.java
View file @
da13073c
...
...
@@ -3,6 +3,7 @@ package cn.kk.spring_simple_operation.mapper;
import
cn.kk.spring_simple_operation.entity.VideoProduct
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -17,5 +18,5 @@ import java.util.List;
@Mapper
public
interface
VideoProductMapper
extends
BaseMapper
<
VideoProduct
>
{
List
<
String
>
selectHaveTask
();
List
<
String
>
selectHaveTask
(
@Param
(
"skus"
)
List
<
String
>
skus
);
}
src/main/java/cn/kk/spring_simple_operation/model/SkuVideoVO.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
.
model
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author kk
* @date 2025/1/2
*/
@Data
public
class
SkuVideoVO
{
private
String
sku
;
private
String
relation_key
;
private
String
parentAsin
;
private
BigDecimal
lowestPrice
;
private
Integer
thirtyDaySales
;
private
String
saleStatus
;
private
String
usUploadInfo
;
public
String
getSku
()
{
return
sku
;
}
public
void
setSku
(
String
sku
)
{
this
.
sku
=
sku
;
}
public
String
getRelation_key
()
{
return
relation_key
;
}
public
void
setRelation_key
(
String
relation_key
)
{
this
.
relation_key
=
relation_key
;
}
public
String
getParentAsin
()
{
return
parentAsin
;
}
public
void
setParentAsin
(
String
parentAsin
)
{
this
.
parentAsin
=
parentAsin
;
}
public
BigDecimal
getLowestPrice
()
{
return
lowestPrice
;
}
public
void
setLowestPrice
(
BigDecimal
lowestPrice
)
{
this
.
lowestPrice
=
lowestPrice
;
}
public
Integer
getThirtyDaySales
()
{
return
thirtyDaySales
;
}
public
void
setThirtyDaySales
(
Integer
thirtyDaySales
)
{
this
.
thirtyDaySales
=
thirtyDaySales
;
}
public
String
getSaleStatus
()
{
return
saleStatus
;
}
public
void
setSaleStatus
(
String
saleStatus
)
{
this
.
saleStatus
=
saleStatus
;
}
public
String
getUsUploadInfo
()
{
return
usUploadInfo
;
}
public
void
setUsUploadInfo
(
String
usUploadInfo
)
{
this
.
usUploadInfo
=
usUploadInfo
;
}
}
src/main/java/cn/kk/spring_simple_operation/service/SyncProductAuditService.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
.
service
;
import
cn.kk.spring_simple_operation.entity.SyncProductAudit
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 对应inv 产品审核表 服务类
* </p>
*
* @author guokunkun
* @since 2025-01-02
*/
public
interface
SyncProductAuditService
extends
IService
<
SyncProductAudit
>
{
}
src/main/java/cn/kk/spring_simple_operation/service/impl/SyncProductAuditServiceImpl.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
.
service
.
impl
;
import
cn.kk.spring_simple_operation.entity.SyncProductAudit
;
import
cn.kk.spring_simple_operation.mapper.SyncProductAuditMapper
;
import
cn.kk.spring_simple_operation.service.SyncProductAuditService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 对应inv 产品审核表 服务实现类
* </p>
*
* @author guokunkun
* @since 2025-01-02
*/
@Service
public
class
SyncProductAuditServiceImpl
extends
ServiceImpl
<
SyncProductAuditMapper
,
SyncProductAudit
>
implements
SyncProductAuditService
{
}
src/main/resources/application.yml
View file @
da13073c
...
...
@@ -21,13 +21,17 @@ spring:
# username: yswg_it_java
# password: Yswg@inv-java241011427
url
:
jdbc:mysql://mydb.com:3306/visual_
1218
?useUnicode=true&characterEncoding=utf8&useSSL=true
url
:
jdbc:mysql://mydb.com:3306/visual_
0102
?useUnicode=true&characterEncoding=utf8&useSSL=true
username
:
root
password
:
root
# url: jdbc:mysql://rm-wz9m4k931n87m9721oo.mysql.rds.aliyuncs.com:3306/visual?useUnicode=true&characterEncoding=utf8&useSSL=true
# username: guokunkun
# password: gkk1602
druid
:
initial-size
:
5
min-idle
:
5
initial-size
:
1
min-idle
:
1
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
...
...
src/main/resources/mapper/SyncProductAuditMapper.xml
0 → 100644
View file @
da13073c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.kk.spring_simple_operation.mapper.SyncProductAuditMapper"
>
<select
id=
"groupSkuSolarTerm_1"
resultType=
"java.lang.String"
>
SELECT
spa.sku
FROM
sync_product_audit spa
LEFT JOIN sync_product_publish spp ON spp.sku = spa.sku
WHERE
spa.sku > ''
AND spa.product_type = 2
AND spa.is_comb_variant = 0
AND spa.variant_amount > 0
AND spa.comb_parent_sku = ''
AND spp.open_date > 0
AND spp.sale_status IN ( '正常销售' )
AND spp.site = 'Amazon.com'
AND spp.is_delete = 0
AND spp.solar_term = 1
AND spp.lowest_price > 0
AND spp.thirty_day_sales > 0
</select>
<select
id=
"groupSkuSolarTerm_Q1Q2"
resultType=
"java.lang.String"
>
SELECT
spa.sku
FROM
sync_product_audit spa
LEFT JOIN sync_product_publish spp ON spp.sku = spa.sku
LEFT JOIN sync_solar_term_info ti ON ti.solar_term_id = spp.solar_term
WHERE
spa.sku > ''
AND spa.product_type = 2
AND spa.is_comb_variant = 0
AND spa.variant_amount > 0
AND spa.comb_parent_sku = ''
AND spp.open_date > 0
AND spp.sale_status IN ( '正常销售', '保留页面', '限制跟卖暂保留', '发货限制安排跟卖' )
AND spp.site = 'Amazon.com'
AND spp.is_delete = 0
AND ti.`quarter` IN ( 'Q1', 'Q2' )
AND spp.lowest_price > 0
AND spp.thirty_day_sales > 0
</select>
</mapper>
src/main/resources/mapper/SyncProductPublishMapper.xml
View file @
da13073c
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper"
>
<select
id=
"selectMotherSku"
resultType=
"cn.kk.spring_simple_operation.
entity.SyncProductPublish
"
>
<select
id=
"selectMotherSku"
resultType=
"cn.kk.spring_simple_operation.
model.SkuVideoVO
"
>
with shortVideo as (select vp.sku
from video_product vp
INNER JOIN visual_video_plan vvp on vvp.id = vp.video_plan_id
...
...
@@ -14,12 +14,13 @@
spp.relation_key,
spp.parent_asin,
spp.lowest_price,
spp.thirty_day_sales
spp.thirty_day_sales,
spp.sale_status
from sync_product_publish spp
LEFT JOIN photo_progress pp on pp.sku = spp.sku
LEFT JOIN shortVideo on shortVideo.sku = spp.sku
where spp.open_date
BETWEEN 1 AND 173255040
0
where spp.open_date
>
0
and spp.sale_status IN ('正常销售')
and spp.site = 'Amazon.com'
and spp.is_delete = 0
...
...
@@ -32,7 +33,7 @@
</select>
<select
id=
"selectChildSku"
resultType=
"cn.kk.spring_simple_operation.
entity.SyncProductPublish
"
>
<select
id=
"selectChildSku"
resultType=
"cn.kk.spring_simple_operation.
model.SkuVideoVO
"
>
with shortVideo as (select vp.sku
from video_product vp
INNER JOIN visual_video_plan vvp on vvp.id = vp.video_plan_id
...
...
@@ -45,14 +46,17 @@
spp.relation_key,
spp.parent_asin,
spp.lowest_price,
spp.thirty_day_sales
spp.thirty_day_sales,
spp.sale_status,
ifnull(spa.us_upload_info, '无sku') as us_upload_info
FROM
sync_product_publish spp
LEFT JOIN photo_progress pp ON pp.sku = spp.sku
LEFT JOIN shortVideo ON shortVideo.sku = spp.sku
left join sync_product_audit spa on spa.sku = spp.sku
LEFT JOIN sync_amazon_item_day said ON said.asin = spp.relation_key AND said.site = spp.site
WHERE
spp.open_date BETWEEN 1
AND 1732550400
spp.open_date > 0
AND spp.sale_status IN ( '正常销售' )
AND spp.site = 'Amazon.com'
AND spp.is_delete = 0
...
...
@@ -61,6 +65,7 @@
AND pp.id IS NULL
AND spp.lowest_price > 0
AND spp.thirty_day_sales > 0
AND said.img_type not like '%2%'
</select>
<select
id=
"selectMotherSku_2"
resultType=
"cn.kk.spring_simple_operation.entity.SyncProductPublish"
>
...
...
@@ -75,7 +80,8 @@
spp.relation_key,
spp.parent_asin,
spp.lowest_price,
spp.thirty_day_sales
spp.thirty_day_sales,
spp.sale_status
from sync_product_publish spp
LEFT JOIN photo_progress pp on pp.sku = spp.sku
LEFT JOIN shortVideo on shortVideo.sku = spp.sku
...
...
@@ -92,7 +98,7 @@
and spp.lowest_price > 0
and spp.thirty_day_sales > 0
</select>
<select
id=
"selectChildSku_2"
resultType=
"cn.kk.spring_simple_operation.
entity.SyncProductPublish
"
>
<select
id=
"selectChildSku_2"
resultType=
"cn.kk.spring_simple_operation.
model.SkuVideoVO
"
>
with shortVideo as (select vp.sku
from video_product vp
INNER JOIN visual_video_plan vvp on vvp.id = vp.video_plan_id
...
...
@@ -105,22 +111,79 @@
spp.relation_key,
spp.parent_asin,
spp.lowest_price,
spp.thirty_day_sales
spp.thirty_day_sales,
spp.sale_status,
ifnull(spa.us_upload_info, '无sku') as us_upload_info
FROM
sync_product_publish spp
LEFT JOIN photo_progress pp ON pp.sku = spp.sku
LEFT JOIN shortVideo ON shortVideo.sku = spp.sku
LEFT JOIN sync_solar_term_info ti ON ti.solar_term_id = spp.solar_term
left join sync_product_audit spa on spa.sku = spp.sku
LEFT JOIN sync_amazon_item_day said ON said.asin = spp.relation_key AND said.site = spp.site
WHERE
spp.open_date BETWEEN 1
AND 1732550400
AND spp.sale_status IN ( '正常销售', '保留页面' )
spp.open_date > 0
AND spp.sale_status IN ( '正常销售', '保留页面', '限制跟卖暂保留', '发货限制安排跟卖' )
AND spp.site = 'Amazon.com'
AND spp.is_delete = 0
AND ti.`
month` BETWEEN 1 AND 6
AND ti.`
quarter` in ('Q1', 'Q2')
AND shortVideo.sku IS NULL
AND pp.id IS NULL
AND spp.lowest_price > 0
AND spp.thirty_day_sales > 0
AND said.img_type NOT LIKE '%2%'
</select>
<select
id=
"groupSkuSolarTerm_1"
resultType=
"cn.kk.spring_simple_operation.model.SkuVideoVO"
>
SELECT
spp.sku,
spp.relation_key,
spp.parent_asin,
spp.lowest_price,
spp.thirty_day_sales,
spp.sale_status,
ifnull(spa.us_upload_info, '无sku') as us_upload_info
FROM sync_product_audit spa
LEFT JOIN sync_product_publish spp on spp.sku = spa.sku
LEFT JOIN photo_progress pp ON pp.sku = spp.sku
WHERE
spp.open_date > 0
AND spp.sale_status IN ( '正常销售' )
AND spp.site = 'Amazon.com'
AND spp.is_delete = 0
AND spp.solar_term = 1
AND pp.id IS NULL
AND spp.lowest_price > 0
AND spp.thirty_day_sales > 0
AND spa.sku > ''
AND (spa.sku = #{sku} or spa.comb_parent_sku = #{sku})
</select>
<select
id=
"groupSkuSolarTerm_Q1Q2"
resultType=
"cn.kk.spring_simple_operation.model.SkuVideoVO"
>
SELECT
spp.sku,
spp.relation_key,
spp.parent_asin,
spp.lowest_price,
spp.thirty_day_sales,
spp.sale_status,
ifnull(spa.us_upload_info, '无sku') as us_upload_info
FROM sync_product_audit spa
LEFT JOIN sync_product_publish spp on spp.sku = spa.sku
LEFT JOIN photo_progress pp ON pp.sku = spp.sku
LEFT JOIN sync_solar_term_info ti ON ti.solar_term_id = spp.solar_term
WHERE
spp.open_date > 0
AND spp.sale_status IN ( '正常销售', '保留页面', '限制跟卖暂保留', '发货限制安排跟卖' )
AND spp.site = 'Amazon.com'
AND spp.is_delete = 0
AND ti.`quarter` in ('Q1', 'Q2')
AND pp.id IS NULL
AND spp.lowest_price > 0
AND spp.thirty_day_sales > 0
AND spa.sku > ''
AND (spa.sku = #{sku} or spa.comb_parent_sku = #{sku})
</select>
</mapper>
src/main/resources/mapper/VideoProductMapper.xml
View file @
da13073c
...
...
@@ -12,5 +12,9 @@
vp.is_delete = 0
AND vvp.is_delete = 0
AND vp.site = 'Amazon.com'
and vp.sku in
<foreach
item=
"sku"
collection=
"skus"
open=
"("
separator=
","
close=
")"
>
#{sku}
</foreach>
</select>
</mapper>
src/test/java/cn/kk/spring_simple_operation/ExcelTest.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.util.ListUtils
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author kk
* @date 2025/1/2
*/
@SpringBootTest
public
class
ExcelTest
{
@Test
public
void
noModelWrite
()
{
// 写法1
String
fileName
=
"D:\\"
+
"noModelWrite"
+
System
.
currentTimeMillis
()
+
".xlsx"
;
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
EasyExcel
.
write
(
fileName
).
head
(
head
()).
sheet
(
"模板"
).
doWrite
(
dataList
());
}
private
List
<
List
<
String
>>
head
()
{
List
<
List
<
String
>>
list
=
ListUtils
.
newArrayList
();
List
<
String
>
head0
=
ListUtils
.
newArrayList
();
head0
.
add
(
"字符串"
+
System
.
currentTimeMillis
());
List
<
String
>
head1
=
ListUtils
.
newArrayList
();
head1
.
add
(
"数字"
+
System
.
currentTimeMillis
());
List
<
String
>
head2
=
ListUtils
.
newArrayList
();
head2
.
add
(
"日期"
+
System
.
currentTimeMillis
());
list
.
add
(
head0
);
list
.
add
(
head1
);
list
.
add
(
head2
);
return
list
;
}
private
List
<
List
<
Object
>>
dataList
()
{
List
<
List
<
Object
>>
list
=
ListUtils
.
newArrayList
();
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
List
<
Object
>
data
=
ListUtils
.
newArrayList
();
data
.
add
(
"字符串"
+
i
);
data
.
add
(
0.56
);
data
.
add
(
new
Date
());
list
.
add
(
data
);
}
return
list
;
}
}
src/test/java/cn/kk/spring_simple_operation/SpringSimpleOperationApplicationTests.java
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
;
import
cn.kk.spring_simple_operation.entity.SyncProductPublish
;
import
cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper
;
import
cn.kk.spring_simple_operation.mapper.VideoProductMapper
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.apache.commons.compress.utils.Lists
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@SpringBootTest
class
SpringSimpleOperationApplicationTests
{
private
static
final
BigDecimal
TWENTY
=
new
BigDecimal
(
"20"
);
private
static
final
BigDecimal
FORTY
=
new
BigDecimal
(
"40"
);
@Resource
private
SyncProductPublishMapper
syncProductPublishMapper
;
@Resource
private
VideoProductMapper
videoProductMapper
;
@Test
void
contextLoads
()
{
}
/**
* 1.已开售时间大于1个月 常规产品 无简易和精细化视频产品(正常销售)
* ① 单价<20美金,SKU或变体总月销100+
* ② 单价在20~40美金,SKU或变体总月销80+
* ③单价>40美金,SKU或变体总月销50+
* 2.已开售时间大于1个月 节气产品热卖期在1-6月 无简易和精细化视频产品(正常销售+保留页面)
* ① 单价<20美金,SKU或变体总月销100+
* ② 单价在20~40美金,SKU或变体总月销80+
* ③单价>40美金,SKU或变体总月销50+
*/
@Test
void
testSyncProductPublish
()
{
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
Map
<
String
,
Integer
>
salesMap
=
new
HashMap
<>();
salesMap
.
put
(
"0~20"
,
0
);
salesMap
.
put
(
"20~40"
,
0
);
salesMap
.
put
(
">40"
,
0
);
Set
<
String
>
haveSkuSet
=
new
HashSet
<>();
// 母体sku
List
<
SyncProductPublish
>
syncProductPublishes
=
syncProductPublishMapper
.
selectMotherSku
();
List
<
SyncProductPublish
>
syncProductPublishes_2
=
new
LinkedList
<>();
syncProductPublishes
.
forEach
(
item
->
{
List
<
SyncProductPublish
>
subList
=
syncProductPublishMapper
.
selectList
(
Wrappers
.<
SyncProductPublish
>
lambdaQuery
().
eq
(
SyncProductPublish:
:
getParentAsin
,
item
.
getRelationKey
()).
select
(
SyncProductPublish:
:
getSku
,
SyncProductPublish:
:
getThirtyDaySales
));
subList
.
add
(
item
);
String
s
=
checkPriceAndSales
(
subList
,
item
.
getLowestPrice
());
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap
.
put
(
s
,
salesMap
.
get
(
s
)
+
1
);
haveSkuSet
.
addAll
(
subList
.
stream
().
map
(
SyncProductPublish:
:
getSku
).
collect
(
Collectors
.
toList
()));
syncProductPublishes_2
.
addAll
(
subList
);
});
//System.out.println(JSONObject.toJSONString(salesMap));
printSkuList
(
syncProductPublishes_2
);
printMap
(
salesMap
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
Integer
>
salesMap_2
=
new
HashMap
<>();
salesMap_2
.
put
(
"0~20"
,
0
);
salesMap_2
.
put
(
"20~40"
,
0
);
salesMap_2
.
put
(
">40"
,
0
);
List
<
SyncProductPublish
>
publishList
=
syncProductPublishMapper
.
selectChildSku
();
List
<
SyncProductPublish
>
publishList_2
=
new
LinkedList
<>();
publishList
.
forEach
(
item
->
{
if
(
haveSkuSet
.
contains
(
item
.
getSku
()))
{
return
;
}
ArrayList
<
SyncProductPublish
>
list
=
new
ArrayList
<>();
list
.
add
(
item
);
String
s
=
checkPriceAndSales
(
list
,
item
.
getLowestPrice
());
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap_2
.
put
(
s
,
salesMap_2
.
get
(
s
)
+
1
);
publishList_2
.
add
(
item
);
});
//System.out.println(JSONObject.toJSONString(salesMap_2));
printSkuList
(
publishList_2
);
printMap
(
salesMap_2
);
}
private
String
checkPriceAndSales
(
List
<
SyncProductPublish
>
subList
,
BigDecimal
lowestPrice
)
{
if
(
CollectionUtils
.
isEmpty
(
subList
)
||
lowestPrice
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
return
null
;
}
int
sum
=
subList
.
stream
().
map
(
SyncProductPublish:
:
getThirtyDaySales
).
reduce
(
Integer:
:
sum
).
get
();
if
(
lowestPrice
.
compareTo
(
TWENTY
)
<=
0
&&
sum
>=
100
)
{
return
"0~20"
;
}
else
if
(
lowestPrice
.
compareTo
(
TWENTY
)
>
0
&&
lowestPrice
.
compareTo
(
FORTY
)
<=
0
&&
sum
>=
80
)
{
return
"20~40"
;
}
else
if
(
lowestPrice
.
compareTo
(
FORTY
)
>
0
&&
sum
>=
50
)
{
return
">40"
;
}
return
null
;
}
private
void
printSkuList
(
List
<
SyncProductPublish
>
list
)
{
list
.
forEach
(
item
->
{
String
content
=
String
.
format
(
"sku: %s, 30天销量: %d, price: %s, relationKey: %s, parentAsin: %s"
,
item
.
getSku
(),
item
.
getThirtyDaySales
(),
item
.
getLowestPrice
(),
item
.
getRelationKey
(),
item
.
getParentAsin
());
System
.
out
.
println
(
content
);
});
}
private
void
printMap
(
Map
<
String
,
Integer
>
salesMap
)
{
System
.
out
.
println
(
"0~20: "
+
salesMap
.
get
(
"0~20"
));
System
.
out
.
println
(
"20~40: "
+
salesMap
.
get
(
"20~40"
));
System
.
out
.
println
(
">40: "
+
salesMap
.
get
(
">40"
));
}
@Test
void
testSyncProductPublish_2
()
{
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
Map
<
String
,
Integer
>
salesMap
=
new
HashMap
<>();
salesMap
.
put
(
"0~20"
,
0
);
salesMap
.
put
(
"20~40"
,
0
);
salesMap
.
put
(
">40"
,
0
);
Set
<
String
>
haveSkuSet
=
new
HashSet
<>();
// 母体sku
List
<
SyncProductPublish
>
syncProductPublishes
=
syncProductPublishMapper
.
selectMotherSku_2
();
List
<
SyncProductPublish
>
syncProductPublishes_2
=
new
LinkedList
<>();
syncProductPublishes
.
forEach
(
item
->
{
List
<
SyncProductPublish
>
subList
=
syncProductPublishMapper
.
selectList
(
Wrappers
.<
SyncProductPublish
>
lambdaQuery
().
eq
(
SyncProductPublish:
:
getParentAsin
,
item
.
getRelationKey
()).
select
(
SyncProductPublish:
:
getSku
,
SyncProductPublish:
:
getThirtyDaySales
));
subList
.
add
(
item
);
String
s
=
checkPriceAndSales
(
subList
,
item
.
getLowestPrice
());
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap
.
put
(
s
,
salesMap
.
get
(
s
)
+
1
);
haveSkuSet
.
addAll
(
subList
.
stream
().
map
(
SyncProductPublish:
:
getSku
).
collect
(
Collectors
.
toList
()));
syncProductPublishes_2
.
addAll
(
subList
);
});
//System.out.println(JSONObject.toJSONString(salesMap));
printSkuList
(
syncProductPublishes_2
);
printMap
(
salesMap
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
Integer
>
salesMap_2
=
new
HashMap
<>();
salesMap_2
.
put
(
"0~20"
,
0
);
salesMap_2
.
put
(
"20~40"
,
0
);
salesMap_2
.
put
(
">40"
,
0
);
List
<
SyncProductPublish
>
publishList
=
syncProductPublishMapper
.
selectChildSku_2
();
List
<
SyncProductPublish
>
publishList_2
=
new
LinkedList
<>();
publishList
.
forEach
(
item
->
{
if
(
haveSkuSet
.
contains
(
item
.
getSku
()))
{
return
;
}
ArrayList
<
SyncProductPublish
>
list
=
new
ArrayList
<>();
list
.
add
(
item
);
String
s
=
checkPriceAndSales
(
list
,
item
.
getLowestPrice
());
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap_2
.
put
(
s
,
salesMap_2
.
get
(
s
)
+
1
);
publishList_2
.
add
(
item
);
});
//System.out.println(JSONObject.toJSONString(salesMap_2));
printSkuList
(
publishList_2
);
printMap
(
salesMap_2
);
}
}
//
package cn.kk.spring_simple_operation;
//
//
import cn.kk.spring_simple_operation.entity.SyncProductPublish;
//
import cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper;
//
import cn.kk.spring_simple_operation.mapper.VideoProductMapper;
//
import com.alibaba.fastjson.JSONObject;
//
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
//
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//
import org.apache.commons.compress.utils.Lists;
//
import org.junit.jupiter.api.Test;
//
import org.springframework.boot.test.context.SpringBootTest;
//
import org.springframework.util.CollectionUtils;
//
//
import javax.annotation.Resource;
//
import java.math.BigDecimal;
//
import java.util.*;
//
import java.util.stream.Collectors;
//
//
@SpringBootTest
//
class SpringSimpleOperationApplicationTests {
//
//
private static final BigDecimal TWENTY = new BigDecimal("20");
//
private static final BigDecimal FORTY = new BigDecimal("40");
//
@Resource
//
private SyncProductPublishMapper syncProductPublishMapper;
//
//
@Resource
//
private VideoProductMapper videoProductMapper;
//
//
//
@Test
//
void contextLoads() {
//
}
//
//
/**
//
* 1.已开售时间大于1个月 常规产品 无简易和精细化视频产品(正常销售)
//
* ① 单价<20美金,SKU或变体总月销100+
//
* ② 单价在20~40美金,SKU或变体总月销80+
//
* ③单价>40美金,SKU或变体总月销50+
//
* 2.已开售时间大于1个月 节气产品热卖期在1-6月 无简易和精细化视频产品(正常销售+保留页面)
//
* ① 单价<20美金,SKU或变体总月销100+
//
* ② 单价在20~40美金,SKU或变体总月销80+
//
* ③单价>40美金,SKU或变体总月销50+
//
*/
//
@Test
//
void testSyncProductPublish() {
//
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
//
//
Map<String, Integer> salesMap = new HashMap<>();
//
salesMap.put("0~20", 0);
//
salesMap.put("20~40", 0);
//
salesMap.put(">40", 0);
//
//
Set<String> haveSkuSet = new HashSet<>();
//
//
// 母体sku
//
List<SyncProductPublish> syncProductPublishes = syncProductPublishMapper.selectMotherSku();
//
List<SyncProductPublish> syncProductPublishes_2 = new LinkedList<>();
//
//
syncProductPublishes.forEach(item -> {
//
List<SyncProductPublish> subList = syncProductPublishMapper.selectList(Wrappers.<SyncProductPublish>lambdaQuery().eq(SyncProductPublish::getParentAsin, item.getRelationKey()).select(SyncProductPublish::getSku, SyncProductPublish::getThirtyDaySales));
//
subList.add(item);
//
//
String s = checkPriceAndSales(subList, item.getLowestPrice());
//
if (StringUtils.isBlank(s)) {
//
return;
//
}
//
salesMap.put(s, salesMap.get(s) + 1);
//
haveSkuSet.addAll(subList.stream().map(SyncProductPublish::getSku).collect(Collectors.toList()));
//
syncProductPublishes_2.addAll(subList);
//
});
//
//System.out.println(JSONObject.toJSONString(salesMap));
//
printSkuList(syncProductPublishes_2);
//
printMap(salesMap);
//
//
try {
//
Thread.sleep(1000);
//
} catch (InterruptedException e) {
//
e.printStackTrace();
//
}
//
//
Map<String, Integer> salesMap_2 = new HashMap<>();
//
salesMap_2.put("0~20", 0);
//
salesMap_2.put("20~40", 0);
//
salesMap_2.put(">40", 0);
//
//
List<SyncProductPublish> publishList = syncProductPublishMapper.selectChildSku();
//
List<SyncProductPublish> publishList_2 = new LinkedList<>();
//
//
publishList.forEach(item -> {
//
if (haveSkuSet.contains(item.getSku())) {
//
return;
//
}
//
ArrayList<SyncProductPublish> list = new ArrayList<>();
//
list.add(item);
//
String s = checkPriceAndSales(list, item.getLowestPrice());
//
if (StringUtils.isBlank(s)) {
//
return;
//
}
//
salesMap_2.put(s, salesMap_2.get(s) + 1);
//
publishList_2.add(item);
//
});
//
//System.out.println(JSONObject.toJSONString(salesMap_2));
//
printSkuList(publishList_2);
//
printMap(salesMap_2);
//
}
//
//
private String checkPriceAndSales(List<SyncProductPublish> subList, BigDecimal lowestPrice) {
//
if (CollectionUtils.isEmpty(subList) || lowestPrice.compareTo(BigDecimal.ZERO) < 0) {
//
return null;
//
}
//
int sum = subList.stream().map(SyncProductPublish::getThirtyDaySales).reduce(Integer::sum).get();
//
if (lowestPrice.compareTo(TWENTY) <= 0 && sum >= 100) {
//
return "0~20";
//
}
//
else if (lowestPrice.compareTo(TWENTY) > 0 && lowestPrice.compareTo(FORTY) <= 0 && sum >= 80) {
//
return "20~40";
//
}
//
else if (lowestPrice.compareTo(FORTY) > 0 && sum >= 50) {
//
return ">40";
//
}
//
return null;
//
}
//
//
private void printSkuList(List<SyncProductPublish> list) {
//
list.forEach(item -> {
//
String content = String.format("sku: %s, 30天销量: %d, price: %s, relationKey: %s, parentAsin: %s", item.getSku(), item.getThirtyDaySales(), item.getLowestPrice(), item.getRelationKey(), item.getParentAsin());
//
System.out.println(content);
//
});
//
}
//
//
private void printMap(Map<String, Integer> salesMap) {
//
System.out.println("0~20: " + salesMap.get("0~20"));
//
System.out.println("20~40: " + salesMap.get("20~40"));
//
System.out.println(">40: " + salesMap.get(">40"));
//
}
//
//
@Test
//
void testSyncProductPublish_2() {
//
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
//
//
Map<String, Integer> salesMap = new HashMap<>();
//
salesMap.put("0~20", 0);
//
salesMap.put("20~40", 0);
//
salesMap.put(">40", 0);
//
//
Set<String> haveSkuSet = new HashSet<>();
//
//
// 母体sku
//
List<SyncProductPublish> syncProductPublishes = syncProductPublishMapper.selectMotherSku_2();
//
List<SyncProductPublish> syncProductPublishes_2 = new LinkedList<>();
//
//
syncProductPublishes.forEach(item -> {
//
List<SyncProductPublish> subList = syncProductPublishMapper.selectList(Wrappers.<SyncProductPublish>lambdaQuery().eq(SyncProductPublish::getParentAsin, item.getRelationKey()).select(SyncProductPublish::getSku, SyncProductPublish::getThirtyDaySales));
//
subList.add(item);
//
//
String s = checkPriceAndSales(subList, item.getLowestPrice());
//
if (StringUtils.isBlank(s)) {
//
return;
//
}
//
salesMap.put(s, salesMap.get(s) + 1);
//
haveSkuSet.addAll(subList.stream().map(SyncProductPublish::getSku).collect(Collectors.toList()));
//
syncProductPublishes_2.addAll(subList);
//
});
//
//System.out.println(JSONObject.toJSONString(salesMap));
//
printSkuList(syncProductPublishes_2);
//
printMap(salesMap);
//
//
try {
//
Thread.sleep(1000);
//
} catch (InterruptedException e) {
//
e.printStackTrace();
//
}
//
//
Map<String, Integer> salesMap_2 = new HashMap<>();
//
salesMap_2.put("0~20", 0);
//
salesMap_2.put("20~40", 0);
//
salesMap_2.put(">40", 0);
//
//
List<SyncProductPublish> publishList = syncProductPublishMapper.selectChildSku_2();
//
List<SyncProductPublish> publishList_2 = new LinkedList<>();
//
//
publishList.forEach(item -> {
//
if (haveSkuSet.contains(item.getSku())) {
//
return;
//
}
//
ArrayList<SyncProductPublish> list = new ArrayList<>();
//
list.add(item);
//
String s = checkPriceAndSales(list, item.getLowestPrice());
//
if (StringUtils.isBlank(s)) {
//
return;
//
}
//
salesMap_2.put(s, salesMap_2.get(s) + 1);
//
publishList_2.add(item);
//
});
//
//System.out.println(JSONObject.toJSONString(salesMap_2));
//
printSkuList(publishList_2);
//
printMap(salesMap_2);
//
}
//
//
}
src/test/java/cn/kk/spring_simple_operation/SpringSimpleOperationApplicationTests2.java
0 → 100644
View file @
da13073c
package
cn
.
kk
.
spring_simple_operation
;
import
cn.kk.spring_simple_operation.entity.SyncProductPublish
;
import
cn.kk.spring_simple_operation.mapper.SyncProductAuditMapper
;
import
cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper
;
import
cn.kk.spring_simple_operation.mapper.VideoProductMapper
;
import
cn.kk.spring_simple_operation.model.SkuVideoVO
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.util.ListUtils
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@SpringBootTest
class
SpringSimpleOperationApplicationTests2
{
private
static
final
BigDecimal
TWENTY
=
new
BigDecimal
(
"20"
);
private
static
final
BigDecimal
THIRTY
=
new
BigDecimal
(
"30"
);
private
static
final
BigDecimal
FORTY
=
new
BigDecimal
(
"40"
);
private
static
final
BigDecimal
SIXTY
=
new
BigDecimal
(
"60"
);
@Resource
private
SyncProductPublishMapper
syncProductPublishMapper
;
@Resource
private
VideoProductMapper
videoProductMapper
;
@Resource
private
SyncProductAuditMapper
syncProductAuditMapper
;
@Test
void
contextLoads
()
{
}
private
Map
<
String
,
Integer
>
initSalesMap
()
{
Map
<
String
,
Integer
>
salesMap
=
new
HashMap
<>();
salesMap
.
put
(
"0~20"
,
0
);
salesMap
.
put
(
"20~30"
,
0
);
salesMap
.
put
(
"30~40"
,
0
);
salesMap
.
put
(
"40~60"
,
0
);
salesMap
.
put
(
">60"
,
0
);
return
salesMap
;
}
@Test
void
singleSkuSolarTerm_1
()
{
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
Map
<
String
,
Integer
>
salesMap
=
initSalesMap
();
List
<
SkuVideoVO
>
publishList
=
syncProductPublishMapper
.
selectChildSku
();
List
<
SkuVideoVO
>
publishList_2
=
new
LinkedList
<>();
publishList
.
forEach
(
item
->
{
ArrayList
<
SkuVideoVO
>
list
=
new
ArrayList
<>();
list
.
add
(
item
);
String
s
=
checkPriceAndSales
(
list
,
item
);
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap
.
put
(
s
,
salesMap
.
get
(
s
)
+
1
);
publishList_2
.
add
(
item
);
});
printMap
(
salesMap
);
exportSkuList
(
publishList_2
,
"常规产品--单个sku"
);
}
@Test
void
groupSkuSolarTerm_1
()
{
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
Map
<
String
,
Integer
>
salesMap
=
initSalesMap
();
List
<
String
>
motherList
=
syncProductAuditMapper
.
groupSkuSolarTerm_1
();
List
<
SkuVideoVO
>
publishList_2
=
new
LinkedList
<>();
motherList
.
forEach
(
sku
->
{
List
<
SkuVideoVO
>
skuVideoVOS
=
syncProductPublishMapper
.
groupSkuSolarTerm_1
(
sku
);
Optional
<
SkuVideoVO
>
first
=
skuVideoVOS
.
stream
().
filter
(
t
->
t
.
getSku
().
equals
(
sku
)).
findFirst
();
if
(!
first
.
isPresent
())
{
return
;
}
List
<
String
>
shortUrlSkuList
=
videoProductMapper
.
selectHaveTask
(
skuVideoVOS
.
stream
().
map
(
SkuVideoVO:
:
getSku
).
collect
(
Collectors
.
toList
()));
Iterator
<
SkuVideoVO
>
iterator
=
skuVideoVOS
.
iterator
();
while
(
iterator
.
hasNext
())
{
SkuVideoVO
skuVideoVO
=
iterator
.
next
();
if
(
shortUrlSkuList
.
contains
(
skuVideoVO
.
getSku
()))
{
iterator
.
remove
();
}
}
if
(
CollectionUtils
.
isEmpty
(
skuVideoVOS
))
{
return
;
}
String
s
=
checkPriceAndSales
(
skuVideoVOS
,
first
.
get
());
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap
.
put
(
s
,
salesMap
.
get
(
s
)
+
1
);
publishList_2
.
add
(
first
.
get
());
});
printMap
(
salesMap
);
exportSkuList
(
publishList_2
,
"常规产品--组合产品母体sku"
);
}
private
String
checkPriceAndSales
(
List
<
SkuVideoVO
>
subList
,
SkuVideoVO
item
)
{
BigDecimal
totalPrice
=
subList
.
stream
().
map
(
SkuVideoVO:
:
getLowestPrice
).
reduce
(
BigDecimal:
:
add
).
get
();
BigDecimal
lowestPrice
=
totalPrice
.
divide
(
new
BigDecimal
(
subList
.
size
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
if
(
CollectionUtils
.
isEmpty
(
subList
)
||
lowestPrice
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
return
null
;
}
int
sum
=
subList
.
stream
().
map
(
SkuVideoVO:
:
getThirtyDaySales
).
reduce
(
Integer:
:
sum
).
get
();
item
.
setThirtyDaySales
(
sum
);
item
.
setLowestPrice
(
lowestPrice
);
if
(
lowestPrice
.
compareTo
(
TWENTY
)
<=
0
&&
sum
>=
25
)
{
return
"0~20"
;
}
else
if
(
lowestPrice
.
compareTo
(
TWENTY
)
>
0
&&
lowestPrice
.
compareTo
(
THIRTY
)
<=
0
&&
sum
>=
15
)
{
return
"20~30"
;
}
else
if
(
lowestPrice
.
compareTo
(
THIRTY
)
>
0
&&
lowestPrice
.
compareTo
(
FORTY
)
<=
0
&&
sum
>=
10
)
{
return
"30~40"
;
}
else
if
(
lowestPrice
.
compareTo
(
FORTY
)
>
0
&&
lowestPrice
.
compareTo
(
SIXTY
)
<=
0
&&
sum
>=
8
)
{
return
"40~60"
;
}
else
if
(
lowestPrice
.
compareTo
(
SIXTY
)
>
0
&&
sum
>=
5
)
{
return
">60"
;
}
return
null
;
}
private
void
printSkuList
(
List
<
SyncProductPublish
>
list
)
{
list
.
forEach
(
item
->
{
String
content
=
String
.
format
(
"sku: %s, 30天销量: %d, price: %s, relationKey: %s, parentAsin: %s"
,
item
.
getSku
(),
item
.
getThirtyDaySales
(),
item
.
getLowestPrice
(),
item
.
getRelationKey
(),
item
.
getParentAsin
());
System
.
out
.
println
(
content
);
});
}
private
void
exportSkuList
(
List
<
SkuVideoVO
>
list
,
String
originName
)
{
list
.
sort
(
Comparator
.
comparing
(
SkuVideoVO:
:
getLowestPrice
));
List
<
List
<
Object
>>
dataList
=
ListUtils
.
newArrayList
();
for
(
SkuVideoVO
syncProductPublish
:
list
)
{
List
<
Object
>
data
=
ListUtils
.
newArrayList
();
data
.
add
(
syncProductPublish
.
getSku
());
data
.
add
(
syncProductPublish
.
getLowestPrice
());
data
.
add
(
syncProductPublish
.
getThirtyDaySales
());
data
.
add
(
syncProductPublish
.
getSaleStatus
());
data
.
add
(
syncProductPublish
.
getUsUploadInfo
());
dataList
.
add
(
data
);
}
// 写法1
String
fileName
=
"D:\\"
+
originName
+
"_"
+
System
.
currentTimeMillis
()
+
".xlsx"
;
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
EasyExcel
.
write
(
fileName
).
head
(
head
()).
sheet
(
originName
).
doWrite
(
dataList
);
}
private
void
printMap
(
Map
<
String
,
Integer
>
salesMap
)
{
System
.
out
.
println
(
"0~20: "
+
salesMap
.
get
(
"0~20"
));
System
.
out
.
println
(
"20~30: "
+
salesMap
.
get
(
"20~30"
));
System
.
out
.
println
(
"30~40: "
+
salesMap
.
get
(
"30~40"
));
System
.
out
.
println
(
"40~60: "
+
salesMap
.
get
(
"40~60"
));
System
.
out
.
println
(
">60: "
+
salesMap
.
get
(
">60"
));
}
private
List
<
List
<
String
>>
head
()
{
List
<
List
<
String
>>
list
=
ListUtils
.
newArrayList
();
List
<
String
>
head0
=
ListUtils
.
newArrayList
();
head0
.
add
(
"sku"
);
List
<
String
>
head1
=
ListUtils
.
newArrayList
();
head1
.
add
(
"单价"
);
List
<
String
>
head2
=
ListUtils
.
newArrayList
();
head2
.
add
(
"月销"
);
List
<
String
>
head3
=
ListUtils
.
newArrayList
();
head3
.
add
(
"销售状态"
);
List
<
String
>
head4
=
ListUtils
.
newArrayList
();
head4
.
add
(
"是否拍摄"
);
list
.
add
(
head0
);
list
.
add
(
head1
);
list
.
add
(
head2
);
list
.
add
(
head3
);
list
.
add
(
head4
);
return
list
;
}
@Test
void
singleSkuSolarTerm_Q1Q2
()
{
Map
<
String
,
Integer
>
salesMap
=
initSalesMap
();
List
<
SkuVideoVO
>
publishList
=
syncProductPublishMapper
.
selectChildSku_2
();
List
<
SkuVideoVO
>
publishList_2
=
new
LinkedList
<>();
publishList
.
forEach
(
item
->
{
ArrayList
<
SkuVideoVO
>
list
=
new
ArrayList
<>();
list
.
add
(
item
);
String
s
=
checkPriceAndSales
(
list
,
item
);
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap
.
put
(
s
,
salesMap
.
get
(
s
)
+
1
);
publishList_2
.
add
(
item
);
});
printMap
(
salesMap
);
exportSkuList
(
publishList_2
,
"节气产品--单个sku"
);
}
@Test
void
groupSkuSolarTerm_Q1Q2
()
{
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
Map
<
String
,
Integer
>
salesMap
=
initSalesMap
();
List
<
String
>
motherList
=
syncProductAuditMapper
.
groupSkuSolarTerm_Q1Q2
();
List
<
SkuVideoVO
>
publishList_2
=
new
LinkedList
<>();
motherList
.
forEach
(
sku
->
{
List
<
SkuVideoVO
>
skuVideoVOS
=
syncProductPublishMapper
.
groupSkuSolarTerm_Q1Q2
(
sku
);
Optional
<
SkuVideoVO
>
first
=
skuVideoVOS
.
stream
().
filter
(
t
->
t
.
getSku
().
equals
(
sku
)).
findFirst
();
if
(!
first
.
isPresent
())
{
return
;
}
List
<
String
>
shortUrlSkuList
=
videoProductMapper
.
selectHaveTask
(
skuVideoVOS
.
stream
().
map
(
SkuVideoVO:
:
getSku
).
collect
(
Collectors
.
toList
()));
skuVideoVOS
.
removeIf
(
skuVideoVO
->
shortUrlSkuList
.
contains
(
skuVideoVO
.
getSku
()));
if
(
CollectionUtils
.
isEmpty
(
skuVideoVOS
))
{
return
;
}
String
s
=
checkPriceAndSales
(
skuVideoVOS
,
first
.
get
());
if
(
StringUtils
.
isBlank
(
s
))
{
return
;
}
salesMap
.
put
(
s
,
salesMap
.
get
(
s
)
+
1
);
publishList_2
.
add
(
first
.
get
());
});
printMap
(
salesMap
);
exportSkuList
(
publishList_2
,
"节气产品--组合产品母体sku"
);
}
}
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