|
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import jnpf.base.ActionResult;
|
|
|
|
|
import jnpf.base.entity.ProvinceEntity;
|
|
|
|
|
import jnpf.base.service.ProvinceService;
|
|
|
|
|
import jnpf.constant.PermissionConst;
|
|
|
|
|
import jnpf.entity.*;
|
|
|
|
|
import jnpf.model.yunguan.YunguanCustomerModel;
|
|
|
|
@ -28,10 +30,7 @@ import java.math.BigDecimal;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Inventory
|
|
|
|
@ -58,6 +57,8 @@ public class YunguanInterfaceController {
|
|
|
|
|
private ContractLCommodityService contractLCommodityService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private DictionaryyunguandataService dictionaryyunguandataService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ProvinceService provinceService;
|
|
|
|
|
/**
|
|
|
|
|
* 运管推送客户数据到智慧
|
|
|
|
|
*
|
|
|
|
@ -73,59 +74,105 @@ public class YunguanInterfaceController {
|
|
|
|
|
String str = new String(bytes, StandardCharsets.UTF_8);
|
|
|
|
|
System.out.println(str);
|
|
|
|
|
JSONObject jsonObject = JSON.parseObject(str);
|
|
|
|
|
if(!ObjectUtil.equal(jsonObject.get("INTF_STATUS").toString(), "S")){
|
|
|
|
|
if(!ObjectUtil.equal(ObjectUtil.isEmpty(jsonObject.get("INTF_STATUS")) ? null : jsonObject.get("INTF_STATUS").toString(), "S")){
|
|
|
|
|
return ActionResult.fail("请推送状态为S的客户");
|
|
|
|
|
}
|
|
|
|
|
SubjectbasicEntity entity = subjectbasicService.getInfo(jsonObject.get("ID").toString());
|
|
|
|
|
SubjectbasicEntity entity = subjectbasicService.getInfo(ObjectUtil.isEmpty(jsonObject.get("ID")) ? null : jsonObject.get("ID").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(entity)){
|
|
|
|
|
//更新客户
|
|
|
|
|
entity.setName(jsonObject.get("CUST_FULL_NAME").toString());//名称
|
|
|
|
|
entity.setName(ObjectUtil.isEmpty(jsonObject.get("CUST_FULL_NAME")) ? null : jsonObject.get("CUST_FULL_NAME").toString());//名称
|
|
|
|
|
// entity.setCalssify("1");//一级
|
|
|
|
|
// entity.setSubjectBasicType("1");//客户
|
|
|
|
|
entity.setCode(jsonObject.get("CUST_NUMBER").toString());//编码
|
|
|
|
|
entity.setKucunOrgCode(jsonObject.get("ORGANIZATION_CODE").toString());//库存组织编码
|
|
|
|
|
entity.setCode(ObjectUtil.isEmpty(jsonObject.get("CUST_NUMBER")) ? null : jsonObject.get("CUST_NUMBER").toString());//编码
|
|
|
|
|
entity.setKucunOrgCode(ObjectUtil.isEmpty(jsonObject.get("ORGANIZATION_CODE")) ? null : jsonObject.get("ORGANIZATION_CODE").toString());//库存组织编码
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",entity.getKucunOrgCode());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity)) {
|
|
|
|
|
entity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());
|
|
|
|
|
entity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());//库存组织名称
|
|
|
|
|
}
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",jsonObject.get("ATTR2").toString());
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",ObjectUtil.isEmpty(jsonObject.get("ATTR2")) ? null : jsonObject.get("ATTR2").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity1)){
|
|
|
|
|
entity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());
|
|
|
|
|
entity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());//等级
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("ATTR3").toString());
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, ObjectUtil.isEmpty(jsonObject.get("ATTR3")) ? null : jsonObject.get("ATTR3").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);//分支机构编码
|
|
|
|
|
}
|
|
|
|
|
entity.setReservedFields1(ObjectUtil.isEmpty(jsonObject.get("ACCOUNT_TYPE")) ? null : jsonObject.get("ACCOUNT_TYPE").toString());//账户类型
|
|
|
|
|
entity.setReservedFields2(ObjectUtil.isEmpty(jsonObject.get("CLIENT_CLASSIFY")) ? null : jsonObject.get("CLIENT_CLASSIFY").toString());//客户类型
|
|
|
|
|
entity.setCountry(ObjectUtil.isEmpty(jsonObject.get("COUNTRY")) ? null : jsonObject.get("COUNTRY").toString());//国家
|
|
|
|
|
entity.setAddress(ObjectUtil.isEmpty(jsonObject.get("SITE_NAME")) ? null : jsonObject.get("SITE_NAME").toString());//详细地址
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity2 = dictionaryyunguandataService.getDateValueInfo("562959704943233029",ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE5")) ? null : jsonObject.get("ATTRIBUTE5").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity2)){
|
|
|
|
|
entity.setEnterpriseNature(dictionaryyunguandataEntity2.getZhihuiValue());//企业性质
|
|
|
|
|
}
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-NN-dd HH:mm:ss");
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject.get("VALID_FROM"))) {
|
|
|
|
|
try {
|
|
|
|
|
entity.setCollaborationStart(sdf.parse(jsonObject.get("VALID_FROM").toString()));//合作开始时间
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
entity.setCompanyTaxNumber(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE1")) ? null : jsonObject.getString("ATTRIBUTE1"));//公司税号
|
|
|
|
|
entity.setPhone(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE2")) ? null : jsonObject.getString("ATTRIBUTE2"));//公司电话
|
|
|
|
|
entity.setDepositBank(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE3")) ? null : jsonObject.getString("ATTRIBUTE3"));//开户银行
|
|
|
|
|
entity.setBankAccount(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE4")) ? null : jsonObject.getString("ATTRIBUTE4"));//银行账号
|
|
|
|
|
entity.setWorkAddress(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE6")) ? null : jsonObject.getString("ATTRIBUTE6"));//单位地址
|
|
|
|
|
subjectbasicService.updateById(entity);
|
|
|
|
|
}else {
|
|
|
|
|
//新增客户
|
|
|
|
|
SubjectbasicEntity subjectbasicEntity = new SubjectbasicEntity();
|
|
|
|
|
subjectbasicEntity.setId(jsonObject.get("ID").toString());//ID
|
|
|
|
|
subjectbasicEntity.setName(jsonObject.get("CUST_FULL_NAME").toString());//名称
|
|
|
|
|
subjectbasicEntity.setId(ObjectUtil.isEmpty(jsonObject.get("ID")) ? null : jsonObject.get("ID").toString());//ID
|
|
|
|
|
subjectbasicEntity.setName(ObjectUtil.isEmpty(jsonObject.get("CUST_FULL_NAME")) ? null : jsonObject.get("CUST_FULL_NAME").toString());//名称
|
|
|
|
|
subjectbasicEntity.setCalssify("1");//一级
|
|
|
|
|
subjectbasicEntity.setSubjectBasicType("1");//客户
|
|
|
|
|
subjectbasicEntity.setCode(jsonObject.get("CUST_NUMBER").toString());//编码
|
|
|
|
|
subjectbasicEntity.setKucunOrgCode(jsonObject.get("ORGANIZATION_CODE").toString());//库存组织编码
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",entity.getKucunOrgCode());
|
|
|
|
|
subjectbasicEntity.setCode(ObjectUtil.isEmpty(jsonObject.get("CUST_NUMBER")) ? null : jsonObject.get("CUST_NUMBER").toString());//编码
|
|
|
|
|
subjectbasicEntity.setKucunOrgCode(ObjectUtil.isEmpty(jsonObject.get("ORGANIZATION_CODE")) ? null : jsonObject.get("ORGANIZATION_CODE").toString());//库存组织编码
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",subjectbasicEntity.getKucunOrgCode());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity)) {
|
|
|
|
|
entity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());
|
|
|
|
|
subjectbasicEntity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());//库存组织名称
|
|
|
|
|
}
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",jsonObject.get("ATTR2").toString());
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",ObjectUtil.isEmpty(jsonObject.get("ATTR2")) ? null : jsonObject.get("ATTR2").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity1)){
|
|
|
|
|
entity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());
|
|
|
|
|
subjectbasicEntity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());//等级
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("ATTR3").toString());
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, ObjectUtil.isEmpty(jsonObject.get("ATTR3")) ? null : jsonObject.get("ATTR3").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.setReservedFields1(ObjectUtil.isEmpty(jsonObject.get("ACCOUNT_TYPE")) ? null : jsonObject.get("ACCOUNT_TYPE").toString());//账户类型
|
|
|
|
|
subjectbasicEntity.setReservedFields2(ObjectUtil.isEmpty(jsonObject.get("CLIENT_CLASSIFY")) ? null : jsonObject.get("CLIENT_CLASSIFY").toString());//客户类型
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject.get("COUNTRY"))){
|
|
|
|
|
subjectbasicEntity.setCountry(jsonObject.get("COUNTRY").toString());//国家
|
|
|
|
|
}else{
|
|
|
|
|
subjectbasicEntity.setCountry("CN");
|
|
|
|
|
}
|
|
|
|
|
subjectbasicEntity.setAddress(ObjectUtil.isEmpty(jsonObject.get("SITE_NAME")) ? null : jsonObject.get("SITE_NAME").toString());//详细地址
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity2 = dictionaryyunguandataService.getDateValueInfo("562959704943233029",ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE5")) ? null : jsonObject.get("ATTRIBUTE5").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity2)){
|
|
|
|
|
subjectbasicEntity.setEnterpriseNature(dictionaryyunguandataEntity2.getZhihuiValue());//企业性质
|
|
|
|
|
}
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-NN-dd HH:mm:ss");
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject.get("VALID_FROM"))) {
|
|
|
|
|
try {
|
|
|
|
|
subjectbasicEntity.setCollaborationStart(sdf.parse(jsonObject.get("VALID_FROM").toString()));//合作开始时间
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
subjectbasicEntity.setCompanyTaxNumber(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE1")) ? null : jsonObject.getString("ATTRIBUTE1"));//公司税号
|
|
|
|
|
subjectbasicEntity.setPhone(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE2")) ? null : jsonObject.getString("ATTRIBUTE2"));//公司电话
|
|
|
|
|
subjectbasicEntity.setDepositBank(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE3")) ? null : jsonObject.getString("ATTRIBUTE3"));//开户银行
|
|
|
|
|
subjectbasicEntity.setBankAccount(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE4")) ? null : jsonObject.getString("ATTRIBUTE4"));//银行账号
|
|
|
|
|
subjectbasicEntity.setWorkAddress(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE6")) ? null : jsonObject.getString("ATTRIBUTE6"));//单位地址
|
|
|
|
|
subjectbasicService.save(subjectbasicEntity);
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.success("运管推送客户数据到智慧成功");
|
|
|
|
@ -146,59 +193,99 @@ public class YunguanInterfaceController {
|
|
|
|
|
String str = new String(bytes, StandardCharsets.UTF_8);
|
|
|
|
|
System.out.println(str);
|
|
|
|
|
JSONObject jsonObject = JSON.parseObject(str);
|
|
|
|
|
if(!ObjectUtil.equal(jsonObject.get("INTF_STATUS").toString(), "S")){
|
|
|
|
|
if(!ObjectUtil.equal(ObjectUtil.isEmpty(jsonObject.get("INTF_STATUS")) ? null : jsonObject.get("INTF_STATUS").toString(), "S")){
|
|
|
|
|
return ActionResult.fail("请推送状态为S的供应商");
|
|
|
|
|
}
|
|
|
|
|
SubjectbasicEntity entity = subjectbasicService.getInfo(jsonObject.get("ID").toString());
|
|
|
|
|
SubjectbasicEntity entity = subjectbasicService.getInfo(ObjectUtil.isEmpty(jsonObject.get("ID")) ? null : jsonObject.get("ID").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(entity)){
|
|
|
|
|
//更新供应商
|
|
|
|
|
entity.setName(jsonObject.get("VENDOR_NAME").toString());//名称
|
|
|
|
|
entity.setName(ObjectUtil.isEmpty(jsonObject.get("VENDOR_NAME")) ? null : jsonObject.get("VENDOR_NAME").toString());//名称
|
|
|
|
|
// entity.setCalssify("1");//一级
|
|
|
|
|
// entity.setSubjectBasicType("2");//供应商
|
|
|
|
|
entity.setCode(jsonObject.get("VENDOR_NUM").toString());//编码
|
|
|
|
|
entity.setKucunOrgCode(jsonObject.get("ATTR3").toString());//库存组织编码
|
|
|
|
|
entity.setCode(ObjectUtil.isEmpty(jsonObject.get("VENDOR_NUM")) ? null : jsonObject.get("VENDOR_NUM").toString());//编码
|
|
|
|
|
entity.setKucunOrgCode(ObjectUtil.isEmpty(jsonObject.get("ATTR3")) ? null : 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());
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",ObjectUtil.isEmpty(jsonObject.get("ATTR1")) ? null : jsonObject.get("ATTR1").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity1)){
|
|
|
|
|
entity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("ORG_ID").toString());
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, ObjectUtil.isEmpty(jsonObject.get("ORG_ID")) ? null : 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);//分支机构编码
|
|
|
|
|
}
|
|
|
|
|
entity.setReservedFields2(ObjectUtil.isEmpty(jsonObject.get("VENDOR_TYPE")) ? null : jsonObject.get("VENDOR_TYPE").toString());
|
|
|
|
|
entity.setCountry(ObjectUtil.isEmpty(jsonObject.get("COUNTRY")) ? null : jsonObject.get("COUNTRY").toString());//国家
|
|
|
|
|
entity.setAddress(ObjectUtil.isEmpty(jsonObject.get("ADDRESS_LINE1")) ? null : jsonObject.get("ADDRESS_LINE1").toString());//详细地址
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity2 = dictionaryyunguandataService.getDateValueInfo("562959704943233029",ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE4")) ? null : jsonObject.get("ATTRIBUTE4").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity2)){
|
|
|
|
|
entity.setEnterpriseNature(dictionaryyunguandataEntity2.getZhihuiValue());//企业性质
|
|
|
|
|
}
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-NN-dd HH:mm:ss");
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject.get("TAX_EFFECTIVE_FROM"))) {
|
|
|
|
|
try {
|
|
|
|
|
entity.setCollaborationStart(sdf.parse(jsonObject.get("TAX_EFFECTIVE_FROM").toString()));//合作开始时间
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
entity.setCompanyTaxNumber(ObjectUtil.isEmpty(jsonObject.get("REGISTRATION_NUM")) ? null : jsonObject.get("REGISTRATION_NUM").toString());//公司税号
|
|
|
|
|
entity.setReservedFields4(ObjectUtil.isEmpty(jsonObject.get("VENDOR_SITE_CODE")) ? null : jsonObject.get("VENDOR_SITE_CODE").toString());//供应商地点名称
|
|
|
|
|
entity.setReservedFields5(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE6")) ? null : jsonObject.get("ATTRIBUTE6").toString());//供应商地点编码
|
|
|
|
|
subjectbasicService.updateById(entity);
|
|
|
|
|
}else {
|
|
|
|
|
//新增供应商
|
|
|
|
|
SubjectbasicEntity subjectbasicEntity = new SubjectbasicEntity();
|
|
|
|
|
subjectbasicEntity.setId(jsonObject.get("ID").toString());//ID
|
|
|
|
|
subjectbasicEntity.setName(jsonObject.get("VENDOR_NAME").toString());//名称
|
|
|
|
|
subjectbasicEntity.setId(ObjectUtil.isEmpty(jsonObject.get("ID")) ? null : jsonObject.get("ID").toString());//ID
|
|
|
|
|
subjectbasicEntity.setName(ObjectUtil.isEmpty(jsonObject.get("VENDOR_NAME")) ? null : 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());
|
|
|
|
|
subjectbasicEntity.setCode(ObjectUtil.isEmpty(jsonObject.get("VENDOR_NUM")) ? null : jsonObject.get("VENDOR_NUM").toString());//编码
|
|
|
|
|
subjectbasicEntity.setKucunOrgCode(ObjectUtil.isEmpty(jsonObject.get("ATTR3")) ? null : jsonObject.get("ATTR3").toString());//库存组织编码
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",subjectbasicEntity.getKucunOrgCode());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity)) {
|
|
|
|
|
entity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());
|
|
|
|
|
subjectbasicEntity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());
|
|
|
|
|
}
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",jsonObject.get("ATTR2").toString());
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity1 = dictionaryyunguandataService.getDateValueInfo("564775124784403525",ObjectUtil.isEmpty(jsonObject.get("ATTR1")) ? null : jsonObject.get("ATTR1").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity1)){
|
|
|
|
|
entity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());
|
|
|
|
|
subjectbasicEntity.setReservedFields3(dictionaryyunguandataEntity1.getZhihuiValue());
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("ORG_ID").toString());
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, ObjectUtil.isEmpty(jsonObject.get("ORG_ID")) ? null : 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.setReservedFields2(ObjectUtil.isEmpty(jsonObject.get("VENDOR_TYPE")) ? null : jsonObject.get("VENDOR_TYPE").toString());//供应商类型
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject.get("COUNTRY"))){
|
|
|
|
|
subjectbasicEntity.setCountry(jsonObject.get("COUNTRY").toString());//国家
|
|
|
|
|
}else{
|
|
|
|
|
subjectbasicEntity.setCountry("中国");
|
|
|
|
|
}
|
|
|
|
|
subjectbasicEntity.setAddress(ObjectUtil.isEmpty(jsonObject.get("ADDRESS_LINE1")) ? null : jsonObject.get("ADDRESS_LINE1").toString());//详细地址
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity2 = dictionaryyunguandataService.getDateValueInfo("562959704943233029",ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE4")) ? null : jsonObject.get("ATTRIBUTE4").toString());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity2)){
|
|
|
|
|
subjectbasicEntity.setEnterpriseNature(dictionaryyunguandataEntity2.getZhihuiValue());//企业性质
|
|
|
|
|
}
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-NN-dd HH:mm:ss");
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject.get("TAX_EFFECTIVE_FROM"))) {
|
|
|
|
|
try {
|
|
|
|
|
subjectbasicEntity.setCollaborationStart(sdf.parse(jsonObject.get("TAX_EFFECTIVE_FROM").toString()));//合作开始时间
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
subjectbasicEntity.setCompanyTaxNumber(ObjectUtil.isEmpty(jsonObject.get("REGISTRATION_NUM")) ? null : jsonObject.get("REGISTRATION_NUM").toString());//公司税号
|
|
|
|
|
subjectbasicEntity.setReservedFields4(ObjectUtil.isEmpty(jsonObject.get("VENDOR_SITE_CODE")) ? null : jsonObject.get("VENDOR_SITE_CODE").toString());//供应商地点名称
|
|
|
|
|
subjectbasicEntity.setReservedFields5(ObjectUtil.isEmpty(jsonObject.get("ATTRIBUTE6")) ? null : jsonObject.get("ATTRIBUTE6").toString());//供应商地点编码
|
|
|
|
|
subjectbasicService.save(subjectbasicEntity);
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.success("运管推送供应商数据到智慧成功");
|
|
|
|
@ -255,20 +342,9 @@ public class YunguanInterfaceController {
|
|
|
|
|
contractLEntity.setProcurementModel("1");
|
|
|
|
|
}
|
|
|
|
|
contractLEntity.setKucunOrgCode(jsonObject.get("ORG_CD").toString());//库存组织编码
|
|
|
|
|
if(ObjectUtil.equal("CK0", contractLEntity.getKucunOrgCode())){
|
|
|
|
|
contractLEntity.setKucunOrgName("济钢城市矿产科技有限公司");
|
|
|
|
|
}else if(ObjectUtil.equal("CK1", contractLEntity.getKucunOrgCode())){
|
|
|
|
|
contractLEntity.setKucunOrgName("济钢城市矿产科技有限公司(日照)");
|
|
|
|
|
}else if(ObjectUtil.equal("CK2", contractLEntity.getKucunOrgCode())){
|
|
|
|
|
contractLEntity.setKucunOrgName("山东济钢愿景工业科技有限公司");
|
|
|
|
|
}else if(ObjectUtil.equal("CK3", contractLEntity.getKucunOrgCode())){
|
|
|
|
|
contractLEntity.setKucunOrgName("济钢城市矿产科技(佛山)有限公司");
|
|
|
|
|
}else if(ObjectUtil.equal("RJ0", contractLEntity.getKucunOrgCode())){
|
|
|
|
|
contractLEntity.setKucunOrgName("日照济钢金属科技有限公司");
|
|
|
|
|
}else if(ObjectUtil.equal("RJ1", contractLEntity.getKucunOrgCode())){
|
|
|
|
|
contractLEntity.setKucunOrgName("日照济钢金属科技有限公司(生产)");
|
|
|
|
|
}else if(ObjectUtil.equal("JT1", contractLEntity.getKucunOrgCode())){
|
|
|
|
|
contractLEntity.setKucunOrgName("济钢集团有限公司广东分公司");
|
|
|
|
|
DictionaryyunguandataEntity dictionaryyunguandataEntity = dictionaryyunguandataService.getDateValueInfo("564773000885326917",contractLEntity.getKucunOrgCode());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictionaryyunguandataEntity)) {
|
|
|
|
|
contractLEntity.setKucunOrgName(dictionaryyunguandataEntity.getZhihuiValue());
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<OrganizeEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("DEPT_CD").toString());
|
|
|
|
|