fix:物料准备盘点接口及修复其他接口问题

This commit is contained in:
shusir
2026-03-20 17:57:20 +08:00
parent 7bf3d2e73a
commit 09730d4b8f
36 changed files with 1317 additions and 46 deletions

View File

@@ -198,8 +198,7 @@ public interface ErrorCodeConstants {
ErrorCode SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_032_160_000, "客户端版本管理不存在"); ErrorCode SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_032_160_000, "客户端版本管理不存在");
ErrorCode MATERIAL_INVENTORY_CHECK_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点不存在"); ErrorCode MATERIAL_INVENTORY_CHECK_ITEM_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点不存在");
ErrorCode MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点项不存在");
ErrorCode MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点明细不存在"); ErrorCode MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点明细不存在");
ErrorCode MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库不存在"); ErrorCode MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库不存在");
ErrorCode MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等不存在"); ErrorCode MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等不存在");

View File

@@ -1,12 +1,15 @@
package com.zt.plat.module.qms.business.config.dal.mapper; package com.zt.plat.module.qms.business.config.dal.mapper;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationParDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationParDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@@ -26,7 +29,9 @@ public interface ConfigWarehouseLocationMapper extends BaseMapperX<ConfigWarehou
MPJLambdaWrapperX<ConfigWarehouseLocationDO> wrapper = new MPJLambdaWrapperX<>(); MPJLambdaWrapperX<ConfigWarehouseLocationDO> wrapper = new MPJLambdaWrapperX<>();
//仓库 //仓库
wrapper.leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId); wrapper.leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId)
// 权限
.leftJoin(ConfigPermissionDO.class, ConfigPermissionDO::getSourceId, ConfigWarehouseLocationDO::getId);
wrapper.selectAll(ConfigWarehouseLocationDO.class) wrapper.selectAll(ConfigWarehouseLocationDO.class)
.selectAs(ConfigWarehouseLocationParDO::getName, ConfigWarehouseLocationRespVO::getWarehouseName) .selectAs(ConfigWarehouseLocationParDO::getName, ConfigWarehouseLocationRespVO::getWarehouseName)
.selectAs(ConfigWarehouseLocationParDO::getCode, ConfigWarehouseLocationRespVO::getWarehouseCode) .selectAs(ConfigWarehouseLocationParDO::getCode, ConfigWarehouseLocationRespVO::getWarehouseCode)
@@ -43,6 +48,11 @@ public interface ConfigWarehouseLocationMapper extends BaseMapperX<ConfigWarehou
.eqIfPresent(ConfigWarehouseLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(ConfigWarehouseLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(ConfigWarehouseLocationDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(ConfigWarehouseLocationDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ConfigWarehouseLocationDO::getRemark, reqVO.getRemark()) .eqIfPresent(ConfigWarehouseLocationDO::getRemark, reqVO.getRemark())
// 角色权限
.and(CollUtil.isNotEmpty(reqVO.getRoleIds()), wrapper1 ->
wrapper1.in(ConfigPermissionDO::getTargetId, reqVO.getRoleIds())
.or()
.eqIfExists(ConfigWarehouseLocationDO::getCreator, SecurityFrameworkUtils.getLoginUserId()))
.orderByDesc(ConfigWarehouseLocationDO::getSortNo); .orderByDesc(ConfigWarehouseLocationDO::getSortNo);
return selectJoinPage(reqVO, ConfigWarehouseLocationRespVO.class, wrapper); return selectJoinPage(reqVO, ConfigWarehouseLocationRespVO.class, wrapper);

View File

@@ -2,12 +2,16 @@ package com.zt.plat.module.qms.business.config.service;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO;
import com.zt.plat.module.qms.enums.QmsPermissionConstant; import com.zt.plat.module.qms.enums.QmsPermissionConstant;
import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant;
import com.zt.plat.module.system.api.permission.PermissionApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
@@ -38,6 +42,9 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati
@Resource @Resource
private ConfigWarehouseLocationMapper configWarehouseLocationMapper; private ConfigWarehouseLocationMapper configWarehouseLocationMapper;
@Autowired
private PermissionApi permissionApi;
@Override @Override
public ConfigWarehouseLocationRespVO save(ConfigWarehouseLocationSaveReqVO reqVo) { public ConfigWarehouseLocationRespVO save(ConfigWarehouseLocationSaveReqVO reqVo) {
Long id = reqVo.getId(); Long id = reqVo.getId();
@@ -171,6 +178,9 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati
@Override @Override
public PageResult<ConfigWarehouseLocationRespVO> getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO) { public PageResult<ConfigWarehouseLocationRespVO> getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO) {
// 获取当前用户角色
CommonResult<Set<Long>> userRoleIds = permissionApi.getUserRoleIdListByUserId(SecurityFrameworkUtils.getLoginUserId());
pageReqVO.setRoleIds(userRoleIds.getData());
return configWarehouseLocationMapper.selectPage(pageReqVO); return configWarehouseLocationMapper.selectPage(pageReqVO);
} }

View File

@@ -0,0 +1,47 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 库存盘点明细分页 Request VO")
@Data
public class MaterialInventoryCheckDetailPageReqVO extends PageParam {
@Schema(description = "盘点项id", example = "1655")
private Long parentId;
@Schema(description = "物料实例id", example = "6754")
private Long infomationId;
@Schema(description = "是否存在,1-存在0-不存在")
private Integer present;
@Schema(description = "物料编号,系统不存在的临时存储起来")
private String infomationCode;
@Schema(description = "当前数量")
private String currentQuantity;
@Schema(description = "状态", example = "1")
private String status;
@Schema(description = "处置方式,字典配置")
private String disposalMethod;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,59 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 库存盘点明细 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialInventoryCheckDetailRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24954")
@ExcelProperty("主键")
private Long id;
@Schema(description = "盘点项id", example = "1655")
@ExcelProperty("盘点项id")
private Long parentId;
@Schema(description = "物料实例id", example = "6754")
@ExcelProperty("物料实例id")
private Long infomationId;
@Schema(description = "是否存在,1-存在0-不存在")
@ExcelProperty("是否存在,1-存在0-不存在")
private Integer present;
@Schema(description = "物料编号,系统不存在的临时存储起来")
@ExcelProperty("物料编号,系统不存在的临时存储起来")
private String infomationCode;
@Schema(description = "当前数量")
@ExcelProperty("当前数量")
private String currentQuantity;
@Schema(description = "状态", example = "1")
@ExcelProperty("状态")
private String status;
@Schema(description = "处置方式,字典配置")
@ExcelProperty("处置方式,字典配置")
private String disposalMethod;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,40 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 库存盘点明细新增/修改 Request VO")
@Data
public class MaterialInventoryCheckDetailSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24954")
private Long id;
@Schema(description = "盘点项id", example = "1655")
private Long parentId;
@Schema(description = "物料实例id", example = "6754")
private Long infomationId;
@Schema(description = "是否存在,1-存在0-不存在")
private Integer present;
@Schema(description = "物料编号,系统不存在的临时存储起来")
private String infomationCode;
@Schema(description = "当前数量")
private String currentQuantity;
@Schema(description = "状态", example = "1")
private String status;
@Schema(description = "处置方式,字典配置")
private String disposalMethod;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,42 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 库存盘点项分页 Request VO")
@Data
public class MaterialInventoryCheckItemPageReqVO extends PageParam {
@Schema(description = "父id", example = "20320")
private Long parentId;
@Schema(description = "盘点物料大类ID", example = "15446")
private Long productId;
@Schema(description = "应有量")
private BigDecimal expected;
@Schema(description = "实有量")
private BigDecimal actual;
@Schema(description = "差异")
private String difference;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,56 @@
package com.zt.plat.module.qms.resource.material.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 库存盘点项 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialInventoryCheckItemRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1246")
@ExcelProperty("主键")
private Long id;
@Schema(description = "父id", example = "20320")
@ExcelProperty("父id")
private Long parentId;
@Schema(description = "盘点物料大类ID", example = "15446")
@ExcelProperty("盘点物料大类ID")
private Long productId;
@Schema(description = "盘点物料大类名称")
@ExcelProperty("盘点物料大类名称")
private String productName;
@Schema(description = "应有量")
@ExcelProperty("应有量")
private BigDecimal expected;
@Schema(description = "实有量")
@ExcelProperty("实有量")
private BigDecimal actual;
@Schema(description = "差异")
@ExcelProperty("差异")
private String difference;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

Some files were not shown because too many files have changed in this diff Show More