Merge branch 'master' of http://git.xdadan.loc/tanex/emis-service
This commit is contained in:
commit
7e8886a8d2
@ -220,6 +220,9 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭线程池
|
||||
executorService.shutdown();
|
||||
|
||||
// 全局去重
|
||||
Map<String, EmisWaybillBatchStatus> batchStatusMap = allBatchStatus.stream()
|
||||
.collect(Collectors.toMap(
|
||||
@ -235,14 +238,24 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
(existing, replacement) -> existing));
|
||||
List<EmisTmsSiteBatchMiss> uniqueMissRecords = new ArrayList<>(missMap.values());
|
||||
|
||||
// 批量插入
|
||||
// 批量插入 - 每次插入5000条
|
||||
if (!uniqueBatchStatus.isEmpty()) {
|
||||
emisWaybillBatchStatusMapper.batchInsertEmisWaybillBatchStatus(uniqueBatchStatus);
|
||||
totalBatchStatusRecords += uniqueBatchStatus.size();
|
||||
int batchSize = 5000;
|
||||
for (int i = 0; i < uniqueBatchStatus.size(); i += batchSize) {
|
||||
int end = Math.min(i + batchSize, uniqueBatchStatus.size());
|
||||
List<EmisWaybillBatchStatus> batch = uniqueBatchStatus.subList(i, end);
|
||||
emisWaybillBatchStatusMapper.batchInsertEmisWaybillBatchStatus(batch);
|
||||
totalBatchStatusRecords += batch.size();
|
||||
}
|
||||
}
|
||||
if (!uniqueMissRecords.isEmpty()) {
|
||||
emisTmsSiteBatchMissMapper.batchInsertEmisTmsSiteBatchMiss(uniqueMissRecords);
|
||||
totalMissRecords += uniqueMissRecords.size();
|
||||
int batchSize = 5000;
|
||||
for (int i = 0; i < uniqueMissRecords.size(); i += batchSize) {
|
||||
int end = Math.min(i + batchSize, uniqueMissRecords.size());
|
||||
List<EmisTmsSiteBatchMiss> batch = uniqueMissRecords.subList(i, end);
|
||||
emisTmsSiteBatchMissMapper.batchInsertEmisTmsSiteBatchMiss(batch);
|
||||
totalMissRecords += batch.size();
|
||||
}
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis();
|
||||
|
||||
@ -192,6 +192,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="blIsQuestion != null and blIsQuestion != ''">
|
||||
AND w.bl_is_question = #{blIsQuestion}
|
||||
</if>
|
||||
<if test="sendSiteCode != null and sendSiteCode != ''">
|
||||
AND w.send_site_code = #{sendSiteCode}
|
||||
</if>
|
||||
<if test="params.beginSendDate != null and params.beginSendDate != ''">
|
||||
and w.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
|
||||
</if>
|
||||
|
||||
@ -28,11 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
r.manager, r.supplier_code, r.start_date, r.end_date, r.remark,
|
||||
r.del_flag, r.create_by, r.create_time, r.update_by, r.update_time, r.create_site, r.update_site,
|
||||
l.line_name,l.trans_manager,
|
||||
(SELECT GROUP_CONCAT(s.name)
|
||||
(SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
|
||||
FROM emis_supplier s
|
||||
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
||||
AND s.del_flag = '0') as supplier_name,
|
||||
(SELECT GROUP_CONCAT(p.prod_name)
|
||||
(SELECT GROUP_CONCAT(p.prod_name ORDER BY FIND_IN_SET(p.prod_code, r.product_type))
|
||||
FROM emis_trans_product p
|
||||
WHERE FIND_IN_SET(p.prod_code, r.product_type)
|
||||
AND p.del_flag = '0') as product_type_name
|
||||
@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectRulesForAllScan" parameterType="EmisTransPlanRule" resultMap="EmisTransPlanRuleResult">
|
||||
select r.id, r.line_code, r.product_type, r.start_site_code,r.next_site_code, s1.site_name as start_site_name,
|
||||
s2.site_name as next_site_name,
|
||||
r.manager, r.supplier_code, r.start_date, r.end_date, (SELECT GROUP_CONCAT(s.name)
|
||||
r.manager, r.supplier_code, r.start_date, r.end_date, (SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
|
||||
FROM emis_supplier s
|
||||
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
||||
AND s.del_flag = '0') as supplier_name
|
||||
@ -111,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectEmisTransPlanRuleByLineCodes" parameterType="list" resultMap="EmisTransPlanRuleResult">
|
||||
select r.id, r.line_code, r.product_type, r.start_site_code,r.next_site_code, s1.site_name as start_site_name,
|
||||
s2.site_name as next_site_name,
|
||||
r.manager, r.supplier_code, r.start_date, r.end_date, (SELECT GROUP_CONCAT(s.name)
|
||||
r.manager, r.supplier_code, r.start_date, r.end_date, (SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
|
||||
FROM emis_supplier s
|
||||
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
||||
AND s.del_flag = '0') as supplier_name
|
||||
@ -146,13 +146,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectSupplierNamesByCodes" parameterType="String" resultType="String">
|
||||
SELECT GROUP_CONCAT(s.name)
|
||||
SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, #{supplierCodes}))
|
||||
FROM emis_supplier s
|
||||
WHERE FIND_IN_SET(s.code, #{supplierCodes}) AND s.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectProductTypeNamesByCodes" parameterType="String" resultType="String">
|
||||
SELECT GROUP_CONCAT(s.prod_name)
|
||||
SELECT GROUP_CONCAT(s.prod_name ORDER BY FIND_IN_SET(s.prod_code, #{productType}))
|
||||
FROM emis_trans_product s
|
||||
WHERE FIND_IN_SET(s.prod_code, #{productType}) AND s.del_flag = 0
|
||||
</select>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user