| | |
| | | } |
| | | return R.ok("保存成功!!"); |
| | | } |
| | | |
| | | @Override |
| | | public boolean qlySave(QlyInspect qlyInspect) { |
| | | String code = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_INSPECT_CODE, qlyInspect); |
| | | if (Objects.isNull(code) || StringUtils.isBlank(code)) { |
| | | throw new CoolException("编码规则错误:" + "请检查编码:" + "「SYS_INSPECT_CODE」" + "是否设置成功!!"); |
| | | } |
| | | qlyInspect.setCode(code); |
| | | if (Objects.isNull(qlyInspect.getAsnCode()) || StringUtils.isBlank(qlyInspect.getAsnCode())) { |
| | | throw new CoolException("收货单号不能为空!!"); |
| | | } |
| | | AsnOrder asnOrder = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getId, qlyInspect.getAsnCode())); |
| | | if (Objects.isNull(asnOrder)) { |
| | | throw new CoolException("收货单不存在!!"); |
| | | } |
| | | qlyInspect.setAsnCode(asnOrder.getCode()).setAsnId(asnOrder.getId()); |
| | | |
| | | return this.save(qlyInspect); |
| | | } |
| | | } |