Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
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
huluobin
dc-java
Commits
cfff1274
Commit
cfff1274
authored
Aug 24, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
头程费用计算
亚马逊广告
parent
56e48859
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
82 additions
and
69 deletions
+82
-69
AmazonAdGenerateReportIdJob.java
...n/java/com/bailuntec/job/AmazonAdGenerateReportIdJob.java
+3
-3
CompanyTest.java
data-base/base-sync-company/src/test/java/CompanyTest.java
+0
-28
DcBaseCostFirstMapper.java
...main/java/com/bailuntec/mapper/DcBaseCostFirstMapper.java
+1
-1
DcBaseCostFirstMapper.xml
.../main/java/com/bailuntec/mapper/DcBaseCostFirstMapper.xml
+1
-2
DcMidCostFirstMapper.java
.../main/java/com/bailuntec/mapper/DcMidCostFirstMapper.java
+8
-0
DcMidCostFirstMapper.xml
...c/main/java/com/bailuntec/mapper/DcMidCostFirstMapper.xml
+60
-22
DcMidCostFirstOrderMapper.java
.../java/com/bailuntec/mapper/DcMidCostFirstOrderMapper.java
+0
-1
DcMidCostFirstOrderMapper.xml
...n/java/com/bailuntec/mapper/DcMidCostFirstOrderMapper.xml
+7
-9
CalculateCostFirstJob.java
...rc/main/java/com/bailuntec/job/CalculateCostFirstJob.java
+0
-0
CostFirstTest.java
...mid-calculate-cost-first/src/test/java/CostFirstTest.java
+1
-2
CalculateCostFirstJobTest.java
...est/java/com/bailuntec/job/CalculateCostFirstJobTest.java
+1
-1
No files found.
data-base/base-sync-amazon-ad/src/main/java/com/bailuntec/job/AmazonAdGenerateReportIdJob.java
View file @
cfff1274
...
...
@@ -46,10 +46,10 @@ public class AmazonAdGenerateReportIdJob implements SimpleJob {
dcBaseCompanyAccountList
.
forEach
(
dcBaseCompanyAccount
->
{
try
{
//
LocalDateTime
reportDate
=
LocalDateTime
.
now
().
minusDays
(
1
).
minusHours
(
12
);
// LocalDateTime reportDate = LocalDateTime.now().minusDays(1).minusHours(12);
LocalDateTime
reportDate
=
LocalDateTime
.
of
(
2020
,
8
,
21
,
0
,
0
);
// LocalDateTime reportDate = LocalDateTime.of(2020, 8, 22, 0, 0);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"reportDate"
,
reportDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
)));
jsonObject
.
put
(
"metrics"
,
propertiesUtil
.
getPropertyAsString
(
"METRICS"
));
...
...
data-base/base-sync-company/src/test/java/CompanyTest.java
deleted
100644 → 0
View file @
56e48859
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.job.CompanyAccountSyncJob
;
import
com.bailuntec.job.CompanyInfoSyncJob
;
import
com.bailuntec.job.CompanyStaffSyncJob
;
import
org.junit.jupiter.api.Test
;
import
java.time.LocalDateTime
;
public
class
CompanyTest
{
@Test
public
void
test
()
{
CompanyInfoSyncJob
skuSyncJob
=
new
CompanyInfoSyncJob
();
skuSyncJob
.
executeJob
(
null
,
new
JobPointLog
(
""
,
0
,
100
,
1
,
1
,
LocalDateTime
.
now
().
minusMonths
(
1
),
LocalDateTime
.
now
().
minusDays
(
29
)));
}
@Test
public
void
test2
()
{
CompanyStaffSyncJob
skuSyncJob
=
new
CompanyStaffSyncJob
();
skuSyncJob
.
executeJob
(
null
,
new
JobPointLog
(
""
,
0
,
100
,
1
,
1
,
LocalDateTime
.
now
().
minusMonths
(
1
),
LocalDateTime
.
now
().
minusDays
(
29
)));
}
@Test
public
void
test3
()
{
CompanyAccountSyncJob
skuSyncJob
=
new
CompanyAccountSyncJob
();
skuSyncJob
.
execute
(
null
);
}
}
data-common/src/main/java/com/bailuntec/mapper/DcBaseCostFirstMapper.java
View file @
cfff1274
...
...
@@ -139,5 +139,5 @@ public interface DcBaseCostFirstMapper {
* @param pageOffset 分页参数
* @return 未计算的基础头程费用
*/
List
<
DcBaseCostFirst
>
listUnCalc
(
@Param
(
"pageStart"
)
Integer
pageStart
,
@Param
(
"pageOffset"
)
Integer
pageOffset
);
List
<
DcBaseCostFirst
>
dcBaseCostGroupList
(
@Param
(
"pageStart"
)
Integer
pageStart
,
@Param
(
"pageOffset"
)
Integer
pageOffset
);
}
data-common/src/main/java/com/bailuntec/mapper/DcBaseCostFirstMapper.xml
View file @
cfff1274
...
...
@@ -834,7 +834,7 @@
# and has_calculation = 0
GROUP BY channel_order_id, transfer_order_id, box_id, warehouse_code) tb;
</select>
<select
id=
"
listUnCalc
"
resultType=
"com.bailuntec.domain.entity.DcBaseCostFirst"
>
<select
id=
"
dcBaseCostGroupList
"
resultType=
"com.bailuntec.domain.entity.DcBaseCostFirst"
>
SELECT t2.*
from (
SELECT channel_order_id, transfer_order_id, box_id, warehouse_code
...
...
@@ -857,7 +857,6 @@
and transfer_order_id = #{transferOrderId}
and box_id = #{boxId}
and warehouse_code = #{warehouseCode}
# and has_calculation = 0
</update>
...
...
data-common/src/main/java/com/bailuntec/mapper/DcMidCostFirstMapper.java
View file @
cfff1274
...
...
@@ -121,4 +121,12 @@ public interface DcMidCostFirstMapper {
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertSelective
(
DcMidCostFirst
record
);
/**
* 批量插入更细
*
* @param dcMidCostFirstList
*/
void
upsertBatch
(
@Param
(
"lists"
)
List
<
DcMidCostFirst
>
dcMidCostFirstList
);
}
data-common/src/main/java/com/bailuntec/mapper/DcMidCostFirstMapper.xml
View file @
cfff1274
...
...
@@ -6,14 +6,14 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"cost_first"
jdbcType=
"DECIMAL"
property=
"costFirst"
/>
<result
column=
"bailun_sku"
jdbcType=
"VARCHAR"
property=
"bailunSku"
/>
<result
column=
"warehouse_code"
jdbcType=
"VARCHAR"
property=
"warehouseCode"
/>
<result
column=
"company_id"
jdbcType=
"INTEGER"
property=
"companyId"
/>
<result
column=
"has_calculation"
jdbcType=
"BIT"
property=
"hasCalculation"
/>
<result
column=
"cost_count"
jdbcType=
"INTEGER"
property=
"costCount"
/>
<result
column=
"has_config"
jdbcType=
"BIT"
property=
"hasConfig"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"cost_first"
jdbcType=
"DECIMAL"
property=
"costFirst"
/>
<result
column=
"bailun_sku"
jdbcType=
"VARCHAR"
property=
"bailunSku"
/>
<result
column=
"warehouse_code"
jdbcType=
"VARCHAR"
property=
"warehouseCode"
/>
<result
column=
"company_id"
jdbcType=
"INTEGER"
property=
"companyId"
/>
<result
column=
"has_calculation"
jdbcType=
"BIT"
property=
"hasCalculation"
/>
<result
column=
"cost_count"
jdbcType=
"INTEGER"
property=
"costCount"
/>
<result
column=
"has_config"
jdbcType=
"BIT"
property=
"hasConfig"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -37,7 +37,8 @@
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
...
...
@@ -70,7 +71,8 @@
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
...
...
@@ -89,7 +91,8 @@
id, cost_first, bailun_sku, warehouse_code, company_id, has_calculation, cost_count,
has_config
</sql>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcMidCostFirstExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcMidCostFirstExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
...
...
@@ -98,10 +101,10 @@
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from dc_mid_cost_first
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
...
...
@@ -121,7 +124,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from dc_mid_cost_first
where id = #{id,jdbcType=INTEGER}
</select>
...
...
@@ -140,7 +143,7 @@
-->
delete from dc_mid_cost_first
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.bailuntec.domain.entity.DcMidCostFirst"
>
...
...
@@ -214,14 +217,15 @@
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcMidCostFirstExample"
resultType=
"java.lang.Long"
>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcMidCostFirstExample"
resultType=
"java.lang.Long"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dc_mid_cost_first
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
...
...
@@ -257,7 +261,7 @@
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
...
...
@@ -275,7 +279,7 @@
cost_count = #{record.costCount,jdbcType=INTEGER},
has_config = #{record.hasConfig,jdbcType=BIT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.bailuntec.domain.entity.DcMidCostFirst"
>
...
...
@@ -324,6 +328,39 @@
has_config = #{hasConfig,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"upsertBatch"
>
insert into dc_mid_cost_first
(
cost_first,
bailun_sku,
warehouse_code,
company_id,
has_calculation,
cost_count,
has_config)
values
<foreach
collection=
"lists"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.costFirst,jdbcType=DECIMAL},
#{item.bailunSku,jdbcType=VARCHAR},
#{item.warehouseCode,jdbcType=VARCHAR},
#{item.companyId,jdbcType=INTEGER},
#{item.hasCalculation,jdbcType=BIT},
#{item.costCount,jdbcType=INTEGER},
#{item.hasConfig,jdbcType=BIT}
)
</foreach>
on duplicate key update
cost_first = values(cost_first),
bailun_sku = values(bailun_sku),
warehouse_code = values(warehouse_code),
company_id = values(company_id),
has_calculation = values(has_calculation),
cost_count = values(cost_count),
has_config = values(has_config)
</update>
<insert
id=
"upsertSelective"
parameterType=
"com.bailuntec.domain.entity.DcMidCostFirst"
>
<!--
WARNING - @mbg.generated
...
...
@@ -435,17 +472,18 @@
cost_count = #{costCount,jdbcType=INTEGER},
has_config = #{hasConfig,jdbcType=BIT}
</insert>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcMidCostFirstExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcMidCostFirstExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from dc_mid_cost_first
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
...
...
data-common/src/main/java/com/bailuntec/mapper/DcMidCostFirstOrderMapper.java
View file @
cfff1274
...
...
@@ -129,6 +129,5 @@ public interface DcMidCostFirstOrderMapper {
List
<
MidCostFirst
>
listSkuWarehouse
(
@Param
(
"v1"
)
int
v1
,
@Param
(
"v2"
)
int
v2
);
int
updateHasCalculation
(
MidCostFirst
midCostFirst
);
}
data-common/src/main/java/com/bailuntec/mapper/DcMidCostFirstOrderMapper.xml
View file @
cfff1274
...
...
@@ -577,28 +577,26 @@
limit 1
</select>
<!---->
<select
id=
"countSkuWarehouse"
resultType=
"int"
>
select count(*)
from (SELECT * FROM dc_mid_cost_first_order where has_calculation = 0 GROUP BY bailun_sku, warehouse_code) tb;
from (SELECT *
FROM dc_mid_cost_first_order
GROUP BY bailun_sku, warehouse_code) tb;
</select>
<!---->
<select
id=
"listSkuWarehouse"
resultType=
"com.bailuntec.domain.pojo.MidCostFirst"
>
SELECT bailun_sku,
warehouse_code,
sum(cost_first) as total_cost_first,
sum(quantity) as total_count
FROM dc_mid_cost_first_order
where has_calculation = 0
GROUP BY bailun_sku, warehouse_code
order by id
asc
order by id
limit #{v1}, #{v2}
</select>
<update
id=
"updateHasCalculation"
>
update dc_mid_cost_first_order
set has_calculation = 1
where bailun_sku = #{bailunSku}
and warehouse_code = #{warehouseCode}
</update>
</mapper>
data-mid/mid-calculate-cost-first/src/main/java/com/bailuntec/job/CalculateCostFirstJob.java
View file @
cfff1274
This diff is collapsed.
Click to expand it.
data-mid/mid-calculate-cost-first/src/test/java/CostFirstTest.java
View file @
cfff1274
...
...
@@ -2,7 +2,6 @@ import com.bailuntec.domain.constant.Constant;
import
com.bailuntec.domain.entity.DcBaseSku
;
import
com.bailuntec.domain.entity.DcMidCostFirst
;
import
com.bailuntec.domain.entity.DcMidCostFirstConfig
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.example.DcBaseSkuExample
;
import
com.bailuntec.domain.example.DcMidCostFirstExample
;
import
com.bailuntec.domain.pojo.MidCostFirst
;
...
...
@@ -37,7 +36,7 @@ public class CostFirstTest {
@Test
public
void
test
()
{
CalculateCostFirstJob
costFirstJob
=
new
CalculateCostFirstJob
();
costFirstJob
.
execute
Job
(
null
,
new
JobPointLog
(
"dc-mid-calculate-cost-first"
,
1
,
100
,
null
,
null
,
null
,
null
)
);
costFirstJob
.
execute
(
null
);
}
@Test
...
...
data-mid/mid-calculate-cost-first/src/test/java/com/bailuntec/job/CalculateCostFirstJobTest.java
View file @
cfff1274
...
...
@@ -20,6 +20,6 @@ class CalculateCostFirstJobTest {
JobPointLog
jobPointLog
=
new
JobPointLog
();
jobPointLog
.
setPageSize
(
1000
);
jobPointLog
.
setPageIndex
(
1
);
calculateCostFirstJob
.
execute
Job
(
null
,
jobPointLog
);
calculateCostFirstJob
.
execute
(
null
);
}
}
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