From 1845355d77ca1380d394f27b1aa7fd8477674a4e Mon Sep 17 00:00:00 2001 From: vayne Date: Wed, 29 May 2024 09:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E7=AE=A1=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scm/DictionaryyunguandataMapper.xml | 3 +- .../controller/BusinessOrderController.java | 44 +++-- .../YunguanInterfaceController.java | 180 +++++++++++++----- .../BusinessOrderPagination.java | 3 + .../scm/publicPopup/OrderContractBox.vue | 11 +- .../scm/purchaseCenter/purchaseOrder/form.vue | 5 +- .../purchaseCenter/receiptVoucher/index.vue | 14 ++ .../views/scm/saleCenter/saleOrder/form.vue | 3 +- 8 files changed, 187 insertions(+), 76 deletions(-) diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/scm/DictionaryyunguandataMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/scm/DictionaryyunguandataMapper.xml index b3310068..df15a27a 100644 --- a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/scm/DictionaryyunguandataMapper.xml +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/scm/DictionaryyunguandataMapper.xml @@ -4,7 +4,7 @@ - diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/BusinessOrderController.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/BusinessOrderController.java index bb1e5c6e..991f4131 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/BusinessOrderController.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/BusinessOrderController.java @@ -1088,26 +1088,36 @@ public class BusinessOrderController { List contractList = new ArrayList<>(); List list = new ArrayList<>(); if (StringUtils.isNotEmpty(businessOrderPagination.getContractType()) && businessOrderPagination.getContractType().equals("1")) { - list = businessOrderService.queryPurchaseContractInfo(businessOrderPagination.getBusinessLineId()); + List contractLEntityList = businessOrderService.queryPurchaseContractInfo(businessOrderPagination.getBusinessLineId()); + list = contractLEntityList.stream().filter(e -> e.getContractNumber().equals(businessOrderPagination.getContractNo())).collect(Collectors.toList()); + for (ContractLEntity entity : list){ + List productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId()); + entity.setProductByContractModelList(productByContractModelList); + QueryWrapper subjectQueryWrapper = new QueryWrapper<>(); + subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject()); + List subjectbasicEntityList = subjectbasicService.list(subjectQueryWrapper); + entity.setSubjectbasicEntityList(subjectbasicEntityList); + } + contractList.addAll(list); }else { list = businessOrderService.querySaleContractInfo(businessOrderPagination.getBusinessLineId()); - } - for (ContractLEntity entity : list){ - List productByContract = new ArrayList<>(); - List productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId()); - entity.setProductByContractModelList(productByContractModelList); - for (ProductByContractModel model : productByContractModelList){ - productByContract.add(model.getProductId()); - } - if(productByContract.containsAll(productIds)){ - List contract = list.stream().filter(e ->e.getId().equals(entity.getId())).collect(Collectors.toList()); - contractList.addAll(contract); + for (ContractLEntity entity : list){ + List productByContract = new ArrayList<>(); + List productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId()); + entity.setProductByContractModelList(productByContractModelList); + for (ProductByContractModel model : productByContractModelList){ + productByContract.add(model.getProductId()); + } + if(productByContract.containsAll(productIds)){ + List contract = list.stream().filter(e ->e.getId().equals(entity.getId())).collect(Collectors.toList()); + contractList.addAll(contract); + } + entity.setProductByContractModelList(productByContractModelList); + QueryWrapper subjectQueryWrapper = new QueryWrapper<>(); + subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject()); + List subjectbasicEntityList = subjectbasicService.list(subjectQueryWrapper); + entity.setSubjectbasicEntityList(subjectbasicEntityList); } - entity.setProductByContractModelList(productByContractModelList); - QueryWrapper subjectQueryWrapper = new QueryWrapper<>(); - subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject()); - List subjectbasicEntityList = subjectbasicService.list(subjectQueryWrapper); - entity.setSubjectbasicEntityList(subjectbasicEntityList); } PageListVO vo = new PageListVO(); vo.setList(contractList); diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/YunguanInterfaceController.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/YunguanInterfaceController.java index 4c3d2623..d48c6c19 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/YunguanInterfaceController.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/YunguanInterfaceController.java @@ -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 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 orgList = organizeService.list(queryWrapper); if(orgList != null && orgList.size() > 0){ List 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 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 orgList = organizeService.list(queryWrapper); if (orgList != null && orgList.size() > 0) { List 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 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 orgList = organizeService.list(queryWrapper); if(orgList != null && orgList.size() > 0){ List 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 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 orgList = organizeService.list(queryWrapper); if (orgList != null && orgList.size() > 0) { List 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 queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(OrganizeEntity::getEnCode, jsonObject.get("DEPT_CD").toString()); diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/businessorder/BusinessOrderPagination.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/businessorder/BusinessOrderPagination.java index 80ef2715..3cbc8f6c 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/businessorder/BusinessOrderPagination.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/businessorder/BusinessOrderPagination.java @@ -66,4 +66,7 @@ public class BusinessOrderPagination extends Pagination { /** 合同类型 */ @JsonProperty("contractType") private String contractType; + /** 合同号 */ + @JsonProperty("contractNo") + private String contractNo; } diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/publicPopup/OrderContractBox.vue b/jnpf-java-boot/jnpf-web/src/views/scm/publicPopup/OrderContractBox.vue index eb9f3147..8b4c1ccb 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/publicPopup/OrderContractBox.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/publicPopup/OrderContractBox.vue @@ -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`, diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/purchaseOrder/form.vue b/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/purchaseOrder/form.vue index ca0aacd1..0d374fb8 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/purchaseOrder/form.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/purchaseOrder/form.vue @@ -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: [] } diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue b/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue index 1c97afd0..022c3edf 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/purchaseCenter/receiptVoucher/index.vue @@ -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: '流程不存在' }); diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/saleOrder/form.vue b/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/saleOrder/form.vue index 4a5a678d..2b67320b 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/saleOrder/form.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/saleCenter/saleOrder/form.vue @@ -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) {