|
|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
package com.xjrsoft.module.contract.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
@ -9,21 +11,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
|
|
import com.xjrsoft.module.contract.dto.LngContractPageDto;
|
|
|
|
|
import com.xjrsoft.module.contract.entity.LngContractFact;
|
|
|
|
|
import com.xjrsoft.module.contract.entity.LngContractPur;
|
|
|
|
|
import com.xjrsoft.module.contract.entity.LngContractPurPngPoint;
|
|
|
|
|
import com.xjrsoft.module.contract.entity.LngContractPurPngPointSales;
|
|
|
|
|
import com.xjrsoft.module.contract.mapper.LngContractFactMapper;
|
|
|
|
|
import com.xjrsoft.module.contract.mapper.LngContractPurMapper;
|
|
|
|
|
import com.xjrsoft.module.contract.mapper.LngContractPurPngPointMapper;
|
|
|
|
|
import com.xjrsoft.module.contract.mapper.LngContractPurPngPointSalesMapper;
|
|
|
|
|
import com.xjrsoft.module.contract.service.IContractPurPngService;
|
|
|
|
|
import com.xjrsoft.module.contract.vo.LngContractApproRelVo;
|
|
|
|
|
import com.xjrsoft.module.contract.vo.LngContractFactRelVo;
|
|
|
|
|
import com.xjrsoft.module.contract.vo.LngContractPageVo;
|
|
|
|
|
import com.xjrsoft.module.contract.vo.LngContractPurVo;
|
|
|
|
|
import com.xjrsoft.module.sales.entity.LngAppro;
|
|
|
|
|
import com.xjrsoft.module.sales.mapper.LngApproMapper;
|
|
|
|
|
import com.xjrsoft.module.system.client.IFileClient;
|
|
|
|
|
import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -40,6 +51,16 @@ public class ContractPurPngServiceImpl extends MPJBaseServiceImpl<LngContractPur
|
|
|
|
|
|
|
|
|
|
private final LngContractPurPngPointSalesMapper lngContractPurPngPointSalesMapper;
|
|
|
|
|
|
|
|
|
|
//private final LngContractApproRelMapper lngContractApproRelMapper;
|
|
|
|
|
|
|
|
|
|
//private final LngContractFactRelMapper lngContractFactRelMapper;
|
|
|
|
|
private final LngContractPurPngPointMapper lngContractPurPngPointMapper;
|
|
|
|
|
|
|
|
|
|
private final LngContractFactMapper lngContractFactMapper;
|
|
|
|
|
|
|
|
|
|
private final LngApproMapper lngApproMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageOutput<LngContractPageVo> queryPage(LngContractPageDto dto) {
|
|
|
|
|
QueryWrapper<LngContractPur> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
@ -63,13 +84,62 @@ public class ContractPurPngServiceImpl extends MPJBaseServiceImpl<LngContractPur
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(lngContractPur.getLngContractPurPngPointList() != null) {
|
|
|
|
|
|
|
|
|
|
for(LngContractPurPngPoint pp:lngContractPur.getLngContractPurPngPointList()) {
|
|
|
|
|
|
|
|
|
|
String fullName = lngContractPurPngPointMapper.getLngStationPngNameByCode(pp.getPointUpCode());
|
|
|
|
|
pp.setPointUpName(fullName);
|
|
|
|
|
List<LngContractPurPngPointSales> list = lngContractPurPngPointSalesMapper.selectList(new LambdaQueryWrapper<LngContractPurPngPointSales>()
|
|
|
|
|
.eq(LngContractPurPngPointSales::getKpppId, pp.getId()));
|
|
|
|
|
pp.setLngContractPurPngPointSalesList(list);
|
|
|
|
|
List<String> names = Lists.newArrayList();
|
|
|
|
|
for(LngContractPurPngPointSales ps:list) {
|
|
|
|
|
String delyNames = lngContractPurPngPointMapper.getLngStationPngNameByCode(ps.getPointDelyCode());
|
|
|
|
|
names.add(delyNames);
|
|
|
|
|
}
|
|
|
|
|
if(CollectionUtil.isNotEmpty(names)) {
|
|
|
|
|
pp.setPointDelyName(names.stream().collect(Collectors.joining(",")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
LngContractPurVo vo = BeanUtil.toBean(lngContractPur, LngContractPurVo.class);
|
|
|
|
|
List<LngContractFactRelVo> lngContractFactRelList = vo.getLngContractFactRelList();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(lngContractFactRelList)) {
|
|
|
|
|
lngContractFactRelList.forEach(x -> {
|
|
|
|
|
LngContractFact lngContractFact = lngContractFactMapper.selectById(x.getKFactId());
|
|
|
|
|
if(lngContractFact != null) {
|
|
|
|
|
x.setComId(lngContractFact.getComId());
|
|
|
|
|
x.setKName(lngContractFact.getKName());
|
|
|
|
|
x.setKNo(lngContractFact.getKNo());
|
|
|
|
|
x.setEmpId(lngContractFact.getEmpId());
|
|
|
|
|
x.setTel(lngContractFact.getTel());
|
|
|
|
|
x.setKTypeCode1(lngContractFact.getKTypeCode1());
|
|
|
|
|
x.setRelTypeCode(lngContractFact.getRelTypeCode());
|
|
|
|
|
}
|
|
|
|
|
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_contract_fact",
|
|
|
|
|
"lngFileUploadList", lngContractFact.getId());
|
|
|
|
|
x.setLngFileUploadList(fileList);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
List<LngContractApproRelVo> lngContractApproRelList = vo.getLngContractApproRelList();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(lngContractApproRelList)) {
|
|
|
|
|
lngContractApproRelList.forEach(x -> {
|
|
|
|
|
LngAppro appro = lngApproMapper.selectById(x.getApproId());
|
|
|
|
|
if(appro != null) {
|
|
|
|
|
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_appro",
|
|
|
|
|
"lngFileUploadList", appro.getId());
|
|
|
|
|
x.setLngFileUploadList(fileList);
|
|
|
|
|
x.setBDeptId(appro.getBDeptId());
|
|
|
|
|
x.setCode(appro.getCode());
|
|
|
|
|
x.setTypeCode(x.getTypeCode());
|
|
|
|
|
x.setEmpId(x.getEmpId());
|
|
|
|
|
x.setDateAppro(appro.getDateAppro());
|
|
|
|
|
x.setTitle(appro.getTitle());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_contract", "lngFileUploadList", vo.getId());
|
|
|
|
|
vo.setLngFileUploadList(fileList);
|
|
|
|
|
|