From 4422564b84dae692a44e955d7d696b39dbf3c155 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期二, 01 四月 2025 09:59:44 +0800 Subject: [PATCH] #新增 1. 添加质检明细批量修改接口 --- rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java index f973218..f8bcbe2 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java @@ -1,12 +1,45 @@ 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.IsptItemsParams; +import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; import com.vincent.rsf.server.manager.mapper.QlyIsptItemMapper; import com.vincent.rsf.server.manager.entity.QlyIsptItem; import com.vincent.rsf.server.manager.service.QlyIsptItemService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Objects; + @Service("qlyIsptItemService") public class QlyIsptItemServiceImpl extends ServiceImpl<QlyIsptItemMapper, QlyIsptItem> implements QlyIsptItemService { + /** + * @author Ryan + * @description 鎵归噺淇敼 + * @param + * @return + * @time 2025/4/1 09:40 + */ + @Override + public boolean batchUpdate(IsptItemsParams params) { + if (Objects.isNull(params.getIds()) || params.getIds().isEmpty()) { + throw new CoolException("ID涓嶈兘涓虹┖锛侊紒"); + } + QlyIsptItem isptItem = params.getIsptItem(); + if (Objects.isNull(isptItem)) { + throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛�"); + } + + return this.update(new LambdaUpdateWrapper<QlyIsptItem>() + .in(QlyIsptItem::getId, params.getIds()) + .set(!Objects.isNull(isptItem.getIsptStatus()), QlyIsptItem::getIsptStatus, !Objects.isNull(isptItem.getIsptStatus()) ? isptItem.getIsptStatus() : "0") + .set(!Objects.isNull(isptItem.getDisQty()), QlyIsptItem::getDisQty, !Objects.isNull(isptItem.getDisQty()) ? isptItem.getDisQty() : 0) + .set(!Objects.isNull(isptItem.getDlyQty()), QlyIsptItem::getDlyQty, !Objects.isNull(isptItem.getDlyQty()) ? isptItem.getDlyQty() : 0) + .set(!Objects.isNull(isptItem.getIsptResult()), QlyIsptItem::getIsptResult, !Objects.isNull(isptItem.getIsptResult()) ? isptItem.getIsptResult() : "0")); + } } -- Gitblit v1.9.1