运管供应商接口修改

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

Loading…
Cancel
Save