Просмотр исходного кода

需求管理--个人及团体用户需求列表

Antiloveg лет назад: 8
Родитель
Сommit
5807307af4

+ 40 - 0
schema/2017-05-13.sql

@@ -0,0 +1,40 @@
+CREATE TABLE `demand` (
+  `id` VARCHAR(36) NOT NULL,
+  `serial_number` INT(8)  NULL COMMENT '编号'  AUTO_INCREMENT,
+  `data_category` INT(1) NULL COMMENT '数据类别(0-个人需求,1-单位需求)',
+  `name` VARCHAR(32) NOT NULL COMMENT '名称',
+  `keyword` VARCHAR(45) NOT NULL COMMENT '关键词',
+  `info_sources` INT(1) NOT NULL COMMENT '信息来源(0-平台采集,1-客户发布)',
+  `industry_categoryA` INT(2) NOT NULL COMMENT '行业类别下拉A',
+  `industry_categoryB` INT(2) NULL COMMENT '行业类别下拉B',
+  `industry_categoryC` INT(2) NULL COMMENT '行业类别下拉C',
+  `demand_type` INT(1) NOT NULL COMMENT '需求类型',
+  `problem_des` VARCHAR(256) NOT NULL COMMENT '问题说明',
+  `technical_requirements` VARCHAR(256) NULL COMMENT '技术指标要求',
+  `picture_url` VARCHAR(500) NULL COMMENT '需求文件--图片URL',
+  `text_file_url` VARCHAR(255) NULL COMMENT '需求文件--文本文件',
+  `video_url` VARCHAR(255) NULL COMMENT '需求文件--视屏文件URL',
+  `fixed_budget` DECIMAL(8,2) NULL COMMENT '固定预算',
+  `fixed_cycle` VARCHAR(12) NULL COMMENT '固定周期',
+  `people_number` INT(5) NULL COMMENT '固定人数',
+  `fixed_scheme` VARCHAR(200) NULL COMMENT '固定方案',
+  `cost_escrow` DECIMAL(8,2) NULL COMMENT '费用托管',
+  `budget_cost` DECIMAL(8,2) NULL COMMENT '预算费用',
+  `validity_period` DATETIME NULL COMMENT '有效期限',
+  `employer_id` VARCHAR(36) NULL COMMENT '雇主客户ID',
+  `employer_name` VARCHAR(16) NOT NULL COMMENT '雇主名称',
+  `employer_address` VARCHAR(128) NULL COMMENT '雇主地址',
+  `employer_contacts` VARCHAR(16) NOT NULL COMMENT '雇主联系人名称',
+  `employer_contacts_mobile` VARCHAR(11) NOT NULL COMMENT '雇主联系人电话',
+  `employer_contacts_mailbox` VARCHAR(255) NOT NULL COMMENT '雇主联系人邮箱',
+  `contacts` INT(1) NULL COMMENT '联系人&联系方式',
+  `status` INT(1) NULL COMMENT '需求状态(0-进行中,1-未解决,2-已解决)',
+  `release` INT(1) NULL COMMENT '是否发布(0-未发布,1-发布)',
+  `release_date` DATETIME NULL COMMENT '发布时间',
+  `create_time` DATETIME NULL COMMENT '需求记录创建时间',
+  `principal_id` VARCHAR(36) NULL COMMENT '负责人(营销员)',
+  `deleted_sign` INT(1) NULL COMMENT '删除标记',
+  PRIMARY KEY (`id`), 
+  INDEX `serialNumber` (`serial_number` ASC))
+ENGINE = InnoDB AUTO_INCREMENT= 600000
+COMMENT = '技术需求';

+ 3 - 3
schema/role_init.sql

@@ -2,6 +2,6 @@ INSERT INTO `role` (`id`, `role_name`, `role_type`)
 VALUES ('1', '超级管理员', 999999),
 VALUES ('2', '地区管理员', 99999),
 VALUES ('3', '审核员', 9999),
-VALUES ('4', '客户经理', 1),
-VALUES ('5', '营销经理', 1),
-VALUES ('6', '营销员', 1);
+VALUES ('4', '客户经理', 4),
+VALUES ('5', '营销经理', 5),
+VALUES ('6', '营销员', 6);

+ 53 - 0
src/main/java/com/goafanti/admin/controller/AdminDemandApiController.java

@@ -1,10 +1,63 @@
 package com.goafanti.admin.controller;
 
+import javax.annotation.Resource;
+
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.demand.service.DemandService;
+
 @RestController
 @RequestMapping(value = "/api/admin/demand")
 public class AdminDemandApiController {
+	@Resource
+	private DemandService demandService;
+
+	/**
+	 * 个人用户--需求列表
+	 */
+	@RequestMapping(value = "/userList", method = RequestMethod.GET)
+	public Result userList(String province, Integer serialNumber, String name, String keyword, Integer infoSources, Integer demandType,
+			String validityPeriodStartDate, String validityPeriodEndDate, String username, 
+			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, String pageNo,
+			String pageSize) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(demandService.selectUserDemandManageList(province, serialNumber, name, keyword, infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate,
+				username, status, releaseStatus, releaseDateStartDate, releaseDateEndDate, pNo, pSize));
+		return res;
+	}
 
+	/**
+	 * 组织用户--需求列表
+	 */
+	@RequestMapping(value = "/orgList", method = RequestMethod.GET)
+	public Result orgList(String province, Integer serialNumber, String name, String keyword, Integer infoSources, Integer demandType,
+			String validityPeriodStartDate, String validityPeriodEndDate, String username, 
+			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, String pageNo,
+			String pageSize) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(demandService.selectOrgDemandManageList(province, serialNumber, name, keyword, infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus, releaseDateStartDate, releaseDateEndDate, pNo, pSize));
+		return res;
+	}
 }

