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 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() .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")); } }