Commit c5e84dbe by huluobin

update

parent d7246312
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bailuntec.domain.entity.DcBaseCompanyAccount;
import com.bailuntec.domain.entity.JobAmazonAdLog;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.example.DcBaseCompanyAccountExample;
import com.bailuntec.domain.example.JobAmazonAdLogExample;
import com.bailuntec.domain.pojo.AmazonAdAuth;
......@@ -11,11 +12,11 @@ import com.bailuntec.domain.pojo.AmazonAdSuccessResult;
import com.bailuntec.domain.pojo.AmazonURI;
import com.bailuntec.mapper.DcBaseCompanyAccountMapper;
import com.bailuntec.mapper.JobAmazonAdLogMapper;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.lang3.StringUtils;
......@@ -26,12 +27,17 @@ import java.time.format.DateTimeFormatter;
import java.util.List;
@Slf4j
public class AmazonAdGenerateReportIdJob implements SimpleJob {
public class AmazonAdGenerateReportIdJob extends PointJob {
private static final PropertiesUtil propertiesUtil = PropertiesUtil.getInstance("const");
private final OkHttpClient client = OkHttpUtil.getInstance();
@Override
public void execute(ShardingContext shardingContext) {
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
LocalDateTime maxAllowTime = LocalDateTime.now().minusHours(36);
LocalDateTime reportDate = jobPointLog.getStartTime();
if (reportDate.compareTo(maxAllowTime) >= 0) {
return;
}
try (SqlSession sqlSession = SessionUtil.getFactory().openSession(true)) {
......@@ -48,7 +54,6 @@ public class AmazonAdGenerateReportIdJob implements SimpleJob {
// .stream()
// .filter(dcBaseCompanyAccount -> dcBaseCompanyAccount.getAccountId().equals(671))
.forEach(dcBaseCompanyAccount -> {
LocalDateTime reportDate = LocalDateTime.now().minusHours(36);
// LocalDateTime reportDate = LocalDateTime.of(2020, 10, 2, 0, 0);
//productAds
......@@ -190,7 +195,7 @@ public class AmazonAdGenerateReportIdJob implements SimpleJob {
}
});
}
jobPointLog.refresh();
}
protected static String switchSiteUrl(String siteEn, String param) {
......
......@@ -20,6 +20,8 @@ public class AmazonAdGenerateReportIdJobTest {
public void executeJob() {
AmazonAdGenerateReportIdJob amazonAdGenerateReportIdJob = new AmazonAdGenerateReportIdJob();
amazonAdGenerateReportIdJob.execute(new ShardingContext(new ShardingContexts("x", null, 1, null, new HashMap<>()), 0));
while (true) {
amazonAdGenerateReportIdJob.execute(new ShardingContext(new ShardingContexts("x", "base-amazon-ad-product-generate", 1, null, new HashMap<>()), 0));
}
}
}
......@@ -40,7 +40,6 @@ public class EbayFinanceAdSyncJobTest {
);
ebayFinanceAdSyncJob.execute(shardingContext);
}
@org.junit.Test
......
......@@ -35,7 +35,7 @@ public class SyncSemiPurchaseOldDetailsJob extends PointJob {
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
MediaType mediaType = MediaType.parse("application/json");
LinkedHashMap<String, Object> map = new LinkedHashMap<>(4);
map.put("start", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusDays(jobPointLog.getType())));
map.put("start", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime()));
map.put("end", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
map.put("pagesize", jobPointLog.getPageSize());
List<PurchaseDetailDTO> purchaseDetailDTOList = null;
......@@ -74,7 +74,8 @@ public class SyncSemiPurchaseOldDetailsJob extends PointJob {
pointLogMapper.upsertSelective(jobPointLog);
}
purchaseDetailDTOList.forEach(purchaseDetail -> {
log.warn(purchaseDetail.getBailunSku() + "&" + purchaseDetail.getPurchaseId());
log.info(purchaseDetail.getBailunSku() + "&" + purchaseDetail.getPurchaseId());
DcSemiPurchaseInfo dcSemiPurchaseInfo = new DcSemiPurchaseInfo();
try {
BeanUtils.copyProperties(dcSemiPurchaseInfo, purchaseDetail);
......
......@@ -2,33 +2,44 @@ import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.job.SyncPurchaseAimsJob;
import com.bailuntec.job.SyncPurchaseDetailsJob;
import com.bailuntec.job.SyncSemiPurchaseDetailsJob;
import com.bailuntec.job.SyncSemiPurchaseOldDetailsJob;
import com.bailuntec.support.PointJob;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import org.junit.jupiter.api.Test;
import java.time.LocalDateTime;
import java.util.HashMap;
public class SyncPurchaseDetailsTest {
@Test
public void test() {
SyncPurchaseDetailsJob syncPurchaseDetailsJob = new SyncPurchaseDetailsJob();
syncPurchaseDetailsJob.executeJob(null, new JobPointLog("base-purchase-details", 1,1000,0,1,
LocalDateTime.of(2020,03,01,0,0),
LocalDateTime.of(2020,03,15,0,0)));
syncPurchaseDetailsJob.executeJob(null, new JobPointLog("base-purchase-details", 1, 1000, 0, 1,
LocalDateTime.of(2020, 03, 01, 0, 0),
LocalDateTime.of(2020, 03, 15, 0, 0)));
}
@Test
public void test1() {
SyncPurchaseAimsJob syncPurchaseAimsJob = new SyncPurchaseAimsJob();
syncPurchaseAimsJob.executeJob(null, new JobPointLog("test", 1, 100, 0, 1,
LocalDateTime.of(2018,12,25,0,0),
LocalDateTime.of(2018,12,26,0,0)));
LocalDateTime.of(2018, 12, 25, 0, 0),
LocalDateTime.of(2018, 12, 26, 0, 0)));
}
@Test
public void test2() {
SyncSemiPurchaseDetailsJob syncSemiPurchaseDetailsJob = new SyncSemiPurchaseDetailsJob();
syncSemiPurchaseDetailsJob.executeJob(null, new JobPointLog("test1", 1, 100, 0, 1,
LocalDateTime.of(2020,4,10,0,0),
LocalDateTime.of(2020,4,28,0,0)));
LocalDateTime.of(2020, 4, 10, 0, 0),
LocalDateTime.of(2020, 4, 28, 0, 0)));
}
@Test
public void test3() {
PointJob pointJob = new SyncSemiPurchaseOldDetailsJob();
pointJob.execute(new ShardingContext(new ShardingContexts("x", "semi-purchase-details-info-old", 1, null, new HashMap<>()), 0));
}
}
......@@ -194,4 +194,16 @@ public class JobPointLog {
result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
return result;
}
private LocalDateTime getNextEndTime() {
return endTime.plusDays(1).isAfter(LocalDateTime.now())
? LocalDateTime.now()
: endTime.plusDays(1);
}
public JobPointLog refresh() {
this.startTime = endTime;
this.endTime = this.getNextEndTime();
return this;
}
}
......@@ -2911,8 +2911,7 @@
twenty_fourthday_sales,
twenty_threeday_sales,
twenty_twoday_sales,
twenty_oneday_sales
,
twenty_oneday_sales,
twentyday_sales,
nineteenday_sales,
eighteenday_sales,
......@@ -3139,7 +3138,10 @@
and bailun_sku = #{bailunSku}
and warehouse_code = #{warehouseCode}
and !(paid_time &gt;= '2020-11-11 00:00:00' and paid_time &lt;= '2020-11-13 00:00:00' and
platform_type = 'Aliexpress')) sales_table
platform_type = 'Aliexpress')
and platform_order_type != '手工单'
) sales_table
</select>
<select id="getSalesVolumeWeekDTO" resultType="com.bailuntec.domain.dto.SalesVolumeWeekDTO">
......@@ -3443,6 +3445,9 @@
and has_buyer_remark = 0
and has_platsku_remark = 0
and has_innersale = 0
and platform_order_type != '手工单'
and !(paid_time &gt;= '2020-11-11 00:00:00' and paid_time &lt;= '2020-11-13 00:00:00' and
platform_type = 'Aliexpress')
<if test="bailunSku != null and bailunSku != ''">
and bailun_sku = #{bailunSku}
</if>
......
......@@ -5,8 +5,8 @@
<configuration>
<!--<properties resource="db-tj.properties"/>-->
<properties resource="db-dev.properties"/>
<!-- <properties resource="db-prod.properties"/>-->
<properties resource="db-dev.properties"/>
<!-- <properties resource="db-prod.properties"/>-->
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
......
......@@ -26,6 +26,7 @@ public interface DcOtherCostMapper {
"on a.company_value = c.company_value and a.bank_company = c.bank_company " +
"left join (select company_value,bank_company,amount_rmb from dc_base_cost where day = #{lastDay} and cost_form = 3 and is_lend = 2 and cost_status = 4) d " +
"on a.company_value = d.company_value and a.bank_company = d.bank_company " +
"where a.company_value is not null " +
"group by a.company_value,a.bank_company")
void insertOneDayOtherReceive(@Param("lastDay") Date lastDay, @Param("twoDaysBefore") Date twoDaysBefore);
......@@ -45,6 +46,7 @@ public interface DcOtherCostMapper {
"left join (select company_value,bank_company,amount_rmb from dc_base_cost where cost_form = 1 and cost_status = 2 and day = #{lastDay} " +
"union select company_value,bank_company,amount_rmb from dc_base_cost where cost_form = 2 and cost_status = 4 and day = #{lastDay}) d " +
"on a.company_value = d.company_value and a.bank_company = d.bank_company " +
"where a.company_value is not null " +
"group by a.company_value,a.bank_company")
void insertOneDayOtherPay(@Param("lastDay") Date lastDay, @Param("twoDaysBefore") Date twoDaysBefore);
......
package com.bailuntec.balancesheet.mapper;
import com.bailuntec.balancesheet.entity.DcSemiDailyStock;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
......@@ -20,6 +20,9 @@ public interface DcSemiDailyStockMapper {
@Select("select sum(inventory_amount) from dc_semi_daily_stock where day = #{lastDay}")
BigDecimal getSemiDailyStockSum(@Param("lastDay") Date lastDay);
@Select("select * from dc_semi_daily_stock where day = #{lastDay} and sku_code =#{skuCode} and warehouse_id = #{warehouseId}" )
DcSemiDailyStock query(@Param("lastDay") Date lastDay, @Param("skuCode") String skuCode, @Param("warehouseId") String warehouseId);
@Select("select sum(inventory_amount) from dc_semi_daily_stock where day = #{lastDay} and warehouse_id in (27,1,26,5,17,15,19,18,2)")
BigDecimal getSemiBailunDailyStockSum(@Param("lastDay") Date lastDay);
......@@ -29,4 +32,4 @@ public interface DcSemiDailyStockMapper {
@Select("select sum((jit_prod_stock + plan_prod_stock) * new_price) from dc_semi_stock_prod_daily where record_time = #{lastDay} and warehouse_name != '哈倪蔓美甲灌装车间'")
BigDecimal getSemiProdInventoryAmountSum(@Param("lastDay") Date lastDay);
}
\ No newline at end of file
}
......@@ -83,8 +83,6 @@ public class BalanceSheetService {
private DcOtherCostMapper dcOtherCostMapper;
@Autowired
private DcLogisticsSupplierTransactionMapper dcLogisticsSupplierTransactionMapper;
// @Autowired
// private DcSemiSkuMapper dcSemiSkuMapper;
@Autowired
private DcSemiSupplierOfferLogMapper dcSemiSupplierOfferLogMapper;
@Autowired
......@@ -377,10 +375,12 @@ public class BalanceSheetService {
}
// 生成半成品每日存货
if (isOk) {
// if (dcSem/**/ iDailyStockMapper.query(date) != null){
dcSemiDailyStockMapper.insertSemiDailyStock(date);
}
}
/**
* 获取半成品在途
*
......@@ -632,7 +632,15 @@ public class BalanceSheetService {
dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet);
}
public void updateSheetSuppliserTransaction(String dateStr, BigDecimal logisticsPayableSum, BigDecimal accountsReceivableUpdate, BigDecimal accountsReceivableImport, BigDecimal otherAccountsReceivableImport, BigDecimal otherAccountsPayableImport, BigDecimal fixedAssetsImport, BigDecimal ncaDeferredTaxAssetsImport, BigDecimal platformBalanceUpdate) throws ParseException {
public void updateSheetSuppliserTransaction(String dateStr,
BigDecimal logisticsPayableSum,
BigDecimal accountsReceivableUpdate,
BigDecimal accountsReceivableImport,
BigDecimal otherAccountsReceivableImport,
BigDecimal otherAccountsPayableImport,
BigDecimal fixedAssetsImport,
BigDecimal ncaDeferredTaxAssetsImport,
BigDecimal platformBalanceUpdate) throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = simpleDateFormat.parse(dateStr);
// 生成资产负债表
......@@ -833,10 +841,12 @@ public class BalanceSheetService {
BigDecimal bankAccountBalanceSum = dcBankAccountBalanceMapper.getBalanceSum(date);
if (bankAccountBalanceSum == null) bankAccountBalanceSum = BigDecimal.ZERO;
dcBalanceSheet.setBankAccountBalance(bankAccountBalanceSum);
// 提现在途金额汇总
BigDecimal withdrawOnWaySum = dcWithdrawOnWayMapper.getWithdrawOnWaySum(date);
if (withdrawOnWaySum == null) withdrawOnWaySum = BigDecimal.ZERO;
dcBalanceSheet.setWithdrawAmount(withdrawOnWaySum);
// 第三方平台余额
BigDecimal platformBalanceSum = dcBalanceSheetMapper.getPlatformBalanceUpdate(date);
if (platformBalanceSum == null || platformBalanceSum.compareTo(BigDecimal.ZERO) == 0) {
......@@ -852,10 +862,12 @@ public class BalanceSheetService {
BigDecimal shortBorrowBalanceSum = dcShortTermBorrowMapper.getShortTermBorrowBalanceSum(date);
if (shortBorrowBalanceSum == null) shortBorrowBalanceSum = BigDecimal.ZERO;
dcBalanceSheet.setShortTermBorrow(shortBorrowBalanceSum);
// 借支单未还金额
BigDecimal amountBorrowedSum = dcBalanceSheetMapper.getAmountBorrowed(date);
if (amountBorrowedSum == null) amountBorrowedSum = BigDecimal.ZERO;
dcBalanceSheet.setAmountBorrowed(amountBorrowedSum);
// 其他应收款、其他应付款
/*BigDecimal otherAccountsReceivable = dcOtherCostMapper.getOtherAccountsReceivableSum(date); // 其他应收款(加借支单未还金额)
if(otherAccountsReceivable == null) otherAccountsReceivable = BigDecimal.ZERO;*/
......
......@@ -8,6 +8,7 @@ import com.bailuntec.balancesheet.entity.DcBalanceSheet;
import com.bailuntec.balancesheet.mapper.*;
import com.bailuntec.balancesheet.util.DateTimeUtil;
import com.bailuntec.balancesheet.util.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -21,6 +22,7 @@ import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
@Slf4j
public class BalanceSheetServiceTest {
@Autowired
......@@ -73,7 +75,11 @@ public class BalanceSheetServiceTest {
@Test
public void doScheduledTask() {
balanceSheetService.doScheduledTask0000();
try {
balanceSheetService.doScheduledTask0000();
} catch (Exception e) {
log.error(e.getMessage());
}
}
@Test
......@@ -96,11 +102,10 @@ public class BalanceSheetServiceTest {
}
}
@Test
public void generateBalanceSheet() {
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
while (startDate.compareTo(endDate) == -1) {
balanceSheetService.generateBalanceSheet(0, "百伦供应链", startDate);
startDate = DateTimeUtil.addDays(startDate, 1); // 日期增加一天
......@@ -109,8 +114,8 @@ public class BalanceSheetServiceTest {
@Test
public void updatePlatformBalance() {
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
while (startDate.compareTo(endDate) == -1) {
// 银行账号
BigDecimal bankAccountBalanceSum = dcBankAccountBalanceMapper.getBalanceSum(startDate);
......@@ -139,8 +144,8 @@ public class BalanceSheetServiceTest {
@Test
public void getSupplierTransactionBatch() {
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
while (startDate.compareTo(endDate) == -1) {
balanceSheetService.getSupplierTransaction(startDate);
// balanceSheetService.getLogisticsSupplierTransaction(startDate);
......@@ -167,8 +172,8 @@ public class BalanceSheetServiceTest {
@Test
public void getInventoryBalance() {
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
while (startDate.compareTo(endDate) == -1) {
// balanceSheetService.getInventoryBalance(startDate);
balanceSheetService.updateInventoryBalance(startDate);
......@@ -181,12 +186,16 @@ public class BalanceSheetServiceTest {
/*Date startDate = DateTimeUtil.stringToDate("2014-04-25", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2018-08-06", DateTimeUtil.DATE_FORMAT);
balanceSheetService.getSemiInventoryBalance(startDate,endDate);*/
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
assert endDate != null;
assert startDate != null;
while (startDate.compareTo(endDate) < 0) {
balanceSheetService.getSemiInventoryBalance(startDate, DateTimeUtil.addDays(startDate, 1));
try {
balanceSheetService.getSemiInventoryBalance(startDate, DateTimeUtil.addDays(startDate, 1));
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
startDate = DateTimeUtil.addDays(startDate, 1); // 日期增加一天
}
}
......@@ -194,8 +203,8 @@ public class BalanceSheetServiceTest {
@Test
public void getSemiTransferAmount() {
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
assert endDate != null;
assert startDate != null;
while (startDate.compareTo(endDate) < 0) {
......@@ -228,28 +237,35 @@ public class BalanceSheetServiceTest {
@Test
public void updateOther() {
Date date = DateTimeUtil.stringToDate("2020-09-29", DateTimeUtil.DATE_FORMAT);
Date dateSubOne = DateTimeUtil.addDays(date, -1);
dcOtherCostMapper.insertOneDayOtherReceive(date, dateSubOne);
dcOtherCostMapper.insertOneDayOtherPay(date, dateSubOne);
// 其他应收款、其他应付款
BigDecimal otherAccountsReceivable = dcOtherCostMapper.getOtherAccountsReceivableSum(date); // 其他应收款
if (otherAccountsReceivable == null) otherAccountsReceivable = BigDecimal.ZERO;
BigDecimal otherAccountsPayable = dcOtherCostMapper.getOtherAccountsPayableSum(date); // 其他应付款
if (otherAccountsPayable == null) otherAccountsPayable = BigDecimal.ZERO;
// 更新资产负债表统计字段
DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();
dcBalanceSheet.setCompanyValue(0);
dcBalanceSheet.setStatisticalTime(date);
dcBalanceSheet.setOtherAccountsReceivable(otherAccountsReceivable); // 其他应收款
dcBalanceSheet.setOtherAccountsPayable(otherAccountsPayable); // 其他应付款
dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
while (startDate.compareTo(endDate) == -1) {
Date date = startDate;
Date dateSubOne = DateTimeUtil.addDays(date, -1);
dcOtherCostMapper.insertOneDayOtherReceive(date, dateSubOne);
dcOtherCostMapper.insertOneDayOtherPay(date, dateSubOne);
// 其他应收款、其他应付款
BigDecimal otherAccountsReceivable = dcOtherCostMapper.getOtherAccountsReceivableSum(date); // 其他应收款
if (otherAccountsReceivable == null) otherAccountsReceivable = BigDecimal.ZERO;
BigDecimal otherAccountsPayable = dcOtherCostMapper.getOtherAccountsPayableSum(date); // 其他应付款
if (otherAccountsPayable == null) otherAccountsPayable = BigDecimal.ZERO;
// 更新资产负债表统计字段
DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();
dcBalanceSheet.setCompanyValue(0);
dcBalanceSheet.setStatisticalTime(date);
dcBalanceSheet.setOtherAccountsReceivable(otherAccountsReceivable); // 其他应收款
dcBalanceSheet.setOtherAccountsPayable(otherAccountsPayable); // 其他应付款
dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet);
startDate = DateTimeUtil.addDays(startDate, 1); // 日期增加一天
}
}
@Test
public void getFixedAssets() {
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
while (startDate.compareTo(endDate) == -1) {
// 固定资产
balanceSheetService.getFixedAssets(DateTimeUtil.addDays(startDate, -1), startDate, DateTimeUtil.addDays(startDate, 1));
......@@ -272,8 +288,8 @@ public class BalanceSheetServiceTest {
@Test
public void updateFund() {
Date startDate = DateTimeUtil.stringToDate("2020-10-20", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-10-28", DateTimeUtil.DATE_FORMAT);
Date startDate = DateTimeUtil.stringToDate("2020-10-19", DateTimeUtil.DATE_FORMAT);
Date endDate = DateTimeUtil.stringToDate("2020-11-02", DateTimeUtil.DATE_FORMAT);
while (startDate.compareTo(endDate) == -1) {
DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();
// 银行账户余额汇总
......
......@@ -325,7 +325,7 @@ public class AutoTurnoverJobTest {
DcBaseStockMapper dcBaseStockMapper = sqlSession.getMapper(DcBaseStockMapper.class);
DcBaseStock dcBaseStock = dcBaseStockMapper.selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo("949361401")
.andBailunSkuEqualTo("948881401")
.andWarehouseCodeEqualTo("GZBLWH")
.example());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment