| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.IsptOrderParam; |
| | |
| | | public List<AsnOrder> getUnInspect(Map<String, Object> params) { |
| | | List<AsnOrder> asnOrders = asnOrderService.list(new LambdaQueryWrapper<AsnOrder>() |
| | | .eq(AsnOrder::getStatus, 1) |
| | | .eq(!Objects.isNull(params.get("asnCode")), AsnOrder::getCode, !Objects.isNull(params.get("asnCode")) ? params.get("asnCode").toString() : "") |
| | | .eq(AsnOrder::getNtyStatus, 0)); |
| | | .eq(!Objects.isNull(params.get("asnCode")) && StringUtils.isNotBlank(params.get("asnCode").toString()), AsnOrder::getCode, StringUtils.isNotBlank(params.get("asnCode").toString()) ? params.get("asnCode").toString() : null)); |
| | | return asnOrders; |
| | | } |
| | | |
| | |
| | | throw new CoolException("明细保存失败!!"); |
| | | } |
| | | } |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().in(AsnOrder::getId, param.getIds()).set(AsnOrder::getNtyStatus, 1))) { |
| | | throw new CoolException("报检状态修改失败!!"); |
| | | } |
| | | 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); |
| | | } |
| | | } |