| | |
| | | public int submit(QualityInspect inspect) { |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(inspect.getId()); |
| | | /*判断不合格*/ |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | |
| | | if (ObjectUtils.isNotNull(qualityInspect.getCheckResult()) && qualityInspect.getCheckResult().equals("不合格")){ |
| | | QualityUnqualified qualityUnqualified = new QualityUnqualified(); |
| | | BeanUtils.copyProperties(qualityInspect,qualityUnqualified); |
| | |
| | | String text = inspectParams.stream().map(QualityInspectParam::getParameterItem).collect(Collectors.joining(",")); |
| | | qualityUnqualified.setDefectivePhenomena(text+"这些指标中存在不合格");//不合格现象 |
| | | qualityUnqualifiedMapper.insert(qualityUnqualified); |
| | | } |
| | | } else { |
| | | |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | if (qualityInspect.getInspectType() == 0) { |
| | | if ("合格".equals(qualityInspect.getCheckResult())) { |
| | | ProcurementAddDto procurementRecordOutAdd = new ProcurementAddDto(); |
| | |
| | | if (qualityInspect.getPurchaseLedgerId() == null) { |
| | | throw new BaseException("请选择采购单"); |
| | | } |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(qualityInspect.getProductId()); |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(qualityInspect.getPurchaseLedgerId()); |
| | | |
| | | ArrayList<Details> detailss = new ArrayList<>(); |
| | | Details details = new Details(); |
| | |
| | | procurementRecordService.save(procurementRecordBuilder.build()); |
| | | |
| | | |
| | | |
| | | }else if (qualityInspect.getInspectType() == 2) { |
| | | //查询UnitPrice/TotalPrice |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectSalesLedgerProductByMainId(qualityInspect.getProductMainId()); |
| | |
| | | procurementRecordOutAdd.setQualityInspectId(qualityInspect.getId()); |
| | | procurementRecordService.add(procurementRecordOutAdd); |
| | | } |
| | | } |
| | | |
| | | qualityInspect.setInspectState(1);//已提交 |
| | | return qualityInspectMapper.updateById(qualityInspect); |
| | | } |