| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | 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.api.entity.dto.PoItemsDto; |
| | | import com.vincent.rsf.server.api.service.ReceiveMsgService; |
| | | import com.vincent.rsf.server.api.service.ReportMsgService; |
| | | import com.vincent.rsf.server.manager.controller.params.AsnOrderAndItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.BatchUpdateParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | |
| | | throw new CoolException("ASN单据不能为空!!"); |
| | | } |
| | | List<PoItemsDto> items = purchaseMapper.poList(asnIds); |
| | | if (items.isEmpty()) { |
| | | throw new CoolException("物料所属采购单据不存在!!"); |
| | | } |
| | | if (reportMsgService.reportInspectNotify(items)) { |
| | | return true; |
| | | } else { |
| | |
| | | List<AsnOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .like(!Objects.isNull(params.get("maktx")), AsnOrderItem::getMaktx, params.get("maktx")) |
| | | .eq(!Objects.isNull(params.get("matnrCode")), AsnOrderItem::getMatnrCode, params.get("matnrCode"))); |
| | | |
| | | if (orderItems.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | } |
| | | return R.ok("修改完成!!"); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 批量修改 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/1 07:58 |
| | | */ |
| | | @Override |
| | | public boolean batchUpdate(BatchUpdateParam params, Long userId) { |
| | | AsnOrder order = params.getOrder(); |
| | | if (Objects.isNull(order)) { |
| | | throw new CoolException("修改参数不能为空!!"); |
| | | } |
| | | return this.update(new LambdaUpdateWrapper<AsnOrder>() |
| | | .in(AsnOrder::getId, params.getIds()) |
| | | .set(!Objects.isNull(order.getRleStatus()), AsnOrder::getRleStatus, order.getRleStatus()) |
| | | .set(!Objects.isNull(order.getNtyStatus()), AsnOrder::getNtyStatus, order.getNtyStatus()) |
| | | .set(!Objects.isNull(order.getStatus()), AsnOrder::getStatus, order.getStatus()) |
| | | .set(!Objects.isNull(order.getWkType()), AsnOrder::getWkType, order.getWkType()) |
| | | .set(!Objects.isNull(order.getExceStatus()), AsnOrder::getExceStatus, order.getExceStatus()) |
| | | .set(AsnOrder::getUpdateBy, userId)); |
| | | |
| | | } |
| | | } |