Commit f82c1cbb authored by chenzhao's avatar chenzhao

修改bug

parent b34e1c82
...@@ -138,7 +138,7 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> { ...@@ -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> { ...@@ -165,7 +165,7 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
/* /*
* 查询id下是否还有子类货位信息 * 查询id下是否还有子类货位信息
* */ * */
List<Map<String,String>> getParentId(Long parentId); List<Map<String,Object>> getParentId(Long parentId);
Map<String, String> getIdAndType(String id); Map<String, String> getIdAndType(String id);
......
...@@ -344,10 +344,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -344,10 +344,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
String code = (String) map.get("code"); String code = (String) map.get("code");
String parentName = formInstanceMapper.getStuctureName(parentId); String parentName = formInstanceMapper.getStuctureName(parentId);
String bizOrgCode = map.get("bizOrgCode").toString(); String bizOrgCode = map.get("bizOrgCode").toString();
String bizOrgName = map.get("bizOrgName").toString();
if (!"0".equals(parentId)) { if (!"0".equals(parentId)) {
fullName = parentName + '-' + name; 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.修改仓库对应子数据 //3.修改仓库对应子数据
fullName = "0".equals(parentId) ? name + "-" : "-" + name; fullName = "0".equals(parentId) ? name + "-" : "-" + name;
name = beforFullName + "-"; name = beforFullName + "-";
...@@ -1175,7 +1185,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1175,7 +1185,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return vo; return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// 3.将建筑的bizOrgCode转换为parentId连接树 ,拼接数据准备 // 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 -> { List<BuildingTreeVo> collect = buildingTreeVos.stream().filter(build ->companyList.stream().map(m -> {
String bizOrgCode = m.getBizOrgCode(); String bizOrgCode = m.getBizOrgCode();
......
...@@ -390,7 +390,8 @@ ...@@ -390,7 +390,8 @@
full_name = #{fullName}, full_name = #{fullName},
parent_id = #{parentId}, parent_id = #{parentId},
code = #{code}, code = #{code},
biz_org_code = #{bizOrgCode} biz_org_code = #{bizOrgCode},
biz_org_name= #{bizOrgName}
where id = #{id} where id = #{id}
</update> </update>
<update id="updateStrFullName"> <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