diff --git a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/vo/XzdCustomerSuppliervo.java b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/vo/XzdCustomerSuppliervo.java new file mode 100644 index 00000000..d1f53ddc --- /dev/null +++ b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/vo/XzdCustomerSuppliervo.java @@ -0,0 +1,31 @@ +package org.dromara.common.core.domain.vo; + +import lombok.Data; + +import java.io.Serial; + + +@Data +public class XzdCustomerSuppliervo { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + + private Long id; + + /** + * 类型(1、供应商,2、客户) + */ + private String type; + + /** + * 供应商-客户id + */ + private Long cSId; + + +} diff --git a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdCustomerSupplierService.java b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdCustomerSupplierService.java new file mode 100644 index 00000000..85bf826f --- /dev/null +++ b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdCustomerSupplierService.java @@ -0,0 +1,14 @@ +package org.dromara.common.core.service; + +import org.dromara.common.core.domain.vo.XzdCustomerSuppliervo; + +public interface XzdCustomerSupplierService { + + /** + * 查询供应商-客户中间 + * + * @param id 主键 + * @return 供应商-客户中间 + */ + XzdCustomerSuppliervo queryByIdone(Long id); +} diff --git a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdCustomerinformationService.java b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdCustomerinformationService.java index fa89b9e8..d50ba555 100644 --- a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdCustomerinformationService.java +++ b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdCustomerinformationService.java @@ -3,4 +3,6 @@ package org.dromara.common.core.service; public interface XzdCustomerinformationService { String selectNmaeByIds(String id); + + String selectNmaeById(Long id); } diff --git a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdSupplierInfoService.java b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdSupplierInfoService.java index 4b8a8ca4..8b9bab77 100644 --- a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdSupplierInfoService.java +++ b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/XzdSupplierInfoService.java @@ -3,4 +3,7 @@ package org.dromara.common.core.service; public interface XzdSupplierInfoService { String selectNmaeByIds(String ids); + + String selectNmaeById(Long id); + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java index ec40d0c8..3bdd9d43 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/vo/XzdSubcontractVo.java @@ -86,7 +86,7 @@ public class XzdSubcontractVo implements Serializable { * 项目名称 */ @ExcelProperty(value = "项目名称") - @Translation(type = TransConstant.PROJECT_ID_TO_NAME, mapper = "project") + @Translation(type = TransConstant.XZD_PROJECT_ID_TO_NAME, mapper = "project") private String projectName; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCorrespondentListImp.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCorrespondentListImp.java index d6cc0978..678d0c35 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCorrespondentListImp.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCorrespondentListImp.java @@ -84,7 +84,12 @@ public class XzdCorrespondentListImp implements IXzdCorrespondentList { private final XzdCustomerinformationMapper xzdCustomerinformationMapper; - private final IXzdCustomertypeService iXzdCustomertypeService; ; + + private final IXzdCustomertypeService iXzdCustomertypeService; + + private final IXzdCustomerSupplierService iXzdCustomerSupplierService; + + private final IXzdCustomerSupplierYybService iXzdCustomerSupplierYybService; @@ -116,6 +121,12 @@ public class XzdCorrespondentListImp implements IXzdCorrespondentList { long id = dto.getXzdCustomerinformation().getId(); + XzdCustomerSupplier xzdCustomerSupplier = new XzdCustomerSupplier(); + xzdCustomerSupplier.setCSId(id); + xzdCustomerSupplier.setType("1"); + + iXzdCustomerSupplierService.save(xzdCustomerSupplier); + // 客户类型添加 List xzdCustomertypeInfo = dto.getXzdCustomertypeInfo(); @@ -559,6 +570,12 @@ public class XzdCorrespondentListImp implements IXzdCorrespondentList { } public void delCorrespondentVoid(Long dto){ +// 删除中间表 + XzdCustomerSupplierYyb xzdCustomerSupplierYyb = iXzdCustomerSupplierYybService.getBaseMapper().selectOne(new LambdaQueryWrapper().eq(XzdCustomerSupplierYyb::getCSId, dto)); + if (xzdCustomerSupplierYyb == null) { + iXzdCustomerSupplierService.getBaseMapper().delete(new LambdaQueryWrapper().eq(XzdCustomerSupplier::getCSId, dto)); + } + // 客户信息 xzdCustomerinformationService.removeById(dto); @@ -576,11 +593,6 @@ public class XzdCorrespondentListImp implements IXzdCorrespondentList { xzdAddressInfoService.removeByMap(temp); - - // 联系人信息 - - - // 联系人信息 List xzdContact = xzdContactService.getBaseMapper().selectByMap(temp); if (xzdContact != null && xzdContact.size() > 0) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerSupplierServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerSupplierServiceImpl.java index a63dac13..9cd661aa 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerSupplierServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerSupplierServiceImpl.java @@ -1,6 +1,8 @@ package org.dromara.xzd.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.vo.XzdCustomerSuppliervo; +import org.dromara.common.core.service.XzdCustomerSupplierService; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -28,7 +30,7 @@ import java.util.Collection; */ @RequiredArgsConstructor @Service -public class XzdCustomerSupplierServiceImpl extends ServiceImpl implements IXzdCustomerSupplierService { +public class XzdCustomerSupplierServiceImpl extends ServiceImpl implements IXzdCustomerSupplierService , XzdCustomerSupplierService { private final XzdCustomerSupplierMapper baseMapper; @@ -129,4 +131,10 @@ public class XzdCustomerSupplierServiceImpl extends ServiceImpl 0; } + + @Override + public XzdCustomerSuppliervo queryByIdone(Long id) { + XzdCustomerSupplierVo xzdCustomerSupplierVo = baseMapper.selectVoById(id); + return MapstructUtils.convert(xzdCustomerSupplierVo, XzdCustomerSuppliervo.class); + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerinformationServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerinformationServiceImpl.java index 8516d041..99e55a5a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerinformationServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/service/impl/XzdCustomerinformationServiceImpl.java @@ -3,7 +3,10 @@ package org.dromara.xzd.service.impl; import cn.hutool.core.convert.Convert; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.vo.XzdCustomerSuppliervo; +import org.dromara.common.core.service.XzdCustomerSupplierService; import org.dromara.common.core.service.XzdCustomerinformationService; +import org.dromara.common.core.service.XzdSupplierInfoService; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.SpringUtils; import org.dromara.common.core.utils.StringUtils; @@ -14,6 +17,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import org.dromara.system.domain.vo.SysDeptVo; +import org.dromara.xzd.domain.vo.XzdSupplierInfoVo; import org.springframework.stereotype.Service; import org.dromara.xzd.domain.bo.XzdCustomerinformationBo; import org.dromara.xzd.domain.vo.XzdCustomerinformationVo; @@ -38,6 +42,10 @@ public class XzdCustomerinformationServiceImpl extends ServiceImpl list = new ArrayList<>(); for (Long id : StringUtils.splitTo(ids, Convert::toLong)) { - XzdCustomerinformationVo vo = SpringUtils.getAopProxy(this).getBaseMapper().selectVoById(id); - if (ObjectUtil.isNotNull(vo)) { - list.add(vo.getUnitName()); + XzdCustomerSuppliervo xzdCustomerSuppliervo = xzdCustomerSupplierService.queryByIdone(id); + if (xzdCustomerSuppliervo == null){ + return null; } + if (xzdCustomerSuppliervo.getType().equals("1")){ + XzdCustomerinformationVo vo = SpringUtils.getAopProxy(this).getBaseMapper().selectVoById(id); + if (ObjectUtil.isNotNull(vo)) { + list.add(vo.getUnitName()); + } + }else { + String s = xzdSupplierInfoService.selectNmaeById(id); + if (StringUtils.isNotBlank(s)){ + list.add(s); + } + + } + } return String.join(StringUtils.SEPARATOR, list); } + + @Override + public String selectNmaeById(Long id) { + XzdCustomerinformationVo xzdCustomerinformationVo = this.queryById(id); + if (xzdCustomerinformationVo == null){ + return null; + } + return xzdCustomerinformationVo.getUnitName(); + } } 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 41251964..148c81fd 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 @@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.RequiredArgsConstructor; import org.dromara.common.core.domain.R; +import org.dromara.common.core.domain.vo.XzdCustomerSuppliervo; +import org.dromara.common.core.service.XzdCustomerSupplierService; +import org.dromara.common.core.service.XzdCustomerinformationService; import org.dromara.common.core.service.XzdSupplierInfoService; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.SpringUtils; @@ -20,6 +23,7 @@ import org.dromara.system.service.impl.SysOssServiceImpl; import org.dromara.system.service.impl.SysUserServiceImpl; import org.dromara.xzd.domain.*; import org.dromara.xzd.domain.bo.XzdSupplierInfoBo; +import org.dromara.xzd.domain.vo.XzdCustomerinformationVo; import org.dromara.xzd.domain.vo.XzdCustomertypeVo; import org.dromara.xzd.domain.vo.XzdSupplierInfoVo; import org.dromara.xzd.mapper.XzdSupplierInfoMapper; @@ -72,11 +76,16 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl list = new ArrayList<>(); for (Long id : StringUtils.splitTo(ids, Convert::toLong)) { - XzdSupplierInfoVo vo = SpringUtils.getAopProxy(this).getBaseMapper().selectVoById(id); - if (ObjectUtil.isNotNull(vo)) { - list.add(vo.getUnitName()); + XzdCustomerSuppliervo xzdCustomerSuppliervo = xzdCustomerSupplierService.queryByIdone(id); + if (xzdCustomerSuppliervo == null){ + return null; + } + if (xzdCustomerSuppliervo.getType().equals("1")){ + String s = xzdCustomerinformationService.selectNmaeById(id); + if (StringUtils.isNotBlank(s)){ + list.add(s); + } + }else { + String s = this.selectNmaeById(id); + if (StringUtils.isNotBlank(s)){ + list.add(s); + } + } } return String.join(StringUtils.SEPARATOR, list); } + + @Override + public String selectNmaeById(Long id) { + XzdSupplierInfoVo xzdSupplierInfoVo = this.baseMapper.selectVoById(Convert.toLong(id)); + if (xzdSupplierInfoVo == null){ + return null; + } + return xzdSupplierInfoVo.getUnitName(); + } }