feat: 新增备货区域数据查询(任务2)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package cn.code.nl.module.lms.controller.admin.stockingivt.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 纸管托盘格位库存响应。
|
||||
*/
|
||||
@Schema(description = "管理后台 - 纸管托盘格位库存 Response VO")
|
||||
@Data
|
||||
public class PaperVehicleInventoryRespVO {
|
||||
|
||||
@Schema(description = "行号")
|
||||
private Integer rowNum;
|
||||
@Schema(description = "列号")
|
||||
private Integer colNum;
|
||||
@Schema(description = "物料编码")
|
||||
private String materialCode;
|
||||
@Schema(description = "物料名称")
|
||||
private String materialName;
|
||||
@Schema(description = "数量")
|
||||
private BigDecimal qty;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.code.nl.module.lms.controller.admin.stockingivt.vo;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 备货区域分页请求。
|
||||
*/
|
||||
@Schema(description = "管理后台 - 备货区域分页 Request VO")
|
||||
@Data
|
||||
public class StockingIvtPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
private String pointCode;
|
||||
@Schema(description = "点位名称")
|
||||
private String pointName;
|
||||
@Schema(description = "托盘号")
|
||||
private String vehicleCode;
|
||||
@Schema(description = "点位类型")
|
||||
private String pointType;
|
||||
@Schema(description = "点位状态")
|
||||
private String ivtStatus;
|
||||
@Schema(description = "是否启用")
|
||||
private String isUsed;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.code.nl.module.lms.controller.admin.stockingivt.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 备货区域响应。
|
||||
*/
|
||||
@Schema(description = "管理后台 - 备货区域 Response VO")
|
||||
@Data
|
||||
public class StockingIvtRespVO {
|
||||
|
||||
@Schema(description = "库存记录标识")
|
||||
private Long ivtId;
|
||||
@Schema(description = "点位编码")
|
||||
private String pointCode;
|
||||
@Schema(description = "点位名称")
|
||||
private String pointName;
|
||||
@Schema(description = "托盘号")
|
||||
private String vehicleCode;
|
||||
@Schema(description = "点位类型")
|
||||
private String pointType;
|
||||
@Schema(description = "点位状态")
|
||||
private String ivtStatus;
|
||||
@Schema(description = "位置")
|
||||
private String pointLocation;
|
||||
@Schema(description = "顺序号")
|
||||
private Integer sortSeq;
|
||||
@Schema(description = "是否启用")
|
||||
private String isUsed;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "修改人")
|
||||
private String updater;
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.code.nl.module.lms.controller.admin.stockingivt.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 备货区域修改请求。
|
||||
*/
|
||||
@Schema(description = "管理后台 - 备货区域修改 Request VO")
|
||||
@Data
|
||||
public class StockingIvtUpdateReqVO {
|
||||
|
||||
@Schema(description = "库存记录标识", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "库存记录标识不能为空")
|
||||
private Long ivtId;
|
||||
@Schema(description = "托盘号")
|
||||
private String vehicleCode;
|
||||
@Schema(description = "点位类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "点位类型不能为空")
|
||||
private String pointType;
|
||||
@Schema(description = "点位状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "点位状态不能为空")
|
||||
private String ivtStatus;
|
||||
@Schema(description = "位置")
|
||||
private String pointLocation;
|
||||
@Schema(description = "顺序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "顺序号不能为空")
|
||||
private Integer sortSeq;
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "是否启用不能为空")
|
||||
private String isUsed;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.code.nl.module.lms.dal.dataobject.stockingivt;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 纸管托盘库存数据对象。
|
||||
*/
|
||||
@TableName("lms_base_papervehicle")
|
||||
@Data
|
||||
public class PaperVehicleDO {
|
||||
|
||||
/** 库存记录标识。 */
|
||||
@TableId
|
||||
private String ivtId;
|
||||
/** 托盘号。 */
|
||||
private String vehicleCode;
|
||||
/** 行号。 */
|
||||
private Integer rowNum;
|
||||
/** 列号。 */
|
||||
private Integer colNum;
|
||||
/** 物料编码。 */
|
||||
private String materialCode;
|
||||
/** 物料名称。 */
|
||||
private String materialName;
|
||||
/** 数量。 */
|
||||
private BigDecimal qty;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.code.nl.module.lms.dal.dataobject.stockingivt;
|
||||
|
||||
import cn.code.nl.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 备货区域点位数据对象。
|
||||
*/
|
||||
@TableName("lms_ivt_stockingivt")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StockingIvtDO extends BaseDO {
|
||||
|
||||
/** 库存记录标识。 */
|
||||
@TableId
|
||||
private Long ivtId;
|
||||
/** 点位编码。 */
|
||||
private String pointCode;
|
||||
/** 点位名称。 */
|
||||
private String pointName;
|
||||
/** 托盘号。 */
|
||||
private String vehicleCode;
|
||||
/** 生产区域。 */
|
||||
private String productArea;
|
||||
/** 点位类型。 */
|
||||
private String pointType;
|
||||
/** 点位状态。 */
|
||||
private String ivtStatus;
|
||||
/** 位置。 */
|
||||
private String pointLocation;
|
||||
/** 顺序号。 */
|
||||
private Integer sortSeq;
|
||||
/** 是否启用。 */
|
||||
private String isUsed;
|
||||
/** 备注。 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.code.nl.module.lms.dal.mysql.stockingivt;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.framework.mybatis.core.util.MyBatisUtils;
|
||||
import cn.code.nl.module.lms.controller.admin.stockingivt.vo.StockingIvtPageReqVO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.stockingivt.PaperVehicleDO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.stockingivt.StockingIvtDO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 备货区域 Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
public interface StockingIvtMapper extends BaseMapperX<StockingIvtDO> {
|
||||
|
||||
/**
|
||||
* 分页查询备货区域。
|
||||
*/
|
||||
default PageResult<StockingIvtDO> selectStockingIvtPage(StockingIvtPageReqVO reqVO) {
|
||||
Page<StockingIvtDO> page = selectStockingIvtPage(MyBatisUtils.buildPage(reqVO), reqVO);
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行备货区域分页 SQL。
|
||||
*/
|
||||
Page<StockingIvtDO> selectStockingIvtPage(Page<StockingIvtDO> page,
|
||||
@Param("reqVO") StockingIvtPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 根据标识查询备货区域点位。
|
||||
*/
|
||||
StockingIvtDO selectStockingIvtById(@Param("ivtId") Long ivtId);
|
||||
|
||||
/**
|
||||
* 更新备货区域点位的可编辑字段。
|
||||
*/
|
||||
int updateStockingIvt(StockingIvtDO updateObj);
|
||||
|
||||
/**
|
||||
* 根据托盘号查询纸管库存。
|
||||
*/
|
||||
List<PaperVehicleDO> selectPaperVehicleList(@Param("vehicleCode") String vehicleCode);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.code.nl.module.lms.dal.mysql.stockingivt.StockingIvtMapper">
|
||||
|
||||
<sql id="stockingIvtColumns">
|
||||
ivt_id, point_code, point_name, vehicle_code, product_area, point_type,
|
||||
ivt_status, point_location, sort_seq, is_used, remark,
|
||||
creator, create_time, updater, update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectStockingIvtPage"
|
||||
resultType="cn.code.nl.module.lms.dal.dataobject.stockingivt.StockingIvtDO">
|
||||
SELECT <include refid="stockingIvtColumns"/>
|
||||
FROM lms_ivt_stockingivt
|
||||
<where>
|
||||
<if test="reqVO.pointCode != null and reqVO.pointCode != ''">
|
||||
point_code LIKE CONCAT('%', #{reqVO.pointCode}, '%')
|
||||
</if>
|
||||
<if test="reqVO.pointName != null and reqVO.pointName != ''">
|
||||
AND point_name LIKE CONCAT('%', #{reqVO.pointName}, '%')
|
||||
</if>
|
||||
<if test="reqVO.vehicleCode != null and reqVO.vehicleCode != ''">
|
||||
AND vehicle_code LIKE CONCAT('%', #{reqVO.vehicleCode}, '%')
|
||||
</if>
|
||||
<if test="reqVO.pointType != null and reqVO.pointType != ''">
|
||||
AND point_type = #{reqVO.pointType}
|
||||
</if>
|
||||
<if test="reqVO.ivtStatus != null and reqVO.ivtStatus != ''">
|
||||
AND ivt_status = #{reqVO.ivtStatus}
|
||||
</if>
|
||||
<if test="reqVO.isUsed != null and reqVO.isUsed != ''">
|
||||
AND is_used = #{reqVO.isUsed}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ivt_id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectStockingIvtById"
|
||||
resultType="cn.code.nl.module.lms.dal.dataobject.stockingivt.StockingIvtDO">
|
||||
SELECT <include refid="stockingIvtColumns"/>
|
||||
FROM lms_ivt_stockingivt
|
||||
WHERE ivt_id = #{ivtId}
|
||||
</select>
|
||||
|
||||
<update id="updateStockingIvt">
|
||||
UPDATE lms_ivt_stockingivt
|
||||
SET vehicle_code = #{vehicleCode},
|
||||
point_type = #{pointType},
|
||||
ivt_status = #{ivtStatus},
|
||||
point_location = #{pointLocation},
|
||||
sort_seq = #{sortSeq},
|
||||
is_used = #{isUsed},
|
||||
remark = #{remark},
|
||||
updater = #{updater}
|
||||
WHERE ivt_id = #{ivtId}
|
||||
</update>
|
||||
|
||||
<select id="selectPaperVehicleList"
|
||||
resultType="cn.code.nl.module.lms.dal.dataobject.stockingivt.PaperVehicleDO">
|
||||
SELECT ivt_id, vehicle_code,
|
||||
CAST(row_num AS SIGNED) AS row_num,
|
||||
CAST(col_num AS SIGNED) AS col_num,
|
||||
material_code, material_name, qty
|
||||
FROM lms_base_papervehicle
|
||||
WHERE vehicle_code = #{vehicleCode}
|
||||
ORDER BY CAST(row_num AS UNSIGNED), CAST(col_num AS UNSIGNED), ivt_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user