Commit 89bf0418 authored by H2T's avatar H2T

filling表 完善同步接口

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