update mes物料BOM逻辑删除采用del_flag

master
yinq 3 weeks ago
parent 11536f78c4
commit 102a274482

@ -119,11 +119,6 @@ public class ProdMaterialBom extends TenantEntity {
*/
private String activeFlag;
/**
* 1 0
*/
private String deleteFlag;
/**
*
*/

@ -120,9 +120,9 @@ public class ProdMaterialBomBo extends BaseEntity {
private String activeFlag;
/**
* 1 0
* 0 2
*/
private String deleteFlag;
private String delFlag;
/**
*

@ -1,7 +1,6 @@
package org.dromara.mes.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.dromara.common.constant.DatabaseConstants;
import org.dromara.common.constant.HwMomMesConstants;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
@ -11,7 +10,6 @@ import lombok.RequiredArgsConstructor;
import org.dromara.common.properties.MesProperties;
import org.dromara.mes.domain.ProdPlanInfo;
import org.dromara.mes.domain.bo.ProdPlanInfoBo;
import org.dromara.mes.domain.vo.ProdPlanInfoVo;
import org.dromara.mes.domain.vo.TreeSelect;
import org.dromara.mes.mapper.ProdPlanInfoMapper;
import org.jetbrains.annotations.NotNull;
@ -70,7 +68,6 @@ public class ProdMaterialBomServiceImpl implements IProdMaterialBomService {
*/
@Override
public List<ProdMaterialBomVo> queryList(ProdMaterialBomBo bo) {
bo.setDeleteFlag(HwMomMesConstants.DELETE_FLAG_NO);
MPJLambdaWrapper<ProdMaterialBom> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
@ -87,7 +84,6 @@ public class ProdMaterialBomServiceImpl implements IProdMaterialBomService {
.like(StringUtils.isNotBlank(bo.getMaterialBomVersion()), ProdMaterialBom::getMaterialBomVersion, bo.getMaterialBomVersion())
.eq(bo.getStandardAmount() != null, ProdMaterialBom::getStandardAmount, bo.getStandardAmount())
.eq(bo.getTopFlag() != null, ProdMaterialBom::getTopFlag, bo.getTopFlag())
.eq(bo.getDeleteFlag() != null, ProdMaterialBom::getDeleteFlag, bo.getDeleteFlag())
.eq(StringUtils.isNotBlank(bo.getCheckType()), ProdMaterialBom::getCheckType, bo.getCheckType())
.eq(bo.getProjectId() != null, ProdMaterialBom::getProjectId, bo.getProjectId())
.eq(bo.getAssembleTime() != null, ProdMaterialBom::getAssembleTime, bo.getAssembleTime())
@ -144,7 +140,6 @@ public class ProdMaterialBomServiceImpl implements IProdMaterialBomService {
@Transactional(rollbackFor = Exception.class)
public Boolean publishByBo(ProdMaterialBomBo bo) {
String materialBomVersion = bo.getMaterialBomVersion();
bo.setDeleteFlag(HwMomMesConstants.DELETE_FLAG_NO);
bo.setMaterialBomVersion(null);
//先获取parentid所有的物料bom信息
@ -223,7 +218,6 @@ public class ProdMaterialBomServiceImpl implements IProdMaterialBomService {
materialBomBos.forEach(materialBomBo -> {
validEntityUsed(materialBomBo);
ProdMaterialBom update = MapstructUtils.convert(materialBomBo, ProdMaterialBom.class);
update.setDeleteFlag(HwMomMesConstants.DELETE_FLAG_YES);
baseMapper.updateById(update);
});
@ -850,7 +844,6 @@ public class ProdMaterialBomServiceImpl implements IProdMaterialBomService {
*/
@Override
public List<ProdMaterialBomVo> queryList4Select(ProdMaterialBomBo bo) {
bo.setDeleteFlag(HwMomMesConstants.DELETE_FLAG_NO);
MPJLambdaWrapper<ProdMaterialBom> lqw = buildQueryWrapper(bo);
List<ProdMaterialBomVo> prodMaterialBomVos = baseMapper.selectVoList(lqw);

@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join base_material_type bmt on bmi.material_type_id = bmt.matrial_type_id
left join base_material_type bmtp on pmb.parent_material_type_id = bmtp.matrial_type_id
<where>
pmb.del_flag='0'
<if test="materialTypeCode != null and materialTypeCode != ''">and bmt.matrial_type_code like concat('%', #{materialTypeCode},
'%')
</if>
@ -118,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join prod_material_bom pmb on pmb.parent_id=bmi.material_id and pmb.material_bom_version = #{materialBomVersion} and pmb.delete_flag='0'
left join base_material_type bmt on bmi.material_type_id = bmt.matrial_type_id
<where>
pmb.del_flag='0'
<if test="parentId != null ">and bmi.material_id = #{parentId}</if>
</where>
order by bmi.material_id desc
@ -139,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join base_material_info bmi on pmb.parent_id=bmi.material_id
left join base_material_type bmt on bmi.parent_material_type_id = bmt.matrial_type_id
<where>
and pmb.delete_flag='0'
pmb.del_flag='0'
<if test="topFlag != null ">and pmb.top_flag = #{topFlag}</if>
</where>
@ -164,6 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join base_material_info bmi on pmb.material_id=bmi.material_id
left join base_material_type bmt on bsb.material_type_id = bmt.matrial_type_id
<where>
pmb.del_flag='0'
<if test="materialTypeCode != null and materialTypeCode != ''">and bmt.matrial_type_code like concat('%', #{materialTypeCode},
'%')
</if>
@ -182,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectNextMaterialBomVersion" parameterType="Long" resultType="String">
SELECT RIGHT('0' + CAST(ISNULL(MAX(CAST(material_bom_version AS INT)), 0) + 1 AS VARCHAR), 2)
FROM prod_material_bom where parent_id = #{parentId}
FROM prod_material_bom where del_flag='0' and parent_id = #{parentId}
</select>
</mapper>

Loading…
Cancel
Save