| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.mapper.ImportRepertoryMapper; |
| | | import com.yuanchu.mom.mapper.InspectUnacceptedMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.mapper.FinishedInspectMapper; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.InspectUnaccepted; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.service.FinishedInspectService; |
| | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | @Resource |
| | | ImportRepertoryMapper importRepertoryMapper; |
| | | |
| | | @Override |
| | | public Integer addProcessInspectionSheet(FinishedInspect finishedInspect) { |
| | | finishedInspect.setType(0); |
| | |
| | | updateWrapper.eq(FinishedInspect::getId, finishedInspectId); |
| | | updateWrapper.set(FinishedInspect::getResult, result); |
| | | finishedInspectMapper.update(new FinishedInspect(), updateWrapper); |
| | | //如果检验结论为不合格,则需要新增不合格检验单,还需要新增半成品库存 |
| | | FinishedInspect finishedInspect = finishedInspectMapper.selectById(finishedInspectId); |
| | | //如果检验结论为不合格,则需要新增不合格检验单,还需要新增半成品库存 |
| | | if (result == 0) { |
| | | /*新增不合格检验单*/ |
| | | InspectUnaccepted inspectUnaccepted = InspectUnaccepted.builder() |
| | |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | //如果检验合格,需要新增成品(0)库存 |
| | | //如果检验合格,需要新增成品(0)库存和入库记录 |
| | | if (result == 1) { |
| | | /*新增成品入库记录*/ |
| | | ImportRepertory importRepertory = ImportRepertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .code(finishedInspect.getMaterialCode()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .build(); |
| | | importRepertoryMapper.insert(importRepertory); |
| | | /*新增成品(0)库存*/ |
| | | //如果入库的信息一样只有库存不一样,则在原来的库存数量上加上相应的数量 |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |