问题清单修复

tags/yfai-pcn-ext-v1.0
jun 10 months ago
parent dc35357c44
commit 62a45210fd

@ -17,4 +17,7 @@ public interface IMesPartShippingGroupService {
@ApiOperation(value = "查询发运组数据")
public List<MesPartShippingGroup> findAll(DdlPackBean packBean);
@ApiOperation(value = "查询发运组数据")
MesPartShippingGroup getMesPartShippingGroup(String organizeCode,String shippingGroupCode);
}

@ -98,7 +98,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
//检查物料
MesPart part;
//获取NC-零件检测-单据
MesPartInspection partInspection;
MesPartInspection partInspection = null;
Integer sourceType = null;
if (!StringUtils.isEmpty(inputModel.getSn())) {
// 数据校验
@ -125,7 +125,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
part = checkPartByPartNo(inputModel.getPartNo(), org);
//获取NC-零件检测-单据
partInspection = getPartInspectionByPartAndLot(inputModel, org);
if(!Objects.isNull(inputModel.getId())){
partInspection = getPartInspectionByPartAndLot(inputModel, org);
}
sourceType = MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.LOT.getValue();
}
@ -332,16 +334,21 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
String srcLocateNo = null;
//若是扫描条码 则判定条码可疑
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
produceSnExtService.update(produceSn);
//查询条码所在库位
srcLocateNo = getDestLocateNo(model, org);
}
if (Objects.isNull(srcLocateNo)) {
srcLocateNo = configService.getCfgValue(org, "LGORT");
}
//移库
MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org);
MesMove move = createMove(model,srcLocateNo, configService.getCfgValue(org, "UMLGO"), org);
moveRepository.save(move);
} else {
@ -399,12 +406,19 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
}
}
private String getDestLocateNo(MesPartInspectionInputModel model, String org) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(model.getSn(), "productSn", packBean);
DdlPreparedPack.getOrderBy(null, null, packBean);
MesMove mesMove = moveRepository.getByProperty(packBean);
return Objects.isNull(mesMove) ? null : mesMove.getUmlgo();
}
private MesMove getMesMove(MesPartInspectionInputModel model, String org) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getNumEqualPack(model.getPartInspection().getId(),"partInspectionId",packBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE.getValue(),"moveType",packBean);
MesMove mesMove = moveRepository.getByProperty(packBean);
return mesMove;
return moveRepository.getByProperty(packBean);
}
/**
@ -438,6 +452,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
private MesPartInspection getPartInspectionByPartAndLot(MesPartInspectionInputModel inputModel, String org) {
//根据扫描的条码查询条码是否存在
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getNumEqualPack(inputModel.getId(), "id", packBean);
DdlPreparedPack.getStringEqualPack(inputModel.getPartNo(), "partNo", packBean);
DdlPreparedPack.getStringEqualPack(inputModel.getLotNo(), "lotNo", packBean);
DdlPreparedPack.getNumEqualPack(inputModel.getQty().intValue(), "qty", packBean);

@ -24,4 +24,11 @@ public class MesPartShippingGroupService implements IMesPartShippingGroupService
return detailDeleteList;
}
@Override
public MesPartShippingGroup getMesPartShippingGroup(String organizeCode, String shippingGroupCode) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(shippingGroupCode, "partShippingGroupCode", packBean);
return shippingGroupRepository.getByProperty(packBean);
}
}

@ -10,6 +10,7 @@ import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingList;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingListDetail;
@ -23,9 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.*;
/**
* @Description :
@ -54,6 +53,9 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
@Autowired
private MesJisShippingRepository jisShippingRepository;
@Autowired
private MesPartShippingGroupService mesPartShippingGroupService;
@Override
public MesShippingLoadingCheckModel queryLoadingOrderNo(MesLoadingList loadingList) {
@ -139,15 +141,24 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
if (StringUtils.isEmpty(vehiclesOrderDetail)) {
throw new ImppBusiException(String.format("【%s】此发运单不存在或还未生成装车单明细请检查数据", model.getShippingCode()));
}
//查询零件发运组
MesPartShippingGroup shippingGroup = getMesPartShippingGroup(org, loadingList.getPartShippingGroupCode());
//根据扫描的发运单以及前端传的发运单明细,进行匹配,若没有找到扫描的发运单,则提示扫描的发运单号不在此装车单中,请检查数据!。
Boolean scanflg = false;
for (MesLoadingListDetail loadingListDetail : model.getDetailList()) {
if (loadingListDetail.getShippingCode().equals(model.getShippingCode())) {
if (loadingListDetail.getTempStatus() == MesCommonConstant.TRUE_INTEGER) {
if (Objects.equals(loadingListDetail.getTempStatus(), MesCommonConstant.TRUE_INTEGER)) {
throw new ImppBusiException(String.format("【%s】此发运单已经扫描过请检查数据", model.getShippingCode()));
}
//校验发运单明细顺序
if(CommonEnumUtil.VALID == shippingGroup.getIsEnableLoadingFailSafe()){
Optional<MesLoadingListDetail> detail = model.getDetailList().stream().filter(k -> k.getShippingCode().compareTo(loadingListDetail.getShippingCode()) < 0 && !Objects.equals(k.getTempStatus(), MesCommonConstant.TRUE_INTEGER)).findFirst();
if(detail.isPresent()){
throw new ImppBusiException(String.format("装车单【%s】启用明细顺序防错发运单【%s】前还有未扫描的发运单请检查数据", loadingList.getOrderCode(), model.getShippingCode()));
}
}
//判断是否需要排序校验 默认排序则需要校验
if (loadingList.getScanSeqWay() == MesExtEnumUtil.SHIPPING_GROUP_SCAN_CONFIRM_SEQ_MODE.DEFAULT_SORT.getValue()) {
@ -232,6 +243,14 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
return model;
}
private MesPartShippingGroup getMesPartShippingGroup(String org, String partShippingGroupCode) {
MesPartShippingGroup shippingGroup = mesPartShippingGroupService.getMesPartShippingGroup(org, partShippingGroupCode);
if(Objects.isNull(shippingGroup)){
throw new ImppBusiException(String.format("零件发运组【%s】信息不存在请检查数据", partShippingGroupCode));
}
return shippingGroup;
}
/**
*
*

@ -7,6 +7,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesSortShippingCheckService;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.aspect.MonitorLog;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingLoadingCheckModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingCheckModel;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
@ -15,6 +16,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesJisShipping;
import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingList;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingListDetail;
@ -78,6 +80,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
@Autowired
private MesCustomerPartRepository mesCustomerPartRepository;
@Autowired
private MesPartShippingGroupService mesPartShippingGroupService;
@Override
public MesSortShippingCheckModel queryShippingOrderNo(MesShippingOrderManagement shippingOrderManagement) {
@ -209,13 +214,19 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//校验发运单是否存在
MesShippingOrderManagement orderManagement = checkMesShippingOrderManagement(model, org);
//零件发运组
MesPartShippingGroup shippingGroup = getMesPartShippingGroup(org, orderManagement.getShippingGroupCode());
//根据条码找到对应的物料号若物料号一致则修改扫描flg将flg改为true.
boolean scanFlg = false;
for (MesShippingOrderManagementDetail detail : model.getDetailList()) {
if (detail.getPartNo().equals(produceSn.getPartNo()) && StringUtils.isEmpty(detail.getBarcode())) {
//校验发运单明细顺序
if(CommonEnumUtil.VALID == shippingGroup.getIsEnableShippingFailSafe()){
Optional<MesShippingOrderManagementDetail> first = model.getDetailList().stream().filter(k -> k.getCustInfoSeq().compareTo(detail.getCustInfoSeq()) < 0 && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).findFirst();
if(first.isPresent()){
throw new ImppBusiException(String.format("发运单【%s】启用明细顺序防错序号【%s】前还有未扫描的发运单明细请检查数据", orderManagement.getShippingCode(), detail.getCustInfoSeq()));
}
}
//判断是否需要排序校验 默认排序则需要校验
if (orderManagement.getScanSeqWay() == MesExtEnumUtil.SHIPPING_GROUP_SCAN_CONFIRM_SEQ_MODE.DEFAULT_SORT.getValue()) {
@ -332,6 +343,14 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
}
private MesPartShippingGroup getMesPartShippingGroup(String org, String partShippingGroupCode) {
MesPartShippingGroup shippingGroup = mesPartShippingGroupService.getMesPartShippingGroup(org, partShippingGroupCode);
if(Objects.isNull(shippingGroup)){
throw new ImppBusiException(String.format("零件发运组【%s】信息不存在请检查数据", partShippingGroupCode));
}
return shippingGroup;
}
private MesProduceSn checkSn(MesSortShippingCheckModel model, String org) {
//校验条码是否重复扫描
Optional<MesShippingOrderManagementDetail> optional = model.getDetailList().stream().filter(k -> !StringUtils.isEmpty(k.getBarcode()) && k.getBarcode().equals(model.getSn())).findFirst();

@ -100,13 +100,16 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
if(CollectionUtils.isEmpty(mesEquipmentSpotCheckList)){
return null;
}
Map<String, List<MesEquipmentSpotCheck>> mesEquipmentSpotCheckMap = mesEquipmentSpotCheckList.stream().collect(Collectors.groupingBy(MesEquipmentSpotCheck::getEquipCode));
Map<String, List<MesEquipmentSpotCheck>> mesEquipmentSpotCheckMap = mesEquipmentSpotCheckList.stream().filter(t->!StringUtils.isEmpty(t.getEquipCode())).collect(Collectors.groupingBy(MesEquipmentSpotCheck::getEquipCode));
if(Objects.isNull(mesEquipmentSpotCheckMap)){
return null;
}
List<MesEquipmentSpotCheckModel> mesEquipmentSpotCheckModelList = new ArrayList<>();
for (Map.Entry<String, List<MesEquipmentSpotCheck>> mesEquipmentSpotCheckEntry : mesEquipmentSpotCheckMap.entrySet()) {
MesEquipmentSpotCheck next = mesEquipmentSpotCheckEntry.getValue().iterator().next();
MesEquipmentSpotCheckModel mesEquipmentSpotCheckModel = new MesEquipmentSpotCheckModel();
BeanUtils.copyProperties(next,mesEquipmentSpotCheckModel);
Map<Integer, List<MesEquipmentSpotCheck>> listMap = mesEquipmentSpotCheckEntry.getValue().stream().collect(Collectors.groupingBy(MesEquipmentSpotCheck::getSpotCheckOrderType));
Map<Integer, List<MesEquipmentSpotCheck>> listMap = mesEquipmentSpotCheckEntry.getValue().stream().filter(t->!StringUtils.isEmpty(t.getSpotCheckOrderType())).collect(Collectors.groupingBy(MesEquipmentSpotCheck::getSpotCheckOrderType));
for (Map.Entry<Integer, List<MesEquipmentSpotCheck>> entry : listMap.entrySet()) {
MesEquipmentSpotCheckModel.MesEquipmentSpotCheckDataModel mesEquipmentSpotCheckDataModel = new MesEquipmentSpotCheckModel.MesEquipmentSpotCheckDataModel();
mesEquipmentSpotCheckDataModel.setSpotCheckOrderType(entry.getKey());

@ -18,6 +18,8 @@ import java.util.List;
@Data
public class MesPartInspectionInputModel {
@ApiParam("NC-零件检测-单据id")
private Long id;
@ApiParam("物料")
private MesPartSap part;

Loading…
Cancel
Save