|
|
@@ -25,9 +25,7 @@ import com.sckw.order.model.KwoWantBuyAddress;
|
|
|
import com.sckw.order.model.KwoWantBuyTrading;
|
|
|
import com.sckw.order.model.dto.WantBuyExport;
|
|
|
import com.sckw.order.model.vo.req.*;
|
|
|
-import com.sckw.order.model.vo.res.WantBuyAddressDetailRes;
|
|
|
-import com.sckw.order.model.vo.res.WantBuyDetailRes;
|
|
|
-import com.sckw.order.model.vo.res.WantBuySelectRes;
|
|
|
+import com.sckw.order.model.vo.res.*;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
@@ -63,7 +61,7 @@ public class KwpWantBuyService {
|
|
|
* @author lt
|
|
|
* @Date 11:50 2023/8/1 0001
|
|
|
**/
|
|
|
- public PageRes<WantBuySelectRes> buyHallList(WantBuySelectParam wantBuySelectParam) {
|
|
|
+ public PageRes<WantBuyHallRes> buyHallList(WantBuySelectParam wantBuySelectParam) {
|
|
|
// 如果有求购方式的查询条件,需要先查询出求购方式的id
|
|
|
if (StringUtils.isNotBlank(wantBuySelectParam.getTrading())) {
|
|
|
List<String> longList = stringToLongList(wantBuySelectParam.getTrading());
|
|
|
@@ -102,10 +100,11 @@ public class KwpWantBuyService {
|
|
|
if (CollectionUtils.isEmpty(wantBuyDto)) {
|
|
|
return new PageRes<>();
|
|
|
}
|
|
|
+ List<WantBuyHallRes> res = BeanUtils.copyToList(wantBuyDto, WantBuyHallRes.class);
|
|
|
|
|
|
// 获取供应企业信息
|
|
|
- List<Long> supplyEntIds = wantBuyDto.stream()
|
|
|
- .map(WantBuySelectRes::getEntId)
|
|
|
+ List<Long> supplyEntIds = res.stream()
|
|
|
+ .map(WantBuyHallRes::getEntId)
|
|
|
.collect(Collectors.toList());
|
|
|
// 通过企业id查询企业信息
|
|
|
List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
|
|
|
@@ -113,17 +112,17 @@ public class KwpWantBuyService {
|
|
|
.collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
|
|
|
|
|
|
// 对求购列表进行数据处理
|
|
|
- wantBuyDto.forEach(wantBuySelectRes -> {
|
|
|
- List<String> tradings = wantBuySelectRes.getWantBuyTradings().stream()
|
|
|
- .map(wantBuyTradingRes -> DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), wantBuyTradingRes.getTrading()))
|
|
|
+ res.forEach(e -> {
|
|
|
+ List<String> tradings = e.getWantBuyTradings().stream()
|
|
|
+ .map(f -> DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), f.getTrading()))
|
|
|
.collect(Collectors.toList());
|
|
|
- wantBuySelectRes.setTradings(String.join(Global.COMMA, tradings));
|
|
|
- wantBuySelectRes.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), wantBuySelectRes.getGoodsType()));
|
|
|
- wantBuySelectRes.setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(wantBuySelectRes.getStatus())));
|
|
|
- wantBuySelectRes.setEntName(Objects.nonNull(entMap.get(wantBuySelectRes.getEntId())) ? entMap.get(wantBuySelectRes.getEntId()) : null);
|
|
|
+ e.setTradings(String.join(Global.COMMA, tradings));
|
|
|
+ e.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()));
|
|
|
+ e.setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(e.getStatus())));
|
|
|
+ e.setEntName(Objects.nonNull(entMap.get(e.getEntId())) ? entMap.get(e.getEntId()) : null);
|
|
|
});
|
|
|
|
|
|
- return new PageRes<>(new PageInfo<>(wantBuyDto));
|
|
|
+ return new PageRes<>(new PageInfo<>(res));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -504,4 +503,25 @@ public class KwpWantBuyService {
|
|
|
});
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 查看联系方式
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-09-12 9:24
|
|
|
+ * @Param id:
|
|
|
+ * @return: com.sckw.order.model.vo.res.WantBuyContactInfoRes
|
|
|
+ */
|
|
|
+ public WantBuyContactInfoRes getContactInfo(Long id) {
|
|
|
+ LambdaQueryWrapper<KwoWantBuy> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(KwoWantBuy::getId, id)
|
|
|
+ .eq(KwoWantBuy::getDelFlag, Global.NO)
|
|
|
+ .last("LIMIT 1");
|
|
|
+ KwoWantBuy wantBuy = kwpWantBuyMapper.selectOne(wrapper);
|
|
|
+ if (Objects.isNull(wantBuy)){
|
|
|
+ throw new BusinessException("求购信息不存在");
|
|
|
+ }
|
|
|
+ WantBuyContactInfoRes res = new WantBuyContactInfoRes();
|
|
|
+ res.setId(id).setContacts(wantBuy.getContacts()).setPhone(wantBuy.getPhone());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|