出入库管理 增加物料模糊查询

出入库管理 增加物料模糊查询
pull/1/head
siontion 9 months ago
parent c6ef489a9a
commit 4ee874118b

@ -74,4 +74,13 @@ public class StoragePageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] cancelTime; private LocalDateTime[] cancelTime;
@Schema(description = "物料编码")
private String matNo;
@Schema(description = "物料名称")
private String matName;
} }

@ -37,6 +37,9 @@ public class StorageLogPageReqVO extends PageParam {
@Schema(description = "批次号") @Schema(description = "批次号")
private String lotNo; private String lotNo;
@Schema(description = "状态")
private String status;
@Schema(description = "备注", example = "你说的对") @Schema(description = "备注", example = "你说的对")
private String description; private String description;

@ -1,46 +1,49 @@
package com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo; package com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import java.util.*; import java.util.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@Schema(description = "管理后台 - 入/出库日志新增/修改 Request VO") @Schema(description = "管理后台 - 入/出库日志新增/修改 Request VO")
@Data @Data
public class StorageLogSaveReqVO { public class StorageLogSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8048") @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8048")
private Long id; private Long id;
@Schema(description = "入/出库Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3528") @Schema(description = "入/出库Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3528")
@NotNull(message = "入/出库Id不能为空") @NotNull(message = "入/出库Id不能为空")
private Long stockId; private Long stockId;
@Schema(description = "物料 Id,对应 base_material表中的 Id 列", requiredMode = Schema.RequiredMode.REQUIRED, example = "21832") @Schema(description = "物料 Id,对应 base_material表中的 Id 列", requiredMode = Schema.RequiredMode.REQUIRED, example = "21832")
@NotNull(message = "物料 Id,对应 base_material表中的 Id 列不能为空") @NotNull(message = "物料 Id,对应 base_material表中的 Id 列不能为空")
private Long matId; private Long matId;
@Schema(description = "仓库 Id对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3") @Schema(description = "仓库 Id对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
@NotNull(message = "仓库 Id对应 wms_wh 表中的Id不能为空") @NotNull(message = "仓库 Id对应 wms_wh 表中的Id不能为空")
private Long whId; private Long whId;
@Schema(description = "库区 Id对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15108") @Schema(description = "库区 Id对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15108")
@NotNull(message = "库区 Id对应 wms_rg 表中的Id不能为空") @NotNull(message = "库区 Id对应 wms_rg 表中的Id不能为空")
private Long rgId; private Long rgId;
@Schema(description = "库区 Id对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3954") @Schema(description = "库区 Id对应 wms_rg 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3954")
@NotNull(message = "库区 Id对应 wms_rg 表中的Id不能为空") @NotNull(message = "库区 Id对应 wms_rg 表中的Id不能为空")
private Long pnId; private Long pnId;
@Schema(description = "库存良品数量") @Schema(description = "库存良品数量")
private BigDecimal storageOkQty; private BigDecimal storageOkQty;
@Schema(description = "批次号") @Schema(description = "批次号")
private String lotNo; private String lotNo;
@Schema(description = "备注", example = "你说的对") @Schema(description = "备注", example = "你说的对")
private String description; private String description;
} @Schema(description = "状态", example = "你说的对")
private Integer status;
}

@ -61,4 +61,9 @@ public class StorageLogDO extends BaseDO {
*/ */
private String description; private String description;
/**
*
*/
private Integer status;
} }

