sap同步工作中心

highway
zhaoxiaolin 1 year ago
parent c5866a95c6
commit 292742f42f

@ -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<SapWorkCenter> adds = new ArrayList<>();
for(String noExsitCode:noExsitCodes){
adds = dtos.stream().filter(dto -> dto.getArbpl().equals(noExsitCode)).collect(Collectors.toList());
List<SapWorkCenter> 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->{

@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getExsitCodes" resultType="java.lang.String">
select factory_code from sys_factory where factory_code in
<foreach collection="code" item="list" open="(" separator="," close=")">
<foreach collection="list" item="code" open="(" separator="," close=")">
#{code}
</foreach>
</select>
@ -227,30 +227,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateFactoryBatchs">
<foreach collection="list" item="item" separator=";">
update sys_factory
set factory_name = #{item.factoryName}
set factory_name = #{item.ktext}
where
factoryCode = #{item.factoryCode}
factory_code = #{item.arbpl}
</foreach>
</update>
<!--批量添加工厂建模表-->
<insert id="addFactoryBatchs">
insert into sys_factory
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.parentId != null">parent_id,</if>
<if test="item.factoryName != null">factory_name,</if>
<if test="item.factoryCode != null">factory_code,</if>
(parent_id,factory_name,factory_code,
create_by,
<if test="item.createTime != null">create_time,</if>
<if test="item.updateTime != null">update_time,</if>
</trim>
create_time,
update_time)
VALUES
<foreach collection="list" index="index" item="item" separator=",">
<if test="item.parentId != null">#{item.parentId},</if>
<if test="item.factoryName != null">#{item.factoryName},</if>
<if test="item.factoryCode != null">#{item.factoryCode},</if>
(#{item.parentId},#{item.ktext},#{item.arbpl},
'job',
<if test="item.createTime != null">#{item.aedat_grnd},</if>
<if test="item.updateTime != null">#{item.aedat_grnd},</if>
#{item.aedat_grnd},
#{item.aedat_grnd})
</foreach>
</insert>
<delete id="deleteBaseBomByFactoryCode" parameterType="String">

Loading…
Cancel
Save