feat(wms): 添加发货单状态修改功能并优化材料卷查询逻辑
- 在IWmsDeliveryWaybillService中新增changeStatus方法定义 - 在WmsDeliveryWaybillController中添加/status接口用于修改发货单状态 - 在WmsDeliveryWaybillServiceImpl中实现changeStatus业务逻辑 - 在WmsMaterialCoilServiceImpl中添加逻辑删除过滤条件 - 从材料卷查询中移除发货时间范围筛选相关代码 - 优化材料卷查询中的时间筛选逻辑和条件处理
This commit is contained in:
@@ -85,6 +85,12 @@ public class WmsDeliveryWaybillController extends BaseController {
|
||||
return toAjax(iWmsDeliveryWaybillService.updateByBo(bo));
|
||||
}
|
||||
|
||||
// 修改发货单状态
|
||||
@Log(title = "发货单主", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/status")
|
||||
public R<Void> changeStatus(@RequestBody WmsDeliveryWaybillBo bo) {
|
||||
return toAjax(iWmsDeliveryWaybillService.changeStatus(bo));
|
||||
}
|
||||
/**
|
||||
* 删除发货单主
|
||||
*
|
||||
|
||||
@@ -46,4 +46,6 @@ public interface IWmsDeliveryWaybillService {
|
||||
* 校验并批量删除发货单主信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
Boolean changeStatus(WmsDeliveryWaybillBo bo);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,13 @@ public class WmsDeliveryWaybillServiceImpl implements IWmsDeliveryWaybillService
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean changeStatus(WmsDeliveryWaybillBo bo) {
|
||||
WmsDeliveryWaybill update = new WmsDeliveryWaybill();
|
||||
update.setWaybillId(bo.getWaybillId());
|
||||
update.setStatus(bo.getStatus());
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
@@ -123,4 +129,6 @@ public class WmsDeliveryWaybillServiceImpl implements IWmsDeliveryWaybillService
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -394,6 +394,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.eq(StringUtils.isNotBlank(bo.getTemperGrade()), "mc.temper_grade", bo.getTemperGrade());
|
||||
// 独占状态
|
||||
qw.eq(bo.getExclusiveStatus() != null, "mc.exclusive_status", bo.getExclusiveStatus());
|
||||
//逻辑删除
|
||||
qw.eq("mc.del_flag", 0);
|
||||
// 按创建时间范围筛选
|
||||
if (bo.getByCreateTimeStart() != null) {
|
||||
qw.ge("mc.create_time", bo.getByCreateTimeStart());
|
||||
@@ -401,13 +403,6 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (bo.getByCreateTimeEnd() != null) {
|
||||
qw.le("mc.create_time", bo.getByCreateTimeEnd());
|
||||
}
|
||||
// 按发货时间范围筛选
|
||||
if (bo.getByExportTimeStart() != null) {
|
||||
qw.ge("mc.export_time", bo.getByExportTimeStart());
|
||||
}
|
||||
if (bo.getByExportTimeEnd() != null) {
|
||||
qw.le("mc.export_time", bo.getByExportTimeEnd());
|
||||
}
|
||||
// 统一处理 warehouseId 与 warehouseIds:
|
||||
List<Long> warehouseIdList = new ArrayList<>();
|
||||
if (bo.getWarehouseId() != null) {
|
||||
@@ -576,17 +571,13 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// "WHERE dp.del_flag = 0 AND dp.coil IS NOT NULL AND dp.coil <> '' " +
|
||||
// "AND FIND_IN_SET(CAST(mc.coil_id AS CHAR), dp.coil))");
|
||||
// }
|
||||
//逻辑删除
|
||||
qw.eq("mc.del_flag", 0);
|
||||
|
||||
//把team字段作为筛选条件
|
||||
qw.eq(StringUtils.isNotBlank(bo.getTeam()), "mc.team", bo.getTeam());
|
||||
//根据开始时间和结束时间筛选修改时间
|
||||
qw.ge(bo.getStartTime() != null, "mc.update_time", bo.getStartTime());
|
||||
qw.le(bo.getEndTime() != null, "mc.update_time", bo.getEndTime());
|
||||
|
||||
qw.ge(bo.getByCreateTimeStart() != null, "mc.create_time", bo.getByCreateTimeStart());
|
||||
qw.le(bo.getByCreateTimeEnd() != null, "mc.create_time", bo.getByCreateTimeEnd());
|
||||
|
||||
// 处理发货时间筛选逻辑(核心修改部分)
|
||||
if (bo.getByExportTimeStart() != null || bo.getByExportTimeEnd() != null) {
|
||||
// 开启OR条件分组:满足情况1 或 情况2
|
||||
|
||||
Reference in New Issue
Block a user