Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-pcitc into dev
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
package com.xjrsoft.module.mdm.client;
|
package com.xjrsoft.module.mdm.client;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
@ -7,6 +8,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import com.xjrsoft.common.constant.GlobalConstant;
|
import com.xjrsoft.common.constant.GlobalConstant;
|
||||||
|
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: ksy
|
* @author: ksy
|
||||||
@ -21,4 +23,7 @@ public interface ILngBankClient {
|
|||||||
@GetMapping("/getTranById")
|
@GetMapping("/getTranById")
|
||||||
String getTranById(@RequestParam("id")String id);
|
String getTranById(@RequestParam("id")String id);
|
||||||
|
|
||||||
|
@GetMapping("/getTranByCodes")
|
||||||
|
List<UpdateLngBBankDto> getTranByCodes(@RequestParam("codes") List<String> codes);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public class LngCustomerBankVo {
|
|||||||
* 银行
|
* 银行
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("银行")
|
@ApiModelProperty("银行")
|
||||||
@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
|
//@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
|
||||||
private String bankCode;
|
private String bankCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,7 +125,11 @@ public class LngCustomerBankVo {
|
|||||||
private Long ruleUserId;
|
private Long ruleUserId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联行号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("联行号")
|
||||||
|
private String interBankCode;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public class LngSupplierBankVo {
|
|||||||
* 银行
|
* 银行
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("银行")
|
@ApiModelProperty("银行")
|
||||||
@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
|
//@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
|
||||||
private String bankCode;
|
private String bankCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,6 +124,12 @@ public class LngSupplierBankVo {
|
|||||||
@ApiModelProperty("数据权限id")
|
@ApiModelProperty("数据权限id")
|
||||||
private Long ruleUserId;
|
private Long ruleUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("联行号")
|
||||||
|
private String interBankCode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import com.xjrsoft.common.constant.GlobalConstant;
|
import com.xjrsoft.common.constant.GlobalConstant;
|
||||||
import com.xjrsoft.common.utils.TenantUtil;
|
import com.xjrsoft.common.utils.TenantUtil;
|
||||||
|
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
||||||
import com.xjrsoft.module.mdm.entity.LngBBank;
|
import com.xjrsoft.module.mdm.entity.LngBBank;
|
||||||
import com.xjrsoft.module.mdm.entity.LngBStationLng;
|
import com.xjrsoft.module.mdm.entity.LngBStationLng;
|
||||||
import com.xjrsoft.module.mdm.service.IBankService;
|
import com.xjrsoft.module.mdm.service.IBankService;
|
||||||
@ -26,7 +27,7 @@ import lombok.AllArgsConstructor;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/lngBank")
|
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/lngBank")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class LngBankClientImpl implements ILngStationClient {
|
public class LngBankClientImpl implements ILngBankClient {
|
||||||
|
|
||||||
private final IBankService lngBankService;
|
private final IBankService lngBankService;
|
||||||
|
|
||||||
@ -49,4 +50,9 @@ public class LngBankClientImpl implements ILngStationClient {
|
|||||||
return bank!=null?bank.getFullName():null;
|
return bank!=null?bank.getFullName():null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UpdateLngBBankDto> getTranByCodes(List<String> codes) {
|
||||||
|
return lngBankService.getByCodes(codes);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.xjrsoft.module.mdm.service;
|
package com.xjrsoft.module.mdm.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
||||||
import com.xjrsoft.module.mdm.entity.LngBBank;
|
import com.xjrsoft.module.mdm.entity.LngBBank;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -13,4 +16,6 @@ import com.xjrsoft.module.mdm.entity.LngBBank;
|
|||||||
public interface IBankService extends IService<LngBBank> {
|
public interface IBankService extends IService<LngBBank> {
|
||||||
|
|
||||||
LngBBank getByCode(String code);
|
LngBBank getByCode(String code);
|
||||||
|
|
||||||
|
List<UpdateLngBBankDto> getByCodes(List<String> codes);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,17 @@
|
|||||||
package com.xjrsoft.module.mdm.service.impl;
|
package com.xjrsoft.module.mdm.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
||||||
import com.xjrsoft.module.mdm.entity.LngBBank;
|
import com.xjrsoft.module.mdm.entity.LngBBank;
|
||||||
import com.xjrsoft.module.mdm.mapper.LngBBankMapper;
|
import com.xjrsoft.module.mdm.mapper.LngBBankMapper;
|
||||||
import com.xjrsoft.module.mdm.service.IBankService;
|
import com.xjrsoft.module.mdm.service.IBankService;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,5 +31,14 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
|
|||||||
return baseMapper.selectOne(queryWrapper);
|
return baseMapper.selectOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UpdateLngBBankDto> getByCodes(List<String> codes) {
|
||||||
|
LambdaQueryWrapper<LngBBank> queryWrapper = new LambdaQueryWrapper<LngBBank>();
|
||||||
|
queryWrapper.in(LngBBank::getCode,codes);
|
||||||
|
List<LngBBank> bankList = baseMapper.selectList(queryWrapper);
|
||||||
|
List<UpdateLngBBankDto> bankDtoList = BeanUtil.copyToList(bankList, UpdateLngBBankDto.class);
|
||||||
|
return bankDtoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.xjrsoft.module.sales.service.impl;
|
package com.xjrsoft.module.sales.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -10,6 +11,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||||
|
import com.xjrsoft.module.mdm.client.ILngBankClient;
|
||||||
|
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
||||||
import com.xjrsoft.module.sales.entity.LngCustomer;
|
import com.xjrsoft.module.sales.entity.LngCustomer;
|
||||||
import com.xjrsoft.module.sales.entity.LngCustomerAttrPower;
|
import com.xjrsoft.module.sales.entity.LngCustomerAttrPower;
|
||||||
import com.xjrsoft.module.sales.entity.LngCustomerBank;
|
import com.xjrsoft.module.sales.entity.LngCustomerBank;
|
||||||
@ -21,6 +24,7 @@ import com.xjrsoft.module.sales.mapper.LngCustomerContactMapper;
|
|||||||
import com.xjrsoft.module.sales.mapper.LngCustomerDocMapper;
|
import com.xjrsoft.module.sales.mapper.LngCustomerDocMapper;
|
||||||
import com.xjrsoft.module.sales.mapper.LngCustomerMapper;
|
import com.xjrsoft.module.sales.mapper.LngCustomerMapper;
|
||||||
import com.xjrsoft.module.sales.service.ICustomerService;
|
import com.xjrsoft.module.sales.service.ICustomerService;
|
||||||
|
import com.xjrsoft.module.sales.vo.LngCustomerBankVo;
|
||||||
import com.xjrsoft.module.sales.vo.LngCustomerDocVo;
|
import com.xjrsoft.module.sales.vo.LngCustomerDocVo;
|
||||||
import com.xjrsoft.module.sales.vo.LngCustomerVo;
|
import com.xjrsoft.module.sales.vo.LngCustomerVo;
|
||||||
import com.xjrsoft.module.system.client.IFileClient;
|
import com.xjrsoft.module.system.client.IFileClient;
|
||||||
@ -28,6 +32,7 @@ import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,6 +53,8 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
|
|||||||
|
|
||||||
private final IFileClient fileClient;
|
private final IFileClient fileClient;
|
||||||
|
|
||||||
|
private final ILngBankClient bankClient;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -72,13 +79,29 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
|
|||||||
if(lngCustomer == null) {
|
if(lngCustomer == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
LngCustomerVo vo = BeanUtil.toBean(lngCustomer, LngCustomerVo.class);
|
LngCustomerVo vo = BeanUtil.toBean(lngCustomer, LngCustomerVo.class);
|
||||||
|
if(CollectionUtil.isNotEmpty(vo.getLngCustomerBankList())) {
|
||||||
|
List<String> codes = vo.getLngCustomerBankList().stream().map(LngCustomerBankVo::getBankCode).collect(Collectors.toList());
|
||||||
|
List<UpdateLngBBankDto> bankList = bankClient.getTranByCodes(codes);
|
||||||
|
Map<String, UpdateLngBBankDto> codeMap = bankList.stream()
|
||||||
|
.collect(Collectors.toMap(UpdateLngBBankDto::getCode,dto -> dto));
|
||||||
|
for(LngCustomerBankVo bank: vo.getLngCustomerBankList()) {
|
||||||
|
if(StrUtil.isNotBlank(bank.getBankCode()) && codeMap.containsKey(bank.getBankCode())) {
|
||||||
|
UpdateLngBBankDto temp =codeMap.get(bank.getBankCode());
|
||||||
|
bank.setBankName(temp.getFullName());
|
||||||
|
//联行号
|
||||||
|
bank.setInterBankCode(temp.getBankCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(CollectionUtil.isNotEmpty(vo.getLngCustomerDocList())) {
|
if(CollectionUtil.isNotEmpty(vo.getLngCustomerDocList())) {
|
||||||
for(LngCustomerDocVo lngCustomerDoc: vo.getLngCustomerDocList()) {
|
for(LngCustomerDocVo lngCustomerDoc: vo.getLngCustomerDocList()) {
|
||||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_customer_doc", "fileList", lngCustomerDoc.getId());
|
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_customer_doc", "fileList", lngCustomerDoc.getId());
|
||||||
lngCustomerDoc.setFileList(fileList);
|
lngCustomerDoc.setFileList(fileList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_customer", "lngFileUploadList", vo.getId());
|
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_customer", "lngFileUploadList", vo.getId());
|
||||||
vo.setLngFileUploadList(fileList);
|
vo.setLngFileUploadList(fileList);
|
||||||
return vo;
|
return vo;
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.xjrsoft.module.supplier.service.impl;
|
package com.xjrsoft.module.supplier.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -8,8 +10,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||||
import com.xjrsoft.module.sales.entity.LngCustomer;
|
import com.xjrsoft.module.mdm.client.ILngBankClient;
|
||||||
import com.xjrsoft.module.supplier.dto.UpdateLngSupplierDto;
|
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
||||||
|
import com.xjrsoft.module.sales.vo.LngCustomerBankVo;
|
||||||
import com.xjrsoft.module.supplier.entity.LngSupplier;
|
import com.xjrsoft.module.supplier.entity.LngSupplier;
|
||||||
import com.xjrsoft.module.supplier.entity.LngSupplierBank;
|
import com.xjrsoft.module.supplier.entity.LngSupplierBank;
|
||||||
import com.xjrsoft.module.supplier.entity.LngSupplierContact;
|
import com.xjrsoft.module.supplier.entity.LngSupplierContact;
|
||||||
@ -19,6 +22,7 @@ import com.xjrsoft.module.supplier.mapper.LngSupplierContactMapper;
|
|||||||
import com.xjrsoft.module.supplier.mapper.LngSupplierDocMapper;
|
import com.xjrsoft.module.supplier.mapper.LngSupplierDocMapper;
|
||||||
import com.xjrsoft.module.supplier.mapper.LngSupplierMapper;
|
import com.xjrsoft.module.supplier.mapper.LngSupplierMapper;
|
||||||
import com.xjrsoft.module.supplier.service.ISupplierService;
|
import com.xjrsoft.module.supplier.service.ISupplierService;
|
||||||
|
import com.xjrsoft.module.supplier.vo.LngSupplierBankVo;
|
||||||
import com.xjrsoft.module.supplier.vo.LngSupplierDocVo;
|
import com.xjrsoft.module.supplier.vo.LngSupplierDocVo;
|
||||||
import com.xjrsoft.module.supplier.vo.LngSupplierVo;
|
import com.xjrsoft.module.supplier.vo.LngSupplierVo;
|
||||||
import com.xjrsoft.module.system.client.IFileClient;
|
import com.xjrsoft.module.system.client.IFileClient;
|
||||||
@ -26,6 +30,7 @@ import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,6 +50,8 @@ public class SupplierServiceImpl extends MPJBaseServiceImpl<LngSupplierMapper, L
|
|||||||
|
|
||||||
private final IFileClient fileClient;
|
private final IFileClient fileClient;
|
||||||
|
|
||||||
|
private final ILngBankClient bankClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean delete(List<Long> ids) {
|
public Boolean delete(List<Long> ids) {
|
||||||
@ -63,6 +70,20 @@ public class SupplierServiceImpl extends MPJBaseServiceImpl<LngSupplierMapper, L
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LngSupplierVo vo = BeanUtil.toBean(lngSupplier, LngSupplierVo.class);
|
LngSupplierVo vo = BeanUtil.toBean(lngSupplier, LngSupplierVo.class);
|
||||||
|
if(CollectionUtil.isNotEmpty(vo.getLngSupplierBankList())) {
|
||||||
|
List<String> codes = vo.getLngSupplierBankList().stream().map(LngSupplierBankVo::getBankCode).collect(Collectors.toList());
|
||||||
|
List<UpdateLngBBankDto> bankList = bankClient.getTranByCodes(codes);
|
||||||
|
Map<String, UpdateLngBBankDto> codeMap = bankList.stream()
|
||||||
|
.collect(Collectors.toMap(UpdateLngBBankDto::getCode,dto -> dto));
|
||||||
|
for(LngSupplierBankVo bank: vo.getLngSupplierBankList()) {
|
||||||
|
if(StrUtil.isNotBlank(bank.getBankCode()) && codeMap.containsKey(bank.getBankCode())) {
|
||||||
|
UpdateLngBBankDto temp =codeMap.get(bank.getBankCode());
|
||||||
|
bank.setBankName(temp.getFullName());
|
||||||
|
//联行号
|
||||||
|
bank.setInterBankCode(temp.getBankCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(CollectionUtil.isNotEmpty(vo.getLngSupplierDocList())) {
|
if(CollectionUtil.isNotEmpty(vo.getLngSupplierDocList())) {
|
||||||
for(LngSupplierDocVo lngSupplierDoc: vo.getLngSupplierDocList()) {
|
for(LngSupplierDocVo lngSupplierDoc: vo.getLngSupplierDocList()) {
|
||||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_Supplier_doc", "fileList", lngSupplierDoc.getId());
|
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_Supplier_doc", "fileList", lngSupplierDoc.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user