明细保存时分批保存

This commit is contained in:
xd 2024-05-22 08:52:36 +08:00
parent 143216de73
commit ecfa045563
5 changed files with 29 additions and 6 deletions

View File

@ -1,5 +1,5 @@
#for tests only ! #for tests only !
#Tue May 21 16:05:10 CST 2024 #Wed May 22 08:23:51 CST 2024
jco.destination.pool_capacity=10 jco.destination.pool_capacity=10
jco.client.lang=ZH jco.client.lang=ZH
jco.client.ashost=172.19.0.120 jco.client.ashost=172.19.0.120
@ -7,5 +7,5 @@ jco.client.saprouter=
jco.client.user=RFC jco.client.user=RFC
jco.client.sysnr=00 jco.client.sysnr=00
jco.destination.peak_limit=10 jco.destination.peak_limit=10
jco.client.passwd=u]!Z{M|^ps7|OTDYVR9FX@#VvMHD7~y@=V7NzYJz?LvRTx~H jco.client.passwd=654321
jco.client.client=300 jco.client.client=300

View File

@ -3,6 +3,7 @@ package com.ruoyi.factory.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.material.domain.CMaterialCost;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
@ -133,7 +134,12 @@ public class CFactoryServiceImpl implements ICFactoryService
} }
if (list.size() > 0) if (list.size() > 0)
{ {
cFactoryMapper.batchCMaterialType(list); int batchSize = 200; // 每批次插入的数据量
for (int i = 0; i < list.size(); i += batchSize) {
int toIndex = Math.min(i + batchSize, list.size());
List<CMaterialTypeFactory> subList = list.subList(i, toIndex);
cFactoryMapper.batchCMaterialType(subList);
}
} }
} }
} }

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.material.domain.CMaterial; import com.ruoyi.material.domain.CMaterial;
import com.ruoyi.material.domain.temp; import com.ruoyi.material.domain.temp;
import com.ruoyi.quot.domain.QuotMaterial;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
@ -126,7 +127,12 @@ public class CMaterialServiceImpl implements ICMaterialService
} }
if (list.size() > 0) if (list.size() > 0)
{ {
cMaterialMapper.batchCMaterialCost(list); int batchSize = 200; // 每批次插入的数据量
for (int i = 0; i < list.size(); i += batchSize) {
int toIndex = Math.min(i + batchSize, list.size());
List<CMaterialCost> subList = list.subList(i, toIndex);
cMaterialMapper.batchCMaterialCost(subList);
}
} }
} }
} }

View File

@ -153,7 +153,12 @@ public class QuotServiceImpl implements IQuotService
} }
if (list.size() > 0) if (list.size() > 0)
{ {
quotMapper.batchQuotMaterial(list); int batchSize = 200; // 每批次插入的数据量
for (int i = 0; i < list.size(); i += batchSize) {
int toIndex = Math.min(i + batchSize, list.size());
List<QuotMaterial> subList = list.subList(i, toIndex);
quotMapper.batchQuotMaterial(subList);
}
} }
} }
} }

View File

@ -6,6 +6,7 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.customer.domain.Bank; import com.ruoyi.customer.domain.Bank;
import com.ruoyi.customer.domain.Customer; import com.ruoyi.customer.domain.Customer;
import com.ruoyi.material.domain.CMaterialCost;
import com.ruoyi.redBook.domain.OAQuot; import com.ruoyi.redBook.domain.OAQuot;
import com.ruoyi.redBook.domain.OAQuotProduct; import com.ruoyi.redBook.domain.OAQuotProduct;
import com.ruoyi.redBook.domain.Product; import com.ruoyi.redBook.domain.Product;
@ -156,7 +157,12 @@ public class RedBookServiceImpl implements IRedBookService
} }
if (list.size() > 0) if (list.size() > 0)
{ {
oaRedBookMapper.batchOAQuotProduct(list); int batchSize = 200; // 每批次插入的数据量
for (int i = 0; i < list.size(); i += batchSize) {
int toIndex = Math.min(i + batchSize, list.size());
List<OAQuotProduct> subList = list.subList(i, toIndex);
oaRedBookMapper.batchOAQuotProduct(subList);
}
} }
} }
} }