+ 16 - 8
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -1,20 +1,28 @@
 package com.goafanti.common.constant;
 
 public class AFTConstants {
-	public static final String	YYYYMMDDHHMMSS	= "yyyy-MM-dd HH:mm:ss";
+	public static final String	YYYYMMDDHHMMSS		= "yyyy-MM-dd HH:mm:ss";
 
-	public static final String	YYYYMMDD		= "yyyy-MM-dd";
+	public static final String	YYYYMMDD			= "yyyy-MM-dd";
 
-	public static final String	SUPERADMIN		= "999999";
+	public static final String	SUPERADMIN			= "999999";				// 超级管理员
 
-	public static final String	AUDITORADMIN	= "9999";
+	public static final String	AREAADMIN			= "99999";				// 地区管理员
 
-	public static final String	PATENTINFO		= "专利申请管理";
+	public static final String	AUDITORADMIN		= "9999";				// 审核员
 
-	public static final String	COGNIZANCE		= "高企认定管理";
+	public static final String	MANAGERADMIN		= "4";					// 客户经理
 
-	public static final String	COPYRIGHT		= "软著申请管理";
+	public static final String	SALESMANAGERADMIN	= "5";					// 营销经理
 
-	public static final String	TECHPROJECT		= "科技项目申报管理";
+	public static final String	SALESMANADMIN		= "6";					// 营销员
+
+	public static final String	PATENTINFO			= "专利申请管理";
+
+	public static final String	COGNIZANCE			= "高企认定管理";
+
+	public static final String	COPYRIGHT			= "软著申请管理";
+
+	public static final String	TECHPROJECT			= "科技项目申报管理";
 
 }

+ 17 - 0
src/main/java/com/goafanti/common/dao/DemandMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.Demand;
+
+public interface DemandMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(Demand record);
+
+    int insertSelective(Demand record);
+
+    Demand selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(Demand record);
+
+    int updateByPrimaryKey(Demand record);
+}

