Commit 89bf0418 authored by H2T's avatar H2T

filling表 完善同步接口

parent a922791a
......@@ -32,7 +32,7 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
List<CylinderFilling> queryUnSyncFilling();
boolean updataSyncFilling(List<String> appIds,List<String> fillingBeforeIds,List<String> sequenceCodes);
boolean batchInsert(@Param("list") List<CylinderFilling> list);
boolean saveAndBatchInsert(@Param("list") List<CylinderFilling> list);
Long selectCountTotal();
......
......@@ -71,18 +71,24 @@
<update id="updataSyncFilling">
update tm_cylinder_filling set sync_state = 3
<where>
app_id in
<foreach collection="appIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and filling_before_id in
<foreach collection="fillingBeforeIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and sequence_code in
<foreach collection="sequenceCodes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="appIds != null and appIds.size() > 0">
app_id in
<foreach collection="appIds" item="appId" index="index" open="(" close=")" separator=",">
#{appId}
</foreach>
</if>
<if test="fillingBeforeIds != null and fillingBeforeIds.size() > 0">
and filling_before_id in
<foreach collection="fillingBeforeIds" item="fillingBeforeId" index="index" open="(" close=")" separator=",">
#{fillingBeforeId}
</foreach>
</if>
<if test="sequenceCodes != null and sequenceCodes.size() > 0">
and sequence_code in
<foreach collection="sequenceCodes" item="sequenceCode" index="index" open="(" close=")" separator=",">
#{sequenceCode}
</foreach>
</if>
</where>
</update>
......@@ -129,10 +135,11 @@
and cf.app_id is not null
ORDER BY
cf.sync_date DESC
LIMIT 10000
LIMIT 1000
</select>
<insert id="batchInsert">
INSERT INTO tz_cylinder_filling (
<insert id="saveAndBatchInsert">
INSERT INTO "amos_tzs_biz"."tz_cylinder_filling"
(
sequence_nbr,
filling_before_id,
filling_unit_name,
......@@ -175,7 +182,7 @@
#{item.recDate},
#{item.recUserId},
#{item.syncDate},
#{item.syncState},
'3',
#{item.appId},
#{item.integrity},
#{item.creditCode},
......
......@@ -135,7 +135,7 @@ public class CylSyncServiceImpl {
return "success";
}
@Transactional
@Transactional(rollbackFor = {Exception.class})
public void fillingDataProcessing(List<CylinderFilling> data) {
List<String> appIds = new ArrayList<>();
List<String> fillingBeforeIds = new ArrayList<>();
......@@ -201,9 +201,8 @@ public class CylSyncServiceImpl {
}
});
if (sourceFillingCheckServiceImpl.updataSyncFilling(appIds, fillingBeforeIds, sequenceCodes)){
cylCylinderFillingCheckMapper.batchInsert(data);
}
cylCylinderFillingCheckMapper.saveAndBatchInsert(data);
sourceFillingCheckServiceImpl.updataSyncFilling(appIds, fillingBeforeIds, sequenceCodes);
}
......
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