This commit is contained in:
2026-06-11 11:28:57 +08:00
6 changed files with 46 additions and 34 deletions

View File

@@ -30,6 +30,11 @@ public class WmsCoilAbnormalBo extends BaseEntity {
*/
private Long coilId;
/**
* 钢卷ID集合逗号分隔用于批量查询
*/
private String coilIds;
/**
* 产线名称
*/

View File

@@ -198,10 +198,10 @@ public class WmsMaterialCoilExportVo {
@ExcelProperty(value = "操作完成时间")
private Date actionCompleteTime;
/**
* 销售人员
*/
private String saleName;
// /**
// * 销售人员
// */
// private String saleName;
/**
* 调拨类型

View File

@@ -230,10 +230,10 @@ public class WmsMaterialCoilVo extends BaseEntity {
private String createByName;
private String updateByName;
//销售id
private Long saleId;
// 销售昵称
private String saleName;
// //销售id
// private Long saleId;
// // 销售昵称
// private String saleName;
//新增长度字段
private Long length;

View File

@@ -20,6 +20,8 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
import java.util.Arrays;
/**
* 钢卷异常信息Service业务层处理
@@ -64,6 +66,17 @@ public class WmsCoilAbnormalServiceImpl implements IWmsCoilAbnormalService {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsCoilAbnormal> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getCoilId() != null, WmsCoilAbnormal::getCoilId, bo.getCoilId());
// 逗号分隔的 coilIds 批量查询
if (StringUtils.isNotBlank(bo.getCoilIds())) {
List<Long> ids = Arrays.stream(bo.getCoilIds().split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::valueOf)
.collect(Collectors.toList());
if (!ids.isEmpty()) {
lqw.in(WmsCoilAbnormal::getCoilId, ids);
}
}
lqw.eq(StringUtils.isNotBlank(bo.getProductionLine()), WmsCoilAbnormal::getProductionLine, bo.getProductionLine());
lqw.eq(StringUtils.isNotBlank(bo.getPosition()), WmsCoilAbnormal::getPosition, bo.getPosition());
lqw.eq(StringUtils.isNotBlank(bo.getPlateSurface()), WmsCoilAbnormal::getPlateSurface, bo.getPlateSurface());

View File

@@ -772,21 +772,21 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
}
}
}
// 新增查询逻辑也就是当saleId未空时候
if (bo.getSaleId() != null) {
if (bo.getSaleId() == -1) {
// 当saleId为-1时查询sale_id为空的记录
qw.isNull("mc.sale_id");
} else if (bo.getSaleId() > 0) {
// 正常传值时依据saleId作为查询条件
qw.eq("mc.sale_id", bo.getSaleId());
}
}
// // 新增查询逻辑也就是当saleId未空时候
// if (bo.getSaleId() != null) {
// if (bo.getSaleId() == -1) {
// // 当saleId为-1时查询sale_id为空的记录
// qw.isNull("mc.sale_id");
// } else if (bo.getSaleId() > 0) {
// // 正常传值时依据saleId作为查询条件
// qw.eq("mc.sale_id", bo.getSaleId());
// }
// }
// 销售人员姓名模糊查询
if (bo.getSaleName() != null && !bo.getSaleName().isEmpty()) {
qw.like("su.nick_name", bo.getSaleName());
}
// // 销售人员姓名模糊查询
// if (bo.getSaleName() != null && !bo.getSaleName().isEmpty()) {
// qw.like("su.nick_name", bo.getSaleName());
// }
// 仅查询废品:质量状态为 D+、D、D-
if (Boolean.TRUE.equals(bo.getOnlyScrap())) {
@@ -1743,12 +1743,12 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
// 使用MyBatis-Plus的updateById方法直接更新
boolean flag = baseMapper.updateById(updateCoil) > 0;
// 特殊处理saleId字段确保null值也能被正确更新
if (bo.getSaleId() == null) {
LambdaUpdateWrapper<WmsMaterialCoil> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(WmsMaterialCoil::getCoilId, bo.getCoilId());
updateWrapper.set(WmsMaterialCoil::getSaleId, (Long)null);
baseMapper.update(null, updateWrapper);
}
// if (bo.getSaleId() == null) {
// LambdaUpdateWrapper<WmsMaterialCoil> updateWrapper = new LambdaUpdateWrapper<>();
// updateWrapper.eq(WmsMaterialCoil::getCoilId, bo.getCoilId());
// updateWrapper.set(WmsMaterialCoil::getSaleId, (Long)null);
// baseMapper.update(null, updateWrapper);
// }
// 检查长度/厚度偏差并插入告警
materialWarningService.checkAndInsertWarnings(updateCoil, bo);

View File

@@ -116,7 +116,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mc.trimming_requirement,
mc.packaging_requirement,
mc.packing_status,
mc.sale_id AS saleId,
mc.length,
mc.actual_length,
mc.actual_width,
@@ -136,7 +135,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mc.schedule_thickness,
mc.theoretical_length,
mc.chrome_plate_coil_no,
mc.sale_name AS saleName,
w.warehouse_name AS warehouseName,
nw.warehouse_name AS nextWarehouseName,
aw.actual_warehouse_name AS actualWarehouseName,
@@ -485,7 +483,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-- 打包状态(直接展示原始值)
mc.packing_status AS packingStatus,
-- 销售
mc.sale_name AS saleName,
-- 调拨类型
mc.transfer_type AS transferType,
-- 理论厚度
@@ -581,7 +578,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mc.packaging_requirement AS packagingRequirement,
mc.quality_status AS qualityStatus,
mc.packing_status AS packingStatus,
mc.sale_name AS saleName,
mc.transfer_type AS transferType,
mc.theoretical_thickness AS theoreticalThickness,
mc.schedule_thickness AS scheduleThickness,
@@ -703,7 +699,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mc.packaging_requirement AS packagingRequirement,
mc.quality_status AS qualityStatus,
mc.packing_status AS packingStatus,
mc.sale_name AS saleName,
mc.transfer_type AS transferType,
mc.theoretical_thickness AS theoreticalThickness,
mc.schedule_thickness AS scheduleThickness,
@@ -978,7 +973,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN wms_warehouse w ON mc.warehouse_id = w.warehouse_id
LEFT JOIN wms_warehouse nw ON mc.next_warehouse_id = nw.warehouse_id
LEFT JOIN wms_actual_warehouse aw ON mc.actual_warehouse_id = aw.actual_warehouse_id
LEFT JOIN sys_user su ON mc.sale_id = su.user_id
LEFT JOIN wms_raw_material rm ON mc.item_type = 'raw_material' AND mc.item_id = rm.raw_material_id
LEFT JOIN wms_product p ON mc.item_type = 'product' AND mc.item_id = p.product_id
LEFT JOIN (