运管接口修改

jg-waiwang-pro
vayne 5 months ago
parent 56871433da
commit 1845355d77

@ -4,7 +4,7 @@
<select id="getDataValue" resultType="jnpf.entity.DictionaryyunguandataEntity">
select
id,
f_id as id,
type_id as typeId,
type_code as typeCode,
type_name as typeName,
@ -18,5 +18,4 @@
and yunguan_value = #{yunguanValue}
</select>
</mapper>

@ -1088,26 +1088,36 @@ public class BusinessOrderController {
List<ContractLEntity> contractList = new ArrayList<>();
List<ContractLEntity> list = new ArrayList<>();
if (StringUtils.isNotEmpty(businessOrderPagination.getContractType()) && businessOrderPagination.getContractType().equals("1")) {
list = businessOrderService.queryPurchaseContractInfo(businessOrderPagination.getBusinessLineId());
List<ContractLEntity> contractLEntityList = businessOrderService.queryPurchaseContractInfo(businessOrderPagination.getBusinessLineId());
list = contractLEntityList.stream().filter(e -> e.getContractNumber().equals(businessOrderPagination.getContractNo())).collect(Collectors.toList());
for (ContractLEntity entity : list){
List<ProductByContractModel> productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId());
entity.setProductByContractModelList(productByContractModelList);
QueryWrapper<SubjectbasicEntity> subjectQueryWrapper = new QueryWrapper<>();
subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject());
List<SubjectbasicEntity> subjectbasicEntityList = subjectbasicService.list(subjectQueryWrapper);
entity.setSubjectbasicEntityList(subjectbasicEntityList);
}
contractList.addAll(list);
}else {
list = businessOrderService.querySaleContractInfo(businessOrderPagination.getBusinessLineId());
}
for (ContractLEntity entity : list){
List<String> productByContract = new ArrayList<>();
List<ProductByContractModel> productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId());
entity.setProductByContractModelList(productByContractModelList);
for (ProductByContractModel model : productByContractModelList){
productByContract.add(model.getProductId());
}
if(productByContract.containsAll(productIds)){
List<ContractLEntity> contract = list.stream().filter(e ->e.getId().equals(entity.getId())).collect(Collectors.toList());
contractList.addAll(contract);
for (ContractLEntity entity : list){
List<String> productByContract = new ArrayList<>();
List<ProductByContractModel> productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId());
entity.setProductByContractModelList(productByContractModelList);
for (ProductByContractModel model : productByContractModelList){
productByContract.add(model.getProductId());
}
if(productByContract.containsAll(productIds)){
List<ContractLEntity> contract = list.stream().filter(e ->e.getId().equals(entity.getId())).collect(Collectors.toList());
contractList.addAll(contract);
}
entity.setProductByContractModelList(productByContractModelList);
QueryWrapper<SubjectbasicEntity> subjectQueryWrapper = new QueryWrapper<>();
subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject());
List<SubjectbasicEntity> subjectbasicEntityList = subjectbasicService.list(subjectQueryWrapper);
entity.setSubjectbasicEntityList(subjectbasicEntityList);
}
entity.setProductByContractModelList(productByContractModelList);
QueryWrapper<SubjectbasicEntity> subjectQueryWrapper = new QueryWrapper<>();
subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject());
List<SubjectbasicEntity> subjectbasicEntityList = subjectbasicService.list(subjectQueryWrapper);
entity.setSubjectbasicEntityList(subjectbasicEntityList);
}
PageListVO vo = new PageListVO();
vo.setList(contractList);

@ -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());

@ -66,4 +66,7 @@ public class BusinessOrderPagination extends Pagination {
/** 合同类型 */
@JsonProperty("contractType")
private String contractType;
/** 合同号 */
@JsonProperty("contractNo")
private String contractNo;
}

@ -66,11 +66,12 @@ export default {
businessLineId: '',
contractType: '',
productIds: [],
checked: []
checked: [],
contractNo: '',
}
},
methods: {
init(businessLineId, productIds, contractType) {
init(businessLineId, productIds, contractType, contractNo) {
if (contractType && typeof (contractType) == 'string') {
this.contractType = contractType;
}
@ -80,6 +81,9 @@ export default {
if (productIds && productIds instanceof Array) {
this.productIds = productIds;
}
if (contractNo && typeof (contractNo) == 'string') {
this.contractNo = contractNo;
}
this.visible = true
this.listLoading = true
let query = {
@ -87,7 +91,8 @@ export default {
keyword: this.keyword,
businessLineId: this.businessLineId,
productIds: this.productIds,
contractType: this.contractType
contractType: this.contractType,
contractNo: this.contractNo,
}
request({
url: `/api/scm/BusinessOrder/contract/getPurchaseContractList`,

@ -1283,6 +1283,7 @@ export default {
businessOrderProductRelationalList: [],
version: 0,
contractInfoList: [],
purchaseContractNo: undefined,
},
tableRequiredData: {},
dataRule:
@ -1786,9 +1787,10 @@ export default {
},
contractInfo2() {
let contractType = '1'//
let purchaseContractNo = this.dataForm.purchaseContractNo
this.ContractBoxVisible = true
this.$nextTick(() => {
this.$refs.ContractBox.init(this.dataForm.businessLineId, this.productIds, contractType)
this.$refs.ContractBox.init(this.dataForm.businessLineId, this.productIds, contractType, purchaseContractNo)
})
},
contractList(list) {
@ -1884,6 +1886,7 @@ export default {
this.dataForm.deliveryType = data[0].deliveryType
this.dataForm.firstSubjectBasicId = data[0].supplierId
this.dataForm.enterpriseId = data[0].customerId
this.dataForm.purchaseContractNo = data[0].purchaseContractNo
var voucherIdList = {
voucherIds: []
}

@ -421,13 +421,16 @@ export default {
})
return
}
debugger
const selectData = this.multipleSelectionItem
let stateFlag = true;
const customId = selectData[0].customerId;
const deliveryType = selectData[0].deliveryType;
const purchaseConractNo = selectData[0].purchaseConractNo;
let customerIdFlag = true;
let purchaseFlag = true;
let deliveryFlag = true;
let contractFlag = true;
selectData.forEach(function (item) {
if (item.flowState != 2) {
stateFlag = false;
@ -441,6 +444,9 @@ export default {
if (item.deliveryType != deliveryType) {
deliveryFlag = false;
}
if (item.purchaseConractNo != purchaseConractNo) {
contractFlag = false;
}
});
// if (!stateFlag) {
// this.$message({
@ -474,6 +480,14 @@ export default {
})
return
}
if (!contractFlag) {
this.$message({
type: 'error',
message: '合同号不一致',
duration: 1500,
})
return
}
selectData.flag = '采购收货凭证生成采购单'
if (!this.purchaseFlowList.length) {
this.$message({ type: 'error', message: '流程不存在' });

@ -1652,8 +1652,9 @@ export default {
contractInfo2() {
let contractType = '2' //
this.ContractBoxVisible = true
let contractNo = ''//
this.$nextTick(() => {
this.$refs.ContractBox.init(this.dataForm.businessLineId, this.productIds, contractType)
this.$refs.ContractBox.init(this.dataForm.businessLineId, this.productIds, contractType, contractNo)
})
},
contractList(list) {

Loading…
Cancel
Save