@ -5,9 +5,17 @@ import java.util.*;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO;
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.chanko.yunxi.mes.module.heli.controller.admin.storage.vo.*; import com.chanko.yunxi.mes.module.heli.controller.admin.storage.vo.*;
import org.springframework.util.StringUtils;
/** /**
* / Mapper * / Mapper
@ -18,26 +26,43 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.storage.vo.*;
public interface StorageMapper extends BaseMapperX<StorageDO> { public interface StorageMapper extends BaseMapperX<StorageDO> {
default PageResult<StorageDO> selectPage(StoragePageReqVO reqVO) { default PageResult<StorageDO> selectPage(StoragePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<StorageDO>() MPJLambdaWrapper<StorageDO> query = new MPJLambdaWrapper<>();
.eqIfPresent(StorageDO::getStockType, reqVO.getStockType()) query.selectAll(StorageDO.class)
.eqIfPresent(StorageDO::getStockInType, reqVO.getStockInType()) .select("mat.code as matNo", "mat.name as matName")
.eqIfPresent(StorageDO::getStockOutType, reqVO.getStockOutType()) .leftJoin(StorageMatDO.class, "sm", StorageMatDO::getStockId, StorageDO::getId)
.eqIfPresent(StorageDO::getStockNo, reqVO.getStockNo()) .leftJoin(MaterialDO.class, "mat", MaterialDO::getId, StorageMatDO::getMatId)
.eqIfPresent(StorageDO::getHeaderNo, reqVO.getHeaderNo()) .orderByDesc(StorageDO::getId);
.eqIfPresent(StorageDO::getDescription, reqVO.getDescription())
.eqIfPresent(StorageDO::getStatus, reqVO.getStatus()) query.like(!StringUtils.isEmpty(reqVO.getMatNo()), "mat.code", reqVO.getMatNo())
.eqIfPresent(StorageDO::getWhId, reqVO.getWhId()) .like(!StringUtils.isEmpty(reqVO.getMatName()), "mat.name", reqVO.getMatName())
.eqIfPresent(StorageDO::getCreator, reqVO.getCreator()) .like(!StringUtils.isEmpty(reqVO.getStockNo()),StorageDO::getStockNo, reqVO.getStockNo())
.betweenIfPresent(StorageDO::getCreateTime, reqVO.getCreateTime()) .like(!StringUtils.isEmpty(reqVO.getHeaderNo()),StorageDO::getHeaderNo, reqVO.getHeaderNo())
.eqIfPresent(StorageDO::getUpdater, reqVO.getUpdater()) .eq(reqVO.getStockType() != null,StorageDO::getStockType, reqVO.getStockType())
.betweenIfPresent(StorageDO::getUpdateTime, reqVO.getUpdateTime()) .eq(reqVO.getStockInType() != null,StorageDO::getStockInType, reqVO.getStockInType())
.eqIfPresent(StorageDO::getKeeper, reqVO.getKeeper()) .eq(reqVO.getWhId() != null,StorageDO::getWhId, reqVO.getWhId())
.betweenIfPresent(StorageDO::getKeeperTime, reqVO.getKeeperTime()) .eq(reqVO.getStatus() != null,StorageDO::getStatus, reqVO.getStatus());
.eqIfPresent(StorageDO::getOutbound, reqVO.getOutbound())
.betweenIfPresent(StorageDO::getOutboundTime, reqVO.getOutboundTime()) return selectPage(reqVO,query);
.eqIfPresent(StorageDO::getCancel, reqVO.getCancel()) // return selectPage(reqVO, new LambdaQueryWrapperX<StorageDO>()
.betweenIfPresent(StorageDO::getCancelTime, reqVO.getCancelTime()) // .eqIfPresent(StorageDO::getStockType, reqVO.getStockType())
.orderByDesc(StorageDO::getId)); // .eqIfPresent(StorageDO::getStockInType, reqVO.getStockInType())
// .eqIfPresent(StorageDO::getStockOutType, reqVO.getStockOutType())
// .eqIfPresent(StorageDO::getStockNo, reqVO.getStockNo())
// .eqIfPresent(StorageDO::getHeaderNo, reqVO.getHeaderNo())
// .eqIfPresent(StorageDO::getDescription, reqVO.getDescription())
// .eqIfPresent(StorageDO::getStatus, reqVO.getStatus())
// .eqIfPresent(StorageDO::getWhId, reqVO.getWhId())
// .eqIfPresent(StorageDO::getCreator, reqVO.getCreator())
// .betweenIfPresent(StorageDO::getCreateTime, reqVO.getCreateTime())
// .eqIfPresent(StorageDO::getUpdater, reqVO.getUpdater())
// .betweenIfPresent(StorageDO::getUpdateTime, reqVO.getUpdateTime())
// .eqIfPresent(StorageDO::getKeeper, reqVO.getKeeper())
// .betweenIfPresent(StorageDO::getKeeperTime, reqVO.getKeeperTime())
// .eqIfPresent(StorageDO::getOutbound, reqVO.getOutbound())
// .betweenIfPresent(StorageDO::getOutboundTime, reqVO.getOutboundTime())
// .eqIfPresent(StorageDO::getCancel, reqVO.getCancel())
// .betweenIfPresent(StorageDO::getCancelTime, reqVO.getCancelTime())
// .orderByDesc(StorageDO::getId));
} }
} }

@ -8,5 +8,7 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/ 文档可见https://www.iocoder.cn/MyBatis/x-plugins/
--> -->
<select id="selectStorageMatLogList" resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelog.StorageLogDO">
select * from v_storage_material_log
</select>
</mapper> </mapper>

@ -217,10 +217,9 @@
</el-col> </el-col>
<el-table :data="formData.attachments" class="hl-table"> <el-table :data="formData.attachments" class="hl-table">
<el-table-column prop="name" label="文件名称" align="center"> <el-table-column prop="name" label="文件名称" align="center">
<template #default="scope"> <!-- <template #default="scope">
<!-- <div></div> -->
<a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a> <a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column prop="createTime" align="center" label="上传日期" :formatter="dateFormatter" /> <el-table-column prop="createTime" align="center" label="上传日期" :formatter="dateFormatter" />
@ -339,7 +338,7 @@ const formData = ref({
status: 1, status: 1,
whId: undefined, whId: undefined,
creator: undefined, creator: undefined,
createTime: undefined, createTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm'),
keeper: undefined, keeper: undefined,
keeperTime: undefined, keeperTime: undefined,
outbound: undefined, outbound: undefined,
@ -418,6 +417,9 @@ const matUploadChange = (file, files) => {
} }
const refreshAttachments = (files, type) => { const refreshAttachments = (files, type) => {
formData.value.attachments = formData.value.attachments.filter((value, index, array) => {
return value.id
})
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
let file = files[i]; let file = files[i];
file.businessFileType = type; file.businessFileType = type;
@ -488,9 +490,11 @@ const submitForm = async () => {
const dataMats = formData.value.matItemDOList as unknown as StorageMatApi.StorageMatVO[] const dataMats = formData.value.matItemDOList as unknown as StorageMatApi.StorageMatVO[]
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value) await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
// if(formData.value.matItemDOList.length>0){
matUploadData.value.businessId = storageid //
matUploadRef.value!.submit() matUploadData.value.businessId = storageid
matUploadRef.value!.submit()
}
message.success(t(commonResult)) message.success(t(commonResult))

@ -198,10 +198,9 @@
</el-col> </el-col>
<el-table :data="formData.attachments" class="hl-table"> <el-table :data="formData.attachments" class="hl-table">
<el-table-column prop="name" label="文件名称" align="center"> <el-table-column prop="name" label="文件名称" align="center">
<template #default="scope"> <!-- <template #default="scope">
<!-- <div></div> -->
<a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a> <a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column prop="createTime" align="center" label="上传日期" :formatter="dateFormatter" /> <el-table-column prop="createTime" align="center" label="上传日期" :formatter="dateFormatter" />
@ -319,7 +318,7 @@ const formData = ref({
status: 1, status: 1,
whId: undefined, whId: undefined,
creator: undefined, creator: undefined,
createTime: undefined, createTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm'),
keeper: undefined, keeper: undefined,
keeperTime: undefined, keeperTime: undefined,
outbound: undefined, outbound: undefined,
@ -396,6 +395,9 @@ const matUploadChange = (file, files) => {
} }
const refreshAttachments = (files, type) => { const refreshAttachments = (files, type) => {
formData.value.attachments = formData.value.attachments.filter((value, index, array) => {
return value.id
})
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
let file = files[i]; let file = files[i];
file.businessFileType = type; file.businessFileType = type;
@ -482,9 +484,11 @@ const submitForm = async () => {
const dataMats = formData.value.matItemDOList as unknown as StorageMatApi.StorageMatVO[] const dataMats = formData.value.matItemDOList as unknown as StorageMatApi.StorageMatVO[]
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value) await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
// if(formData.value.matItemDOList.length>0){
matUploadData.value.businessId = storageid //
matUploadRef.value!.submit() matUploadData.value.businessId = storageid
matUploadRef.value!.submit()
}
message.success(t(commonResult)) message.success(t(commonResult))

@ -37,7 +37,7 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="物料名称" prop="matName"> <el-form-item label="物料名称" prop="matName">
<el-input <el-input
v-model="queryParams.matName" v-model="queryParams.matName"
placeholder="物料名称" placeholder="物料名称"
@ -45,7 +45,7 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> --> </el-form-item>
<el-form-item label="入库类型" prop="stockInType"> <el-form-item label="入库类型" prop="stockInType">
<el-select <el-select
v-model="queryParams.stockInType" v-model="queryParams.stockInType"

@ -39,7 +39,7 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="物料名称" prop="matName"> <el-form-item label="物料名称" prop="matName">
<el-input <el-input
v-model="queryParams.matName" v-model="queryParams.matName"
placeholder="物料名称" placeholder="物料名称"
@ -47,7 +47,7 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> --> </el-form-item>
<el-form-item label="出库类型" prop="stockInType"> <el-form-item label="出库类型" prop="stockInType">
<el-select <el-select
v-model="queryParams.stockInType" v-model="queryParams.stockInType"

@ -73,6 +73,7 @@ CREATE TABLE `wms_storage_log` (
`updater` varchar(64) NULL DEFAULT NULL COMMENT '记录的修改人,对应员工表中的 Id', `updater` varchar(64) NULL DEFAULT NULL COMMENT '记录的修改人,对应员工表中的 Id',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`tenant_id` bigint(20) NOT NULL COMMENT '租户编号', `tenant_id` bigint(20) NOT NULL COMMENT '租户编号',
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态1为保存2为提交3为作废',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '入/出库日志表' ROW_FORMAT = DYNAMIC; ) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '入/出库日志表' ROW_FORMAT = DYNAMIC;

Loading…
Cancel
Save