|
@@ -163,21 +163,37 @@ public class IntermediateContractServiceImpl extends ServiceImpl<IntermediateCon
|
|
public IntermediateContract getPrintInfo(IntermediateContractDto dto) {
|
|
public IntermediateContract getPrintInfo(IntermediateContractDto dto) {
|
|
Assert.notEmpty(dto.getId(), "参数异常");
|
|
Assert.notEmpty(dto.getId(), "参数异常");
|
|
IntermediateContract in = this.getById(dto.getId());
|
|
IntermediateContract in = this.getById(dto.getId());
|
|
- IntermediateContractVo vo = new IntermediateContractVo();
|
|
|
|
- BeanUtils.copyProperties(in,vo);
|
|
|
|
if(ObjectUtil.isEmpty(in)){
|
|
if(ObjectUtil.isEmpty(in)){
|
|
throw new ServiceException("合同不存在");
|
|
throw new ServiceException("合同不存在");
|
|
}
|
|
}
|
|
|
|
+ IntermediateContractVo vo = new IntermediateContractVo();
|
|
|
|
+ BeanUtils.copyProperties(in,vo);
|
|
//赋值买方卖方公司名称
|
|
//赋值买方卖方公司名称
|
|
List<Long> corporationIds = Arrays.asList(in.getBuyCorporationId(), in.getSellCorporationId());
|
|
List<Long> corporationIds = Arrays.asList(in.getBuyCorporationId(), in.getSellCorporationId());
|
|
Map<Long, Corporation> corporationMap = corporationService.mapKEntity(Corporation::getId, q -> q.in(Corporation::getId, corporationIds));
|
|
Map<Long, Corporation> corporationMap = corporationService.mapKEntity(Corporation::getId, q -> q.in(Corporation::getId, corporationIds));
|
|
Corporation buyCorporation = corporationMap.get(in.getBuyCorporationId());
|
|
Corporation buyCorporation = corporationMap.get(in.getBuyCorporationId());
|
|
- Corporation sellCorporation = corporationMap.get(in.getSellCorporationId());
|
|
|
|
|
|
+ //赋值买方信息
|
|
|
|
+ vo.setBuyContactNumber(in.getBuyContactName());
|
|
|
|
+ vo.setBuyCorporationName(in.getBuyContactNumber());
|
|
if (ObjectUtil.isNotEmpty(buyCorporation)) {
|
|
if (ObjectUtil.isNotEmpty(buyCorporation)) {
|
|
- vo.setBuyCorporationName(buyCorporation.getName());
|
|
|
|
|
|
+ vo.setBuyContactName(buyCorporation.getNameEn());
|
|
|
|
+ //赋值买方国家省市详细地址信息
|
|
|
|
+ vo.setBuyCountryName(buyCorporation.getCountryEnStr());
|
|
|
|
+ vo.setBuyProvinceName(buyCorporation.getProvinceEnStr());
|
|
|
|
+ vo.setBuyCityName(buyCorporation.getCityEnStr());
|
|
|
|
+ vo.setBuyDetailedAddress(buyCorporation.getAddressEn());
|
|
}
|
|
}
|
|
|
|
+ Corporation sellCorporation = corporationMap.get(in.getSellCorporationId());
|
|
|
|
+ //赋值卖方信息
|
|
|
|
+ vo.setSellContactNumber(in.getSellContactName());
|
|
|
|
+ vo.setSellCorporationNameEn(in.getSellContactNumber());
|
|
if (ObjectUtil.isNotEmpty(sellCorporation)) {
|
|
if (ObjectUtil.isNotEmpty(sellCorporation)) {
|
|
- vo.setSellCorporationName(sellCorporation.getName());
|
|
|
|
|
|
+ vo.setSellContactName(sellCorporation.getNameEn());
|
|
|
|
+ //赋值卖方国家省市详细地址信息
|
|
|
|
+ vo.setSellCountryName(sellCorporation.getCountryEnStr());
|
|
|
|
+ vo.setSellProvinceName(sellCorporation.getProvinceEnStr());
|
|
|
|
+ vo.setSellCityName(sellCorporation.getCityEnStr());
|
|
|
|
+ vo.setSellDetailedAddress(sellCorporation.getAddressEn());
|
|
}
|
|
}
|
|
//查询最新的一条单证信息
|
|
//查询最新的一条单证信息
|
|
Documents documents = documentsService.getOne(Wrappers.<Documents>query().lambda().in(Documents::getId,Arrays.asList(in.getDocumentsIds().split(","))).orderByDesc(Documents::getCreateTime).last("limit 1"));
|
|
Documents documents = documentsService.getOne(Wrappers.<Documents>query().lambda().in(Documents::getId,Arrays.asList(in.getDocumentsIds().split(","))).orderByDesc(Documents::getCreateTime).last("limit 1"));
|