Browse Source

#公开市场列表查询

sunhuijun 1 month ago
parent
commit
692ee6deb1

+ 27 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/controller/FreemarketController.java

@@ -0,0 +1,27 @@
+package cn.chinaunicom.omniFlowNetCompute.controller;
+
+import cn.chinaunicom.omniFlowNetCompute.core.web.controller.BaseController;
+import cn.chinaunicom.omniFlowNetCompute.core.web.page.TableDataInfo;
+import cn.chinaunicom.omniFlowNetCompute.domain.Freemarket;
+import cn.chinaunicom.omniFlowNetCompute.service.FreemarketService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/freemarket")
+public class FreemarketController extends BaseController {
+
+    @Autowired
+    private FreemarketService freemarketService;
+
+    @GetMapping("/list")
+    public TableDataInfo list(Freemarket param) {
+        startPage();
+        List<Freemarket> list = freemarketService.listByCondition(param);
+        return getDataTable(list);
+    }
+}

+ 11 - 1
src/main/java/cn/chinaunicom/omniFlowNetCompute/controller/OpportunityController.java

@@ -1,5 +1,6 @@
 package cn.chinaunicom.omniFlowNetCompute.controller;
 import cn.chinaunicom.omniFlowNetCompute.core.web.controller.BaseController;
+import cn.chinaunicom.omniFlowNetCompute.core.web.domain.AjaxResult;
 import cn.chinaunicom.omniFlowNetCompute.core.web.page.TableDataInfo;
 import cn.chinaunicom.omniFlowNetCompute.domain.Opportunity;
 import cn.chinaunicom.omniFlowNetCompute.pojo.OpportunityQueryParam;
@@ -10,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 @RestController
-@RequestMapping("/api/opportunity")
+@RequestMapping("/opportunity")
 public class OpportunityController extends BaseController {
 
     @Autowired
@@ -22,4 +23,13 @@ public class OpportunityController extends BaseController {
         List<Opportunity> list = opportunityService.listByCondition(param);
         return getDataTable(list);
     }
+
+    // /**
+    //  * 根据商机id获取详细信息
+    //  */
+    // @GetMapping(value = "/{noticeId}")
+    // public AjaxResult getInfo(@PathVariable Long noticeId)
+    // {
+    //     return success(opportunityService.selectNoticeById(noticeId));
+    // }
 }

+ 203 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/domain/Freemarket.java

@@ -0,0 +1,203 @@
+package cn.chinaunicom.omniFlowNetCompute.domain;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 项目公告信息表 实体类
+ * 对应表:project_announcement
+ */
+@Data
+public class Freemarket {
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 公告类型(如“单一”)
+     */
+    private String announcementType;
+
+    /**
+     * 公告标题
+     */
+    private String announcementTitle;
+
+    /**
+     * 项目编号
+     */
+    private String projectCode;
+
+    /**
+     * 是否相关(1=是,0=否)
+     */
+    private Integer isRelevant;
+
+    /**
+     * 采购单位
+     */
+    private String purchaseUnit;
+
+    /**
+     * 最终使用客户
+     */
+    private String finalUser;
+
+    /**
+     * 对应自然客户ID
+     */
+    private Long naturalCustomerId;
+
+    /**
+     * 客户群(如“要客”“非要客”)
+     */
+    private String customerGroup;
+
+    /**
+     * 分类(如“G”“B”)
+     */
+    private String category;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 招标代理
+     */
+    private String tenderAgent;
+
+    /**
+     * 招标代理联系电话
+     */
+    private String tenderAgentPhone;
+
+    /**
+     * 信息匹配词
+     */
+    private String matchKeywords;
+
+    /**
+     * 购买标书截止时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date bidDocumentDeadline;
+
+    /**
+     * 开标日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date bidOpeningDate;
+
+    /**
+     * 公告地址(链接)
+     */
+    private String announcementUrl;
+
+    /**
+     * 剑鱼地址(链接)
+     */
+    private String jianyuUrl;
+
+    /**
+     * 预算(万元)
+     */
+    private BigDecimal budget;
+
+    /**
+     * 招标信息发布时间
+     */
+    private Date tenderInfoPublishTime;
+
+    /**
+     * 分公司
+     */
+    private String branchCompany;
+
+    /**
+     * 行业
+     */
+    private String industry;
+
+    /**
+     * 业务分类
+     */
+    private String businessCategory;
+
+    /**
+     * 业务需求
+     */
+    private String businessDemand;
+
+    /**
+     * 商机编号
+     */
+    private Long opportunityId;
+
+    /**
+     * 是否参与(1=是,0=否)
+     */
+    private Integer isParticipate;
+
+    /**
+     * 不参与原因
+     */
+    private String notParticipateReason;
+
+
+    /**
+     * 本阶段开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date currentStageStartTime;
+
+    /**
+     * 支撑主责单位
+     */
+    private String supportMainUnit;
+
+    /**
+     * 支撑部门和责任人
+     */
+    private String supportDepartment;
+
+    /**
+     * 是否知晓(1=是,0=否)
+     */
+    private Integer isAware;
+
+    /**
+     * 红黄绿牌
+     */
+    private String rbgLabel;
+
+    /**
+     * 弃标审批单号
+     */
+    private String discardApprovalNumber;
+
+    /**
+     * 发布时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date publishTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+}

+ 3 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/domain/Opportunity.java

@@ -1,6 +1,7 @@
 package cn.chinaunicom.omniFlowNetCompute.domain;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
@@ -14,6 +15,8 @@ public class Opportunity {
     private String opportunityStage;
     private String supportPerson;
     private String supportUnit;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date signTimeStart;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date estimatedSignDate;
 }

+ 15 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/mapper/FreemarketMapper.java

@@ -0,0 +1,15 @@
+package cn.chinaunicom.omniFlowNetCompute.mapper;
+
+import cn.chinaunicom.omniFlowNetCompute.domain.Freemarket;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface FreemarketMapper {
+
+    /**
+     * 分页查询公开市场列表(带条件)
+     */
+    List<Freemarket> selectPageByCondition(Freemarket param);
+}

