维修及配件管理修改修复
This commit is contained in:
parent
8f9fb12a25
commit
344bbfaad0
|
|
@ -128,4 +128,5 @@ public class PartType extends BaseEntity
|
||||||
@ApiModelProperty(value = "三级层级")
|
@ApiModelProperty(value = "三级层级")
|
||||||
private String thirdLevel;
|
private String thirdLevel;
|
||||||
|
|
||||||
|
private Integer flag;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,16 +185,71 @@ public class PartLeaseServiceImpl implements PartLeaseService {
|
||||||
}
|
}
|
||||||
if ("2".equals(partType.getLevel()) && partType.getId() == null) {
|
if ("2".equals(partType.getLevel()) && partType.getId() == null) {
|
||||||
// 获取partTypeList中的level为2的数据
|
// 获取partTypeList中的level为2的数据
|
||||||
for (PartType type : partTypeList) {
|
if(partType.getFlag() == null) {
|
||||||
PartType type1 = new PartType();
|
// 获取partTypeList中的level为2的数据
|
||||||
type1.setId(type.getSecondId());
|
for (PartType type : partTypeList) {
|
||||||
type1.setPaName(type.getPartName());
|
PartType type1 = new PartType();
|
||||||
// 先判断list集合中是否包含该数据
|
type1.setId(type.getSecondId());
|
||||||
if (!list.contains(type1)) {
|
type1.setPaName(type.getPartName());
|
||||||
list.add(type1);
|
type1.setSecondId(type.getSecondId());
|
||||||
|
type1.setSecondLevel(type.getSecondLevel());
|
||||||
|
type1.setThirdId(type.getThirdId());
|
||||||
|
type1.setThirdLevel(type.getThirdLevel());
|
||||||
|
type1.setStorageNum(type.getStorageNum());
|
||||||
|
type1.setUnitName(type.getUnitName());
|
||||||
|
type1.setPartName(type.getPartName());
|
||||||
|
// 先判断list集合中是否包含该数据
|
||||||
|
if (!list.contains(type1)) {
|
||||||
|
list.add(type1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}else{
|
||||||
|
for (PartType type : partTypeList) {
|
||||||
|
PartType type1 = new PartType();
|
||||||
|
type1.setId(type.getSecondId());
|
||||||
|
type1.setPaName(type.getPaName());
|
||||||
|
type1.setSecondId(type.getSecondId());
|
||||||
|
type1.setSecondLevel(type.getSecondLevel());
|
||||||
|
type1.setThirdId(type.getThirdId());
|
||||||
|
type1.setThirdLevel(type.getThirdLevel());
|
||||||
|
type1.setStorageNum(type.getStorageNum());
|
||||||
|
type1.setUnitName(type.getUnitName());
|
||||||
|
type1.setPartName(type.getPartName());
|
||||||
|
// 先判断list集合中是否包含该数据
|
||||||
|
if (!list.contains(type1)) {
|
||||||
|
list.add(type1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
// 从list获取secondLevel为2的数据,并去重放到secondList中
|
||||||
|
for (PartType type : list) {
|
||||||
|
if ("2".equals(type.getSecondLevel())) {
|
||||||
|
PartType type1 = new PartType();
|
||||||
|
type1.setId(type.getSecondId());
|
||||||
|
type1.setPaName(type.getPartName());
|
||||||
|
if (!secondList.contains(type1)) {
|
||||||
|
secondList.add(type1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("3".equals(type.getThirdLevel())) {
|
||||||
|
PartType type1 = new PartType();
|
||||||
|
type1.setId(type.getThirdId());
|
||||||
|
type1.setPaName(type.getPaName());
|
||||||
|
type1.setLevel(type.getThirdLevel());
|
||||||
|
type1.setUnitName(type.getUnitName());
|
||||||
|
type1.setStorageNum(type.getStorageNum());
|
||||||
|
if (!thirdList.contains(type1)) {
|
||||||
|
thirdList.add(type1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map.put("secondList", secondList);
|
||||||
|
map.put("thirdList", thirdList);
|
||||||
|
return AjaxResult.success(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success(list);
|
|
||||||
}
|
}
|
||||||
if ("3".equals(partType.getLevel()) && partType.getId() == null) {
|
if ("3".equals(partType.getLevel()) && partType.getId() == null) {
|
||||||
// 获取partTypeList中的level为3的数据
|
// 获取partTypeList中的level为3的数据
|
||||||
|
|
|
||||||
|
|
@ -1484,7 +1484,9 @@ public class RepairServiceImpl implements RepairService {
|
||||||
bean1.setUserName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
bean1.setUserName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||||
//查询配件列表
|
//查询配件列表
|
||||||
List<PartType> partList = repairMapper.getPartData(bean1);
|
List<PartType> partList = repairMapper.getPartData(bean1);
|
||||||
bean1.setPartTypeList(partList);
|
if(partList.size() > 0){
|
||||||
|
bean1.setPartTypeList(partList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,16 @@
|
||||||
<if test="level == 2 and id != null">
|
<if test="level == 2 and id != null">
|
||||||
and m1.parent_id = #{id}
|
and m1.parent_id = #{id}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="level == 2 and id != null and paName != null and paName != ''">
|
||||||
|
and (
|
||||||
|
m1.pa_name like concat('%', #{paName}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="level == 2 and (id == null or id == '') and paName != null and paName != ''">
|
||||||
|
and (
|
||||||
|
m1.pa_name like concat('%', #{paName}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
<if test="level == 3 and id != null">
|
<if test="level == 3 and id != null">
|
||||||
and m.parent_id = #{id}
|
and m.parent_id = #{id}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -958,7 +958,7 @@
|
||||||
CONCAT(bai.`code`, '-', rad.`level`) as `code`,
|
CONCAT(bai.`code`, '-', rad.`level`) as `code`,
|
||||||
mm.ma_code as maCode,
|
mm.ma_code as maCode,
|
||||||
su.nick_name as repairer,
|
su.nick_name as repairer,
|
||||||
DATE_FORMAT(rad.update_time,'%y%m%d') as createTime,
|
DATE_FORMAT(rad.update_time,'%Y-%m-%d') as createTime,
|
||||||
mt.rated_load as ratedLoad,
|
mt.rated_load as ratedLoad,
|
||||||
mt.test_load as testLoad,
|
mt.test_load as testLoad,
|
||||||
mt.holding_time as holdingTime,
|
mt.holding_time as holdingTime,
|
||||||
|
|
@ -986,6 +986,8 @@
|
||||||
LEFT JOIN ma_part_type mpt2 on mpt2.pa_id = mpt.parent_id
|
LEFT JOIN ma_part_type mpt2 on mpt2.pa_id = mpt.parent_id
|
||||||
WHERE rad.id = #{id}
|
WHERE rad.id = #{id}
|
||||||
and rar.is_ds = 0
|
and rar.is_ds = 0
|
||||||
|
and rar.part_id IS NOT NULL
|
||||||
|
and mpt2.pa_name IS NOT NULL
|
||||||
]]>
|
]]>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue