物料管理批次bug和品牌idbug

This commit is contained in:
zhou-hongcheng
2026-01-22 11:36:47 +08:00
parent 9e8f0f195a
commit 55b6554216
2 changed files with 133 additions and 3 deletions
@@ -170,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
and material_base_info_id in (SELECT
DISTINCT material_base_info_id
FROM test_szwl_wms.material_inventory
FROM ngwl_test_wms.material_inventory
WHERE
allocation_quantity > 0
AND del_flag = 1)
@@ -178,6 +178,118 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryList" parameterType="com.mhd.basic.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO" resultMap="MaterialBaseInfoResult">
<include refid="selectMaterialBaseInfoPo"/>
<include refid="selectMaterialBaseInfoPo1"/>
<include refid="selectMaterialBaseInfoPo2"/>
</select>
<sql id="selectMaterialBaseInfoPo2">
<where>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="shipperId != null ">
and shipper_id = #{shipperId}
</if>
<if test="shipperName != null and shipperName != ''">
and shipper_name like concat('%', #{shipperName}, '%')
</if>
<if test="materialCode != null and materialCode != ''">
and material_code = #{materialCode}
</if>
<if test="materialName != null and materialName != ''">
and material_name like concat('%', #{materialName}, '%')
</if>
<if test="barCode != null and barCode != ''">
and bar_code = #{barCode}
</if>
<if test="materialClassifyCode != null and materialClassifyCode != ''">
and material_classify_code = #{materialClassifyCode}
</if>
<if test="materialClassifyName != null and materialClassifyName != ''">
and material_classify_name like concat('%', #{materialClassifyName}, '%')
</if>
<if test="materialType != null and materialType != ''">
and material_type = #{materialType}
</if>
<if test="materialTypeName != null and materialTypeName != ''">
and material_type_name like concat('%', #{materialTypeName}, '%')
</if>
<if test="unitCode != null and unitCode != ''">
and unit_code = #{unitCode}
</if>
<if test="unitName != null and unitName != ''">
and unit_name like concat('%', #{unitName}, '%')
</if>
<if test="packId != null ">
and pack_id = #{packId}
</if>
<if test="packCode != null and packCode != ''">
and pack_code = #{packCode}
</if>
<if test="packName != null and packName != ''">
and pack_name like concat('%', #{packName}, '%')
</if>
<if test="brandId != null ">
and brand_id = #{brandId}
</if>
<if test="brandCode != null and brandCode != ''">
and brand_code = #{brandCode}
</if>
<if test="brandName != null and brandName != ''">
and brand_name like concat('%', #{brandName}, '%')
</if>
<if test="shelfLife != null ">
and shelf_life = #{shelfLife}
</if>
<if test="weightLimit != null ">
and weight_limit = #{weightLimit}
</if>
<if test="volumeLimit != null ">
and volume_limit = #{volumeLimit}
</if>
<if test="materialShape != null and materialShape != ''">
and material_shape = #{materialShape}
</if>
<if test="materialShapeName != null and materialShapeName != ''">
and material_shape_name like concat('%', #{materialShapeName}, '%')
</if>
<if test="materialSize != null and materialSize != ''">
and material_size = #{materialSize}
</if>
<if test="materialLength != null ">
and material_length = #{materialLength}
</if>
<if test="materialWidth != null ">
and material_width = #{materialWidth}
</if>
<if test="materialHeight != null ">
and material_height = #{materialHeight}
</if>
<if test="nullify != null ">
and nullify = #{nullify}
</if>
<if test="createByName != null and createByName != ''">
and create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and update_by_name like concat('%', #{updateByName}, '%')
</if>
<!-- 传 1:只查公共 , 2:只查自己的 ,3:公共的和自己的 -->
<choose>
<when test="common != null and (common == 1 or common == 2) "> and common = #{common} </when>
<otherwise> and (
1 = 1
or common = 1 )</otherwise>
</choose>
<choose>
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
<otherwise> and del_flag = 1 </otherwise>
</choose>
</where>
</sql>
</mapper>
@@ -1,5 +1,6 @@
package com.mhd.wms.application.service.materialBaseInfo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.domain.materialBarCode.service.MaterialBarCodeDomainService;
@@ -8,12 +9,16 @@ import com.mhd.wms.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO;
import com.mhd.wms.domain.materialBaseInfo.service.MaterialBaseInfoDomainService;
import com.mhd.wms.domain.materialCommon.repository.todo.MaterialCommonDO;
import com.mhd.wms.domain.materialCommon.service.MaterialCommonDomainService;
import com.mhd.wms.domain.materialGoodsRule.entity.MaterialGoodsRule;
import com.mhd.wms.domain.materialGoodsRule.repository.mapper.MaterialGoodsRuleMapper;
import com.mhd.wms.domain.materialGoodsRule.repository.po.MaterialGoodsRulePO;
import com.mhd.wms.domain.materialGoodsRule.repository.todo.MaterialGoodsRuleDO;
import com.mhd.wms.domain.materialGoodsRule.service.MaterialGoodsRuleDomainService;
import com.mhd.wms.domain.materialInventoryWarning.service.MaterialInventoryWarningDomainService;
import com.mhd.wms.domain.materialWarehouseControl.repository.todo.MaterialWarehouseControlDO;
import com.mhd.wms.domain.materialWarehouseControl.service.MaterialWarehouseControlDomainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +47,8 @@ public class MaterialBaseInfoApplicationService {
@Autowired
private MaterialBarCodeDomainService materialBarCodeDomainService;
@Autowired
private MaterialGoodsRuleMapper materialGoodsRuleMapper;
/**
* 分页查询物料基础信息列表
@@ -55,7 +62,18 @@ public class MaterialBaseInfoApplicationService {
materialBaseInfoDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
}
}
return materialBaseInfoDomainService.queryList(materialBaseInfoDO);
List<MaterialBaseInfoPO> materialBaseInfoPOS = materialBaseInfoDomainService.queryList(materialBaseInfoDO);
for (MaterialBaseInfoPO materialBaseInfoPO : materialBaseInfoPOS) {
MaterialGoodsRule materialGoodsRules = materialGoodsRuleMapper.selectOne(new LambdaQueryWrapper<MaterialGoodsRule>()
.eq(MaterialGoodsRule::getMaterialBaseInfoId, materialBaseInfoPO.getMaterialBaseInfoId())
.eq(MaterialGoodsRule::getDelFlag, 1));
if (materialGoodsRules != null){
MaterialGoodsRulePO materialGoodsRulePO = new MaterialGoodsRulePO();
BeanUtils.copyProperties(materialGoodsRules,materialGoodsRulePO);
materialBaseInfoPO.setMaterialGoodsRule(materialGoodsRulePO);
}
}
return materialBaseInfoPOS;
}