+ 693 - 0
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -0,0 +1,693 @@
+<?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="com.goafanti.common.dao.DemandMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.Demand" >
+    <id column="id" property="id" jdbcType="VARCHAR" />
+    <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
+    <result column="data_category" property="dataCategory" jdbcType="INTEGER" />
+    <result column="name" property="name" jdbcType="VARCHAR" />
+    <result column="keyword" property="keyword" jdbcType="VARCHAR" />
+    <result column="info_sources" property="infoSources" jdbcType="INTEGER" />
+    <result column="industry_category_a" property="industryCategoryA" jdbcType="INTEGER" />
+    <result column="industry_category_b" property="industryCategoryB" jdbcType="INTEGER" />
+    <result column="industry_category_c" property="industryCategoryC" jdbcType="INTEGER" />
+    <result column="demand_type" property="demandType" jdbcType="INTEGER" />
+    <result column="problem_des" property="problemDes" jdbcType="VARCHAR" />
+    <result column="technical_requirements" property="technicalRequirements" jdbcType="VARCHAR" />
+    <result column="picture_url" property="pictureUrl" jdbcType="VARCHAR" />
+    <result column="text_file_url" property="textFileUrl" jdbcType="VARCHAR" />
+    <result column="video_url" property="videoUrl" jdbcType="VARCHAR" />
+    <result column="fixed_budget" property="fixedBudget" jdbcType="DECIMAL" />
+    <result column="fixed_cycle" property="fixedCycle" jdbcType="VARCHAR" />
+    <result column="people_number" property="peopleNumber" jdbcType="INTEGER" />
+    <result column="fixed_scheme" property="fixedScheme" jdbcType="VARCHAR" />
+    <result column="cost_escrow" property="costEscrow" jdbcType="DECIMAL" />
+    <result column="budget_cost" property="budgetCost" jdbcType="DECIMAL" />
+    <result column="validity_period" property="validityPeriod" jdbcType="TIMESTAMP" />
+    <result column="employer_id" property="employerId" jdbcType="VARCHAR" />
+    <result column="employer_name" property="employerName" jdbcType="VARCHAR" />
+    <result column="employer_address" property="employerAddress" jdbcType="VARCHAR" />
+    <result column="employer_contacts" property="employerContacts" jdbcType="VARCHAR" />
+    <result column="employer_contacts_mobile" property="employerContactsMobile" jdbcType="VARCHAR" />
+    <result column="employer_contacts_mailbox" property="employerContactsMailbox" jdbcType="VARCHAR" />
+    <result column="contacts" property="contacts" jdbcType="INTEGER" />
+    <result column="status" property="status" jdbcType="INTEGER" />
+    <result column="release_status" property="releaseStatus" jdbcType="INTEGER" />
+    <result column="release_date" property="releaseDate" jdbcType="TIMESTAMP" />
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="principal_id" property="principalId" jdbcType="VARCHAR" />
+    <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, serial_number, data_category, name, keyword, info_sources, industry_category_a, 
+    industry_category_b, industry_category_c, demand_type, problem_des, technical_requirements, 
+    picture_url, text_file_url, video_url, fixed_budget, fixed_cycle, people_number, 
+    fixed_scheme, cost_escrow, budget_cost, validity_period, employer_id, employer_name, 
+    employer_address, employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, 
+    contacts, status, release_status, release_date, create_time, principal_id, deleted_sign
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from demand
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from demand
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.Demand" >
+    insert into demand (id, serial_number, data_category, 
+      name, keyword, info_sources, 
+      industry_category_a, industry_category_b, industry_category_c, 
+      demand_type, problem_des, technical_requirements, 
+      picture_url, text_file_url, video_url, 
+      fixed_budget, fixed_cycle, people_number, 
+      fixed_scheme, cost_escrow, budget_cost, 
+      validity_period, employer_id, employer_name, 
+      employer_address, employer_contacts, employer_contacts_mobile, 
+      employer_contacts_mailbox, contacts, status, 
+      release_status, release_date, create_time, 
+      principal_id, deleted_sign)
+    values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER}, 
+      #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{infoSources,jdbcType=INTEGER}, 
+      #{industryCategoryA,jdbcType=INTEGER}, #{industryCategoryB,jdbcType=INTEGER}, #{industryCategoryC,jdbcType=INTEGER}, 
+      #{demandType,jdbcType=INTEGER}, #{problemDes,jdbcType=VARCHAR}, #{technicalRequirements,jdbcType=VARCHAR}, 
+      #{pictureUrl,jdbcType=VARCHAR}, #{textFileUrl,jdbcType=VARCHAR}, #{videoUrl,jdbcType=VARCHAR}, 
+      #{fixedBudget,jdbcType=DECIMAL}, #{fixedCycle,jdbcType=VARCHAR}, #{peopleNumber,jdbcType=INTEGER}, 
+      #{fixedScheme,jdbcType=VARCHAR}, #{costEscrow,jdbcType=DECIMAL}, #{budgetCost,jdbcType=DECIMAL}, 
+      #{validityPeriod,jdbcType=TIMESTAMP}, #{employerId,jdbcType=VARCHAR}, #{employerName,jdbcType=VARCHAR}, 
+      #{employerAddress,jdbcType=VARCHAR}, #{employerContacts,jdbcType=VARCHAR}, #{employerContactsMobile,jdbcType=VARCHAR}, 
+      #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
+      #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{principalId,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.Demand" >
+    insert into demand
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="serialNumber != null" >
+        serial_number,
+      </if>
+      <if test="dataCategory != null" >
+        data_category,
+      </if>
+      <if test="name != null" >
+        name,
+      </if>
+      <if test="keyword != null" >
+        keyword,
+      </if>
+      <if test="infoSources != null" >
+        info_sources,
+      </if>
+      <if test="industryCategoryA != null" >
+        industry_category_a,
+      </if>
+      <if test="industryCategoryB != null" >
+        industry_category_b,
+      </if>
+      <if test="industryCategoryC != null" >
+        industry_category_c,
+      </if>
+      <if test="demandType != null" >
+        demand_type,
+      </if>
+      <if test="problemDes != null" >
+        problem_des,
+      </if>
+      <if test="technicalRequirements != null" >
+        technical_requirements,
+      </if>
+      <if test="pictureUrl != null" >
+        picture_url,
+      </if>
+      <if test="textFileUrl != null" >
+        text_file_url,
+      </if>
+      <if test="videoUrl != null" >
+        video_url,
+      </if>
+      <if test="fixedBudget != null" >
+        fixed_budget,
+      </if>
+      <if test="fixedCycle != null" >
+        fixed_cycle,
+      </if>
+      <if test="peopleNumber != null" >
+        people_number,
+      </if>
+      <if test="fixedScheme != null" >
+        fixed_scheme,
+      </if>
+      <if test="costEscrow != null" >
+        cost_escrow,
+      </if>
+      <if test="budgetCost != null" >
+        budget_cost,
+      </if>
+      <if test="validityPeriod != null" >
+        validity_period,
+      </if>
+      <if test="employerId != null" >
+        employer_id,
+      </if>
+      <if test="employerName != null" >
+        employer_name,
+      </if>
+      <if test="employerAddress != null" >
+        employer_address,
+      </if>
+      <if test="employerContacts != null" >
+        employer_contacts,
+      </if>
+      <if test="employerContactsMobile != null" >
+        employer_contacts_mobile,
+      </if>
+      <if test="employerContactsMailbox != null" >
+        employer_contacts_mailbox,
+      </if>
+      <if test="contacts != null" >
+        contacts,
+      </if>
+      <if test="status != null" >
+        status,
+      </if>
+      <if test="releaseStatus != null" >
+        release_status,
+      </if>
+      <if test="releaseDate != null" >
+        release_date,
+      </if>
+      <if test="createTime != null" >
+        create_time,
+      </if>
+      <if test="principalId != null" >
+        principal_id,
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNumber != null" >
+        #{serialNumber,jdbcType=INTEGER},
+      </if>
+      <if test="dataCategory != null" >
+        #{dataCategory,jdbcType=INTEGER},
+      </if>
+      <if test="name != null" >
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="keyword != null" >
+        #{keyword,jdbcType=VARCHAR},
+      </if>
+      <if test="infoSources != null" >
+        #{infoSources,jdbcType=INTEGER},
+      </if>
+      <if test="industryCategoryA != null" >
+        #{industryCategoryA,jdbcType=INTEGER},
+      </if>
+      <if test="industryCategoryB != null" >
+        #{industryCategoryB,jdbcType=INTEGER},
+      </if>
+      <if test="industryCategoryC != null" >
+        #{industryCategoryC,jdbcType=INTEGER},
+      </if>
+      <if test="demandType != null" >
+        #{demandType,jdbcType=INTEGER},
+      </if>
+      <if test="problemDes != null" >
+        #{problemDes,jdbcType=VARCHAR},
+      </if>
+      <if test="technicalRequirements != null" >
+        #{technicalRequirements,jdbcType=VARCHAR},
+      </if>
+      <if test="pictureUrl != null" >
+        #{pictureUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="textFileUrl != null" >
+        #{textFileUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="videoUrl != null" >
+        #{videoUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="fixedBudget != null" >
+        #{fixedBudget,jdbcType=DECIMAL},
+      </if>
+      <if test="fixedCycle != null" >
+        #{fixedCycle,jdbcType=VARCHAR},
+      </if>
+      <if test="peopleNumber != null" >
+        #{peopleNumber,jdbcType=INTEGER},
+      </if>
+      <if test="fixedScheme != null" >
+        #{fixedScheme,jdbcType=VARCHAR},
+      </if>
+      <if test="costEscrow != null" >
+        #{costEscrow,jdbcType=DECIMAL},
+      </if>
+      <if test="budgetCost != null" >
+        #{budgetCost,jdbcType=DECIMAL},
+      </if>
+      <if test="validityPeriod != null" >
+        #{validityPeriod,jdbcType=TIMESTAMP},
+      </if>
+      <if test="employerId != null" >
+        #{employerId,jdbcType=VARCHAR},
+      </if>
+      <if test="employerName != null" >
+        #{employerName,jdbcType=VARCHAR},
+      </if>
+      <if test="employerAddress != null" >
+        #{employerAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="employerContacts != null" >
+        #{employerContacts,jdbcType=VARCHAR},
+      </if>
+      <if test="employerContactsMobile != null" >
+        #{employerContactsMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="employerContactsMailbox != null" >
+        #{employerContactsMailbox,jdbcType=VARCHAR},
+      </if>
+      <if test="contacts != null" >
+        #{contacts,jdbcType=INTEGER},
+      </if>
+      <if test="status != null" >
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="releaseStatus != null" >
+        #{releaseStatus,jdbcType=INTEGER},
+      </if>
+      <if test="releaseDate != null" >
+        #{releaseDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="principalId != null" >
+        #{principalId,jdbcType=VARCHAR},
+      </if>
+      <if test="deletedSign != null" >
+        #{deletedSign,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Demand" >
+    update demand
+    <set >
+      <if test="serialNumber != null" >
+        serial_number = #{serialNumber,jdbcType=INTEGER},
+      </if>
+      <if test="dataCategory != null" >
+        data_category = #{dataCategory,jdbcType=INTEGER},
+      </if>
+      <if test="name != null" >
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="keyword != null" >
+        keyword = #{keyword,jdbcType=VARCHAR},
+      </if>
+      <if test="infoSources != null" >
+        info_sources = #{infoSources,jdbcType=INTEGER},
+      </if>
+      <if test="industryCategoryA != null" >
+        industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
+      </if>
+      <if test="industryCategoryB != null" >
+        industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
+      </if>
+      <if test="industryCategoryC != null" >
+        industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
+      </if>
+      <if test="demandType != null" >
+        demand_type = #{demandType,jdbcType=INTEGER},
+      </if>
+      <if test="problemDes != null" >
+        problem_des = #{problemDes,jdbcType=VARCHAR},
+      </if>
+      <if test="technicalRequirements != null" >
+        technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
+      </if>
+      <if test="pictureUrl != null" >
+        picture_url = #{pictureUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="textFileUrl != null" >
+        text_file_url = #{textFileUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="videoUrl != null" >
+        video_url = #{videoUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="fixedBudget != null" >
+        fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
+      </if>
+      <if test="fixedCycle != null" >
+        fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
+      </if>
+      <if test="peopleNumber != null" >
+        people_number = #{peopleNumber,jdbcType=INTEGER},
+      </if>
+      <if test="fixedScheme != null" >
+        fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
+      </if>
+      <if test="costEscrow != null" >
+        cost_escrow = #{costEscrow,jdbcType=DECIMAL},
+      </if>
+      <if test="budgetCost != null" >
+        budget_cost = #{budgetCost,jdbcType=DECIMAL},
+      </if>
+      <if test="validityPeriod != null" >
+        validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
+      </if>
+      <if test="employerId != null" >
+        employer_id = #{employerId,jdbcType=VARCHAR},
+      </if>
+      <if test="employerName != null" >
+        employer_name = #{employerName,jdbcType=VARCHAR},
+      </if>
+      <if test="employerAddress != null" >
+        employer_address = #{employerAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="employerContacts != null" >
+        employer_contacts = #{employerContacts,jdbcType=VARCHAR},
+      </if>
+      <if test="employerContactsMobile != null" >
+        employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
+      </if>
+      <if test="employerContactsMailbox != null" >
+        employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
+      </if>
+      <if test="contacts != null" >
+        contacts = #{contacts,jdbcType=INTEGER},
+      </if>
+      <if test="status != null" >
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="releaseStatus != null" >
+        release_status = #{releaseStatus,jdbcType=INTEGER},
+      </if>
+      <if test="releaseDate != null" >
+        release_date = #{releaseDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null" >
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="principalId != null" >
+        principal_id = #{principalId,jdbcType=VARCHAR},
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Demand" >
+    update demand
+    set serial_number = #{serialNumber,jdbcType=INTEGER},
+      data_category = #{dataCategory,jdbcType=INTEGER},
+      name = #{name,jdbcType=VARCHAR},
+      keyword = #{keyword,jdbcType=VARCHAR},
+      info_sources = #{infoSources,jdbcType=INTEGER},
+      industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
+      industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
+      industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
+      demand_type = #{demandType,jdbcType=INTEGER},
+      problem_des = #{problemDes,jdbcType=VARCHAR},
+      technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
+      picture_url = #{pictureUrl,jdbcType=VARCHAR},
+      text_file_url = #{textFileUrl,jdbcType=VARCHAR},
+      video_url = #{videoUrl,jdbcType=VARCHAR},
+      fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
+      fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
+      people_number = #{peopleNumber,jdbcType=INTEGER},
+      fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
+      cost_escrow = #{costEscrow,jdbcType=DECIMAL},
+      budget_cost = #{budgetCost,jdbcType=DECIMAL},
+      validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
+      employer_id = #{employerId,jdbcType=VARCHAR},
+      employer_name = #{employerName,jdbcType=VARCHAR},
+      employer_address = #{employerAddress,jdbcType=VARCHAR},
+      employer_contacts = #{employerContacts,jdbcType=VARCHAR},
+      employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
+      employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
+      contacts = #{contacts,jdbcType=INTEGER},
+      status = #{status,jdbcType=INTEGER},
+      release_status = #{releaseStatus,jdbcType=INTEGER},
+      release_date = #{releaseDate,jdbcType=TIMESTAMP},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      principal_id = #{principalId,jdbcType=VARCHAR},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  <select id="findManageUserDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
+  	select 
+	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, 
+	  d.name, d.keyword, d.info_sources as infoSources, 
+	  ui.username, d.demand_type as demandType, d.validity_period as validityPeriod, 
+	  d.employer_name as employerName, ui.province, d.status, 
+	  d.release_status as releaseStatus, d.release_date as releaseDate, a.name as principalId
+	from  demand d 
+	LEFT JOIN user_identity ui on d.principal_id = ui.uid
+	LEFT JOIN admin a on a.id = d.principal_id
+	<if test="mid != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	where d.deleted_sign = 0 and d.data_category = 0 
+	<if test="mid != null">
+		and u.mid = #{mid,jdbcType=VARCHAR}
+	</if>
+	<if test="principal != null">
+		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	</if>
+	<if test="province != null">
+		and  ui.province = #{province,jdbcType=VARCHAR}
+	</if>
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  d.name = #{name,jdbcType=VARCHAR}
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="username != null">
+		and  ui.username = #{username,jdbcType=VARCHAR}
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=VARCHAR}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=INTEGER}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+  	order by d.serial_number desc
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
+  		select 
+	 count(1)
+	from  demand d 
+	LEFT JOIN user_identity ui on d.principal_id = ui.uid
+	LEFT JOIN admin a on a.id = d.principal_id
+	<if test="mid != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	where d.deleted_sign = 0 and d.data_category = 0 
+	<if test="mid != null">
+		and u.mid = #{mid,jdbcType=VARCHAR}
+	</if>
+	<if test="principal != null">
+		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	</if>
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="province != null">
+		and  ui.province = #{province,jdbcType=VARCHAR}
+	</if>
+	<if test="name != null">
+		and  d.name = #{name,jdbcType=VARCHAR}
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="username != null">
+		and  ui.username = #{username,jdbcType=VARCHAR}
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=VARCHAR}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=INTEGER}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+  </select>
+  
+   <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
+  	select 
+	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, 
+	  d.name, d.keyword, d.info_sources as infoSources, 
+	  oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod, 
+	  d.employer_name as employerName, oi.licence_province as province, d.status, 
+	  d.release_status as releaseStatus, d.release_date as releaseDate, a.name as principalId
+	from  demand d 
+	LEFT JOIN organization_identity oi on d.principal_id = oi.uid
+	LEFT JOIN admin a on a.id = d.principal_id
+	<if test="mid != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	where d.deleted_sign = 0 and d.data_category = 1 
+	<if test="mid != null">
+		and u.mid = #{mid,jdbcType=VARCHAR}
+	</if>
+	<if test="principal != null">
+		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	</if>
+	<if test="province != null">
+		and  oi.licence_province = #{province,jdbcType=VARCHAR}
+	</if>
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  d.name = #{name,jdbcType=VARCHAR}
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="username != null">
+		and  oi.unit_name = #{username,jdbcType=VARCHAR}
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=VARCHAR}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+  	order by d.serial_number desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
+  		select 
+	 count(1)
+	from  demand d 
+	LEFT JOIN organization_identity oi on d.principal_id = oi.uid
+	LEFT JOIN admin a on a.id = d.principal_id
+	<if test="mid != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	where d.deleted_sign = 0 and d.data_category = 1
+	<if test="mid != null">
+		and u.mid = #{mid,jdbcType=VARCHAR}
+	</if>
+	<if test="principal != null">
+		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	</if>
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="province != null">
+		and  oi.licence_province = #{province,jdbcType=VARCHAR}
+	</if>
+	<if test="name != null">
+		and  d.name = #{name,jdbcType=VARCHAR}
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="username != null">
+		and  oi.unit_name = #{username,jdbcType=VARCHAR}
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=VARCHAR}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+  </select>
+  
+</mapper>

