diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWorkCenterServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWorkCenterServiceImpl.java index 864777de..393d495b 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWorkCenterServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWorkCenterServiceImpl.java @@ -271,15 +271,16 @@ public class SapWorkCenterServiceImpl implements SapWorkCenterService { for(String exsitCode:exsitCodes){ updates = dtos.stream().filter(dto -> dto.getArbpl().equals(exsitCode)).collect(Collectors.toList()); } - if(CollectionUtils.isEmpty(updates)){ + if(!CollectionUtils.isEmpty(updates)){ int m = sapBomMapper.updateFactoryBatchs(updates); System.out.println("工作中心更新成功条数:"+m); } List adds = new ArrayList<>(); for(String noExsitCode:noExsitCodes){ - adds = dtos.stream().filter(dto -> dto.getArbpl().equals(noExsitCode)).collect(Collectors.toList()); + List adds0 = dtos.stream().filter(dto -> dto.getArbpl().equals(noExsitCode)).collect(Collectors.toList()); + adds.addAll(adds0); } - if(CollectionUtils.isEmpty(adds)){ + if(!CollectionUtils.isEmpty(adds)){ //工厂parentId String parentId = sapBomMapper.getParentId(adds.get(0).getWeeks()); adds.stream().forEach(e->{ diff --git a/op-modules/op-sap/src/main/resources/mapper/sap/SapBomMapper.xml b/op-modules/op-sap/src/main/resources/mapper/sap/SapBomMapper.xml index 0226dbc3..8298c7e6 100644 --- a/op-modules/op-sap/src/main/resources/mapper/sap/SapBomMapper.xml +++ b/op-modules/op-sap/src/main/resources/mapper/sap/SapBomMapper.xml @@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -227,30 +227,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_factory - set factory_name = #{item.factoryName} + set factory_name = #{item.ktext} where - factoryCode = #{item.factoryCode} + factory_code = #{item.arbpl} insert into sys_factory - - parent_id, - factory_name, - factory_code, + (parent_id,factory_name,factory_code, create_by, - create_time, - update_time, - + create_time, + update_time) VALUES - #{item.parentId}, - #{item.factoryName}, - #{item.factoryCode}, + (#{item.parentId},#{item.ktext},#{item.arbpl}, 'job', - #{item.aedat_grnd}, - #{item.aedat_grnd}, + #{item.aedat_grnd}, + #{item.aedat_grnd})