Browse Source

Merge remote-tracking branch 'origin/master' into test

Michael 8 years ago
parent
commit
b765f807be

+ 3 - 0
src/main/java/com/goafanti/achievement/bo/AchievementUserOwnerDetailBo.java

@@ -4,6 +4,8 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import com.goafanti.common.utils.StringUtils;
+
 public class AchievementUserOwnerDetailBo extends AchievementOrgOwnerDetailBo {
 	
 	private Integer province;
@@ -105,6 +107,7 @@ public class AchievementUserOwnerDetailBo extends AchievementOrgOwnerDetailBo {
 	}
 
 	public String getCountInterest() {
+		if (StringUtils.isBlank(CountInterest)) CountInterest = "0";
 		return String.valueOf(Integer.valueOf(CountInterest)+20);
 	}
 

+ 56 - 4
src/main/java/com/goafanti/achievement/controller/AdminAchievementApiController.java

@@ -26,6 +26,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.AchievementFields;
 import com.goafanti.common.enums.AchievementImportFields;
@@ -57,6 +58,8 @@ public class AdminAchievementApiController extends CertifyApiController {
     private AchievementOrderService	achievementOrderService;
     @Resource
     private MarketingManagementService marketingManagementService;
+    @Resource
+    private AdminMapper adminMapper;
     /**
      * 个人成果列表
      */
@@ -80,7 +83,7 @@ public class AdminAchievementApiController extends CertifyApiController {
         return res;
     }
     /**
-     * 组织用户成果列表
+     * 组织用户成果列表(个人组织合并)
      */
     @RequestMapping(value = "/orgList", method = RequestMethod.GET)
     private Result orgList(Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber, String name,
@@ -142,16 +145,20 @@ public class AdminAchievementApiController extends CertifyApiController {
         return res;
     }
     /**
-     * 组织用户成果详情详情
+     * 组织用户成果详情详情(个人组织合并)
      */
     @RequestMapping(value = "/orgDetail", method = RequestMethod.GET)
-    private Result orgDetail(String id) {
+    private Result orgDetail(String id,int ownerType) {
         Result res = new Result();
         if (StringUtils.isBlank(id)) {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
             return res;
         }
-        res.setData(achievementService.selectOrgOwnerDetail(id));
+        if(ownerType==0){
+        	res.setData(achievementService.selectUserOwnerDetail(id));
+        }else if(ownerType==1){
+        	res.setData(achievementService.selectOrgOwnerDetail(id));
+        }       
         return res;
     }
     /**
@@ -629,4 +636,49 @@ public class AdminAchievementApiController extends CertifyApiController {
         res.setData(data);
         return res;
     }
+    /**
+     * 我的成果列表
+     */
+    @RequestMapping(value = "/myList", method = RequestMethod.GET)
+    private Result myList(Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber, String name,
+            String keyword, Integer category, Integer status, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate,
+            Integer releaseStatus,String internationalFlag, String pageNo, String pageSize,Integer boutique,Integer hot) {
+        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);
+        }
+        String techBrokerId=TokenManager.getAdminId();
+        Object o = achievementService.listMyAchievement(techBrokerId,ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name,
+                keyword, category, status, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus,internationalFlag, pNo, pSize,boutique,hot);
+        res.setData(o);     
+        return res;
+    }
+    
+    /**
+     * 科技成果管理列表
+     */
+    @RequestMapping(value = "/manageList", method = RequestMethod.GET)
+    private Result manageList(Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber, String name,
+            String keyword, Integer category, Integer status, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate,
+            Integer releaseStatus,String internationalFlag, String pageNo, String pageSize,Integer boutique,Integer hot) {
+        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);
+        }
+        String techBrokerId=TokenManager.getAdminId();
+        Object o = achievementService.listManageAchievement(techBrokerId,ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name,
+                keyword, category, status, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus,internationalFlag, pNo, pSize,boutique,hot);
+        res.setData(o);     
+        return res;
+    }
 }

+ 7 - 1
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -93,7 +93,13 @@ public interface AchievementService {
 	Pagination<AchievementPartnerListBo> listAppMyAchievement(Integer pNo, Integer pSize);
 
 	AchievementUserOwnerDetailBo selectAppUserOwnerDetail(String id);
-
 	
+	Pagination<AchievementListBo> listMyAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber,
+			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
+			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus,String internationalFlag, Integer pNo, Integer pSize,Integer boutique,Integer hot);
+
+	Pagination<AchievementListBo> listManageAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber,
+			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
+			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus,String internationalFlag, Integer pNo, Integer pSize,Integer boutique,Integer hot);
 	
 }

