feat(lot合批):新增逻辑
1.增加作业规则筛选一下可以看到的拆/合批次的工序作业规则:LOT_OPERATION,用于维护可以查看处理的工序
This commit is contained in:
parent
8be9a1c293
commit
d814ecce61
@ -74,12 +74,18 @@ public class BasisRequest {
|
||||
|
||||
// 用于接收 作业规则 CHECK_SPLIT_LOT_STATUS 或 CHECK_MERGE_LOT_STATUS的值 lot状态
|
||||
private String checkLotStatus;
|
||||
private List<String> checkLotStatusList;
|
||||
|
||||
// 作业规则 NOT_ALLOW_MERGE_MANY_TIMES 不允许多次合批 Y:不允许多次合批 其他:允许
|
||||
// 作业规则 NOT_ALLOW_SPLIT_MANY_TIMES 不允许多次拆批 Y:不允许多次拆批 其他:允许
|
||||
// 用于接收 NOT_ALLOW_MERGE_MANY_TIMES 或 NOT_ALLOW_SPLIT_MANY_TIMES 的值
|
||||
private String notAllowSplitMergeManyTimes;
|
||||
|
||||
// 用于接收工序
|
||||
private String lotOperation;
|
||||
|
||||
private List<String> lotOperationList;
|
||||
|
||||
// 是否查询lot_event_log表的标识,若falg不为空则查询,否则不查询
|
||||
private String selectLotEventLogFlag;
|
||||
|
||||
|
||||
@ -110,6 +110,11 @@ public class LotBasisDTO extends LotBasis {
|
||||
// 用于接收 NOT_ALLOW_MERGE_MANY_TIMES 或 NOT_ALLOW_SPLIT_MANY_TIMES 的值
|
||||
private String notAllowSplitMergeManyTimes;
|
||||
|
||||
// 用于接收工序
|
||||
private String lotOperation;
|
||||
|
||||
private List<String> lotOperationList;
|
||||
|
||||
// 操作:Lot拆批 或 Lot合批
|
||||
private String action;
|
||||
|
||||
|
||||
@ -51,8 +51,8 @@ public class ValidFactory extends InsertFactory {
|
||||
return lotBasis;
|
||||
}
|
||||
|
||||
protected LotBasisDTO isExistLot2(String site, String lotNo, String selectLotEventLogFlag) {
|
||||
LotBasisDTO lotBasis = lotBasisService.getLotBasisInfo2(LotBasis.genHandle(site, lotNo), selectLotEventLogFlag);
|
||||
protected LotBasisDTO isExistLot2(String site, String lotNo,List<String> checkLotStatusList, List<String> lotOperationList, String selectLotEventLogFlag) {
|
||||
LotBasisDTO lotBasis = lotBasisService.getLotBasisInfo2(LotBasis.genHandle(site, lotNo), checkLotStatusList, lotOperationList, selectLotEventLogFlag);
|
||||
if (ObjectUtil.isNull(lotBasis)) {
|
||||
throw BusinessException.build("条码号[" + lotNo + "]不存在");
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ public interface LotBasisService extends ExpansionService<LotBasis> {
|
||||
|
||||
LotBasisDTO getLotBasisInfo(String lotBasisBo);
|
||||
|
||||
LotBasisDTO getLotBasisInfo2(String lotBasisBo, String selectLotEventLogFlag);
|
||||
LotBasisDTO getLotBasisInfo2(String lotBasisBo,List<String> checkLotStatusList, List<String> lotOperationList, String selectLotEventLogFlag);
|
||||
|
||||
List<LotBasisDTO> getLotBasisInfoByList(List<String> lotBasisBoList);
|
||||
|
||||
|
||||
@ -223,7 +223,7 @@ public interface ProcessService {
|
||||
* @param selectLotEventLogFlag 是否查询lot_event_log表的标识,若falg不为空则查询,否则不查询
|
||||
* @return {@code LotBasisDTO} 生產批基礎信息
|
||||
*/
|
||||
LotBasisDTO checkExist2(String site, String lotNo, String selectLotEventLogFlag);
|
||||
LotBasisDTO checkExist2(String site, String lotNo, List<String> checkLotStatusList, List<String> lotOperationList, String selectLotEventLogFlag);
|
||||
|
||||
/**
|
||||
* 檢查生產批是否為當前工序
|
||||
|
||||
@ -15,6 +15,7 @@ import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.data.mybatis.expand.service.ExpansionServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@ -33,8 +34,8 @@ public class LotBasisServiceImpl extends ExpansionServiceImpl<LotBasisMapper, Lo
|
||||
}
|
||||
|
||||
@Override
|
||||
public LotBasisDTO getLotBasisInfo2( String lotBasisBo, String selectLotEventLogFlag) {
|
||||
return super.baseMapper.selectLotBasisInfo2(lotBasisBo, selectLotEventLogFlag);
|
||||
public LotBasisDTO getLotBasisInfo2( String lotBasisBo,List<String> checkLotStatusList, List<String> lotOperationList, String selectLotEventLogFlag) {
|
||||
return super.baseMapper.selectLotBasisInfo2(lotBasisBo, checkLotStatusList, lotOperationList, selectLotEventLogFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -94,6 +95,16 @@ public class LotBasisServiceImpl extends ExpansionServiceImpl<LotBasisMapper, Lo
|
||||
dto.setSelectLotEventLogFlag("Y");
|
||||
}
|
||||
|
||||
// 获取
|
||||
String lotOperation = dto.getLotOperation();
|
||||
// 获取作业规则中,Lot工序列表
|
||||
List<String> lotOperationList = null;
|
||||
if (StrUtil.isNotBlank(lotOperation)) {
|
||||
lotOperationList = Arrays.asList(lotOperation.split("[;]"));
|
||||
}
|
||||
// 设置
|
||||
dto.setLotOperationList(lotOperationList);
|
||||
|
||||
if (StrUtil.isNotBlank(dto.getOperation())) {
|
||||
dto.setOperationBo(Operation.genHandle(dto.getSite(), dto.getOperation(), BaseConstants.CURRENT_REVISION));
|
||||
}
|
||||
|
||||
@ -2447,21 +2447,6 @@ public class ProcessServiceImpl extends ValidFactory implements ProcessService {
|
||||
@Override
|
||||
public void validationBeforeSplitMerge2(BasisRequest basisRequest) {
|
||||
checkEmpty(basisRequest.getLotNo());
|
||||
/*
|
||||
如果作业规则【NOT_ALLOW_MERGE_MANY_TIMES】存在,并等于Y,则不允许多次合批;
|
||||
生产批开窗就不能查询到已经进行过合批或拆批的数据;LotNo在 lot_event_log 表,EVENT字段不等于P分批和M合批的
|
||||
否则允许多次合批,就可以查询到已经进行过合批或拆批的数据
|
||||
|
||||
如果作业规则【NOT_ALLOW_SPLIT_MANY_TIMES】存在,并等于Y,则不允许多次拆批;
|
||||
生产批开窗就不能查询到已经进行过合批或拆批的数据;LotNo在 lot_event_log 表,EVENT字段不等于P分批和M合批的
|
||||
否则允许多次拆批,就可以查询到已经进行过合批或拆批的数据
|
||||
*/
|
||||
if ("Y".equals(basisRequest.getNotAllowSplitMergeManyTimes())) {
|
||||
basisRequest.setSelectLotEventLogFlag("Y");
|
||||
}
|
||||
LotBasisDTO lotBasis = checkExist2(basisRequest.getSite(), basisRequest.getLotNo(), basisRequest.getSelectLotEventLogFlag());
|
||||
LotState lotState = lotStateService.getById(LotState.genHandle(lotBasis.getHandle()));
|
||||
|
||||
String msg = "";
|
||||
String rule = "";
|
||||
switch (basisRequest.getAction()) {
|
||||
@ -2485,15 +2470,39 @@ public class ProcessServiceImpl extends ValidFactory implements ProcessService {
|
||||
// 报错 :作业规则 CHECK_LOT_STATUS 没有维护,请检查!
|
||||
throw BusinessException.build("[Lot" + msg + "]功能,作业规则[" + rule + "]没有维护,请检查!");
|
||||
}
|
||||
basisRequest.setCheckLotStatusList(checkLotStatusList);
|
||||
|
||||
// 获取
|
||||
String lotOperation = basisRequest.getLotOperation();
|
||||
// 获取作业规则中,Lot工序列表
|
||||
List<String> lotOperationList = null;
|
||||
if (StrUtil.isNotBlank(lotOperation)) {
|
||||
lotOperationList = Arrays.asList(lotOperation.split("[;]"));
|
||||
}
|
||||
basisRequest.setLotOperationList(lotOperationList);
|
||||
/*
|
||||
如果作业规则【NOT_ALLOW_MERGE_MANY_TIMES】存在,并等于Y,则不允许多次合批;
|
||||
生产批开窗就不能查询到已经进行过合批或拆批的数据;LotNo在 lot_event_log 表,EVENT字段不等于P分批和M合批的
|
||||
否则允许多次合批,就可以查询到已经进行过合批或拆批的数据
|
||||
|
||||
如果作业规则【NOT_ALLOW_SPLIT_MANY_TIMES】存在,并等于Y,则不允许多次拆批;
|
||||
生产批开窗就不能查询到已经进行过合批或拆批的数据;LotNo在 lot_event_log 表,EVENT字段不等于P分批和M合批的
|
||||
否则允许多次拆批,就可以查询到已经进行过合批或拆批的数据
|
||||
*/
|
||||
if ("Y".equals(basisRequest.getNotAllowSplitMergeManyTimes())) {
|
||||
basisRequest.setSelectLotEventLogFlag("Y");
|
||||
}
|
||||
LotBasisDTO lotBasis = checkExist2(basisRequest.getSite(), basisRequest.getLotNo(), checkLotStatusList, lotOperationList, basisRequest.getSelectLotEventLogFlag());
|
||||
LotState lotState = lotStateService.getById(LotState.genHandle(lotBasis.getHandle()));
|
||||
|
||||
|
||||
// 判断 lot状态是否在作业规则中,不在报错
|
||||
// 如果 lotState.getStatus() 在 checkLotStatusList 中,则通过,否则报错
|
||||
if (!checkLotStatusList.contains(lotState.getStatus())) {
|
||||
// Lot no[xxx]状态不在作业规则中,不可合批或拆批
|
||||
throw BusinessException.build("Lot No[" + basisRequest.getLotNo() + "]状态[" + lotState.getStatus() + "]不在作业规则状态[" + checkLotStatus + "]中,不可" + msg);
|
||||
throw BusinessException.build("条码号[" + basisRequest.getLotNo() + "]状态[" + lotState.getStatus() + "]不在作业规则状态[" + checkLotStatus + "]中,不可" + msg);
|
||||
}
|
||||
|
||||
|
||||
// 如果母批的状态等于C,就查询该母批是否在 wms.wms_inventory 表存在
|
||||
if ("C".equals(lotState.getStatus())) {
|
||||
// 母批状态为C,查询库存表
|
||||
@ -2882,8 +2891,8 @@ public class ProcessServiceImpl extends ValidFactory implements ProcessService {
|
||||
return isExistLot(site, lotNo);
|
||||
}
|
||||
@Override
|
||||
public LotBasisDTO checkExist2(String site, String lotNo, String selectLotEventLogFlag) {
|
||||
return isExistLot2(site, lotNo, selectLotEventLogFlag);
|
||||
public LotBasisDTO checkExist2(String site, String lotNo, List<String> checkLotStatusList, List<String> lotOperationList, String selectLotEventLogFlag) {
|
||||
return isExistLot2(site, lotNo, checkLotStatusList, lotOperationList, selectLotEventLogFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -184,11 +184,12 @@ public class WipServiceImpl extends GetFactory implements WipService {
|
||||
String custPart = basisRequest.getCustPart();
|
||||
// 是否查询 lot_event_log 表的标识,若 falg 不为空则查询,否则不查询
|
||||
String selectLotEventLogFlag = basisRequest.getSelectLotEventLogFlag();
|
||||
|
||||
List<String> checkLotStatusList = basisRequest.getCheckLotStatusList();
|
||||
List<String> lotOperationList = basisRequest.getLotOperationList();
|
||||
LotBasisDTO lotBasisDTO = new LotBasisDTO();
|
||||
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
lotBasisDTO = lotBasisService.getLotBasisInfo2(LotBasis.genHandle(site, lotNo), selectLotEventLogFlag);
|
||||
lotBasisDTO = lotBasisService.getLotBasisInfo2(LotBasis.genHandle(site, lotNo),checkLotStatusList, lotOperationList, selectLotEventLogFlag);
|
||||
if (ObjectUtil.isNull(lotBasisDTO)) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("process.error4", lotNo));
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ public interface LotBasisMapper extends ExpansionBaseMapper<LotBasis> {
|
||||
|
||||
LotBasisDTO selectLotBasisInfo(@Param("lotBasisBo") String lotBasisBo);
|
||||
|
||||
LotBasisDTO selectLotBasisInfo2(@Param("lotBasisBo") String lotBasisBo,@Param("selectLotEventLogFlag") String selectLotEventLogFlag);
|
||||
LotBasisDTO selectLotBasisInfo2(@Param("lotBasisBo") String lotBasisBo,@Param("checkLotStatusList") List<String> checkLotStatusList, @Param("lotOperationList") List<String> lotOperationList, @Param("selectLotEventLogFlag") String selectLotEventLogFlag);
|
||||
|
||||
List<LotBasisDTO> selectLotBasisInfoByList(@Param("lotBasisBoList") List<String> lotBasisBoList);
|
||||
|
||||
|
||||
@ -148,6 +148,28 @@
|
||||
</if>
|
||||
<where>
|
||||
AND a.HANDLE = #{lotBasisBo}
|
||||
<if test="checkLotStatusList != null and checkLotStatusList.size() > 0">
|
||||
AND g.STATUS in
|
||||
<foreach collection="checkLotStatusList"
|
||||
item="status"
|
||||
index="index"
|
||||
open="("
|
||||
separator=","
|
||||
close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="lotOperationList != null and lotOperationList.size() > 0">
|
||||
AND i.OPERATION in
|
||||
<foreach collection="lotOperationList"
|
||||
item="operation"
|
||||
index="index"
|
||||
open="("
|
||||
separator=","
|
||||
close=")">
|
||||
#{operation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="selectLotEventLogFlag != null and selectLotEventLogFlag != ''">
|
||||
AND lel.EVENT not in ('P','M')
|
||||
</if>
|
||||
@ -345,6 +367,17 @@
|
||||
<if test="dto.operationBo != null and dto.operationBo != ''">
|
||||
AND e.OPERATION_BO = #{dto.operationBo}
|
||||
</if>
|
||||
<if test="dto.lotOperationList != null and dto.lotOperationList.size() > 0">
|
||||
AND f.OPERATION in
|
||||
<foreach collection="dto.lotOperationList"
|
||||
item="operation"
|
||||
index="index"
|
||||
open="("
|
||||
separator=","
|
||||
close=")">
|
||||
#{operation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.resourceBo != null and dto.resourceBo != ''">
|
||||
AND (d.RESOURCE_BO = #{dto.resourceBo}
|
||||
OR exists(select lot_state_bo from lot_start_equipment e where d.lot_serial = e.lot_serial and e.resource_bo = #{dto.resourceBo}))
|
||||
@ -356,9 +389,6 @@
|
||||
<if test="dto.segmentNo != null and dto.segmentNo !=''">
|
||||
AND g.SEGMENT_NO = #{dto.segmentNo}
|
||||
</if>
|
||||
<!-- <if test="dto.segmentNo == null or dto.segmentNo ==''">-->
|
||||
<!-- AND g.SEGMENT_NO != 'CP' AND g.SEGMENT_NO != 'FT'-->
|
||||
<!-- </if>-->
|
||||
</if>
|
||||
<if test="dto.statusList != null and dto.statusList.size() > 0">
|
||||
AND d.STATUS in
|
||||
|
||||
Loading…
Reference in New Issue
Block a user