Commit f82c1cbb authored by chenzhao's avatar chenzhao

修改bug

parent b34e1c82
......@@ -138,7 +138,7 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
/**
* 修改仓库
*/
int updateStr(@Param("id") Long id,@Param("name") String name,@Param("fullName") String fullName,@Param("parentId")String parentId, @Param("code")String code, @Param("bizOrgCode")String bizOrgCode);
int updateStr(@Param("id") Long id,@Param("name") String name,@Param("fullName") String fullName,@Param("parentId")String parentId, @Param("code")String code, @Param("bizOrgCode")String bizOrgCode,@Param("bizOrgName")String bizOrgName);
/**
......@@ -165,7 +165,7 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
/*
* 查询id下是否还有子类货位信息
* */
List<Map<String,String>> getParentId(Long parentId);
List<Map<String,Object>> getParentId(Long parentId);
Map<String, String> getIdAndType(String id);
......
......@@ -344,10 +344,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
String code = (String) map.get("code");
String parentName = formInstanceMapper.getStuctureName(parentId);
String bizOrgCode = map.get("bizOrgCode").toString();
String bizOrgName = map.get("bizOrgName").toString();
if (!"0".equals(parentId)) {
fullName = parentName + '-' + name;
}
formInstanceMapper.updateStr(instanceId, name, fullName, parentId, code,bizOrgCode);
formInstanceMapper.updateStr(instanceId, name, fullName, parentId, code,bizOrgCode,bizOrgName);
/*若还有子级节点,一起修改*/
List<Map<String, Object>> result = formInstanceMapper.getParentId(instanceId);
if (result.size()>0 && result != null){
result.forEach(e->
{
long id1 = Long.parseLong(e.get("id").toString());
formInstanceMapper.updateStr(id1 ,e.get("name").toString(),e.get("full_name").toString(),e.get("parent_id").toString(),e.get("code").toString(),bizOrgCode,bizOrgName);
});
}
//3.修改仓库对应子数据
fullName = "0".equals(parentId) ? name + "-" : "-" + name;
name = beforFullName + "-";
......@@ -1175,7 +1185,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return vo;
}).collect(Collectors.toList());
// 3.将建筑的bizOrgCode转换为parentId连接树 ,拼接数据准备
Map<String, Long> comMap = companyList.stream().collect(Collectors.toMap(BuildingTreeVo::getBizOrgCode, BuildingTreeVo::getId));
Map<String, Long> comMap = orgUsrLists.stream().collect(Collectors.toMap(OrgUsrDto::getBizOrgCode, OrgUsrDto::getSequenceNbr));
//增加了一层对树的过滤,过滤掉指定公司外的其他建筑。
List<BuildingTreeVo> collect = buildingTreeVos.stream().filter(build ->companyList.stream().map(m -> {
String bizOrgCode = m.getBizOrgCode();
......
......@@ -390,7 +390,8 @@
full_name = #{fullName},
parent_id = #{parentId},
code = #{code},
biz_org_code = #{bizOrgCode}
biz_org_code = #{bizOrgCode},
biz_org_name= #{bizOrgName}
where id = #{id}
</update>
<update id="updateStrFullName">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment