|
|
@@ -44,17 +44,19 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
@RequiredArgsConstructor
|
|
|
public class KwpWantBuyService {
|
|
|
-
|
|
|
@DubboReference(version = "2.0.0", group = "design", check = false)
|
|
|
private RemoteSystemService remoteSystemService;
|
|
|
-
|
|
|
private final KwpWantBuyMapper kwpWantBuyMapper;
|
|
|
-
|
|
|
private final KwpWantBuyTradingMapper kwpWantBuyTradingMapper;
|
|
|
private final KwpWantBuyAddressMapper kwpWantBuyAddressMapper;
|
|
|
private final KwoWantBuyAddressService kwoWantBuyAddressService;
|
|
|
private final KwoWantBuyTradingService kwoWantBuyTradingService;
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 求购大厅列表查询
|
|
|
+ * @author lt
|
|
|
+ * @Date 11:50 2023/8/1 0001
|
|
|
+ **/
|
|
|
public PageRes<WantBuySelectRes> buyHallList(WantBuySelectParam wantBuySelectParam){
|
|
|
// 如果有求购方式的查询条件,需要先查询出求购方式的id
|
|
|
if (StringUtils.isNotBlank(wantBuySelectParam.getTrading())) {
|
|
|
@@ -98,6 +100,11 @@ public class KwpWantBuyService {
|
|
|
return new PageRes<>(new PageInfo<>(wantBuyDto));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc 求购列表查询
|
|
|
+ * @author lt
|
|
|
+ * @Date 11:50 2023/8/1 0001
|
|
|
+ **/
|
|
|
public PageRes<WantBuySelectRes> select(WantBuySelectParam wantBuySelectParam) {
|
|
|
|
|
|
if (StringUtils.isNotBlank(wantBuySelectParam.getTrading())) {
|
|
|
@@ -141,8 +148,12 @@ public class KwpWantBuyService {
|
|
|
return new PageRes<>(new PageInfo<>(wantBuyDto));
|
|
|
}
|
|
|
|
|
|
- private List<String> goodsTypeHandle(WantBuySelectParam wantBuySelectParam)
|
|
|
- {
|
|
|
+ /**
|
|
|
+ * @Desc 求购列表查询
|
|
|
+ * @param wantBuySelectParam
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<String> goodsTypeHandle(WantBuySelectParam wantBuySelectParam) {
|
|
|
List<SysDictResDto> goodsTypeList = remoteSystemService.queryDictBottom(wantBuySelectParam.getGoodsType(), wantBuySelectParam.getGoodsTypeValue());
|
|
|
if (CollectionUtils.isNotEmpty(goodsTypeList)) {
|
|
|
return goodsTypeList.stream().map(SysDictResDto::getValue).toList();
|
|
|
@@ -150,6 +161,10 @@ public class KwpWantBuyService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Desc 字符串转数组
|
|
|
+ * @return
|
|
|
+ */
|
|
|
private List<String> stringToLongList(String str) {
|
|
|
if (StringUtils.isBlank(str)) {
|
|
|
return null;
|
|
|
@@ -157,10 +172,8 @@ public class KwpWantBuyService {
|
|
|
// 使用逗号分隔字符串,并去除两端空格
|
|
|
String[] stringArray = str.split(Global.COMMA);
|
|
|
return Arrays.asList(stringArray);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @Desc 求购草稿新增
|
|
|
* @Author lt
|
|
|
@@ -175,7 +188,6 @@ public class KwpWantBuyService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @Desc 求购上架新增
|
|
|
* @Author lt
|
|
|
@@ -189,6 +201,11 @@ public class KwpWantBuyService {
|
|
|
addWantBuy(param, message, status);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc 新增求购统一方法
|
|
|
+ * @author lt
|
|
|
+ * @Date 11:52 2023/8/1 0001
|
|
|
+ **/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void addWantBuy(AddWantBuyParam param, String message, Integer status) {
|
|
|
Date currentDate = new Date();
|
|
|
@@ -207,8 +224,6 @@ public class KwpWantBuyService {
|
|
|
.setRemark(param.getRemark()).setStatus(status).setCreateBy(userId)
|
|
|
.setCreateTime(currentDate).setUpdateBy(userId)
|
|
|
.setUpdateTime(currentDate).setDelFlag(Global.NO);
|
|
|
-
|
|
|
-
|
|
|
kwpWantBuyMapper.insert(kwoWantBuy);
|
|
|
if (Objects.isNull(kwoWantBuy.getId())) {
|
|
|
throw new BusinessException(message + "失败");
|
|
|
@@ -281,8 +296,10 @@ public class KwpWantBuyService {
|
|
|
* @Date 14:56 2023/7/25 0025
|
|
|
**/
|
|
|
public void batchTakeOffShelves(WantBuyDels param) {
|
|
|
- if (BeanUtils.isEmpty(param)) throw new BusinessException("请提供需要下架的产品");
|
|
|
- List<String> ids = List.of(param.getIds().split(","));
|
|
|
+ if (BeanUtils.isEmpty(param)) {
|
|
|
+ throw new BusinessException("请提供需要下架的产品");
|
|
|
+ }
|
|
|
+ List<String> ids = List.of(param.getIds().split(Global.COMMA));
|
|
|
//1.查询ids所属产品只有status=1的才能下架,如果存在其它状态的则不能下架
|
|
|
LambdaUpdateWrapper<KwoWantBuy> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
updateWrapper.eq(KwoWantBuy::getDelFlag, Global.NO).in(KwoWantBuy::getId, ids);
|
|
|
@@ -417,7 +434,6 @@ public class KwpWantBuyService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @Desc: 根据id查询求购信息
|
|
|
* @param id
|