+ 50 - 0
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -758,5 +758,55 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		return (Pagination<AchievementPartnerListBo>) findPage("findMyAchievementListByPage", "findMyAchievementCount",
 				params,pNo, pSize);
 	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AchievementListBo> listMyAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId,
+			Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
+			String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus, String internationalFlag,Integer pNo, Integer pSize,
+			Integer boutique, Integer hot) {
+		Map<String, Object> params = disposeParams(ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
+				boutique,internationalFlag, hot);
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+		
+		return (Pagination<AchievementListBo>) findPage("findManageAchievementListByPage",
+				"findManageAchievementCount",params,pNo, pSize);
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AchievementListBo> listManageAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId,
+			Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
+			String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus, String internationalFlag,Integer pNo, Integer pSize,
+			Integer boutique, Integer hot) {
+		Map<String, Object> params = disposeParams(ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
+				boutique,internationalFlag, hot);
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+		
+		return (Pagination<AchievementListBo>) findPage("findManageAchievementListByPage",
+				"findManageAchievementCount",params,pNo, pSize);
+	}
 
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -89,5 +89,7 @@ public interface AdminMapper {
 	String selectUserNoById(String superiorId);
 	
 	int updateByUserNo(Admin record);
+	
+	List<String>selectIdBySuperiorId(String superiorId);
 
 }

+ 166 - 0
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1804,5 +1804,171 @@
   	</if>
   	</select>
   	
+  	<select id="findManageAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
+  	select 
+  		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
+  		a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType, 
+  		<!-- oi.unit_name as username,  -->a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
+  		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
+  	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	</if>
+	<if test="hot != null and hot == 0"><!-- 无首页参数 -->
+		,0 as hot
+	</if>
+	<if test="hot==null"><!-- 在首页 -->
+		,ifnull(mm.effective,0) as hot
+	</if>
+  	from achievement a
+  	LEFT JOIN admin ad on ad.id = a.tech_broker_id
+  	LEFT JOIN department_management dm on dm.id = ad.department_id
+	<!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
+	<if test="adminId != null">
+		LEFT JOIN user u on a.owner_id = u.id
+	</if>
+  	<if test="hot != null and hot == 1"> <!-- 在首页 -->
+		inner join marketing_management mm on a.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
+  	where a.deleted_sign = 0 
+  	<if test="ownerType != null">
+		and a.owner_type = #{ownerType,jdbcType=VARCHAR}
+	</if>
+  	<if test="techBrokerId != null">
+		and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
+	</if>
+  	<if test="ownerName != null">
+  		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%') 	
+  	</if>
+  	<!-- <if test="unitName != null">
+  		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+  	</if> -->
+  	<if test="ownerId != null">
+		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
+	</if>
+  	<if test="serialNumber != null">
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  a.category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="releaseStatus != null">
+	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
+	</if>
+	
+	<if test="boutique != null">
+		and a.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+	order by serial_number desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="findManageAchievementCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from achievement a
+  	LEFT JOIN admin ad on ad.id = a.tech_broker_id
+  	LEFT JOIN department_management dm on dm.id = ad.department_id
+	<!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
+	<if test="adminId != null">
+		LEFT JOIN user u on a.owner_id = u.id
+	</if>
+  	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on a.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
+  	where a.deleted_sign = 0 
+  	<if test="ownerType != null">
+		and a.owner_type = #{ownerType,jdbcType=VARCHAR}
+	</if>
+  	<if test="techBrokerId != null">
+		and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
+	</if>
+  	<if test="ownerName != null">
+  		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
+  	</if>
+  	<!-- <if test="unitName != null">
+  		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+  	</if> -->
+  	<if test="ownerId != null">
+		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
+	</if>
+  	<if test="serialNumber != null">
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  a.category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="releaseStatus != null">
+	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
+	</if>
+	
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and  mm.effective = 1
+	</if>
+  </select>
   	
 </mapper>

+ 7 - 1
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -565,5 +565,11 @@
 	set user_no = #{userNo,jdbcType=VARCHAR}
 	where
 	id=#{id,jdbcType=VARCHAR}  
-  </update>
+  </update>
+  <select id="selectIdBySuperiorId" parameterType="java.lang.String" resultType="java.lang.String">
+	select id
+	from admin
+	where
+	superior_id=#{superiorId,jdbcType=VARCHAR}
+  </select>
 </mapper>

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

@@ -1704,4 +1704,424 @@
 	left join business_project  b on t.project_id=b.id
 	where  t.uid=#{uid,jdbcType=VARCHAR}
 	</select>