+ 0 - 16
src/main/java/cn/chinaunicom/omniFlowNetCompute/pojo/ListResponse.java

@@ -1,16 +0,0 @@
-package cn.chinaunicom.omniFlowNetCompute.pojo;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class ListResponse<T> {
-    private List<T> list;
-    private Long total;
-
-    public ListResponse(List<T> list, Long total) {
-        this.list = list;
-        this.total = total;
-    }
-}

+ 12 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/service/FreemarketService.java

@@ -0,0 +1,12 @@
+package cn.chinaunicom.omniFlowNetCompute.service;
+
+import cn.chinaunicom.omniFlowNetCompute.domain.Freemarket;
+
+import java.util.List;
+
+
+public interface FreemarketService
+{
+
+    public List<Freemarket> listByCondition(Freemarket param) ;
+}

+ 23 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/service/impl/FreemarketServiceImpl.java

@@ -0,0 +1,23 @@
+package cn.chinaunicom.omniFlowNetCompute.service.impl;
+
+
+import cn.chinaunicom.omniFlowNetCompute.domain.Freemarket;
+import cn.chinaunicom.omniFlowNetCompute.mapper.FreemarketMapper;
+import cn.chinaunicom.omniFlowNetCompute.service.FreemarketService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class FreemarketServiceImpl implements FreemarketService {
+
+    @Autowired
+    private FreemarketMapper freemarketMapper;
+
+    @Override
+    public List<Freemarket> listByCondition(Freemarket param) {
+        return freemarketMapper.selectPageByCondition(param);
+    }
+}

+ 3 - 3
src/main/java/cn/chinaunicom/omniFlowNetCompute/service/impl/OpportunityServiceImpl.java

@@ -23,8 +23,8 @@ public class OpportunityServiceImpl implements OpportunityService {
     }
 
     // @Override
-    // public OpportunityDetailVO getDetailByCode(String opportunityCode) {
-    //     Opportunity opportunity = opportunityMapper.selectDetailByCode(opportunityCode);
-    //     return convertToDetailVO(opportunity);
+    // public SysBanner selectNoticeById(Long noticeId)
+    // {
+    //     return bannerMapper.selectNoticeById(noticeId);
     // }
 }

