|
|
|
@ -42,6 +42,9 @@ import java.util.*; |
|
|
|
@Service |
|
|
|
@Slf4j |
|
|
|
public class DailyPlanServiceImpl implements DailyPlanService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private OutboundLabelScanMapper outboundLabelScanMapper; |
|
|
|
@Autowired |
|
|
|
private TCPClient tcpClient; |
|
|
|
@Autowired |
|
|
|
@ -2302,6 +2305,16 @@ public class DailyPlanServiceImpl implements DailyPlanService { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
//如果传了工序号 就校验下 |
|
|
|
if(soToolData.getSeqNo()!=null){ |
|
|
|
String fifoFlag = outboundLabelScanMapper.getSysParamenter(toolingHistDataList.get(0).getSite(), "205"); |
|
|
|
if ("Y".equalsIgnoreCase(String.valueOf(fifoFlag).trim())){ |
|
|
|
// 参数205=Y时:校验工具实例当前领用派工单(ToolDetail.now_seq_no)必须等于本次报工派工单 - rqrq |
|
|
|
if(toolDetailData.getNowSeqNo()!=soToolData.getSeqNo()){ |
|
|
|
throw new RuntimeException("本工具"+ "未在本派工单领用"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String toolDesc = dailyPlanMapper.getToolHeaderDescription(toolDetailData.getToolID(), toolDetailData.getSite()); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("toolInstanceID", toolDetailData.getToolInstanceID()); |
|
|
|
@ -2491,6 +2504,33 @@ public class DailyPlanServiceImpl implements DailyPlanService { |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void batchSaveToolingHist(List<ToolingHistData> toolingHistDataList) { |
|
|
|
if (Objects.isNull(toolingHistDataList) || toolingHistDataList.isEmpty()){ |
|
|
|
throw new RuntimeException("保存数据不能为空"); |
|
|
|
} |
|
|
|
String fifoFlag = outboundLabelScanMapper.getSysParamenter(toolingHistDataList.get(0).getSite(), "205"); |
|
|
|
if ("Y".equalsIgnoreCase(String.valueOf(fifoFlag).trim())){ |
|
|
|
// 参数205=Y时:校验工具实例当前领用派工单(ToolDetail.now_seq_no)必须等于本次报工派工单 - rqrq |
|
|
|
for (ToolingHistData toolingHistData : toolingHistDataList) { |
|
|
|
if (!StringUtils.hasText(toolingHistData.getSite())){ |
|
|
|
throw new RuntimeException("工厂编码不能为空"); |
|
|
|
} |
|
|
|
if (!StringUtils.hasText(toolingHistData.getToolInstanceID())){ |
|
|
|
throw new RuntimeException("工具实例编码不能为空"); |
|
|
|
} |
|
|
|
if (Objects.isNull(toolingHistData.getSeqNo())){ |
|
|
|
throw new RuntimeException("派工单号不能为空"); |
|
|
|
} |
|
|
|
ToolDetailData toolDetailData = new LambdaQueryChainWrapper<>(toolDetailMapper) |
|
|
|
.eq(ToolDetailData::getSite, toolingHistData.getSite()) |
|
|
|
.eq(ToolDetailData::getToolInstanceID, toolingHistData.getToolInstanceID()) |
|
|
|
.one(); |
|
|
|
if (Objects.isNull(toolDetailData) |
|
|
|
|| Objects.isNull(toolDetailData.getNowSeqNo()) |
|
|
|
|| !toolDetailData.getNowSeqNo().equals(toolingHistData.getSeqNo())){ |
|
|
|
throw new RuntimeException("工具实例" + toolingHistData.getToolInstanceID() + "未在本派工单领用"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
dailyPlanMapper.batchSaveToolingHist(toolingHistDataList); |
|
|
|
} |
|
|
|
|
|
|
|
|