+ 499 - 0
src/main/java/com/goafanti/common/model/Demand.java

@@ -0,0 +1,499 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class Demand {
+    private String id;
+
+    /**
+    * 编号
+    */
+    private Integer serialNumber;
+
+    /**
+    * 数据类别(0-个人需求,1-单位需求)
+    */
+    private Integer dataCategory;
+
+    /**
+    * 名称
+    */
+    private String name;
+
+    /**
+    * 关键词
+    */
+    private String keyword;
+
+    /**
+    * 信息来源(0-平台采集,1-客户发布)
+    */
+    private Integer infoSources;
+
+    /**
+    * 行业类别下拉A
+    */
+    private Integer industryCategoryA;
+
+    /**
+    * 行业类别下拉B
+    */
+    private Integer industryCategoryB;
+
+    /**
+    * 行业类别下拉C
+    */
+    private Integer industryCategoryC;
+
+    /**
+    * 需求类型
+    */
+    private Integer demandType;
+
+    /**
+    * 问题说明
+    */
+    private String problemDes;
+
+    /**
+    * 技术指标要求
+    */
+    private String technicalRequirements;
+
+    /**
+    * 需求文件--图片URL
+    */
+    private String pictureUrl;
+
+    /**
+    * 需求文件--文本文件
+    */
+    private String textFileUrl;
+
+    /**
+    * 需求文件--视屏文件URL
+    */
+    private String videoUrl;
+
+    /**
+    * 固定预算
+    */
+    private BigDecimal fixedBudget;
+
+    /**
+    * 固定周期
+    */
+    private String fixedCycle;
+
+    /**
+    * 固定人数
+    */
+    private Integer peopleNumber;
+
+    /**
+    * 固定方案
+    */
+    private String fixedScheme;
+
+    /**
+    * 费用托管
+    */
+    private BigDecimal costEscrow;
+
+    /**
+    * 预算费用
+    */
+    private BigDecimal budgetCost;
+
+    /**
+    * 有效期限
+    */
+    private Date validityPeriod;
+
+    /**
+    * 雇主客户ID
+    */
+    private String employerId;
+
+    /**
+    * 雇主名称
+    */
+    private String employerName;
+
+    /**
+    * 雇主地址
+    */
+    private String employerAddress;
+
+    /**
+    * 雇主联系人名称
+    */
+    private String employerContacts;
+
+    /**
+    * 雇主联系人电话
+    */
+    private String employerContactsMobile;
+
+    /**
+    * 雇主联系人邮箱
+    */
+    private String employerContactsMailbox;
+
+    /**
+    * 联系人&联系方式
+    */
+    private Integer contacts;
+
+    /**
+    * 需求状态(0-进行中,1-未解决,2-已解决)
+    */
+    private Integer status;
+
+    /**
+    * 是否发布(0-未发布,1-发布)
+    */
+    private Integer releaseStatus;
+
+    /**
+    * 发布时间
+    */
+    private Date releaseDate;
+
+    /**
+    * 需求记录创建时间
+    */
+    private Date createTime;
+
+    /**
+    * 负责人(营销员)
+    */
+    private String principalId;
+
+    /**
+    * 删除标记
+    */
+    private Integer deletedSign;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(Integer serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getDataCategory() {
+        return dataCategory;
+    }
+
+    public void setDataCategory(Integer dataCategory) {
+        this.dataCategory = dataCategory;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getKeyword() {
+        return keyword;
+    }
+
+    public void setKeyword(String keyword) {
+        this.keyword = keyword;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getInfoSources() {
+        return infoSources;
+    }
+
+    public void setInfoSources(Integer infoSources) {
+        this.infoSources = infoSources;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getIndustryCategoryA() {
+        return industryCategoryA;
+    }
+
+    public void setIndustryCategoryA(Integer industryCategoryA) {
+        this.industryCategoryA = industryCategoryA;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getIndustryCategoryB() {
+        return industryCategoryB;
+    }
+
+    public void setIndustryCategoryB(Integer industryCategoryB) {
+        this.industryCategoryB = industryCategoryB;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getIndustryCategoryC() {
+        return industryCategoryC;
+    }
+
+    public void setIndustryCategoryC(Integer industryCategoryC) {
+        this.industryCategoryC = industryCategoryC;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getDemandType() {
+        return demandType;
+    }
+
+    public void setDemandType(Integer demandType) {
+        this.demandType = demandType;
+    }
+
+    public String getProblemDes() {
+        return problemDes;
+    }
+
+    public void setProblemDes(String problemDes) {
+        this.problemDes = problemDes;
+    }
+
+    public String getTechnicalRequirements() {
+        return technicalRequirements;
+    }
+
+    public void setTechnicalRequirements(String technicalRequirements) {
+        this.technicalRequirements = technicalRequirements;
+    }
+
+    public String getPictureUrl() {
+        return pictureUrl;
+    }
+
+    public void setPictureUrl(String pictureUrl) {
+        this.pictureUrl = pictureUrl;
+    }
+
+    public String getTextFileUrl() {
+        return textFileUrl;
+    }
+
+    public void setTextFileUrl(String textFileUrl) {
+        this.textFileUrl = textFileUrl;
+    }
+
+    public String getVideoUrl() {
+        return videoUrl;
+    }
+
+    public void setVideoUrl(String videoUrl) {
+        this.videoUrl = videoUrl;
+    }
+
+    public BigDecimal getFixedBudget() {
+        return fixedBudget;
+    }
+
+    public void setFixedBudget(BigDecimal fixedBudget) {
+        this.fixedBudget = fixedBudget;
+    }
+
+    public String getFixedCycle() {
+        return fixedCycle;
+    }
+
+    public void setFixedCycle(String fixedCycle) {
+        this.fixedCycle = fixedCycle;
+    }
+
+    public Integer getPeopleNumber() {
+        return peopleNumber;
+    }
+
+    public void setPeopleNumber(Integer peopleNumber) {
+        this.peopleNumber = peopleNumber;
+    }
+
+    public String getFixedScheme() {
+        return fixedScheme;
+    }
+
+    public void setFixedScheme(String fixedScheme) {
+        this.fixedScheme = fixedScheme;
+    }
+
+    public BigDecimal getCostEscrow() {
+        return costEscrow;
+    }
+
+    public void setCostEscrow(BigDecimal costEscrow) {
+        this.costEscrow = costEscrow;
+    }
+
+    public BigDecimal getBudgetCost() {
+        return budgetCost;
+    }
+
+    public void setBudgetCost(BigDecimal budgetCost) {
+        this.budgetCost = budgetCost;
+    }
+
+    public Date getValidityPeriod() {
+        return validityPeriod;
+    }
+
+    public void setValidityPeriod(Date validityPeriod) {
+        this.validityPeriod = validityPeriod;
+    }
+
+    public String getEmployerId() {
+        return employerId;
+    }
+
+    public void setEmployerId(String employerId) {
+        this.employerId = employerId;
+    }
+
+    public String getEmployerName() {
+        return employerName;
+    }
+
+    public void setEmployerName(String employerName) {
+        this.employerName = employerName;
+    }
+
+    public String getEmployerAddress() {
+        return employerAddress;
+    }
+
+    public void setEmployerAddress(String employerAddress) {
+        this.employerAddress = employerAddress;
+    }
+
+    public String getEmployerContacts() {
+        return employerContacts;
+    }
+
+    public void setEmployerContacts(String employerContacts) {
+        this.employerContacts = employerContacts;
+    }
+
+    public String getEmployerContactsMobile() {
+        return employerContactsMobile;
+    }
+
+    public void setEmployerContactsMobile(String employerContactsMobile) {
+        this.employerContactsMobile = employerContactsMobile;
+    }
+
+    public String getEmployerContactsMailbox() {
+        return employerContactsMailbox;
+    }
+
+    public void setEmployerContactsMailbox(String employerContactsMailbox) {
+        this.employerContactsMailbox = employerContactsMailbox;
+    }
+
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(Integer contacts) {
+        this.contacts = contacts;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+    
+    @JsonFormat(shape = Shape.STRING)
+    public Integer getReleaseStatus() {
+		return releaseStatus;
+	}
+
+	public void setReleaseStatus(Integer releaseStatus) {
+		this.releaseStatus = releaseStatus;
+	}
+
+	public Date getReleaseDate() {
+        return releaseDate;
+    }
+
+    public void setReleaseDate(Date releaseDate) {
+        this.releaseDate = releaseDate;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getPrincipalId() {
+        return principalId;
+    }
+
+    public void setPrincipalId(String principalId) {
+        this.principalId = principalId;
+    }
+    
+    @JsonIgnore
+    public Integer getDeletedSign() {
+        return deletedSign;
+    }
+
+    public void setDeletedSign(Integer deletedSign) {
+        this.deletedSign = deletedSign;
+    }
+    
+    public String getValidityPeriodFormattedDate() {
+		if (this.validityPeriod == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getValidityPeriod(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setValidityPeriodFormattedDate(String validityPeriodFormattedDate) {
+
+	}
+	
+	public String getReleaseDateFormattedDate() {
+		if (this.releaseDate == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setReleaseDateFormattedDate(String releaseDateFormattedDate) {
+
+	}
+}

+ 218 - 0
src/main/java/com/goafanti/demand/bo/DemandManageListBo.java

@@ -0,0 +1,218 @@
+package com.goafanti.demand.bo;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+
+public class DemandManageListBo {
+
+	private String	id;
+
+	/**
+	 * 编号
+	 */
+	private Integer	serialNumber;
+
+	/**
+	 * 数据类别(0-个人需求,1-单位需求)
+	 */
+	private Integer	dataCategory;
+
+	/**
+	 * 名称
+	 */
+	private String	name;
+
+	/**
+	 * 关键词
+	 */
+	private String	keyword;
+
+	/**
+	 * 信息来源(0-平台采集,1-客户发布)
+	 */
+	private Integer	infoSources;
+
+	private String	username;
+
+	/**
+	 * 需求类型
+	 */
+	private Integer	demandType;
+
+	private Date	validityPeriod;
+
+	private String	employerName;
+
+	private String	province;
+
+	private Integer	status;
+
+	/**
+	 * 是否发布(0-未发布,1-发布)
+	 */
+	private Integer	releaseStatus;
+
+	/**
+	 * 发布时间
+	 */
+	private Date	releaseDate;
+
+	/**
+	 * 负责人(营销员)
+	 */
+	private String	principalId;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	public Integer getDataCategory() {
+		return dataCategory;
+	}
+
+	public void setDataCategory(Integer dataCategory) {
+		this.dataCategory = dataCategory;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getKeyword() {
+		return keyword;
+	}
+
+	public void setKeyword(String keyword) {
+		this.keyword = keyword;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getInfoSources() {
+		return infoSources;
+	}
+
+	public void setInfoSources(Integer infoSources) {
+		this.infoSources = infoSources;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getDemandType() {
+		return demandType;
+	}
+
+	public void setDemandType(Integer demandType) {
+		this.demandType = demandType;
+	}
+
+	public Date getValidityPeriod() {
+		return validityPeriod;
+	}
+
+	public void setValidityPeriod(Date validityPeriod) {
+		this.validityPeriod = validityPeriod;
+	}
+
+	public String getEmployerName() {
+		return employerName;
+	}
+
+	public void setEmployerName(String employerName) {
+		this.employerName = employerName;
+	}
+
+	public String getProvince() {
+		return province;
+	}
+
+	public void setProvince(String province) {
+		this.province = province;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getReleaseStatus() {
+		return releaseStatus;
+	}
+
+	public void setReleaseStatus(Integer releaseStatus) {
+		this.releaseStatus = releaseStatus;
+	}
+
+	public Date getReleaseDate() {
+		return releaseDate;
+	}
+
+	public void setReleaseDate(Date releaseDate) {
+		this.releaseDate = releaseDate;
+	}
+
+	public String getPrincipalId() {
+		return principalId;
+	}
+
+	public void setPrincipalId(String principalId) {
+		this.principalId = principalId;
+	}
+
+	public String getValidityPeriodFormattedDate() {
+		if (this.validityPeriod == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getValidityPeriod(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setValidityPeriodFormattedDate(String validityPeriodFormattedDate) {
+
+	}
+
+	public String getReleaseDateFormattedDate() {
+		if (this.releaseDate == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setReleaseDateFormattedDate(String releaseDateFormattedDate) {
+
+	}
+
+}

+ 18 - 0
src/main/java/com/goafanti/demand/service/DemandService.java

@@ -0,0 +1,18 @@
+package com.goafanti.demand.service;
+
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.demand.bo.DemandManageListBo;
+
+public interface DemandService {
+
+	Pagination<DemandManageListBo> selectUserDemandManageList(String province, Integer serialNumber, String name, String keyword,
+			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
+			String employerName, Integer status, Integer releaseStatus, String releaseDateStartDate,
+			String releaseDateEndDate, Integer pNo, Integer pSize);
+
+	Pagination<DemandManageListBo> selectOrgDemandManageList(String province, Integer serialNumber, String name,
+			String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
+			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus, String releaseDateStartDate,
+			String releaseDateEndDate, Integer pNo, Integer pSize);
+
+}

+ 251 - 0
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -0,0 +1,251 @@
+package com.goafanti.demand.service.impl;
+
+import java.text.ParseException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.DemandMapper;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.contract.bo.ContractManageListBo;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.bo.DemandManageListBo;
+import com.goafanti.demand.service.DemandService;
+
+@Service
+public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements DemandService {
+	@Autowired
+	private DemandMapper demandMapper;
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandManageListBo> selectUserDemandManageList(String province, Integer serialNumber, String name, String keyword,
+			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
+			String username, Integer status, Integer releaseStatus, String releaseDateStartDate,
+			String releaseDateEndDate, Integer pNo, Integer pSize) {
+		Map<String, Object> params = new HashMap<>();
+		Date vStart = null;
+		Date vEnd = null;
+		Date rStart = null;
+		Date rEnd = null;
+
+		if (!StringUtils.isBlank(validityPeriodStartDate)) {
+			try {
+				vStart = DateUtils.parseDate(validityPeriodStartDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (!StringUtils.isBlank(validityPeriodEndDate)) {
+			try {
+				vEnd = DateUtils.parseDate(validityPeriodEndDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (!StringUtils.isBlank(releaseDateStartDate)) {
+			try {
+				rStart = DateUtils.parseDate(releaseDateStartDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (!StringUtils.isBlank(releaseDateEndDate)) {
+			try {
+				rEnd = DateUtils.parseDate(releaseDateEndDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (null != vStart) {
+			params.put("vStart", vStart);
+		}
+
+		if (null != vEnd) {
+			params.put("vEnd", vEnd);
+		}
+
+		if (null != rStart) {
+			params.put("rStart", rStart);
+		}
+
+		if (null != rEnd) {
+			params.put("rEnd", rEnd);
+		}
+		
+		if (!StringUtils.isBlank(province)){
+			params.put("province", province);
+		}
+
+		if (null != serialNumber) {
+			params.put("serialNumber", serialNumber);
+		}
+
+		if (!StringUtils.isBlank(name)) {
+			params.put("name", name);
+		}
+
+		if (!StringUtils.isBlank(keyword)) {
+			params.put("keyword", keyword);
+		}
+
+		if (!StringUtils.isBlank(username)) {
+			params.put("username", username);
+		}
+
+		if (null != infoSources) {
+			params.put("infoSources", infoSources);
+		}
+
+		if (null != demandType) {
+			params.put("demandType", demandType);
+		}
+
+		if (null != status) {
+			params.put("status", status);
+		}
+
+		if (null != releaseStatus) {
+			params.put("releaseStatus", releaseStatus);
+		}
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0) {
+			pSize = 10;
+		}
+
+		if (TokenManager.hasRole(AFTConstants.SALESMANAGERADMIN) || TokenManager.hasRole(AFTConstants.SALESMANADMIN)) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
+		if (TokenManager.hasRole(AFTConstants.MANAGERADMIN)){
+			params.put("mid", TokenManager.getAdminId());
+		}
+
+		return (Pagination<DemandManageListBo>) findPage("findManageUserDemandListByPage", "findManageUserDemandCount",
+				params, pNo, pSize);
+
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandManageListBo> selectOrgDemandManageList(String province, Integer serialNumber, String name,
+			String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
+			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus, String releaseDateStartDate,
+			String releaseDateEndDate, Integer pNo, Integer pSize) {
+		Map<String, Object> params = new HashMap<>();
+		Date vStart = null;
+		Date vEnd = null;
+		Date rStart = null;
+		Date rEnd = null;
+
+		if (!StringUtils.isBlank(validityPeriodStartDate)) {
+			try {
+				vStart = DateUtils.parseDate(validityPeriodStartDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (!StringUtils.isBlank(validityPeriodEndDate)) {
+			try {
+				vEnd = DateUtils.parseDate(validityPeriodEndDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (!StringUtils.isBlank(releaseDateStartDate)) {
+			try {
+				rStart = DateUtils.parseDate(releaseDateStartDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (!StringUtils.isBlank(releaseDateEndDate)) {
+			try {
+				rEnd = DateUtils.parseDate(releaseDateEndDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (null != vStart) {
+			params.put("vStart", vStart);
+		}
+
+		if (null != vEnd) {
+			params.put("vEnd", vEnd);
+		}
+
+		if (null != rStart) {
+			params.put("rStart", rStart);
+		}
+
+		if (null != rEnd) {
+			params.put("rEnd", rEnd);
+		}
+		
+		if (!StringUtils.isBlank(province)){
+			params.put("province", province);
+		}
+
+		if (null != serialNumber) {
+			params.put("serialNumber", serialNumber);
+		}
+
+		if (!StringUtils.isBlank(name)) {
+			params.put("name", name);
+		}
+
+		if (!StringUtils.isBlank(keyword)) {
+			params.put("keyword", keyword);
+		}
+
+		if (!StringUtils.isBlank(username)) {
+			params.put("username", username);
+		}
+
+		if (null != infoSources) {
+			params.put("infoSources", infoSources);
+		}
+
+		if (null != demandType) {
+			params.put("demandType", demandType);
+		}
+
+		if (null != status) {
+			params.put("status", status);
+		}
+
+		if (null != releaseStatus) {
+			params.put("releaseStatus", releaseStatus);
+		}
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0) {
+			pSize = 10;
+		}
+
+		if (TokenManager.hasRole(AFTConstants.SALESMANAGERADMIN) || TokenManager.hasRole(AFTConstants.SALESMANADMIN)) {
+			params.put("principal", TokenManager.getAdminId());
+		}
+		
+		if (TokenManager.hasRole(AFTConstants.MANAGERADMIN)){
+			params.put("mid", TokenManager.getAdminId());
+		}
+
+		return (Pagination<DemandManageListBo>) findPage("findManageOrgDemandListByPage", "findManageOrgDemandCount",
+				params, pNo, pSize);
+	}
+}