diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java index d406e03d..9a81a063 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java @@ -26,6 +26,8 @@ public interface CallItemMapper extends BaseMapper { List selectDispatchCallItem(List list); + void deleteCallItem(List list); + void deleteDispatchCallItem(List list); List selectCallItemAndType(@Param("sfcDispatchBo") String sfcDispatchBo); diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java index 428ec6a0..e79893a0 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java @@ -28,10 +28,7 @@ import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -55,21 +52,21 @@ public class CallItemServiceImpl extends ServiceImpl i @Override public void sfcDispatchCallItem(String site, String user, List sfcDispatchList) { + LocalDateTime nowDate = LocalDateTime.now(); if (sfcDispatchList == null || sfcDispatchList.size() <= 0) { return; } - LocalDateTime nowDate = LocalDateTime.now(); + + //删除原来的数据 + callItemMapper.deleteDispatchCallItem(sfcDispatchList); //查询叫料组件 List callItemList = callItemMapper.selectDispatchCallItem(sfcDispatchList); if (callItemList == null || callItemList.size() <= 0) { return; } - List list = new ArrayList<>(); - - //删除原来的数据 - callItemMapper.deleteDispatchCallItem(sfcDispatchList); + List list = new ArrayList<>(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //工序叫料数据 //Leon.L 2021/8/16 业务取消工序叫料 @@ -254,8 +251,8 @@ public class CallItemServiceImpl extends ServiceImpl i } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - //删除原来的数据 - callItemMapper.deleteDispatchCallItem(sfcDispatchList); + //删除原来的非发料状态数据 + callItemMapper.deleteCallItem(sfcDispatchList); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ List list = callItemMapper.selectDispatchCallItem(sfcDispatchList); @@ -271,7 +268,7 @@ public class CallItemServiceImpl extends ServiceImpl i String callItemNo = callItem.getSfc() + callItem.getStepId() + component; callItem.setCallItemNo(callItemNo); - callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, callItemNo)); + callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, UUID.randomUUID().toString())); callItem.setCallType(Constants.CALL_TYPE_MATERIAL); callItem.setStatus(Constants.CALL_ITEM_STATUS_NEW); callItem.setCreateUser(user); diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index a0f16b00..1690e7ac 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -604,6 +604,13 @@ WHERE SFC_DISPATCH_BO = #{sfcDispatchBo} AND STATUS IN ('802','803') + + DELETE FROM Z_CALL_ITEM WHERE STATUS != '803' AND SFC_DISPATCH_BO IN + + #{item.handle} + + + DELETE FROM Z_CALL_ITEM WHERE SFC_DISPATCH_BO IN @@ -613,7 +620,7 @@