|
|
@@ -90,7 +90,7 @@ public class KwpWantBuyService {
|
|
|
.map(wantBuyTradingRes -> DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), wantBuyTradingRes.getTrading()))
|
|
|
.collect(Collectors.toList());
|
|
|
wantBuySelectRes.setTradings(String.join(Global.COMMA, tradings));
|
|
|
- wantBuySelectRes.setGoodsType(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), wantBuySelectRes.getGoodsType()));
|
|
|
+ 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);
|
|
|
});
|
|
|
@@ -199,7 +199,7 @@ public class KwpWantBuyService {
|
|
|
// KwoWantBuy kwoWantBuy = BeanUtils.copyProperties(param, KwoWantBuy.class);
|
|
|
KwoWantBuy kwoWantBuy = new KwoWantBuy();
|
|
|
Long userId = LoginUserHolder.getUserId();
|
|
|
- kwoWantBuy.setEntId(LoginUserHolder.getEntId()).setEntName(LoginUserHolder.getEntName())
|
|
|
+ kwoWantBuy.setEntId(LoginUserHolder.getEntId())
|
|
|
.setName(param.getName()).setGoodsType(param.getGoodsType())
|
|
|
.setSpec(param.getSpec()).setPrice(param.getPrice())
|
|
|
.setAmount(param.getAmount()).setContacts(param.getContacts())
|
|
|
@@ -292,6 +292,11 @@ public class KwpWantBuyService {
|
|
|
kwpWantBuyMapper.update(null, updateWrapper);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc 求购删除
|
|
|
+ * @author lt
|
|
|
+ * @Date 10:15 2023/8/1 0001
|
|
|
+ **/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void dels(WantBuyDels param) {
|
|
|
List<String> ids = List.of(param.getIds().split(","));
|
|
|
@@ -308,6 +313,11 @@ public class KwpWantBuyService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc 求购详情查询
|
|
|
+ * @author lt
|
|
|
+ * @Date 10:15 2023/8/1 0001
|
|
|
+ **/
|
|
|
public WantBuyDetailRes detail(Long id) {
|
|
|
//先判断求购订单是否存在
|
|
|
KwoWantBuy kwoWantBuy = kwpWantBuyMapper.selectById(id);
|
|
|
@@ -326,20 +336,21 @@ public class KwpWantBuyService {
|
|
|
System.out.println(wantBuyAddressInfo);
|
|
|
responseData.setAddressInfo(wantBuyAddressInfo);
|
|
|
}
|
|
|
+ //获取求购企业信息
|
|
|
+ EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwoWantBuy.getEntId());
|
|
|
+ if (Objects.nonNull(entCacheResDto)) {
|
|
|
+ responseData.setEntName(entCacheResDto.getFirmName());
|
|
|
+ }
|
|
|
//求购支付方式集合
|
|
|
List<KwoWantBuyTrading> tradingList = kwoWantBuyTradingService.getByWantBuyId(id);
|
|
|
if (Objects.nonNull(tradingList) && !tradingList.isEmpty()) {
|
|
|
List<String> tradings = tradingList.stream().map(KwoWantBuyTrading::getTrading).collect(Collectors.toList());
|
|
|
responseData.setTradings(tradings);
|
|
|
-// ArrayList<String> objects = new ArrayList<>();
|
|
|
-// for (String trading : tradings) {
|
|
|
-// objects.add(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(),trading));
|
|
|
-// }
|
|
|
//改成stream流的方式
|
|
|
List<String> result = tradings.stream()
|
|
|
.map(trading -> DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), trading))
|
|
|
.collect(Collectors.toList());
|
|
|
- String tradingLabels = String.join(",", result);
|
|
|
+ String tradingLabels = String.join(Global.COMMA, result);
|
|
|
//获取到的是一个集合,需要转换成字符串
|
|
|
responseData.setTradingLabels(tradingLabels);
|
|
|
}
|