zouyu
10 天以前 c935e18fab3604e493de29b164ea4019244bb182
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java
@@ -20,6 +20,7 @@
import com.ruoyi.inspect.pojo.IfsSplitOrderRecord;
import com.ruoyi.inspect.service.IfsPartPropsRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -133,8 +134,8 @@
                IfsPartPropsRecord ifsPartPropsRecord = new IfsPartPropsRecord();
                ifsPartPropsRecord.setIfsInventoryId(ifsInventoryQuantity.getId());//ifs订单id
                ifsPartPropsRecord.setDrumNo(parseObject.get("ATTR1").toString());//载具编号
                BigDecimal startMeterMark = new BigDecimal(parseObject.get("ATTR2").toString());
                BigDecimal endMeterMark = new BigDecimal(parseObject.get("ATTR3").toString());
                BigDecimal startMeterMark = ObjectUtils.isNotEmpty(parseObject.get("ATTR2"))?new BigDecimal(parseObject.get("ATTR2").toString()):BigDecimal.ZERO;
                BigDecimal endMeterMark = ObjectUtils.isNotEmpty(parseObject.get("ATTR3"))?new BigDecimal(parseObject.get("ATTR3").toString()):BigDecimal.ZERO;
                ifsPartPropsRecord.setStartMeterMark(startMeterMark);//起始米标
                ifsPartPropsRecord.setEndMeterMark(endMeterMark);//截止米标
                ifsPartPropsRecord.setOuterColor(parseObject.get("ATTR4").toString());//外护颜色
@@ -150,6 +151,29 @@
    public IfsPartPropsRecordDTO getOneByContract(IfsInventoryQuantityDto ifsInventoryQuantityDto) {
        return baseMapper.selectOneByContract(ifsInventoryQuantityDto);
    }
    @Override
    public IfsPartPropsRecordDTO getIfsPartProps(IfsInventoryQuantityDto ifsPartPropsRecordDTO) {
        validateParams(ifsPartPropsRecordDTO);
        ifsPartPropsRecordDTO.setOrderType(OrderType.WG.getValue());
        return baseMapper.selectOneByContract(ifsPartPropsRecordDTO);
    }
    void validateParams(IfsInventoryQuantityDto ifsPartPropsRecordDTO){
        if(Objects.isNull(ifsPartPropsRecordDTO)){
            throw new RuntimeException("传入参数不能为空");
        }
        if(StringUtils.isBlank(ifsPartPropsRecordDTO.getContract())){
            throw new RuntimeException("工厂域不能为空");
        }
        if(StringUtils.isBlank(ifsPartPropsRecordDTO.getUpdateBatchNo())){
            throw new RuntimeException("批次号不能为空");
        }
        if(StringUtils.isBlank(ifsPartPropsRecordDTO.getPartNo())){
            throw new RuntimeException("零件号不能为空");
        }
    }
}