+	
+  <select id="findMyDemandListByPage" 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.urgent_days as urgentDays,d.urgent_money as urgentMoney,
+	  d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
+	  d.employer_id as employerId, d.audit_status as auditStatus,
+	  d.tech_broker_id as techBrokerId,d.boutique
+	 <if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	 </if>
+	 <if test="hot != null and hot == 0"><!-- 不在首页 -->
+		,0 as hot
+	 </if>
+	 <if test="hot==null"><!-- 无首页参数 -->
+		,ifnull(mm.effective,0) as hot
+	 </if>
+	from  demand d 
+	<!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
+	LEFT JOIN admin a on a.id = d.tech_broker_id
+	<if test="adminId != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+	</if>
+	<if test="dataCategory != null">
+		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		and (u.mid = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
+		)
+	</if>
+	<!-- <if test="province != null">
+		and  oi.licence_province = #{province,jdbcType=INTEGER}
+	</if> -->
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
+	</if>
+	<!-- <if test="unitName != null">
+		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+	</if> -->
+	<if test="employerName != null">
+		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
+		and  (d.employer_id is null or d.employer_id='')
+	</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=INTEGER}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![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>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  	order by d.serial_number desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id ="findMyDemandCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+	count(1)
+	from  demand d 
+	<!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
+	LEFT JOIN admin a on a.id = d.tech_broker_id
+	<if test="adminId != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+	</if>
+	<if test="dataCategory != null">
+		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		and (u.mid = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
+		)
+	</if>
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<!-- <if test="province != null">
+		and  oi.licence_province = #{province,jdbcType=INTEGER}
+	</if> -->
+	<if test="name != null">
+		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<!-- <if test="unitName != null">
+		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+	</if> -->
+	<if test="employerName != null">
+		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
+		and  (d.employer_id is null or d.employer_id='')
+	</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_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![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>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  </select>
+  
+  <select id="findManageDemandListByPage" 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.urgent_days as urgentDays,d.urgent_money as urgentMoney,
+	  d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
+	  d.employer_id as employerId, d.audit_status as auditStatus,
+	  d.tech_broker_id as techBrokerId,d.boutique
+	 <if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	 </if>
+	 <if test="hot != null and hot == 0"><!-- 不在首页 -->
+		,0 as hot
+	 </if>
+	 <if test="hot==null"><!-- 无首页参数 -->
+		,ifnull(mm.effective,0) as hot
+	 </if>
+	from  demand d 
+	<!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
+	LEFT JOIN admin a on a.id = d.tech_broker_id
+	LEFT JOIN department_management dm on dm.id = a.department_id
+	<if test="adminId != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
+	</if>
+	<if test="dataCategory != null">
+		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		and (u.mid = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
+		)
+	</if>
+	<!-- <if test="province != null">
+		and  oi.licence_province = #{province,jdbcType=INTEGER}
+	</if> -->
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
+	</if>
+	<!-- <if test="unitName != null">
+		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+	</if> -->
+	<if test="employerName != null">
+		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
+		and  (d.employer_id is null or d.employer_id='')
+	</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=INTEGER}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![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>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  	order by d.serial_number desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id ="findManagegDemandCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+	count(1)
+	from  demand d 
+	<!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
+	LEFT JOIN admin a on a.id = d.tech_broker_id
+	LEFT JOIN department_management dm on dm.id = a.department_id
+	<if test="adminId != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
+	</if>
+	<if test="dataCategory != null">
+		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		and (u.mid = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
+	</if>
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
+		)
+	</if>
+	<if test="serialNumber != null">
+		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<!-- <if test="province != null">
+		and  oi.licence_province = #{province,jdbcType=INTEGER}
+	</if> -->
+	<if test="name != null">
+		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<!-- <if test="unitName != null">
+		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+	</if> -->
+	<if test="employerName != null">
+		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
+		and  (d.employer_id is null or d.employer_id='')
+	</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_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![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>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  </select>
 </mapper>

+ 58 - 5
src/main/java/com/goafanti/demand/controller/AdminDemandApiController.java

@@ -214,7 +214,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 组织用户--需求列表
+	 * 组织用户--需求列表(个人组织合并)
 	 */
 	@RequestMapping(value = "/orgList", method = RequestMethod.GET)
 	public Result orgList(Integer dataCategory,String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
@@ -307,18 +307,23 @@ public class AdminDemandApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 组织用户详情
+	 * 组织用户详情(个人组织合并)
 	 */
 	@RequestMapping(value = "/orgDemandDetail", method = RequestMethod.GET)
-	public Result orgDemandDetail(String id) {
+	public Result orgDemandDetail(String id,int dataCategory) {
 		Result res = new Result();
 
 		if (StringUtils.isBlank(id)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
 			return res;
 		}
-
-		res.setData(demandService.selectOrgDemandDetail(id));
+		if(dataCategory==0){
+			res.setData(demandService.selectUserDemandDetail(id));
+			return res;
+		}else if(dataCategory==1){
+			res.setData(demandService.selectOrgDemandDetail(id));
+			return res;
+		}
 		return res;
 	}
 
@@ -652,5 +657,53 @@ public class AdminDemandApiController extends CertifyApiController {
 		res.setData(data);
 		return res;
 	}
+	
+	/**
+	 * 我的需求列表
+	 */
+	@RequestMapping(value = "/myList", method = RequestMethod.GET)
+	public Result myList(Integer dataCategory,String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
+			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
+			String unitName, Integer status, Integer releaseStatus, String releaseDateStartDate,
+			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, String pageNo, String pageSize,Integer boutique,Integer hot) {
+		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.selectMyDemandManageList(dataCategory,employerName, auditStatus, province, serialNumber, name, keyword,
+				infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate, unitName, status,
+				releaseStatus, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, pNo, pSize,boutique,hot,TokenManager.getAdminId()));
+		return res;
+	}
+	
+	/**
+	 * 我的需求列表
+	 */
+	@RequestMapping(value = "/manageList", method = RequestMethod.GET)
+	public Result manageList(Integer dataCategory,String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
+			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
+			String unitName, Integer status, Integer releaseStatus, String releaseDateStartDate,
+			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, String pageNo, String pageSize,Integer boutique,Integer hot) {
+		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.selectManageDemandManageList(dataCategory,employerName, auditStatus, province, serialNumber, name, keyword,
+				infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate, unitName, status,
+				releaseStatus, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, pNo, pSize,boutique,hot,TokenManager.getAdminId()));
+		return res;
+	}
 
 }

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

@@ -94,5 +94,13 @@ public interface DemandService {
 
 	Pagination<DemandSearchListBo> listMyDemand(Integer pNo, Integer pSize);
 
+	Pagination<DemandManageListBo> selectMyDemandManageList(Integer dataCategory,String employerName, Integer auditStatus, Integer 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 createDateStartDate, String createDateEndDate, Integer pNo, Integer pSize,Integer boutique,Integer hot,String techBrokerId);
 	
+	Pagination<DemandManageListBo> selectManageDemandManageList(Integer dataCategory,String employerName, Integer auditStatus, Integer 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 createDateStartDate, String createDateEndDate, Integer pNo, Integer pSize,Integer boutique,Integer hot,String techBrokerId);
 }

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

@@ -945,7 +945,87 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		return (Pagination<DemandSearchListBo>) findPage("findAppMyDemandListByPage", "findAppMyDemandCount", params, pNo, pSize);
 	}
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandManageListBo> selectMyDemandManageList(Integer dataCategory,String employerName, Integer auditStatus,
+			Integer 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 createDateStartDate, String createDateEndDate, Integer pNo,
+			Integer pSize, Integer boutique, Integer hot, String techBrokerId) {
+		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
+				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, boutique, hot);
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		if (null != dataCategory) {
+			params.put("dataCategory", dataCategory);
+		}
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("adminId", TokenManager.getAdminId());
+		}
+
+		if (StringUtils.isNotBlank(employerName)) {
+			params.put("employerName", employerName);
+		}
+
+		if (StringUtils.isNotBlank(username)) {
+			params.put("unitName", username);
+		}
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+
+		return (Pagination<DemandManageListBo>) findPage("findMyDemandListByPage", "findMyDemandCount",
+				params, pNo, pSize);
+	}
 	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandManageListBo> selectManageDemandManageList(Integer dataCategory,String employerName, Integer auditStatus,
+			Integer 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 createDateStartDate, String createDateEndDate, Integer pNo,
+			Integer pSize, Integer boutique, Integer hot, String techBrokerId) {
+		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
+				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, boutique, hot);
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		if (null != dataCategory) {
+			params.put("dataCategory", dataCategory);
+		}
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("adminId", TokenManager.getAdminId());
+		}
+
+		if (StringUtils.isNotBlank(employerName)) {
+			params.put("employerName", employerName);
+		}
+
+		if (StringUtils.isNotBlank(username)) {
+			params.put("unitName", username);
+		}
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+
+		return (Pagination<DemandManageListBo>) findPage("findManageDemandListByPage", "findManagegDemandCount",
+				params, pNo, pSize);
+	}
 		
 	
 }