|
|
|
@ -55,18 +55,28 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
|
|
|
|
|
this.setProduce_info_list(codeRelationDto.getJSONObject("produce_info_list"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public List<RelCodeBatch> disposeRelCodeBatch(String customerId){
|
|
|
|
|
public List<RelCodeBatch> disposeRelCodeBatch(String customerId,String code){
|
|
|
|
|
JSONArray jsonArrayBaseInfoDto = this.getBase_infos_dto().getJSONObject("base_info_list").getJSONArray("base_info_dto");
|
|
|
|
|
JSONObject jsonObject = (JSONObject) jsonArrayBaseInfoDto.get(0);
|
|
|
|
|
// RelCodeBatch relCodeBatch = new RelCodeBatch();
|
|
|
|
|
List<Map<String, String>> jsonArray = (List) this.getCode_relation_list().get("code_info");
|
|
|
|
|
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
Collections.reverse(jsonArray);
|
|
|
|
|
if (jsonArray != null && jsonArray.size() > 0) {
|
|
|
|
|
for (Map<String, String> map : jsonArray) {
|
|
|
|
|
// 倒叙判断级别 进行处理小查大就不加对象了
|
|
|
|
|
if((map.get("code").equals(code) && "1".equals(map.get("code_pack_level")))
|
|
|
|
|
|| map.get("code").equals(code)
|
|
|
|
|
){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
list.add(map.get("parent_code"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 循环判断获取父级编码
|
|
|
|
|
Set<String> set = new HashSet<>(list);
|
|
|
|
|
List<RelCodeBatch> batchList = new ArrayList<>();
|
|
|
|
|
for (String parentCode : set) {
|
|
|
|
@ -76,7 +86,12 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
|
|
|
|
|
Integer twoLevelCount = 0;
|
|
|
|
|
Integer threeLevelCount = 0;
|
|
|
|
|
for (Map<String, String> map : jsonArray) {
|
|
|
|
|
|
|
|
|
|
if(map.get("parent_code").equals("86540770000062502347") && map.get("code").equals("86193260002250549251")){
|
|
|
|
|
System.out.println();
|
|
|
|
|
}
|
|
|
|
|
if(parentCode.equals(map.get("code")) && StringUtils.isNotEmpty(map.get("parent_code"))){
|
|
|
|
|
relCodeBatch.setParentCode(map.get("parent_code"));
|
|
|
|
|
}
|
|
|
|
|
if(!parentCode.equals(map.get("code")) && parentCode.equals(map.get("parent_code"))){
|
|
|
|
|
switch (map.get("code_pack_level")) {
|
|
|
|
|
case "1":
|
|
|
|
@ -111,7 +126,6 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
|
|
|
|
|
relCodeBatch.setUpdateUser(customerId);
|
|
|
|
|
relCodeBatch.setUploadFlagUp(0);
|
|
|
|
|
relCodeBatch.setUploadFlagDown(0);
|
|
|
|
|
relCodeBatch.setParentCode(null);
|
|
|
|
|
relCodeBatch.setErpId(customerId);
|
|
|
|
|
|
|
|
|
|
relCodeBatch.setOneLevelCount(oneLevelCount);
|
|
|
|
|