refactor(wms): 将批次id改为生产任务id并优化相关功能

- 将 WmsSchedulePlanDetail 中的 batchId 改为 taskId
- 更新相关 BO、VO 类中的字段名称
- 修改数据库查询以适应新的字段
- 移除未使用的权限注解
This commit is contained in:
JR
2025-08-26 16:06:23 +08:00
parent 4c748a537a
commit e804d961b0
7 changed files with 37 additions and 26 deletions

View File

@@ -1,6 +1,5 @@
package com.klp.controller;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.util.*;
@@ -9,7 +8,6 @@ import com.klp.domain.vo.*;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;

View File

@@ -38,7 +38,7 @@ public class WmsSchedulePlanDetail extends BaseEntity {
/**
* 批次id
*/
private Long batchId;
private Long taskId;
/**
* 产品ID
*/

View File

@@ -36,9 +36,9 @@ public class WmsSchedulePlanDetailBo extends BaseEntity {
private Long lineId;
/**
* 批次id
* 生产任务ID批次id
*/
private Long batchId;
private Long taskId;
/**
* 产品ID

View File

@@ -41,10 +41,10 @@ public class WmsSchedulePlanDetailVo {
private Long lineId;
/**
* 批次id
* 生产任务id(原批次id)
*/
@ExcelProperty(value = "批次id")
private Long batchId;
@ExcelProperty(value = "生产任务id")
private Long taskId;
/**
* 产品ID
@@ -108,4 +108,15 @@ public class WmsSchedulePlanDetailVo {
@ExcelProperty(value = "批次号")
private String batchNo;
/**
* 计划名称
*/
@ExcelProperty(value = "计划名称")
private String planName;
/**
* 计划编码
*/
@ExcelProperty(value = "计划编码")
private String planCode;
}

View File

@@ -22,4 +22,6 @@ public interface WmsSchedulePlanDetailMapper extends BaseMapperPlus<WmsScheduleP
List<PlanTimeAgg> selectPlanTimeAgg(@Param("planIds") List<Long> planIds);
Page<WmsSchedulePlanDetailVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<WmsSchedulePlanDetail> lqw);
List<WmsSchedulePlanDetailVo> selectVoListWithName(@Param("ew") QueryWrapper<WmsSchedulePlanDetail> lqw);
}

View File

@@ -55,20 +55,8 @@ public class WmsSchedulePlanDetailServiceImpl implements IWmsSchedulePlanDetailS
*/
@Override
public List<WmsSchedulePlanDetailVo> queryList(WmsSchedulePlanDetailBo bo) {
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WmsSchedulePlanDetail> buildQueryWrapper(WmsSchedulePlanDetailBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getPlanId() != null, WmsSchedulePlanDetail::getPlanId, bo.getPlanId());
lqw.eq(bo.getLineId() != null, WmsSchedulePlanDetail::getLineId, bo.getLineId());
lqw.eq(bo.getBatchId() != null, WmsSchedulePlanDetail::getBatchId, bo.getBatchId());
lqw.eq(bo.getProductId() != null, WmsSchedulePlanDetail::getProductId, bo.getProductId());
lqw.eq(bo.getQuantity() != null, WmsSchedulePlanDetail::getQuantity, bo.getQuantity());
lqw.eq(bo.getStartDate() != null, WmsSchedulePlanDetail::getStartDate, bo.getStartDate());
lqw.eq(bo.getEndDate() != null, WmsSchedulePlanDetail::getEndDate, bo.getEndDate());
return lqw;
QueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapperPlus(bo);
return baseMapper.selectVoListWithName(lqw);
}
private QueryWrapper<WmsSchedulePlanDetail> buildQueryWrapperPlus(WmsSchedulePlanDetailBo bo) {
@@ -78,7 +66,7 @@ public class WmsSchedulePlanDetailServiceImpl implements IWmsSchedulePlanDetailS
lqw.eq("wspd.del_flag", 0);
lqw.eq( bo.getPlanId()!=null ,"wspd.plan_id", bo.getPlanId());
lqw.eq(bo.getLineId()!=null ,"wspd.line_id", bo.getLineId());
lqw.eq(bo.getBatchId()!=null ,"wspd.batch_id", bo.getBatchId());
lqw.eq(bo.getTaskId()!=null ,"wspd.task_id", bo.getTaskId());
lqw.eq(bo.getProductId()!=null ,"wspd.product_id", bo.getProductId());
lqw.eq(bo.getQuantity()!=null ,"wspd.quantity", bo.getQuantity());
lqw.eq(bo.getStartDate()!=null ,"wspd.start_date", bo.getStartDate());

View File

@@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="detailId" column="detail_id"/>
<result property="planId" column="plan_id"/>
<result property="lineId" column="line_id"/>
<result property="batchId" column="batch_id"/>
<result property="taskId" column="task_id"/>
<result property="productId" column="product_id"/>
<result property="quantity" column="quantity"/>
<result property="startDate" column="start_date"/>
@@ -39,11 +39,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsSchedulePlanDetailVo">
SELECT *,
wpl.line_name AS lineName,
wbt.batch_no AS batchNo
wpt.plan_name AS planName,
wpt.plan_code AS planCode
FROM wms_schedule_plan_detail wspd
left join wms_production_line wpl on wspd.line_id = wpl.line_id
left join wms_batch wbt on wspd.batch_id = wbt.batch_id
left join wms_production_task wpt on wspd.task_id = wpt.task_id
${ew.customSqlSegment}
</select>
<select id="selectVoListWithName" resultType="com.klp.domain.vo.WmsSchedulePlanDetailVo">
SELECT *,
wpl.line_name AS lineName,
wpt.plan_name AS planName,
wpt.plan_code AS planCode
FROM wms_schedule_plan_detail wspd
left join wms_production_line wpl on wspd.line_id = wpl.line_id
left join wms_production_task wpt on wspd.task_id = wpt.task_id
${ew.customSqlSegment}
</select>
</mapper>