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
6784d946
Commit
6784d946
authored
Nov 28, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购在途 周转
parent
1a831e4f
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
368 additions
and
223 deletions
+368
-223
pom.xml
data-base/base-sync-finance-ebay/pom.xml
+1
-1
OrderSyncJob30.java
...order/src/main/java/com/bailuntec/job/OrderSyncJob30.java
+11
-28
OrderSyncJobTest.java
...der/src/test/java/com/bailuntec/job/OrderSyncJobTest.java
+2
-3
SalesDetailItem.java
...c/main/java/com/bailuntec/domain/dto/SalesDetailItem.java
+38
-0
DcBaseWeekCoefficient.java
...va/com/bailuntec/domain/entity/DcBaseWeekCoefficient.java
+4
-0
DcBaseOmsSku30Mapper.java
.../main/java/com/bailuntec/mapper/DcBaseOmsSku30Mapper.java
+2
-0
DcBaseOmsSku30Mapper.xml
...c/main/java/com/bailuntec/mapper/DcBaseOmsSku30Mapper.xml
+117
-113
DcBaseStockMapper.xml
.../src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
+2
-1
DcBaseWeekCoefficientMapper.java
...ava/com/bailuntec/mapper/DcBaseWeekCoefficientMapper.java
+8
-1
DcBaseWeekCoefficientMapper.xml
...java/com/bailuntec/mapper/DcBaseWeekCoefficientMapper.xml
+37
-22
DcMidTransitMapper.xml
...src/main/java/com/bailuntec/mapper/DcMidTransitMapper.xml
+1
-1
SalesDayConfigMapper.java
.../main/java/com/bailuntec/mapper/SalesDayConfigMapper.java
+8
-1
SalesDayConfigMapper.xml
...c/main/java/com/bailuntec/mapper/SalesDayConfigMapper.xml
+42
-25
pom.xml
data-finance/finance-balance-sheet/pom.xml
+11
-0
BalanceSheetServiceTest.java
...iluntec/balancesheet/service/BalanceSheetServiceTest.java
+2
-2
pom.xml
data-show/show-auto-turnover/pom.xml
+3
-3
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+65
-8
job.properties
...show/show-auto-turnover/src/main/resources/job.properties
+2
-1
AutoTurnoverTest.java
...ow/show-auto-turnover/src/test/java/AutoTurnoverTest.java
+2
-2
AutoTurnoverJobTest.java
.../src/test/java/com/bailuntec/job/AutoTurnoverJobTest.java
+10
-11
No files found.
data-base/base-sync-finance-ebay/pom.xml
View file @
6784d946
...
...
@@ -22,12 +22,12 @@
<groupId>
com.bailuntec
</groupId>
<artifactId>
data-common
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
io.github.linus87
</groupId>
<artifactId>
ebaycalls
</artifactId>
...
...
data-base/base-sync-oms-order/src/main/java/com/bailuntec/job/OrderSyncJob30.java
View file @
6784d946
package
com
.
bailuntec
.
job
;
import
com.alibaba.fastjson.JSON
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.constant.Constant
;
import
com.bailuntec.domain.entity.*
;
import
com.bailuntec.domain.enumerate.OrderExceptionStatus
;
import
com.bailuntec.domain.enumerate.OrderExceptionType
;
import
com.bailuntec.domain.enumerate.PlatformType
;
import
com.bailuntec.domain.example.*
;
import
com.bailuntec.domain.pojo.*
;
import
com.bailuntec.mapper.*
;
import
com.bailuntec.support.CallBailunSystem
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.mapper.DcBaseOmsSku30Mapper
;
import
com.bailuntec.support.PointJob
;
import
com.bailuntec.utils.ExceptionUtil
;
import
com.bailuntec.utils.OkHttpUtil
;
import
com.bailuntec.utils.PropertiesUtil
;
import
com.bailuntec.utils.SessionUtil
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.session.SqlSession
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
public
class
OrderSyncJob30
extends
PointJob
{
...
...
@@ -42,7 +18,14 @@ public class OrderSyncJob30 extends PointJob {
@Override
public
void
executeJob
(
ShardingContext
shardingContext
,
JobPointLog
jobPointLog
)
{
String
queryTime
=
DateTimeFormatter
.
ofPattern
(
CommonConstant
.
DATE_FORMAT
).
format
(
LocalDate
.
now
());
DcBaseOmsSku30Mapper
dcBaseOmsSku30Mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseOmsSku30Mapper
.
class
);
SqlSession
sqlSession
=
SessionUtil
.
getFactory
().
openSession
(
true
);
DcBaseOmsSku30Mapper
dcBaseOmsSku30Mapper
=
sqlSession
.
getMapper
(
DcBaseOmsSku30Mapper
.
class
);
try
{
dcBaseOmsSku30Mapper
.
truncateTable
();
dcBaseOmsSku30Mapper
.
upsertByOmsSku
(
queryTime
);
}
finally
{
sqlSession
.
close
();
}
}
}
data-base/base-sync-oms-order/src/test/java/com/bailuntec/job/OrderSyncJobTest.java
View file @
6784d946
...
...
@@ -57,9 +57,8 @@ public class OrderSyncJobTest {
@Test
public
void
testBigDecimal
()
{
BigDecimal
totalCost
=
BigDecimal
.
ONE
;
totalCost
=
this
.
calc
(
totalCost
);
System
.
out
.
println
(
totalCost
);
OrderSyncJob30
orderSyncJob30
=
new
OrderSyncJob30
();
orderSyncJob30
.
executeJob
(
null
,
null
);
}
...
...
data-common/src/main/java/com/bailuntec/domain/dto/SalesDetailItem.java
0 → 100644
View file @
6784d946
package
com
.
bailuntec
.
domain
.
dto
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/11/28 3:56 下午
*/
@Data
public
class
SalesDetailItem
{
private
BigDecimal
sales
;
private
LocalDate
date
;
private
BigDecimal
weekCoefficient
;
private
BigDecimal
salesDayConfig
;
private
String
bailunSku
;
private
String
warehouseCode
;
private
BigDecimal
showSales
;
public
void
calcShowSales
()
{
this
.
showSales
=
sales
;
if
(
salesDayConfig
!=
null
)
{
this
.
showSales
=
salesDayConfig
;
}
if
(
weekCoefficient
!=
null
)
{
this
.
showSales
=
showSales
.
multiply
(
weekCoefficient
);
}
}
}
data-common/src/main/java/com/bailuntec/domain/entity/DcBaseWeekCoefficient.java
View file @
6784d946
package
com
.
bailuntec
.
domain
.
entity
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
lombok.Data
;
...
...
@@ -77,6 +78,9 @@ public class DcBaseWeekCoefficient {
*/
private
String
formula
;
private
LocalDate
weekDate
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_week_coefficient
...
...
data-common/src/main/java/com/bailuntec/mapper/DcBaseOmsSku30Mapper.java
View file @
6784d946
...
...
@@ -123,4 +123,6 @@ public interface DcBaseOmsSku30Mapper {
int
upsertSelective
(
DcBaseOmsSku30
record
);
int
upsertByOmsSku
(
@Param
(
"queryTime"
)
String
queryTime
);
void
truncateTable
();
}
data-common/src/main/java/com/bailuntec/mapper/DcBaseOmsSku30Mapper.xml
View file @
6784d946
...
...
@@ -3494,118 +3494,122 @@
where pay_time
>
= DATE_SUB(#{queryTime}, INTERVAL 31 DAY)
and pay_time
<
#{queryTime}
on duplicate key update
origin_order_id = values(origin_order_id),
platform_type = values(platform_type),
transaction_id = values(transaction_id),
pay_time = values(pay_time),
pay_method = values(pay_method),
pay_account = values(pay_account),
pay_status = values(pay_status),
collection_account = values(collection_account),
platform_order_type = values(platform_order_type),
website = values(website),
create_time = values(create_time),
paid_time = values(paid_time),
refund_time = values(refund_time),
seller_id = values(seller_id),
bailun_account_id = values(bailun_account_id),
hq_account = values(hq_account),
seller_account = values(seller_account),
seller_order_id = values(seller_order_id),
seller_email = values(seller_email),
order_update_time = values(order_update_time),
seller_order_exchange_rate = values(seller_order_exchange_rate),
seller_other_exchange_rate = values(seller_other_exchange_rate),
finance_order_exchange_rate = values(finance_order_exchange_rate),
finance_other_exchange_rate = values(finance_other_exchange_rate),
cny_to_usd_exchange_rate = values(cny_to_usd_exchange_rate),
order_to_usd_exchange_rate = values(order_to_usd_exchange_rate),
other_to_usd_exchange_rate = values(other_to_usd_exchange_rate),
order_currency = values(order_currency),
other_currency = values(other_currency),
seller_name = values(seller_name),
bailun_order_id = values(bailun_order_id),
platform_order_status = values(platform_order_status),
bailun_order_status = values(bailun_order_status),
bailun_payment_status = values(bailun_payment_status),
bailun_interception_status = values(bailun_interception_status),
shipping_status = values(shipping_status),
bailun_sku = values(bailun_sku),
bailun_sku_title_en = values(bailun_sku_title_en),
bailun_sku_title_cn = values(bailun_sku_title_cn),
bailun_sku_quantity_ordered = values(bailun_sku_quantity_ordered),
bailun_sku_quantity_shipped = values(bailun_sku_quantity_shipped),
bailun_sku_quantity_refund = values(bailun_sku_quantity_refund),
bailun_sku_quantity_picked = values(bailun_sku_quantity_picked),
warehouse_name = values(warehouse_name),
warehouse_code_fba = values(warehouse_code_fba),
warehouse_code = values(warehouse_code),
bailun_sku_unit_price = values(bailun_sku_unit_price),
bailun_sku_weight = values(bailun_sku_weight),
bailun_sku_size = values(bailun_sku_size),
amount_sales = values(amount_sales),
amount_total = values(amount_total),
amount_shipping = values(amount_shipping),
amount_product = values(amount_product),
amount_tax = values(amount_tax),
amount_adjustment = values(amount_adjustment),
amount_gift_wrap = values(amount_gift_wrap),
amount_refund = values(amount_refund),
amount_prepaid = values(amount_prepaid),
cost_total = values(cost_total),
cost_promotion = values(cost_promotion),
cost_platform_fee = values(cost_platform_fee),
cost_product = values(cost_product),
cost_shipping = values(cost_shipping),
cost_package = values(cost_package),
cost_fba_fee = values(cost_fba_fee),
cost_paypal_fee = values(cost_paypal_fee),
cost_refund_commisson = values(cost_refund_commisson),
cost_handle_bailun = values(cost_handle_bailun),
cost_handle_platform = values(cost_handle_platform),
cost_tail = values(cost_tail),
cost_first = values(cost_first),
cost_logistics = values(cost_logistics),
profit_total = values(profit_total),
profit_rate = values(profit_rate),
receipt_country = values(receipt_country),
receipt_city = values(receipt_city),
receipt_area = values(receipt_area),
receipt_address = values(receipt_address),
receipt_address_2 = values(receipt_address_2),
receipt_postal_code = values(receipt_postal_code),
receiver = values(receiver),
receiver_phone = values(receiver_phone),
buyer_id = values(buyer_id),
buyer_name = values(buyer_name),
buyer_email = values(buyer_email),
has_fba_exception = values(has_fba_exception),
has_platform_exception = values(has_platform_exception),
has_cancle = values(has_cancle),
area_id = values(area_id),
bailun_category_id = values(bailun_category_id),
bailun_category_name = values(bailun_category_name),
gmt_create = values(gmt_create),
gmt_modified = values(gmt_modified),
ratio_weight = values(ratio_weight),
ratio_price = values(ratio_price),
bailun_picking_status = values(bailun_picking_status),
bailun_require_logistics = values(bailun_require_logistics),
has_delete = values(has_delete),
has_scalp = values(has_scalp),
has_buyer_remark = values(has_buyer_remark),
has_platsku_remark = values(has_platsku_remark),
logistics_method_code = values(logistics_method_code),
logistics_method_name = values(logistics_method_name),
has_innersale = values(has_innersale),
company_id = values(company_id),
bailun_refund_status = values(bailun_refund_status),
refund_obj = values(refund_obj),
refund_type = values(refund_type),
refund_reference_id = values(refund_reference_id),
has_fba_s = values(has_fba_s),
bailun_sku_quantity_pushed = values(bailun_sku_quantity_pushed),
amount_general_cargo = values(amount_general_cargo),
has_transfer_order = values(has_transfer_order)
origin_order_id = values(origin_order_id),
platform_type = values(platform_type),
transaction_id = values(transaction_id),
pay_time = values(pay_time),
pay_method = values(pay_method),
pay_account = values(pay_account),
pay_status = values(pay_status),
collection_account = values(collection_account),
platform_order_type = values(platform_order_type),
website = values(website),
create_time = values(create_time),
paid_time = values(paid_time),
refund_time = values(refund_time),
seller_id = values(seller_id),
bailun_account_id = values(bailun_account_id),
hq_account = values(hq_account),
seller_account = values(seller_account),
seller_order_id = values(seller_order_id),
seller_email = values(seller_email),
order_update_time = values(order_update_time),
seller_order_exchange_rate = values(seller_order_exchange_rate),
seller_other_exchange_rate = values(seller_other_exchange_rate),
finance_order_exchange_rate = values(finance_order_exchange_rate),
finance_other_exchange_rate = values(finance_other_exchange_rate),
cny_to_usd_exchange_rate = values(cny_to_usd_exchange_rate),
order_to_usd_exchange_rate = values(order_to_usd_exchange_rate),
other_to_usd_exchange_rate = values(other_to_usd_exchange_rate),
order_currency = values(order_currency),
other_currency = values(other_currency),
seller_name = values(seller_name),
bailun_order_id = values(bailun_order_id),
platform_order_status = values(platform_order_status),
bailun_order_status = values(bailun_order_status),
bailun_payment_status = values(bailun_payment_status),
bailun_interception_status = values(bailun_interception_status),
shipping_status = values(shipping_status),
bailun_sku = values(bailun_sku),
bailun_sku_title_en = values(bailun_sku_title_en),
bailun_sku_title_cn = values(bailun_sku_title_cn),
bailun_sku_quantity_ordered = values(bailun_sku_quantity_ordered),
bailun_sku_quantity_shipped = values(bailun_sku_quantity_shipped),
bailun_sku_quantity_refund = values(bailun_sku_quantity_refund),
bailun_sku_quantity_picked = values(bailun_sku_quantity_picked),
warehouse_name = values(warehouse_name),
warehouse_code_fba = values(warehouse_code_fba),
warehouse_code = values(warehouse_code),
bailun_sku_unit_price = values(bailun_sku_unit_price),
bailun_sku_weight = values(bailun_sku_weight),
bailun_sku_size = values(bailun_sku_size),
amount_sales = values(amount_sales),
amount_total = values(amount_total),
amount_shipping = values(amount_shipping),
amount_product = values(amount_product),
amount_tax = values(amount_tax),
amount_adjustment = values(amount_adjustment),
amount_gift_wrap = values(amount_gift_wrap),
amount_refund = values(amount_refund),
amount_prepaid = values(amount_prepaid),
cost_total = values(cost_total),
cost_promotion = values(cost_promotion),
cost_platform_fee = values(cost_platform_fee),
cost_product = values(cost_product),
cost_shipping = values(cost_shipping),
cost_package = values(cost_package),
cost_fba_fee = values(cost_fba_fee),
cost_paypal_fee = values(cost_paypal_fee),
cost_refund_commisson = values(cost_refund_commisson),
cost_handle_bailun = values(cost_handle_bailun),
cost_handle_platform = values(cost_handle_platform),
cost_tail = values(cost_tail),
cost_first = values(cost_first),
cost_logistics = values(cost_logistics),
profit_total = values(profit_total),
profit_rate = values(profit_rate),
receipt_country = values(receipt_country),
receipt_city = values(receipt_city),
receipt_area = values(receipt_area),
receipt_address = values(receipt_address),
receipt_address_2 = values(receipt_address_2),
receipt_postal_code = values(receipt_postal_code),
receiver = values(receiver),
receiver_phone = values(receiver_phone),
buyer_id = values(buyer_id),
buyer_name = values(buyer_name),
buyer_email = values(buyer_email),
has_fba_exception = values(has_fba_exception),
has_platform_exception = values(has_platform_exception),
has_cancle = values(has_cancle),
area_id = values(area_id),
bailun_category_id = values(bailun_category_id),
bailun_category_name = values(bailun_category_name),
gmt_create = values(gmt_create),
gmt_modified = values(gmt_modified),
ratio_weight = values(ratio_weight),
ratio_price = values(ratio_price),
bailun_picking_status = values(bailun_picking_status),
bailun_require_logistics = values(bailun_require_logistics),
has_delete = values(has_delete),
has_scalp = values(has_scalp),
has_buyer_remark = values(has_buyer_remark),
has_platsku_remark = values(has_platsku_remark),
logistics_method_code = values(logistics_method_code),
logistics_method_name = values(logistics_method_name),
has_innersale = values(has_innersale),
company_id = values(company_id),
bailun_refund_status = values(bailun_refund_status),
refund_obj = values(refund_obj),
refund_type = values(refund_type),
refund_reference_id = values(refund_reference_id),
has_fba_s = values(has_fba_s),
bailun_sku_quantity_pushed = values(bailun_sku_quantity_pushed),
amount_general_cargo = values(amount_general_cargo),
has_transfer_order = values(has_transfer_order)
</update>
<delete
id=
"truncateTable"
>
delete from dc_base_oms_sku_30
</delete>
</mapper>
data-common/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
View file @
6784d946
...
...
@@ -1387,7 +1387,8 @@
on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
where (t2.`status` = 0 or t2.`status` is null)
and t1.id % #{shardingContext.shardingTotalCount} = #{shardingContext.shardingItem}
order by t1.id desc
order by t1.id
# desc
limit #{pageStart}, #{pageOffset};
</select>
...
...
data-common/src/main/java/com/bailuntec/mapper/DcBaseWeekCoefficientMapper.java
View file @
6784d946
package
com
.
bailuntec
.
mapper
;
import
com.bailuntec.domain.dto.SalesDetailItem
;
import
com.bailuntec.domain.entity.DcBaseWeekCoefficient
;
import
com.bailuntec.domain.example.DcBaseWeekCoefficientExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
DcBaseWeekCoefficientMapper
{
/**
* This method was generated by MyBatis Generator.
...
...
@@ -120,4 +122,9 @@ public interface DcBaseWeekCoefficientMapper {
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertSelective
(
DcBaseWeekCoefficient
record
);
List
<
DcBaseWeekCoefficient
>
selectByDays
(
@Param
(
"salesDetailItemList"
)
List
<
SalesDetailItem
>
salesDetailItemList
,
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
);
}
data-common/src/main/java/com/bailuntec/mapper/DcBaseWeekCoefficientMapper.xml
View file @
6784d946
...
...
@@ -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=
"bailun_sku"
jdbcType=
"VARCHAR"
property=
"bailunSku"
/>
<result
column=
"warehouse_code"
jdbcType=
"VARCHAR"
property=
"warehouseCode"
/>
<result
column=
"bailun_sku_warehouse_code"
jdbcType=
"VARCHAR"
property=
"bailunSkuWarehouseCode"
/>
<result
column=
"week"
jdbcType=
"INTEGER"
property=
"week"
/>
<result
column=
"coefficient"
jdbcType=
"VARCHAR"
property=
"coefficient"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"formula"
jdbcType=
"VARCHAR"
property=
"formula"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"bailun_sku"
jdbcType=
"VARCHAR"
property=
"bailunSku"
/>
<result
column=
"warehouse_code"
jdbcType=
"VARCHAR"
property=
"warehouseCode"
/>
<result
column=
"bailun_sku_warehouse_code"
jdbcType=
"VARCHAR"
property=
"bailunSkuWarehouseCode"
/>
<result
column=
"week"
jdbcType=
"INTEGER"
property=
"week"
/>
<result
column=
"coefficient"
jdbcType=
"VARCHAR"
property=
"coefficient"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"formula"
jdbcType=
"VARCHAR"
property=
"formula"
/>
</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, bailun_sku, warehouse_code, bailun_sku_warehouse_code, week, coefficient, update_date,
formula
</sql>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseWeekCoefficientExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseWeekCoefficientExample"
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_base_week_coefficient
<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_base_week_coefficient
where id = #{id,jdbcType=INTEGER}
</select>
...
...
@@ -140,7 +143,7 @@
-->
delete from dc_base_week_coefficient
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.bailuntec.domain.entity.DcBaseWeekCoefficient"
>
...
...
@@ -214,14 +217,15 @@
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseWeekCoefficientExample"
resultType=
"java.lang.Long"
>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseWeekCoefficientExample"
resultType=
"java.lang.Long"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dc_base_week_coefficient
<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 @@
update_date = #{record.updateDate,jdbcType=TIMESTAMP},
formula = #{record.formula,jdbcType=VARCHAR}
<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.DcBaseWeekCoefficient"
>
...
...
@@ -435,21 +439,32 @@
update_date = #{updateDate,jdbcType=TIMESTAMP},
formula = #{formula,jdbcType=VARCHAR}
</insert>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseWeekCoefficientExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseWeekCoefficientExample"
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_base_week_coefficient
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
limit 1
</select>
<select
id=
"selectByDays"
resultType=
"com.bailuntec.domain.entity.DcBaseWeekCoefficient"
>
SELECT t2.*,t1.week_date from week_config t1
LEFT JOIN dc_base_week_coefficient t2
on t1.`week` = t2.`week` and t2.bailun_sku = #{bailunSku} and t2.warehouse_code = #{warehouseCode}
and t1.week_date in
<foreach
close=
")"
collection=
"salesDetailItemList"
item=
"item"
open=
"("
separator=
","
>
#{item.date}
</foreach>
</select>
</mapper>
data-common/src/main/java/com/bailuntec/mapper/DcMidTransitMapper.xml
View file @
6784d946
...
...
@@ -860,7 +860,7 @@
price,
transport_type
FROM dc_base_purchase
WHERE buy_status IN (0, 1, 2, 3)
WHERE buy_status IN (0, 1, 2, 3
,9
)
AND has_delete = 0
GROUP BY bailun_sku,
parent_id
...
...
data-common/src/main/java/com/bailuntec/mapper/SalesDayConfigMapper.java
View file @
6784d946
package
com
.
bailuntec
.
mapper
;
import
com.bailuntec.domain.dto.SalesDetailItem
;
import
com.bailuntec.domain.entity.SalesDayConfig
;
import
com.bailuntec.domain.example.SalesDayConfigExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
SalesDayConfigMapper
{
/**
* This method was generated by MyBatis Generator.
...
...
@@ -120,4 +122,9 @@ public interface SalesDayConfigMapper {
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertSelective
(
SalesDayConfig
record
);
List
<
SalesDayConfig
>
selectByDays
(
@Param
(
"salesDetailItemList"
)
List
<
SalesDetailItem
>
salesDetailItemList
,
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
);
}
data-common/src/main/java/com/bailuntec/mapper/SalesDayConfigMapper.xml
View file @
6784d946
...
...
@@ -6,17 +6,17 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"bailun_sku"
jdbcType=
"VARCHAR"
property=
"bailunSku"
/>
<result
column=
"warehouse_code"
jdbcType=
"VARCHAR"
property=
"warehouseCode"
/>
<result
column=
"bailun_sku_warehouse_code"
jdbcType=
"VARCHAR"
property=
"bailunSkuWarehouseCode"
/>
<result
column=
"date"
jdbcType=
"TIMESTAMP"
property=
"date"
/>
<result
column=
"date_str"
jdbcType=
"VARCHAR"
property=
"dateStr"
/>
<result
column=
"sales"
jdbcType=
"DECIMAL"
property=
"sales"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"create_user"
jdbcType=
"VARCHAR"
property=
"createUser"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"update_user"
jdbcType=
"VARCHAR"
property=
"updateUser"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"bailun_sku"
jdbcType=
"VARCHAR"
property=
"bailunSku"
/>
<result
column=
"warehouse_code"
jdbcType=
"VARCHAR"
property=
"warehouseCode"
/>
<result
column=
"bailun_sku_warehouse_code"
jdbcType=
"VARCHAR"
property=
"bailunSkuWarehouseCode"
/>
<result
column=
"date"
jdbcType=
"TIMESTAMP"
property=
"date"
/>
<result
column=
"date_str"
jdbcType=
"VARCHAR"
property=
"dateStr"
/>
<result
column=
"sales"
jdbcType=
"DECIMAL"
property=
"sales"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"create_user"
jdbcType=
"VARCHAR"
property=
"createUser"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"update_user"
jdbcType=
"VARCHAR"
property=
"updateUser"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -40,7 +40,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>
...
...
@@ -73,7 +74,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>
...
...
@@ -92,7 +94,8 @@
id, bailun_sku, warehouse_code, bailun_sku_warehouse_code, date, date_str, sales,
create_date, create_user, update_date, update_user
</sql>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.SalesDayConfigExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.SalesDayConfigExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
...
...
@@ -101,10 +104,10 @@
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from sales_day_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
...
...
@@ -124,7 +127,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from sales_day_config
where id = #{id,jdbcType=INTEGER}
</select>
...
...
@@ -143,7 +146,7 @@
-->
delete from sales_day_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.bailuntec.domain.entity.SalesDayConfig"
>
...
...
@@ -237,14 +240,15 @@
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.SalesDayConfigExample"
resultType=
"java.lang.Long"
>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.SalesDayConfigExample"
resultType=
"java.lang.Long"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from sales_day_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
...
...
@@ -289,7 +293,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"
>
...
...
@@ -310,7 +314,7 @@
update_date = #{record.updateDate,jdbcType=TIMESTAMP},
update_user = #{record.updateUser,jdbcType=VARCHAR}
<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.SalesDayConfig"
>
...
...
@@ -513,21 +517,34 @@
update_date = #{updateDate,jdbcType=TIMESTAMP},
update_user = #{updateUser,jdbcType=VARCHAR}
</insert>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.SalesDayConfigExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.SalesDayConfigExample"
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 sales_day_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
limit 1
</select>
<select
id=
"selectByDays"
resultType=
"com.bailuntec.domain.entity.SalesDayConfig"
>
SELECT * from week_config t1
LEFT JOIN sales_day_config t2
on t1.`week_date` = t2.date and t2.bailun_sku = #{bailunSku} and t2.warehouse_code = #{warehouseCode}
and t1.week_date in
<foreach
close=
")"
collection=
"salesDetailItemList"
item=
"item"
open=
"("
separator=
","
>
#{item.date}
</foreach>
</select>
</mapper>
data-finance/finance-balance-sheet/pom.xml
View file @
6784d946
...
...
@@ -98,6 +98,17 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<!--测试用例插件-->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<!-- 跳过测试-->
<configuration>
<skipTests>
true
</skipTests>
</configuration>
</plugin>
</plugins>
</build>
...
...
data-finance/finance-balance-sheet/src/test/java/com/bailuntec/balancesheet/service/BalanceSheetServiceTest.java
View file @
6784d946
...
...
@@ -104,8 +104,8 @@ public class BalanceSheetServiceTest {
@Test
public
void
generateBalanceSheet
()
{
Date
startDate
=
DateTimeUtil
.
stringToDate
(
"2020-1
0-19
"
,
DateTimeUtil
.
DATE_FORMAT
);
Date
endDate
=
DateTimeUtil
.
stringToDate
(
"2020-11-
02
"
,
DateTimeUtil
.
DATE_FORMAT
);
Date
startDate
=
DateTimeUtil
.
stringToDate
(
"2020-1
1-26
"
,
DateTimeUtil
.
DATE_FORMAT
);
Date
endDate
=
DateTimeUtil
.
stringToDate
(
"2020-11-
26
"
,
DateTimeUtil
.
DATE_FORMAT
);
while
(
startDate
.
compareTo
(
endDate
)
==
-
1
)
{
balanceSheetService
.
generateBalanceSheet
(
0
,
"百伦供应链"
,
startDate
);
startDate
=
DateTimeUtil
.
addDays
(
startDate
,
1
);
// 日期增加一天
...
...
data-show/show-auto-turnover/pom.xml
View file @
6784d946
...
...
@@ -34,7 +34,6 @@
<version>
2.1.1
</version>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
...
...
@@ -45,8 +44,8 @@
<artifactId>
junit-jupiter-api
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
@@ -89,7 +88,8 @@
<!--镜像名称:镜像版本-->
<skipDockerBuild>
false
</skipDockerBuild>
<imageName>
ccr.ccs.tencentyun.com/blt.data.center/dc-show-auto-turnover:${maven.build.timestamp}
</imageName>
<imageName>
ccr.ccs.tencentyun.com/blt.data.center/dc-show-auto-turnover:${maven.build.timestamp}
</imageName>
<dockerDirectory>
src/main/docker
</dockerDirectory>
<resources>
<resource>
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
6784d946
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.alibaba.fastjson.TypeReference
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.constant.Constant
;
import
com.bailuntec.domain.dto.SalesDetailItem
;
import
com.bailuntec.domain.dto.SalesVolumeAvgDTO
;
import
com.bailuntec.domain.dto.SalesVolumeDTO
;
import
com.bailuntec.domain.entity.*
;
...
...
@@ -21,6 +22,7 @@ import com.bailuntec.utils.OkHttpUtil;
import
com.bailuntec.utils.PropertiesUtil
;
import
com.bailuntec.utils.SessionUtil
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
com.google.common.collect.Lists
;
import
com.google.gson.Gson
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.OkHttpClient
;
...
...
@@ -40,6 +42,8 @@ import java.time.format.DateTimeFormatter;
import
java.util.*
;
import
java.util.concurrent.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
@Slf4j
public
class
AutoTurnoverJob
extends
PointJob
{
...
...
@@ -218,7 +222,6 @@ public class AutoTurnoverJob extends PointJob {
//库存对应的仓库
dcBaseWarehouse
=
baseWarehouseMapper
.
selectOneByExample
(
DcBaseWarehouseExample
.
newAndCreateCriteria
().
andWarehouseCodeEqualTo
(
warehouseCode
).
example
());
BigDecimal
incrementalRatio
=
BigDecimal
.
ONE
;
int
compareSales
=
0
;
//销量
DcAutoSalesMapper
autoSalesMapper
;
...
...
@@ -267,7 +270,11 @@ public class AutoTurnoverJob extends PointJob {
}
finally
{
SessionUtil
.
closeSession
();
}
autoTurnoverUseDcAutoSales
(
bailunSku
,
warehouseCode
,
dcAutoSales
,
dcBaseStock
,
dcBaseWarehouse
,
dcAutoWarehouseweekSales
);
autoTurnoverUseDcAutoSales
(
bailunSku
,
warehouseCode
,
dcAutoSales
,
dcBaseStock
,
dcBaseWarehouse
);
}
/**
...
...
@@ -283,14 +290,12 @@ public class AutoTurnoverJob extends PointJob {
* @param dcAutoSales 销量
* @param dcBaseStock 库存
* @param dcBaseWarehouse 仓库
* @param dcAutoWarehouseweekSales 自动周转系数
*/
private
void
autoTurnoverUseDcAutoSales
(
String
bailunSku
,
String
warehouseCode
,
DcAutoSales
dcAutoSales
,
DcBaseStock
dcBaseStock
,
DcBaseWarehouse
dcBaseWarehouse
,
DcAutoWarehouseweekSales
dcAutoWarehouseweekSales
)
throws
Exception
{
DcBaseWarehouse
dcBaseWarehouse
)
throws
Exception
{
//记录时间
LocalDate
recordTime
=
LocalDate
.
now
();
...
...
@@ -778,6 +783,50 @@ public class AutoTurnoverJob extends PointJob {
dcAutoTurnover
.
setIsOutStock
(
0
);
dcAutoTurnover
.
setGmtModified
(
LocalDateTime
.
now
());
/*周系数*/
List
<
String
>
param
=
new
ArrayList
<>(
Lists
.
newArrayList
(
dcAutoTurnover
.
getSalesDetails
()
.
trim
()
.
substring
(
1
)
.
substring
(
0
,
dcAutoTurnover
.
getSalesDetails
().
length
()
-
2
)
.
split
(
","
)));
List
<
BigDecimal
>
salesDetails
=
param
.
stream
().
map
(
var
->
{
try
{
String
ss
=
var
.
trim
();
return
new
BigDecimal
(
ss
);
}
catch
(
Exception
ex
)
{
throw
ex
;
}
}).
collect
(
Collectors
.
toList
());
AtomicReference
<
LocalDate
>
localDate
=
new
AtomicReference
<>(
LocalDate
.
now
().
minusDays
(
7
));
List
<
SalesDetailItem
>
salesDetailItemList
=
salesDetails
.
stream
().
map
(
salesDetail
->
{
SalesDetailItem
salesDetailItem
=
new
SalesDetailItem
();
salesDetailItem
.
setSales
(
salesDetail
);
salesDetailItem
.
setDate
(
localDate
.
get
());
localDate
.
set
(
localDate
.
get
().
plusDays
(
1
));
return
salesDetailItem
;
}).
collect
(
Collectors
.
toList
());
DcBaseWeekCoefficientMapper
dcBaseWeekCoefficientMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseWeekCoefficientMapper
.
class
);
SalesDayConfigMapper
salesDayConfigMapper
=
SessionUtil
.
getSession
().
getMapper
(
SalesDayConfigMapper
.
class
);
List
<
DcBaseWeekCoefficient
>
dcBaseWeekCoefficientList
=
dcBaseWeekCoefficientMapper
.
selectByDays
(
salesDetailItemList
,
dcAutoTurnover
.
getBailunSku
(),
dcAutoTurnover
.
getWarehouseCode
());
List
<
SalesDayConfig
>
salesDayConfigMapperList
=
salesDayConfigMapper
.
selectByDays
(
salesDetailItemList
,
dcAutoTurnover
.
getBailunSku
(),
dcAutoTurnover
.
getWarehouseCode
());
Map
<
LocalDate
,
DcBaseWeekCoefficient
>
weekCoefficientMap
=
dcBaseWeekCoefficientList
.
stream
().
collect
(
Collectors
.
toMap
(
DcBaseWeekCoefficient:
:
getWeekDate
,
dcBaseWeekCoefficient
->
dcBaseWeekCoefficient
));
Map
<
LocalDate
,
SalesDayConfig
>
salesDayConfigMap
=
salesDayConfigMapperList
.
stream
().
collect
(
Collectors
.
toMap
(
salesDayConfig
->
salesDayConfig
.
getDate
().
toLocalDate
(),
salesDayConfig
->
salesDayConfig
));
salesDetailItemList
.
stream
().
peek
(
salesDetailItem
->
{
salesDetailItem
.
setSalesDayConfig
(
salesDayConfigMap
.
get
(
salesDetailItem
.
getDate
()).
getSales
());
salesDetailItem
.
setWeekCoefficient
(
new
BigDecimal
(
weekCoefficientMap
.
get
(
salesDetailItem
.
getDate
()).
getCoefficient
()));
})
.
forEach
(
SalesDetailItem:
:
calcShowSales
);
dcAutoTurnover
.
setSalesDetails
(
salesDetailItemList
.
stream
().
map
(
SalesDetailItem:
:
getShowSales
).
map
(
BigDecimal:
:
toString
).
collect
(
Collectors
.
joining
(
","
)));
int
i
=
autoTurnoverMapper
.
updateByExampleSelective
(
dcAutoTurnover
,
DcAutoTurnoverExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
dcAutoTurnover
.
getBailunSku
()).
andWarehouseCodeEqualTo
(
dcAutoTurnover
.
getWarehouseCode
()).
example
());
if
(
i
==
0
)
{
...
...
@@ -793,6 +842,7 @@ public class AutoTurnoverJob extends PointJob {
}
private
void
caculatePlatformAvgSales
(
DcAutoTurnoverWithBLOBs
dcAutoTurnover
)
{
try
{
DcAutoSalesMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoSalesMapper
.
class
);
...
...
@@ -1471,10 +1521,17 @@ public class AutoTurnoverJob extends PointJob {
* @param forecastShortSupplyList 预测断货
* @param autoForecastDay 周转倍数
*/
private
void
initForecaseList
(
List
<
String
>
forecastInboundRelationList
,
List
<
BigDecimal
>
forecastInventoryList
,
List
<
Integer
>
forecastPurchaseInboundList
,
List
<
Integer
>
forecastTransferInboundList
,
List
<
Integer
>
forecastInboundList
,
List
<
BigDecimal
>
forecastSalesList
,
List
<
BigDecimal
>
forecastShortSupplyList
,
Integer
autoForecastDay
,
List
<
String
>
forecastSalesExplainList
)
{
private
void
initForecaseList
(
List
<
String
>
forecastInboundRelationList
,
List
<
BigDecimal
>
forecastInventoryList
,
List
<
Integer
>
forecastPurchaseInboundList
,
List
<
Integer
>
forecastTransferInboundList
,
List
<
Integer
>
forecastInboundList
,
List
<
BigDecimal
>
forecastSalesList
,
List
<
BigDecimal
>
forecastShortSupplyList
,
Integer
autoForecastDay
,
List
<
String
>
forecastSalesExplainList
)
{
for
(
int
i1
=
0
;
i1
<
autoForecastDay
;
i1
++)
{
forecastInboundList
.
add
(
0
);
forecastInventoryList
.
add
(
BigDecimal
.
ZERO
);
forecastSalesList
.
add
(
BigDecimal
.
ZERO
);
...
...
data-show/show-auto-turnover/src/main/resources/job.properties
View file @
6784d946
...
...
@@ -10,8 +10,9 @@ EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE
=
data-center
JOB_NAME
=
show-auto-turnover
8
JOB_NAME
=
show-auto-turnover
12
JOB_CRON
=
0 0 3 * * ?
#JOB_CRON=0 50 9 * * ?
SHARDING_TOTAL_COUNT
=
8
...
...
data-show/show-auto-turnover/src/test/java/AutoTurnoverTest.java
View file @
6784d946
...
...
@@ -137,8 +137,8 @@ public class AutoTurnoverTest {
public
void
testXX
()
{
DcBaseStock
dcBaseStock
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
)
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
"
950093401
"
)
.
andWarehouseCodeEqualTo
(
"
GZBLWH
"
)
.
andBailunSkuEqualTo
(
"
LM-EO-007
"
)
.
andWarehouseCodeEqualTo
(
"
MMDUSFBA
"
)
.
example
());
try
{
...
...
data-show/show-auto-turnover/src/test/java/com/bailuntec/job/AutoTurnoverJobTest.java
View file @
6784d946
...
...
@@ -57,7 +57,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
0
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
0
),
jobPointLog
);
}
...
...
@@ -68,7 +68,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
1
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
1
),
jobPointLog
);
}
...
...
@@ -79,7 +79,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
2
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
2
),
jobPointLog
);
}
...
...
@@ -90,7 +90,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
3
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
3
),
jobPointLog
);
}
...
...
@@ -101,7 +101,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
4
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
4
),
jobPointLog
);
}
...
...
@@ -112,7 +112,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
5
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
5
),
jobPointLog
);
}
...
...
@@ -123,7 +123,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
6
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
6
),
jobPointLog
);
}
...
...
@@ -134,7 +134,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
INCREMENT
"
,
new
HashMap
<>()),
7
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
8
,
"
NORMAL
"
,
new
HashMap
<>()),
7
),
jobPointLog
);
}
...
...
@@ -145,9 +145,8 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageIndex
(
1
);
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
"show-auto-turnover3"
,
1
,
"
INCREMENT
"
,
new
HashMap
<>()),
0
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
"show-auto-turnover3"
,
1
,
"
NORMAL
"
,
new
HashMap
<>()),
0
),
jobPointLog
);
}
...
...
@@ -159,7 +158,7 @@ public class AutoTurnoverJobTest {
jobPointLog
.
setPageSize
(
1000
);
AutoTurnoverJob
autoTurnoverJob
=
new
AutoTurnoverJob
();
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
1
,
"
INCREMENT
"
,
new
HashMap
<>()),
0
),
autoTurnoverJob
.
executeJob
(
new
ShardingContext
(
new
ShardingContexts
(
"x"
,
null
,
1
,
"
NORMAL
"
,
new
HashMap
<>()),
0
),
jobPointLog
);
}
...
...
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