运管供应商接口修改

jg-waiwang-pro
vayne 5 months ago
parent e25e93f22b
commit 472cb2f2f7

@ -78,9 +78,10 @@ public class YunguanInterfaceController {
} }
SubjectbasicEntity entity = subjectbasicService.getInfo(jsonObject.get("ID").toString()); SubjectbasicEntity entity = subjectbasicService.getInfo(jsonObject.get("ID").toString());
if (ObjectUtil.isNotEmpty(entity)){ if (ObjectUtil.isNotEmpty(entity)){
//更新客户
entity.setName(jsonObject.get("CUST_FULL_NAME").toString());//名称 entity.setName(jsonObject.get("CUST_FULL_NAME").toString());//名称
entity.setCalssify("1");//一级 // entity.setCalssify("1");//一级
entity.setSubjectBasicType("1");//客户 // entity.setSubjectBasicType("1");//客户
entity.setCode(jsonObject.get("CUST_NUMBER").toString());//编码 entity.setCode(jsonObject.get("CUST_NUMBER").toString());//编码
entity.setKucunOrgCode(jsonObject.get("ORGANIZATION_CODE").toString());//库存组织编码 entity.setKucunOrgCode(jsonObject.get("ORGANIZATION_CODE").toString());//库存组织编码
DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",entity.getKucunOrgCode()); DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",entity.getKucunOrgCode());
@ -99,8 +100,9 @@ public class YunguanInterfaceController {
String organizeId = JSON.toJSONString(conpanyIdList); String organizeId = JSON.toJSONString(conpanyIdList);
entity.setOrganizeJsonId(organizeId);//分支机构编码 entity.setOrganizeJsonId(organizeId);//分支机构编码
} }
subjectbasicService.updateById(entity);//更新客户 subjectbasicService.updateById(entity);
}else { }else {
//新增客户
SubjectbasicEntity subjectbasicEntity = new SubjectbasicEntity(); SubjectbasicEntity subjectbasicEntity = new SubjectbasicEntity();
subjectbasicEntity.setId(jsonObject.get("ID").toString());//ID subjectbasicEntity.setId(jsonObject.get("ID").toString());//ID
subjectbasicEntity.setName(jsonObject.get("CUST_FULL_NAME").toString());//名称 subjectbasicEntity.setName(jsonObject.get("CUST_FULL_NAME").toString());//名称
@ -124,7 +126,7 @@ public class YunguanInterfaceController {
String organizeId = JSON.toJSONString(conpanyIdList); String organizeId = JSON.toJSONString(conpanyIdList);
subjectbasicEntity.setOrganizeJsonId(organizeId);//分支机构编码 subjectbasicEntity.setOrganizeJsonId(organizeId);//分支机构编码
} }
subjectbasicService.save(subjectbasicEntity);//新增客户 subjectbasicService.save(subjectbasicEntity);
} }
return ActionResult.success("运管推送客户数据到智慧成功"); return ActionResult.success("运管推送客户数据到智慧成功");
} }
@ -147,45 +149,58 @@ public class YunguanInterfaceController {
if(!ObjectUtil.equal(jsonObject.get("INTF_STATUS").toString(), "S")){ if(!ObjectUtil.equal(jsonObject.get("INTF_STATUS").toString(), "S")){
return ActionResult.fail("请推送状态为S的供应商"); return ActionResult.fail("请推送状态为S的供应商");
} }
SubjectbasicEntity subjectbasicEntity = new SubjectbasicEntity(); SubjectbasicEntity entity = subjectbasicService.getInfo(jsonObject.get("ID").toString());
subjectbasicEntity.setName(jsonObject.get("VENDOR_NAME").toString());//名称 if (ObjectUtil.isNotEmpty(entity)){
subjectbasicEntity.setCalssify("1");//一级 //更新供应商
subjectbasicEntity.setSubjectBasicType("2");//供应商 entity.setName(jsonObject.get("VENDOR_NAME").toString());//名称
subjectbasicEntity.setCode(jsonObject.get("VENDOR_NUM").toString());//编码 // entity.setCalssify("1");//一级
subjectbasicEntity.setKucunOrgCode(jsonObject.get("ATTR3").toString());//库存组织编码 // entity.setSubjectBasicType("2");//供应商
if(ObjectUtil.equal("CK0", subjectbasicEntity.getKucunOrgCode())){ entity.setCode(jsonObject.get("VENDOR_NUM").toString());//编码
subjectbasicEntity.setKucunOrgName("济钢城市矿产科技有限公司"); entity.setKucunOrgCode(jsonObject.get("ATTR3").toString());//库存组织编码
}else if(ObjectUtil.equal("CK1", subjectbasicEntity.getKucunOrgCode())){ DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",entity.getKucunOrgCode());
subjectbasicEntity.setKucunOrgName("济钢城市矿产科技有限公司(日照)"); if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity)) {
}else if(ObjectUtil.equal("CK2", subjectbasicEntity.getKucunOrgCode())){ entity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());
subjectbasicEntity.setKucunOrgName("山东济钢愿景工业科技有限公司"); }
}else if(ObjectUtil.equal("CK3", subjectbasicEntity.getKucunOrgCode())){ DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",jsonObject.get("ATTR2").toString());
subjectbasicEntity.setKucunOrgName("济钢城市矿产科技(佛山)有限公司"); if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity1)){
}else if(ObjectUtil.equal("RJ0", subjectbasicEntity.getKucunOrgCode())){ entity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());
subjectbasicEntity.setKucunOrgName("日照济钢金属科技有限公司"); }
}else if(ObjectUtil.equal("RJ1", subjectbasicEntity.getKucunOrgCode())){ QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>();
subjectbasicEntity.setKucunOrgName("日照济钢金属科技有限公司(生产)"); queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("ORG_ID").toString());
}else if(ObjectUtil.equal("JT1", subjectbasicEntity.getKucunOrgCode())){ List<OrganizeEntity> orgList = organizeService.list(queryWrapper);
subjectbasicEntity.setKucunOrgName("济钢集团有限公司广东分公司"); if(orgList != null && orgList.size() > 0){
} List<String> conpanyIdList = Arrays.asList(orgList.get(0).getCompanyIdTree().split(","));
if(ObjectUtil.equal("A级", jsonObject.get("ATTR1").toString())){ String organizeId = JSON.toJSONString(conpanyIdList);
subjectbasicEntity.setReservedFields3("1"); entity.setOrganizeJsonId(organizeId);//分支机构编码
}else if(ObjectUtil.equal("B级", jsonObject.get("ATTR1").toString())){ }
subjectbasicEntity.setReservedFields3("2"); subjectbasicService.updateById(entity);
}else if(ObjectUtil.equal("C级", jsonObject.get("ATTR1").toString())){ }else {
subjectbasicEntity.setReservedFields3("3"); //新增供应商
}else if(ObjectUtil.equal("D级", jsonObject.get("ATTR1").toString())){ SubjectbasicEntity subjectbasicEntity = new SubjectbasicEntity();
subjectbasicEntity.setReservedFields3("4"); subjectbasicEntity.setId(jsonObject.get("ID").toString());//ID
} subjectbasicEntity.setName(jsonObject.get("VENDOR_NAME").toString());//名称
QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>(); subjectbasicEntity.setCalssify("1");//一级
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("ORG_ID").toString()); subjectbasicEntity.setSubjectBasicType("2");//供应商
List<OrganizeEntity> orgList = organizeService.list(queryWrapper); subjectbasicEntity.setCode(jsonObject.get("VENDOR_NUM").toString());//编码
if(orgList != null && orgList.size() > 0){ subjectbasicEntity.setKucunOrgCode(jsonObject.get("ATTR3").toString());//库存组织编码
List<String> conpanyIdList = Arrays.asList(orgList.get(0).getCompanyIdTree().split(",")); DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",entity.getKucunOrgCode());
String organizeId = JSON.toJSONString(conpanyIdList); if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity)) {
subjectbasicEntity.setOrganizeJsonId(organizeId);//分支机构编码 entity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());
}
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",jsonObject.get("ATTR2").toString());
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity1)){
entity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());
}
QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("ORG_ID").toString());
List<OrganizeEntity> orgList = organizeService.list(queryWrapper);
if (orgList != null && orgList.size() > 0) {
List<String> conpanyIdList = Arrays.asList(orgList.get(0).getCompanyIdTree().split(","));
String organizeId = JSON.toJSONString(conpanyIdList);
subjectbasicEntity.setOrganizeJsonId(organizeId);//分支机构编码
}
subjectbasicService.save(subjectbasicEntity);
} }
subjectbasicService.save(subjectbasicEntity);
return ActionResult.success("运管推送供应商数据到智慧成功"); return ActionResult.success("运管推送供应商数据到智慧成功");
} }

Loading…
Cancel
Save