|
|
@@ -520,19 +520,23 @@ public class KwoTradeOrderService {
|
|
|
//单位信息
|
|
|
List<KwoTradeOrderUnit> units = kwoTradeOrderUnitService.getByOrderId(id);
|
|
|
if (CollectionUtils.isNotEmpty(units)) {
|
|
|
- List<UnitInfoDetailRes> unitInfos = BeanUtils.copyToList(units, UnitInfoDetailRes.class);
|
|
|
- unitInfos.forEach(e -> {
|
|
|
- e.setUnitTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_UNIT_TYPE.getType(), e.getUnitType()));
|
|
|
+ List<UnitInfoDetailRes> unitInfos = new ArrayList<>(units.size());
|
|
|
+ units.forEach(e->{
|
|
|
+ UnitInfoDetailRes unit = BeanUtils.copyProperties(e, UnitInfoDetailRes.class);
|
|
|
+ unit.setUnitTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_UNIT_TYPE.getType(), unit.getUnitType()));
|
|
|
+ unitInfos.add(unit);
|
|
|
});
|
|
|
detail.setUnitInfo(unitInfos);
|
|
|
}
|
|
|
//地址信息
|
|
|
List<KwoTradeOrderAddress> addressList = kwoTradeOrderAddressService.getByOrderId(id);
|
|
|
if (CollectionUtils.isNotEmpty(addressList)) {
|
|
|
- List<AddressInfoDetailRes> addressInfoDetails = BeanUtils.copyToList(addressList, AddressInfoDetailRes.class);
|
|
|
- addressInfoDetails.forEach(e -> {
|
|
|
- e.setAddressTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_ADDRESS_TYPE.getType(), e.getAddressType()));
|
|
|
- e.setTypeLabel(DictEnum.getLabel(DictTypeEnum.ADDRESS_TYPE.getType(), e.getType()));
|
|
|
+ List<AddressInfoDetailRes> addressInfoDetails = new ArrayList<>(addressList.size());
|
|
|
+ addressList.forEach(e -> {
|
|
|
+ AddressInfoDetailRes address = BeanUtils.copyProperties(e, AddressInfoDetailRes.class);
|
|
|
+ address.setAddressTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_ADDRESS_TYPE.getType(), address.getAddressType()));
|
|
|
+ address.setTypeLabel(DictEnum.getLabel(DictTypeEnum.ADDRESS_TYPE.getType(), address.getType()));
|
|
|
+ addressInfoDetails.add(address);
|
|
|
});
|
|
|
detail.setAddressInfo(addressInfoDetails);
|
|
|
}
|
|
|
@@ -681,6 +685,9 @@ public class KwoTradeOrderService {
|
|
|
if (StringUtils.isBlank(e.getFirmName())) {
|
|
|
throw new BusinessException("企业名称不能为空!");
|
|
|
}
|
|
|
+ if (Objects.isNull(e.getContactsId())) {
|
|
|
+ throw new BusinessException("联系人id不能为空!");
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(e.getContacts())) {
|
|
|
throw new BusinessException("联系人姓名不能为空!");
|
|
|
}
|