diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdSupplierInfoServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdSupplierInfoServiceImpl.java index 49cad115..d88c1246 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdSupplierInfoServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdSupplierInfoServiceImpl.java @@ -36,7 +36,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; /** * 供应商信息Service业务层处理 @@ -358,12 +361,12 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl 0; @@ -371,7 +374,9 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdSupplierQualification::getSupplierId,old.getId()); + xzdSupplierQualificationService.remove(lambdaQueryWrapper); } for (XzdSupplierQualification qualification : bo.getQualifications()) { qualification.setSupplierId(update.getId()); @@ -379,7 +384,9 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdSupplierQualification::getSupplierId,old.getId()); + xzdSupplierQualificationService.remove(lambdaQueryWrapper); } } @@ -393,7 +400,11 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdAddressInfo::getCustomerinformationId,old.getId()); + lambdaQueryWrapper.eq(XzdAddressInfo::getType, "2"); + xzdAddressInfoService.remove(lambdaQueryWrapper); +// xzdAddressInfoService.removeByIds(old.getAddresses()); } for (XzdAddressInfo address : bo.getAddresses()) { address.setType("2"); @@ -402,14 +413,22 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdAddressInfo::getCustomerinformationId,old.getId()); + lambdaQueryWrapper.eq(XzdAddressInfo::getType, "2"); + xzdAddressInfoService.remove(lambdaQueryWrapper); } } //处理联系人信息 if (bo.getContacts() != null && !bo.getContacts().isEmpty()){ if (old.getContacts() != null && !old.getContacts().isEmpty()){ - xzdContactService.removeByIds(old.getContacts()); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdContact::getCustomerinformationId,old.getId()); + lambdaQueryWrapper.eq(XzdContact::getType, "2"); + xzdContactService.remove(lambdaQueryWrapper); +// xzdContactService.removeByIds(old.getContacts()); } for (XzdContact contact : bo.getContacts()) { contact.setType("2"); @@ -418,14 +437,22 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdContact::getCustomerinformationId,old.getId()); + lambdaQueryWrapper.eq(XzdContact::getType, "2"); + xzdContactService.remove(lambdaQueryWrapper); +// xzdContactService.removeByIds(old.getContacts()); } } //处理证照信息 if (bo.getCertificates() != null && !bo.getCertificates().isEmpty()){ if (old.getCertificates() != null && !old.getCertificates().isEmpty()){ - xzdCertificateInfoService.removeByIds(old.getCertificates()); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdCertificateInfo::getCustomerinformationId,old.getId()); + lambdaQueryWrapper.eq(XzdCertificateInfo::getType, "2"); + xzdCertificateInfoService.remove(lambdaQueryWrapper); +// xzdCertificateInfoService.removeByIds(old.getCertificates()); } for (XzdCertificateInfo certificate : bo.getCertificates()) { certificate.setType("2"); @@ -434,7 +461,11 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(XzdCertificateInfo::getCustomerinformationId,old.getId()); + lambdaQueryWrapper.eq(XzdCertificateInfo::getType, "2"); + xzdCertificateInfoService.remove(lambdaQueryWrapper); +// xzdCertificateInfoService.removeByIds(old.getCertificates()); } } @@ -470,7 +501,7 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdCustomertypeInfo::getType,"2"); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdCustomertypeInfo::getCustomerinformationId, update.getId()); + xzdCustomertypeInfoService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdCustomertypeInfoService.removeByIds(old.getCustomerTypes()); } } //处理供应物料 if (bo.getMaterials() != null && !bo.getMaterials().isEmpty()){ if (old.getMaterials() != null && !old.getMaterials().isEmpty()){ - xzdSupplyMaterialsService.removeByIds(old.getMaterials()); + LambdaQueryWrapper xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdSupplyMaterials::getSupplierId, update.getId()); + xzdSupplyMaterialsService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdSupplyMaterialsService.removeByIds(old.getMaterials()); } for (XzdSupplyMaterials customerType : bo.getMaterials()) { customerType.setSupplierId(update.getId()); @@ -517,14 +555,19 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdSupplyMaterials::getSupplierId, update.getId()); + xzdSupplyMaterialsService.remove(xzdCustomertypeInfoLambdaQueryWrapper); } } //供应商评价 if (bo.getEvaluations() != null && !bo.getEvaluations().isEmpty()){ if (old.getEvaluations() != null && !old.getEvaluations().isEmpty()){ - xzdSupplierEvaluationService.removeByIds(old.getEvaluations()); + LambdaQueryWrapper xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdSupplierEvaluation::getSupplierId, update.getId()); + xzdSupplierEvaluationService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdSupplierEvaluationService.removeByIds(old.getEvaluations()); } for (XzdSupplierEvaluation customerType : bo.getEvaluations()) { customerType.setSupplierId(update.getId()); @@ -532,14 +575,21 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdSupplierEvaluation::getSupplierId, update.getId()); + xzdSupplierEvaluationService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdSupplierEvaluationService.removeByIds(old.getEvaluations()); } } //项目信息 if (bo.getProjects() != null && !bo.getProjects().isEmpty()){ if (old.getProjects() != null && !old.getProjects().isEmpty()){ - xzdProjectInfoService.removeByIds(old.getProjects()); + LambdaQueryWrapper xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdProjectInfo::getCustomerinformationId, update.getId()); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdProjectInfo::getType,"2"); + xzdProjectInfoService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdProjectInfoService.removeByIds(old.getProjects()); } for (XzdProjectInfo project : bo.getProjects()) { project.setCustomerinformationId(update.getId()); @@ -548,7 +598,11 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdProjectInfo::getCustomerinformationId, update.getId()); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdProjectInfo::getType,"2"); + xzdProjectInfoService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdProjectInfoService.removeByIds(old.getProjects()); } } @@ -556,7 +610,11 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdContractInfo::getCustomerinformationId, update.getId()); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdContractInfo::getType,"2"); + xzdContractInfoService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdContractInfoService.removeByIds(old.getContracts()); } for (XzdContractInfo contract : bo.getContracts()) { contract.setType("2"); @@ -565,7 +623,11 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl xzdCustomertypeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdContractInfo::getCustomerinformationId, update.getId()); + xzdCustomertypeInfoLambdaQueryWrapper.eq(XzdContractInfo::getType,"2"); + xzdContractInfoService.remove(xzdCustomertypeInfoLambdaQueryWrapper); +// xzdContractInfoService.removeByIds(old.getContracts()); } }