修复上料问题

uat-temp-nht-2506120000-jialiao
jason 4 weeks ago
parent 13ea542a77
commit a90b8d16c3

@ -7,16 +7,23 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesContainerSnPart;
import cn.estsh.i3plus.pojo.mes.bean.MesContainerTypePart;
import cn.estsh.i3plus.pojo.mes.bean.MesRawSnWeightRecord;
import cn.estsh.i3plus.pojo.mes.repository.MesContainerSnPartRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesContainerTypePartRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesRawSnWeightRecordRepository;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author jason
*/
public class MesAbstractContainerBindDispatchService implements IMesContainerBindDispatchService {
@Autowired
protected MesContainerSnPartRepository containerSnPartRDao;
@Autowired
protected MesContainerTypePartRepository containerTypePartRDao;
@Autowired
protected MesRawSnWeightRecordRepository rawSnWeightRecordRDao;
protected MesAbstractContainerBindDispatchService(MesExtEnumUtil.CONTAINER_TYPE containerType, MesExtEnumUtil.CONTAINER_PART_MATCH_TYPE matchType) {
ContainerBindManager.INSTANCE.register(containerType, matchType, this);
@ -55,4 +62,17 @@ public class MesAbstractContainerBindDispatchService implements IMesContainerBin
}
return model;
}
protected Double getRawSnWeightQty(String organizeCode, String barcode) {
MesRawSnWeightRecord weightRecord = rawSnWeightRecordRDao.getByProperty(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "barCode"},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), barcode});
if (weightRecord == null) {
MesPcnException.throwMesBusiException("调配器条码【%s】不存在于原料重量记录表请检查数据", barcode);
}
if (weightRecord.getNetWeight() == null) {
MesPcnException.throwMesBusiException("调配器条码【%s】在原料重量记录表中的数量不能为空请检查数据", barcode);
}
return weightRecord.getNetWeight();
}
}

@ -13,6 +13,7 @@ import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
*
@ -40,6 +41,10 @@ public class MesContainerBindCooperationPartService extends MesAbstractContainer
}
result.put(MesPcnExtConstWords.DATA_TYPE, MesExtEnumUtil.CONTAINER_BARCODE_DATA_TYPE.STATUS_10.getValue());
if (Objects.equals(model.getContainerType(), MesExtEnumUtil.CONTAINER_TYPE.CONTAINER_TYPE_50.getValue())) {
Double netWeight = getRawSnWeightQty(organizeCode, barcode);
result.put(MesPcnExtConstWords.QTY, netWeight);
}
return result;
}
}

@ -52,6 +52,10 @@ public class MesContainerBindProductSnService extends MesAbstractContainerBindDi
}
result.put(MesPcnExtConstWords.DATA_TYPE, MesExtEnumUtil.CONTAINER_BARCODE_DATA_TYPE.STATUS_10.getValue());
if (Objects.equals(model.getContainerType(), MesExtEnumUtil.CONTAINER_TYPE.CONTAINER_TYPE_50.getValue())) {
Double netWeight = getRawSnWeightQty(organizeCode, barcode);
result.put(MesPcnExtConstWords.QTY, netWeight);
}
return result;
}
}

Loading…
Cancel
Save