|
@@ -438,8 +438,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
|
|
|
@Override
|
|
|
public ContractVo detail(Long id) {
|
|
|
- Contract Contract = this.getById(id);
|
|
|
- ContractVo result = BeanUtil.toBean(Contract, ContractVo.class);
|
|
|
+ Contract contract = this.getById(id);
|
|
|
+ Assert.notEmpty(contract, "查询不到合同信息");
|
|
|
+ ContractVo result = BeanUtil.toBean(contract, ContractVo.class);
|
|
|
|
|
|
List<ContractProduct> contractProductList = contractProductService.list(q -> q.eq(ContractProduct::getContractId, id));
|
|
|
productInfoService.attributeAssign(contractProductList, ContractProduct::getProductId, (item, product) -> {
|
|
@@ -458,7 +459,11 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
item.setProductCode(product.getCode());
|
|
|
});
|
|
|
result.setContractShipmentList(contractShipmentList);
|
|
|
-
|
|
|
+ //赋值国省市名称
|
|
|
+ Map<Long, String> areaMapByIds = CustomizeAreaUtil.getAreaMapByIds(Arrays.asList(result.getBuyCountryId(), result.getBuyProvinceId(), result.getBuyCityId()));
|
|
|
+ result.setBuyCountryName(areaMapByIds.get(result.getBuyCountryId()));
|
|
|
+ result.setBuyProvinceName(areaMapByIds.get(result.getBuyProvinceId()));
|
|
|
+ result.setBuyCityName(areaMapByIds.get(result.getBuyCityId()));
|
|
|
return result;
|
|
|
}
|
|
|
|