| | |
| | | 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; |
| | |
| | | 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());//外护颜色 |
| | |
| | | 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("零件号不能为空"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |