feat(warning): 添加钢卷告警批量处理功能
- 在 IWmsMaterialWarningService 中添加 batchHandle 方法接口 - 在 WmsMaterialWarningBo 中新增 warningIds 字段用于存储 ID 集合 - 在 WmsMaterialWarningController 中添加 /batchHandle 接口 - 在 WmsMaterialWarningServiceImpl 中实现批量处理逻辑 - 更新 Excel 导出标题中的分隔符为中文顿号 - 批量处理时自动填充处理人、处理时间和处理状态信息
This commit is contained in:
@@ -84,7 +84,7 @@ public class WmsMaterialWarningController extends BaseController {
|
||||
@PostMapping("/export")
|
||||
public void export(WmsMaterialWarningBo bo, HttpServletResponse response) {
|
||||
List<WmsMaterialWarningVo> list = iWmsMaterialWarningService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "钢卷通用维度告警(长度/厚度/宽度)", WmsMaterialWarningVo.class, response);
|
||||
ExcelUtil.exportExcel(list, "钢卷通用维度告警(长度、厚度、宽度)", WmsMaterialWarningVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,6 +118,16 @@ public class WmsMaterialWarningController extends BaseController {
|
||||
return toAjax(iWmsMaterialWarningService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量处理告警(填写处理人、处理时间、处理状态、处理备注)
|
||||
*/
|
||||
@Log(title = "钢卷通用维度告警批量处理", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/batchHandle")
|
||||
public R<Void> batchHandle(@Validated @RequestBody WmsMaterialWarningBo bo) {
|
||||
return toAjax(iWmsMaterialWarningService.batchHandle(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除钢卷通用维度告警(长度/厚度/宽度)
|
||||
*
|
||||
|
||||
@@ -7,6 +7,8 @@ import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -120,5 +122,8 @@ public class WmsMaterialWarningBo extends BaseEntity {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createEndTime;
|
||||
|
||||
// id集合
|
||||
private List<Long> warningIds;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -49,6 +49,11 @@ public interface IWmsMaterialWarningService {
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 批量处理告警(填写处理人、处理时间、处理状态、处理备注)
|
||||
*/
|
||||
Boolean batchHandle(WmsMaterialWarningBo bo);
|
||||
|
||||
/**
|
||||
* 检查钢卷长度/厚度偏差并批量插入告警记录
|
||||
* 在 calculateTheoretical 计算出理论长度和理论厚度后调用
|
||||
|
||||
@@ -5,8 +5,11 @@ import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.core.service.ConfigService;
|
||||
import com.klp.common.helper.LoginHelper;
|
||||
import com.klp.common.utils.DateUtils;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.mapper.WmsCoilPendingActionMapper;
|
||||
@@ -155,6 +158,22 @@ public class WmsMaterialWarningServiceImpl implements IWmsMaterialWarningService
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量处理告警(填写处理人、处理时间、处理状态、处理备注)
|
||||
*/
|
||||
@Override
|
||||
public Boolean batchHandle(WmsMaterialWarningBo bo) {
|
||||
bo.setHandleBy(LoginHelper.getNickName());
|
||||
bo.setHandleTime(DateUtils.getNowDate());
|
||||
LambdaUpdateWrapper<WmsMaterialWarning> luw = Wrappers.lambdaUpdate();
|
||||
luw.set(WmsMaterialWarning::getWarningStatus, bo.getWarningStatus())
|
||||
.set(StringUtils.isNotBlank(bo.getHandleBy()), WmsMaterialWarning::getHandleBy, bo.getHandleBy())
|
||||
.set(bo.getHandleTime() != null, WmsMaterialWarning::getHandleTime, bo.getHandleTime())
|
||||
.set(StringUtils.isNotBlank(bo.getHandleRemark()), WmsMaterialWarning::getHandleRemark, bo.getHandleRemark())
|
||||
.in(WmsMaterialWarning::getWarningId, bo.getWarningIds());
|
||||
return baseMapper.update(null, luw) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查钢卷长度/厚度偏差并批量插入告警记录
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user