| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addInsOrder(List<SampleProductDto> list, InsOrder insOrder) { |
| | | if (insOrder == null || insOrder.getSampleDate() == null) { |
| | | throw new ErrorException("送样日期不能为空"); |
| | | } |
| | | // todo: 下单判断抽样计划的唯一性 |
| | | if (insOrder.getQuarterItemId() != null) { |
| | | Long quarterItemCount = insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery() |
| | |
| | | snapshot.setTemplateId(template.getId()); |
| | | snapshot.setName(template.getName()); |
| | | snapshot.setNumber(template.getNumber()); |
| | | snapshot.setStandardRequirement(template.getStandardRequirement()); |
| | | snapshot.setRemark(template.getRemark()); |
| | | snapshot.setThing(template.getThing()); |
| | | snapshot.setSort(selection.getSort()); |
| | |
| | | .select(InsOrderStandardTemplate::getTemplateId, |
| | | InsOrderStandardTemplate::getTemperature, |
| | | InsOrderStandardTemplate::getDetectionTime, |
| | | InsOrderStandardTemplate::getDetectionEndTime, |
| | | InsOrderStandardTemplate::getDetectionPlace, |
| | | InsOrderStandardTemplate::getInsResult) |
| | | .orderByAsc(InsOrderStandardTemplate::getSort, |
| | |
| | | condition.setTemplateId(snapshot.getTemplateId()); |
| | | condition.setTemperature(snapshot.getTemperature()); |
| | | condition.setDetectionTime(snapshot.getDetectionTime()); |
| | | condition.setDetectionEndTime(snapshot.getDetectionEndTime() == null |
| | | ? snapshot.getDetectionTime() : snapshot.getDetectionEndTime()); |
| | | condition.setDetectionPlace(snapshot.getDetectionPlace()); |
| | | condition.setInsResult(snapshot.getInsResult()); |
| | | condition.setDeviceIds(templateDeviceIds.getOrDefault( |
| | |
| | | List<String> unqualifiedList = insProductMapper.selectUnqualifiedList(orderDto.getId()); |
| | | orderDto.setUnqualifiedItem(CollUtil.join(unqualifiedList, ",")); |
| | | } |
| | | orderDto.setCreateTimeString(orderDto.getCreateTime() == null ? "" : orderDto.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | orderDto.setSampleDateString(orderDto.getSampleDate() == null ? "" : orderDto.getSampleDate().toString()); |
| | | |
| | | } |
| | | |