+ 96 - 0
src/main/resources/mapper/omni/FreemarketMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="cn.chinaunicom.omniFlowNetCompute.mapper.FreemarketMapper">
+
+    <resultMap type="cn.chinaunicom.omniFlowNetCompute.domain.Freemarket" id="BaseResultMap">
+        <id column="id" property="id" jdbcType="BIGINT"/>
+        <result column="announcement_type" property="announcementType" jdbcType="VARCHAR"/>
+        <result column="announcement_title" property="announcementTitle" jdbcType="VARCHAR"/>
+        <result column="project_code" property="projectCode" jdbcType="VARCHAR"/>
+        <result column="is_relevant" property="isRelevant" jdbcType="TINYINT"/>
+        <result column="purchase_unit" property="purchaseUnit" jdbcType="VARCHAR"/>
+        <result column="final_user" property="finalUser" jdbcType="VARCHAR"/>
+        <result column="natural_customer_id" property="naturalCustomerId" jdbcType="BIGINT"/>
+        <result column="customer_group" property="customerGroup" jdbcType="VARCHAR"/>
+        <result column="category" property="category" jdbcType="VARCHAR"/>
+        <result column="project_name" property="projectName" jdbcType="VARCHAR"/>
+        <result column="tender_agent" property="tenderAgent" jdbcType="VARCHAR"/>
+        <result column="tender_agent_phone" property="tenderAgentPhone" jdbcType="VARCHAR"/>
+        <result column="match_keywords" property="matchKeywords" jdbcType="VARCHAR"/>
+        <result column="bid_document_deadline" property="bidDocumentDeadline" />
+        <result column="bid_opening_date" property="bidOpeningDate" />
+        <result column="announcement_url" property="announcementUrl" jdbcType="VARCHAR"/>
+        <result column="jianyu_url" property="jianyuUrl" jdbcType="VARCHAR"/>
+        <result column="budget" property="budget" jdbcType="DECIMAL"/>
+        <result column="tender_info_publish_time" property="tenderInfoPublishTime" />
+        <result column="branch_company" property="branchCompany" jdbcType="VARCHAR"/>
+        <result column="industry" property="industry" jdbcType="VARCHAR"/>
+        <result column="business_category" property="businessCategory" jdbcType="VARCHAR"/>
+        <result column="business_demand" property="businessDemand" jdbcType="VARCHAR"/>
+        <result column="opportunity_id" property="opportunityId" jdbcType="BIGINT"/>
+        <result column="is_participate" property="isParticipate" jdbcType="TINYINT"/>
+        <result column="not_participate_reason" property="notParticipateReason" jdbcType="VARCHAR"/>
+        <result column="current_stage_start_time" property="currentStageStartTime" />
+        <result column="support_main_unit" property="supportMainUnit" jdbcType="VARCHAR"/>
+        <result column="support_department" property="supportDepartment" jdbcType="VARCHAR"/>
+        <result column="is_aware" property="isAware" jdbcType="TINYINT"/>
+        <result column="rbg_label" property="rbgLabel" jdbcType="VARCHAR"/>
+        <result column="discard_approval_number" property="discardApprovalNumber" jdbcType="VARCHAR"/>
+        <result column="publish_time" property="publishTime" />
+        <result column="create_time" property="createTime" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+    <!-- 通用查询字段 -->
+    <sql id="Base_Column_List">
+        id, announcement_type, announcement_title, project_code, is_relevant, purchase_unit, final_user,
+        natural_customer_id, customer_group, category, project_name, tender_agent, tender_agent_phone,
+        match_keywords, bid_document_deadline, bid_opening_date, announcement_url, jianyu_url, budget,
+        tender_info_publish_time, branch_company, industry, business_category, business_demand,
+        opportunity_id, is_participate, not_participate_reason, is_aware, rbg_label, discard_approval_number,
+        publish_time, create_time, update_time
+    </sql>
+
+    <!-- ========== 核心SQL 1:详情页查询 - 根据主键ID查询单条详情数据 ========== -->
+    <select id="selectById" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM project_announcement
+        WHERE id = #{id}
+    </select>
+
+    <!-- ========== 核心SQL 2:列表页查询 - 分页+多条件模糊查询(最常用) ========== -->
+    <select id="selectPageByCondition" parameterType="cn.chinaunicom.omniFlowNetCompute.domain.Freemarket" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM freemarket
+        WHERE 1=1
+        <!-- 公告标题 模糊查询 -->
+        <if test="announcementTitle != null and announcementTitle != ''">
+            AND announcement_title LIKE CONCAT('%',#{announcementTitle},'%')
+        </if>
+        <!-- 项目编号 精准查询 -->
+        <if test="projectCode != null and projectCode != ''">
+            AND project_code = #{projectId}
+        </if>
+        <!-- 采购单位 模糊查询 -->
+        <if test="purchaseUnit != null and purchaseUnit != ''">
+            AND purchase_unit LIKE CONCAT('%',#{purchaseUnit},'%')
+        </if>
+        <!-- 是否相关 精准查询 -->
+        <if test="isRelevant != null">
+            AND is_relevant = #{isRelevant}
+        </if>
+        <!-- 客户群 精准查询 -->
+        <if test="customerGroup != null and customerGroup != ''">
+            AND customer_group = #{customerGroup}
+        </if>
+        <!-- 是否参与 精准查询 -->
+        <if test="isParticipate != null">
+            AND is_participate = #{isParticipate}
+        </if>
+        <!-- 排序:按创建时间倒序,最新的在前面 -->
+        ORDER BY create_time DESC
+    </select>
+</mapper>