@@ -15,8 +15,8 @@ import org.springframework.beans.factory.annotation.Value; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.Collections; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | |||||
import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMATTER; | import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMATTER; | ||||
@@ -55,6 +55,7 @@ public class MhApiClient { | |||||
private static final String DICT_URL = "/dict_data/listByType"; | private static final String DICT_URL = "/dict_data/listByType"; | ||||
private static final String PURCHASE_NOTICE = "/buy_notice/saveBuyNoticeList"; | private static final String PURCHASE_NOTICE = "/buy_notice/saveBuyNoticeList"; | ||||
private static final String PURCHASE_NOTICE_GET = "/buy_notice/getBuyIdeaList"; | |||||
public MhRetDTO<List<MhUnitDTO>> queryUnits() { | public MhRetDTO<List<MhUnitDTO>> queryUnits() { | ||||
@@ -198,4 +199,24 @@ public class MhApiClient { | |||||
} | } | ||||
} | } | ||||
public List<MhPurchaseIntentionDTO> listPurchaseNotice(Long unitId) { | |||||
String retBody; | |||||
if (!environmentUtil.isDevEnv()) { | |||||
String url = mhApiHost + PURCHASE_NOTICE_GET; | |||||
retBody = HttpUtil.get(url + "?unitId=" + unitId); | |||||
} else { | |||||
return Collections.emptyList(); | |||||
} | |||||
MhRetDTO<List<MhPurchaseIntentionDTO>> retObj = JSONUtil.toBean(retBody, | |||||
new TypeReference<MhRetDTO<List<MhPurchaseIntentionDTO>>>() { | |||||
}, false); | |||||
if (retObj.isOk()) { | |||||
return retObj.getData(); | |||||
} else { | |||||
log.error("获取采购意向失败:{} {}", unitId, retBody); | |||||
throw BizException.wrap("获取采购意向失败"); | |||||
} | |||||
} | |||||
} | } |
@@ -0,0 +1,99 @@ | |||||
package com.hz.pm.api.external.model.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* MhPurchaseIntentionDTO | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 10:49 2024/4/10 | |||||
*/ | |||||
@Data | |||||
public class MhPurchaseIntentionDTO { | |||||
private String id; | |||||
@ApiModelProperty("标项名称") | |||||
private String buyItem; | |||||
@ApiModelProperty("预算金额") | |||||
private double budgetMoney; | |||||
@ApiModelProperty("采购方式,根据字典项获取对应的文本") | |||||
private String buyWay; | |||||
@ApiModelProperty("开标时间") | |||||
private Date bidOpenTime; | |||||
@ApiModelProperty("截止时间") | |||||
private Date endTime; | |||||
@ApiModelProperty("详细地址") | |||||
private String detailAddress; | |||||
@ApiModelProperty("链接地址") | |||||
private String linkAddress; | |||||
@ApiModelProperty("传真") | |||||
private String fax; | |||||
@ApiModelProperty("采购描述(富文本)") | |||||
private String buyDesc; | |||||
@ApiModelProperty("采购凭证") | |||||
private String buyFile; | |||||
@ApiModelProperty("采购单位id") | |||||
private Long buyUnitId; | |||||
@ApiModelProperty("采购单位名称") | |||||
private String buyUnitName; | |||||
@ApiModelProperty("创建单位") | |||||
private Long createUnit; | |||||
@ApiModelProperty("联系人") | |||||
private String linkUser; | |||||
@ApiModelProperty("联系方式") | |||||
private String linkPhone; | |||||
@ApiModelProperty("创建人") | |||||
private String createUser; | |||||
@ApiModelProperty("创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty("更新人") | |||||
private String updateUser; | |||||
@ApiModelProperty("更新时间") | |||||
private Date updateTime; | |||||
@ApiModelProperty("发布状态") | |||||
private String postStatus; | |||||
@ApiModelProperty("浏览量") | |||||
private int viewCount; | |||||
@ApiModelProperty("采购范围:N 非公开、Y 公开") | |||||
private String buyScope; | |||||
@ApiModelProperty("类型采购意向") | |||||
private String type; | |||||
@ApiModelProperty("采购设备类型") | |||||
private String buyDeviceType; | |||||
@ApiModelProperty("采购设备类型列表") | |||||
private String buyDeviceTypeList; | |||||
@ApiModelProperty("数据来源") | |||||
private String source; | |||||
} |