fix(qms): exclude current lots from shop-order first-SFC check
Station-in now calls QMS after commit, so lot_state already contains the starting lot and CHK_FIRST_SFC never creates SYWX jobs.
This commit is contained in:
parent
146dac5f9e
commit
5b5ef20f78
@ -648,8 +648,12 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
AtomicInteger count = new AtomicInteger(0);
|
||||
shopOrderBoMap.forEach((shopOrderBo, lotBasisList) -> {
|
||||
String shopOrder = HandleBoProcessor.trimHandle(shopOrderBo);
|
||||
Integer i = autoCreateJobMapper.chkFirstSfcByLotEquipment($site, shopOrder, $resource);
|
||||
Integer j = autoCreateJobMapper.chkFirstSfcByLotState($site, shopOrder, $resource);
|
||||
List<String> currentLotNos = lotBasisList.stream()
|
||||
.map(LotBasis::getLotNo)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
Integer i = autoCreateJobMapper.chkFirstSfcByLotEquipment($site, shopOrder, $resource, currentLotNos);
|
||||
Integer j = autoCreateJobMapper.chkFirstSfcByLotState($site, shopOrder, $resource, currentLotNos);
|
||||
int k = i + j;
|
||||
|
||||
if (k <= 0) {
|
||||
|
||||
@ -11,10 +11,12 @@ import java.util.List;
|
||||
public interface AutoCreateJobMapper {
|
||||
|
||||
Integer chkFirstSfcByLotEquipment(@Param("site") String site, @Param("shopOrder") String shopOrder,
|
||||
@Param("resource") String resource);
|
||||
@Param("resource") String resource,
|
||||
@Param("excludeLotNos") List<String> excludeLotNos);
|
||||
|
||||
Integer chkFirstSfcByLotState(@Param("site") String site, @Param("shopOrder") String shopOrder,
|
||||
@Param("resource") String resource);
|
||||
@Param("resource") String resource,
|
||||
@Param("excludeLotNos") List<String> excludeLotNos);
|
||||
|
||||
Integer chkDailyFirstSfcByLotEquipment(@Param("site") String site, @Param("resource") String resource,
|
||||
@Param("daily") LocalDateTime daily);
|
||||
|
||||
@ -26,6 +26,12 @@
|
||||
where a.SITE = #{site}
|
||||
and a.SHOP_ORDER = #{shopOrder}
|
||||
and e.RESRCE = #{resource}
|
||||
<if test="excludeLotNos != null and excludeLotNos.size() > 0">
|
||||
and b.LOT_NO not in
|
||||
<foreach collection="excludeLotNos" item="lotNo" open="(" separator="," close=")">
|
||||
#{lotNo}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="chkFirstSfcByLotState" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
@ -36,6 +42,12 @@
|
||||
where a.SITE = #{site}
|
||||
and a.SHOP_ORDER = #{shopOrder}
|
||||
and d.RESRCE = #{resource}
|
||||
<if test="excludeLotNos != null and excludeLotNos.size() > 0">
|
||||
and b.LOT_NO not in
|
||||
<foreach collection="excludeLotNos" item="lotNo" open="(" separator="," close=")">
|
||||
#{lotNo}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="chkDailyFirstSfcByLotEquipment" resultType="java.lang.Integer">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user