配件管理新增重复数据问题修改
This commit is contained in:
parent
a83665da93
commit
1a1607f8cc
|
|
@ -56,5 +56,7 @@ public interface MaPartTypeMapper {
|
|||
int checkPartName(String paName);
|
||||
|
||||
List<MaPartType> selectPartName(String paName);
|
||||
|
||||
List<MaPartType> selectPartNameByLevel(MaPartType maPartType);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,13 @@ public class MaPartTypeServiceImpl implements IPartTypeService {
|
|||
// if (StringUtils.isNotNull(info) && info.getPaId().longValue() != paId.longValue()) {
|
||||
// return UserConstants.NOT_UNIQUE;
|
||||
// }
|
||||
// 查询具有相同paName的所有MaPartType对象
|
||||
if (maPartType.getLevel() != null && maPartType.getParentId() != null) {
|
||||
List<MaPartType> maPartTypes = maPartTypeMapper.selectPartNameByLevel(maPartType);
|
||||
if (maPartTypes.size() > 0) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
}
|
||||
// 查询具有相同paName的所有MaPartType对象
|
||||
List<MaPartType> maPartTypes = maPartTypeMapper.selectPartName(maPartType.getPaName());
|
||||
|
||||
|
|
|
|||
|
|
@ -197,5 +197,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from ma_part_type
|
||||
where pa_name = #{paName}
|
||||
</select>
|
||||
<select id="selectPartNameByLevel" resultType="com.bonus.sgzb.base.domain.MaPartType">
|
||||
select pa_id, pa_name, parent_id, status, num, unit_id, buy_price, level, warn_num, del_flag, create_by, create_time, remark, company_id
|
||||
from ma_part_type
|
||||
where pa_name = #{paName} and level = #{level} and parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue