Переглянути джерело

统计日报表新增字段查询
求职信息导出

yanliming 1 рік тому
батько
коміт
de2ef8664b

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/PersonInfoDAO.java

@@ -22,4 +22,5 @@ public interface PersonInfoDAO {
 	int clearOpenId(String id);
 	PersonInfo findByPhone(String phone);
 	Integer dailyReportList(@Param("searchParams") Map<String, Object> searchParams);
+	Integer dailyPersonReg(@Param("searchParams") Map<String, Object> searchParams);
 }

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/RecruitInformationInfoDAO.java

@@ -19,4 +19,5 @@ public interface RecruitInformationInfoDAO {
 	List<RecruitInformationInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
 	List<RecruitInformationInfo> searchMobile(Map<String, Object> searchParams, List<Sort> sortList);
 	Integer dailyReportList(@Param("searchParams")Map<String, Object> searchParams);
+	Integer sumJobRequirementNum(@Param("searchParams")Map<String, Object> searchParams);
 }

+ 4 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/NewsInfo.java

@@ -57,6 +57,10 @@ public class NewsInfo {
 	@ApiModelProperty(value = "审核状态")
 	private String status;
 
+	@ApiModelProperty(value = "审核状态")
+	private String codeImage;
+
+
 	@Transient
 	@ApiModelProperty(value = "类型翻译")
 	private String categoryN;

+ 5 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/PersonInfo.java

@@ -94,4 +94,9 @@ public class PersonInfo {
 	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date phoneLastUpdateTime;
+
+	@ApiModelProperty(value = "认证时间")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date checkTime;
 }

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/PersonInfoService.java

@@ -20,4 +20,5 @@ public interface PersonInfoService {
 	int clearOpenId(String id);
 	PersonInfo findByPhone(String phone);
 	Integer dailyReportList(Map<String, Object> searchParams);
+	Integer dailyPersonReg(Map<String, Object> searchParams);
 }

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/RecruitInformationInfoService.java

@@ -16,4 +16,5 @@ public interface RecruitInformationInfoService {
 	Page<RecruitInformationInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	Page<RecruitInformationInfo> pageSearchMobile(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	Integer dailyReportList(Map<String, Object> searchParams);
+	Integer sumJobRequirementNum(Map<String, Object> searchParams);
 }

+ 5 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/PersonInfoServiceImpl.java

@@ -87,4 +87,9 @@ public class PersonInfoServiceImpl implements PersonInfoService {
 	public Integer dailyReportList(Map<String, Object> searchParams){
 		return personInfoDAO.dailyReportList(searchParams);
 	}
+
+	@Override
+	public Integer dailyPersonReg(Map<String, Object> searchParams){
+		return personInfoDAO.dailyPersonReg(searchParams);
+	}
 }

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/RecruitInformationInfoServiceImpl.java

@@ -81,4 +81,10 @@ public class RecruitInformationInfoServiceImpl implements RecruitInformationInfo
 	public Integer dailyReportList(Map<String, Object> searchParams){
 		return recruitInformationInfoDAO.dailyReportList(searchParams);
 	}
+
+
+	@Override
+	public Integer sumJobRequirementNum(Map<String, Object> searchParams){
+		return recruitInformationInfoDAO.sumJobRequirementNum(searchParams);
+	}
 }

+ 7 - 1
common/src/main/resources/mapper/base/NewsInfo.xml

@@ -16,6 +16,8 @@
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
 			<result property="status" column="status_" />
+			<result property="codeImage" column="code_image" />
+
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.NewsInfo">
 	<!--
@@ -25,7 +27,7 @@
 	-->
 	<![CDATA[
 		insert into base_news_info
-	    (id_,title_,category_,content,browse_number,thumbnail_image,create_by,create_time,update_by,update_time,del_flag,status_)
+	    (id_,title_,category_,content,browse_number,thumbnail_image,create_by,create_time,update_by,update_time,del_flag,status_,code_image)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -40,6 +42,7 @@
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{status,jdbcType=VARCHAR}
+,#{codeImage,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -82,6 +85,9 @@
 			<if test="status!=null">
 				status_=#{status,jdbcType=VARCHAR},
 			</if>
+			<if test="codeImage!=null">
+				code_image=#{codeImage,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 20 - 1
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -25,6 +25,7 @@
 			<result property="isAnonymous" column="is_anonymous" />
 			<result property="jobStatus" column="job_status" />
 			<result property="phoneLastUpdateTime" column="phone_last_update_time" />
+			<result property="checkTime" column="check_time" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.PersonInfo">
 	<!--
@@ -36,7 +37,7 @@
 		insert into base_person_info
 	    (id_,user_name,password_,real_name,phone_,id_card,open_id,photo_,gender_,age_,
 	    enterprise_id,status_,create_by,create_time,update_by,update_time,del_flag,
-	    intention_,is_anonymous,job_status,phone_last_update_time)
+	    intention_,is_anonymous,job_status,phone_last_update_time,check_time)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -60,6 +61,7 @@
 ,#{isAnonymous,jdbcType= NUMERIC }
 ,#{jobStatus,jdbcType=VARCHAR}
 ,#{phoneLastUpdateTime,jdbcType= TIMESTAMP }
+,#{checkTime,jdbcType= TIMESTAMP }
 		)
 	]]>
 	</insert>
@@ -129,6 +131,9 @@
 			<if test="phoneLastUpdateTime!=null">
 				phone_last_update_time=#{phoneLastUpdateTime,jdbcType= TIMESTAMP },
 			</if>
+			<if test="checkTime!=null">
+			check_time=#{checkTime,jdbcType= TIMESTAMP },
+		</if>
 		</set>
 	where id_=#{id}
 	</update>
@@ -187,4 +192,18 @@
 			]]>
 		</if>
 	</select>
+	<select id="dailyPersonReg" parameterType="hashmap" resultType="java.lang.Integer">
+		select count(*) from base_person_info
+		where del_flag = 0
+		<if test="searchParams.startTime!= null">
+			<![CDATA[
+				and create_time >= #{searchParams.startTime}
+			]]>
+		</if>
+		<if test="searchParams.endTime!= null">
+			<![CDATA[
+				and create_time <= #{searchParams.endTime}
+			]]>
+		</if>
+	</select>
 </mapper>

+ 223 - 207
common/src/main/resources/mapper/base/RecruitInformationInfo.xml

@@ -1,40 +1,40 @@
 <?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">
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.employment.modules.base.dao.RecruitInformationInfoDAO">
-	<resultMap id="RecruitInformationInfoMap" type="com.jpsoft.employment.modules.base.entity.RecruitInformationInfo">
-		<id property="id" column="id_" />
-			<result property="enterpriseId" column="enterprise_id" />
-			<result property="positionName" column="position_name" />
-			<result property="salary" column="salary_" />
-			<result property="settlementMethod" column="settlement_method" />
-			<result property="industry" column="industry_" />
-			<result property="recruitingNumbers" column="recruiting_numbers" />
-			<result property="desc" column="desc_" />
-			<result property="contacts" column="contacts" />
-			<result property="contactsPhone" column="contacts_phone" />
-			<result property="workArea" column="work_area" />
-			<result property="address" column="address_" />
-			<result property="browseNumber" column="browse_number" />
-			<result property="status" column="status_" />
-			<result property="createBy" column="create_by" />
-			<result property="createTime" column="create_time" />
-			<result property="updateBy" column="update_by" />
-			<result property="updateTime" column="update_time" />
-			<result property="delFlag" column="del_flag" />
-			<result property="salaryForm" column="salary_form" />
-			<result property="isOnline" column="is_online" />
-			<result property="ageRequirement" column="age_requirement" />
-			<result property="isTopping" column="is_topping" />
-			</resultMap>
-	<insert id="insert"  parameterType="com.jpsoft.employment.modules.base.entity.RecruitInformationInfo">
-	<!--
-	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
-		select sys_guid() from dual
-	</selectKey>
-	-->
-	<![CDATA[
+    <resultMap id="RecruitInformationInfoMap" type="com.jpsoft.employment.modules.base.entity.RecruitInformationInfo">
+        <id property="id" column="id_"/>
+        <result property="enterpriseId" column="enterprise_id"/>
+        <result property="positionName" column="position_name"/>
+        <result property="salary" column="salary_"/>
+        <result property="settlementMethod" column="settlement_method"/>
+        <result property="industry" column="industry_"/>
+        <result property="recruitingNumbers" column="recruiting_numbers"/>
+        <result property="desc" column="desc_"/>
+        <result property="contacts" column="contacts"/>
+        <result property="contactsPhone" column="contacts_phone"/>
+        <result property="workArea" column="work_area"/>
+        <result property="address" column="address_"/>
+        <result property="browseNumber" column="browse_number"/>
+        <result property="status" column="status_"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="salaryForm" column="salary_form"/>
+        <result property="isOnline" column="is_online"/>
+        <result property="ageRequirement" column="age_requirement"/>
+        <result property="isTopping" column="is_topping"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.RecruitInformationInfo">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
 		insert into base_recruit_information_info
 	    (id_,enterprise_id,position_name,salary_,settlement_method,industry_,recruiting_numbers,desc_,contacts,contacts_phone,
 	    work_area,address_,browse_number,status_,create_by,create_time,update_by,update_time,del_flag,
@@ -66,202 +66,218 @@
 ,#{isTopping,jdbcType= NUMERIC }
 		)
 	]]>
-	</insert>
-	<delete id="delete" parameterType="string">
+    </insert>
+    <delete id="delete" parameterType="string">
 		delete from base_recruit_information_info where id_=#{id,jdbcType=VARCHAR}
 	</delete>
-	<update id="update"  parameterType="com.jpsoft.employment.modules.base.entity.RecruitInformationInfo">
-		update base_recruit_information_info
-		<set>
-				<if test="enterpriseId!=null">
-		enterprise_id=#{enterpriseId,jdbcType=VARCHAR},
-		</if>
-				<if test="positionName!=null">
-		position_name=#{positionName,jdbcType=VARCHAR},
-		</if>
-				<if test="salary!=null">
-		salary_=#{salary,jdbcType=VARCHAR},
-		</if>
-				<if test="settlementMethod!=null">
-		settlement_method=#{settlementMethod,jdbcType=VARCHAR},
-		</if>
-				<if test="industry!=null">
-		industry_=#{industry,jdbcType=VARCHAR},
-		</if>
-				<if test="recruitingNumbers!=null">
-		recruiting_numbers=#{recruitingNumbers,jdbcType=VARCHAR},
-		</if>
-				<if test="desc!=null">
-					desc_=#{desc,jdbcType=VARCHAR},
-		</if>
-				<if test="contacts!=null">
-		contacts=#{contacts,jdbcType=VARCHAR},
-		</if>
-				<if test="contactsPhone!=null">
-		contacts_phone=#{contactsPhone,jdbcType=VARCHAR},
-		</if>
-				<if test="workArea!=null">
-		work_area=#{workArea,jdbcType=VARCHAR},
-		</if>
-				<if test="address!=null">
-		address_=#{address,jdbcType=VARCHAR},
-		</if>
-				<if test="browseNumber!=null">
-		browse_number=#{browseNumber,jdbcType= NUMERIC },
-		</if>
-				<if test="status!=null">
-		status_=#{status,jdbcType=VARCHAR},
-		</if>
-				<if test="createBy!=null">
-		create_by=#{createBy,jdbcType=VARCHAR},
-		</if>
-				<if test="createTime!=null">
-		create_time=#{createTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="updateBy!=null">
-		update_by=#{updateBy,jdbcType=VARCHAR},
-		</if>
-				<if test="updateTime!=null">
-		update_time=#{updateTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="delFlag!=null">
-		del_flag=#{delFlag,jdbcType= NUMERIC },
-		</if>
-			<if test="salaryForm!=null">
-				salary_form=#{salaryForm,jdbcType= VARCHAR },
-			</if>
-			<if test="isOnline!=null">
-				is_online=#{isOnline,jdbcType= NUMERIC },
-			</if>
-			<if test="ageRequirement!=null">
-				age_requirement=#{ageRequirement,jdbcType= VARCHAR },
-			</if>
-			<if test="isTopping!=null">
-				is_topping=#{isTopping,jdbcType= NUMERIC },
-			</if>
-		</set>
-	where id_=#{id}
-	</update>
-	<select id="get" parameterType="string" resultMap="RecruitInformationInfoMap">
+    <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.RecruitInformationInfo">
+        update base_recruit_information_info
+        <set>
+            <if test="enterpriseId!=null">
+                enterprise_id=#{enterpriseId,jdbcType=VARCHAR},
+            </if>
+            <if test="positionName!=null">
+                position_name=#{positionName,jdbcType=VARCHAR},
+            </if>
+            <if test="salary!=null">
+                salary_=#{salary,jdbcType=VARCHAR},
+            </if>
+            <if test="settlementMethod!=null">
+                settlement_method=#{settlementMethod,jdbcType=VARCHAR},
+            </if>
+            <if test="industry!=null">
+                industry_=#{industry,jdbcType=VARCHAR},
+            </if>
+            <if test="recruitingNumbers!=null">
+                recruiting_numbers=#{recruitingNumbers,jdbcType=VARCHAR},
+            </if>
+            <if test="desc!=null">
+                desc_=#{desc,jdbcType=VARCHAR},
+            </if>
+            <if test="contacts!=null">
+                contacts=#{contacts,jdbcType=VARCHAR},
+            </if>
+            <if test="contactsPhone!=null">
+                contacts_phone=#{contactsPhone,jdbcType=VARCHAR},
+            </if>
+            <if test="workArea!=null">
+                work_area=#{workArea,jdbcType=VARCHAR},
+            </if>
+            <if test="address!=null">
+                address_=#{address,jdbcType=VARCHAR},
+            </if>
+            <if test="browseNumber!=null">
+                browse_number=#{browseNumber,jdbcType= NUMERIC },
+            </if>
+            <if test="status!=null">
+                status_=#{status,jdbcType=VARCHAR},
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="salaryForm!=null">
+                salary_form=#{salaryForm,jdbcType= VARCHAR },
+            </if>
+            <if test="isOnline!=null">
+                is_online=#{isOnline,jdbcType= NUMERIC },
+            </if>
+            <if test="ageRequirement!=null">
+                age_requirement=#{ageRequirement,jdbcType= VARCHAR },
+            </if>
+            <if test="isTopping!=null">
+                is_topping=#{isTopping,jdbcType= NUMERIC },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="RecruitInformationInfoMap">
 		select * from base_recruit_information_info where id_=#{0}
 	</select>
-	<select id="exist" parameterType="string" resultType="int">
+    <select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_recruit_information_info where id_=#{0}
 	</select>
-	<select id="list" resultMap="RecruitInformationInfoMap">
+    <select id="list" resultMap="RecruitInformationInfoMap">
 		select * from base_recruit_information_info where del_flag = 0
 	</select>
-	<select id="search" parameterType="hashmap" resultMap="RecruitInformationInfoMap">
-		<![CDATA[
+    <select id="search" parameterType="hashmap" resultMap="RecruitInformationInfoMap">
+        <![CDATA[
 			SELECT a.* FROM base_recruit_information_info a
 			INNER JOIN base_enterprise_info b on a.enterprise_id=b.id_
 		]]>
-		<where>
-			a.del_flag = false
-			<if test="searchParams.name != null">
-				and b.name_ like #{searchParams.name}
-			</if>
-			<if test="searchParams.positionName != null">
-				and a.position_name like #{searchParams.positionName}
-			</if>
-			<if test="searchParams.method != null">
-				and a.settlement_method = #{searchParams.method}
-			</if>
-			<if test="searchParams.intendedIndustries != null">
-				and a.industry_ = #{searchParams.intendedIndustries}
-			</if>
-			<if test="searchParams.status != null">
-				and a.status_ = #{searchParams.status}
-			</if>
-			<if test="searchParams.workArea != null">
-				and a.work_area like #{searchParams.workArea}
-			</if>
-			<if test="searchParams.isOnline != null">
-				and a.is_online = #{searchParams.isOnline}
-			</if>
-			<if test="searchParams.isTopping != null">
-				and a.is_topping = #{searchParams.isTopping}
-			</if>
-		</where>
-		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-	        ${sort.name} ${sort.order}
-	 	</foreach>
-	</select>
-	<select id="searchMobile" parameterType="hashmap" resultMap="RecruitInformationInfoMap">
-		<![CDATA[
+        <where>
+            a.del_flag = false
+            <if test="searchParams.name != null">
+                and b.name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.positionName != null">
+                and a.position_name like #{searchParams.positionName}
+            </if>
+            <if test="searchParams.method != null">
+                and a.settlement_method = #{searchParams.method}
+            </if>
+            <if test="searchParams.intendedIndustries != null">
+                and a.industry_ = #{searchParams.intendedIndustries}
+            </if>
+            <if test="searchParams.status != null">
+                and a.status_ = #{searchParams.status}
+            </if>
+            <if test="searchParams.workArea != null">
+                and a.work_area like #{searchParams.workArea}
+            </if>
+            <if test="searchParams.isOnline != null">
+                and a.is_online = #{searchParams.isOnline}
+            </if>
+            <if test="searchParams.isTopping != null">
+                and a.is_topping = #{searchParams.isTopping}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="searchMobile" parameterType="hashmap" resultMap="RecruitInformationInfoMap">
+        <![CDATA[
 			SELECT
 				a.*
 			FROM
 				base_recruit_information_info a
 				left join base_enterprise_info b on a.enterprise_id = b.id_
 		]]>
-		<where>
-			a.del_flag = 0
-			and b.del_flag = 0
-			<if test="searchParams.enterpriseId != null">
-				and a.enterprise_id = #{searchParams.enterpriseId}
-			</if>
-			<if test="searchParams.status != null">
-				and a.status_ = #{searchParams.status}
-			</if>
-			<if test="searchParams.settlementMethod != null">
-				and a.settlement_method = #{searchParams.settlementMethod}
-			</if>
-			<if test="searchParams.positionName != null">
-				and a.position_name like #{searchParams.positionName}
-			</if>
-			<if test="searchParams.content != null">
-				and (a.position_name like #{searchParams.content} or a.desc_ like #{searchParams.content})
-			</if>
-			<if test="searchParams.industry != null">
-				and a.industry_ = #{searchParams.industry}
-			</if>
-			<if test="searchParams.salaryForm != null">
-				and a.salary_form = #{searchParams.salaryForm}
-			</if>
-			<if test="searchParams.salaryStart != null">
-				<![CDATA[
+        <where>
+            a.del_flag = 0
+            and b.del_flag = 0
+            <if test="searchParams.enterpriseId != null">
+                and a.enterprise_id = #{searchParams.enterpriseId}
+            </if>
+            <if test="searchParams.status != null">
+                and a.status_ = #{searchParams.status}
+            </if>
+            <if test="searchParams.settlementMethod != null">
+                and a.settlement_method = #{searchParams.settlementMethod}
+            </if>
+            <if test="searchParams.positionName != null">
+                and a.position_name like #{searchParams.positionName}
+            </if>
+            <if test="searchParams.content != null">
+                and (a.position_name like #{searchParams.content} or a.desc_ like #{searchParams.content})
+            </if>
+            <if test="searchParams.industry != null">
+                and a.industry_ = #{searchParams.industry}
+            </if>
+            <if test="searchParams.salaryForm != null">
+                and a.salary_form = #{searchParams.salaryForm}
+            </if>
+            <if test="searchParams.salaryStart != null">
+                <![CDATA[
 				and a.salary_ >= #{searchParams.salaryStart}
 				]]>
-			</if>
-			<if test="searchParams.salaryEnd != null">
-				<![CDATA[
+            </if>
+            <if test="searchParams.salaryEnd != null">
+                <![CDATA[
 				and a.salary_ <= #{searchParams.salaryEnd}
 				]]>
-			</if>
-			<if test="searchParams.status != null">
-				and a.status_ = #{searchParams.status}
-			</if>
-			<if test="searchParams.isOnline != null">
-				and a.is_online = #{searchParams.isOnline}
-			</if>
-		</where>
-		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-			${sort.name} ${sort.order}
-		</foreach>
-	</select>
-	<select id="dailyReportList" parameterType="hashmap" resultType="java.lang.Integer">
-		select count(*) from base_recruit_information_info
-		<where>
-			<if test="searchParams.delFlag!= null">
-				and del_flag = #{searchParams.delFlag}
-			</if>
-			<if test="searchParams.isOnline!= null">
-				and is_online = #{searchParams.isOnline}
-			</if>
-			<if test="searchParams.status!= null">
-				and status_ = #{searchParams.status}
-			</if>
-			<if test="searchParams.startTime!= null">
-				<![CDATA[
+            </if>
+            <if test="searchParams.status != null">
+                and a.status_ = #{searchParams.status}
+            </if>
+            <if test="searchParams.isOnline != null">
+                and a.is_online = #{searchParams.isOnline}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="dailyReportList" parameterType="hashmap" resultType="java.lang.Integer">
+        select count(*) from base_recruit_information_info
+        <where>
+            <if test="searchParams.delFlag!= null">
+                and del_flag = #{searchParams.delFlag}
+            </if>
+            <if test="searchParams.isOnline!= null">
+                and is_online = #{searchParams.isOnline}
+            </if>
+            <if test="searchParams.status!= null">
+                and status_ = #{searchParams.status}
+            </if>
+            <if test="searchParams.startTime!= null">
+                <![CDATA[
 					and create_time >= #{searchParams.startTime}
 				]]>
-			</if>
-			<if test="searchParams.endTime!= null">
-				<![CDATA[
+            </if>
+            <if test="searchParams.endTime!= null">
+                <![CDATA[
 					and create_time <= #{searchParams.endTime}
 				]]>
-			</if>
-		</where>
-	</select>
+            </if>
+        </where>
+    </select>
+    <select id="sumJobRequirementNum" parameterType="hashmap" resultType="java.lang.Integer">
+        SELECT sum(recruiting_numbers) FROM base_recruit_information_info
+        <where>
+            del_flag=FALSE and status_='1' and is_online=true
+            <if test="searchParams.startTime!= null">
+                <![CDATA[
+					and create_time >= #{searchParams.startTime}
+				]]>
+            </if>
+            <if test="searchParams.endTime!= null">
+                <![CDATA[
+					and create_time <= #{searchParams.endTime}
+				]]>
+            </if>
+        </where>
+    </select>
 </mapper>

+ 203 - 101
web/src/main/java/com/jpsoft/employment/modules/base/controller/JobInformationInfoController.java

@@ -1,11 +1,13 @@
 package com.jpsoft.employment.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.employment.config.OSSConfig;
 import com.jpsoft.employment.modules.base.entity.JobEnterpriseRelation;
 import com.jpsoft.employment.modules.base.entity.PersonInfo;
 import com.jpsoft.employment.modules.base.service.JobEnterpriseRelationService;
 import com.jpsoft.employment.modules.base.service.PersonInfoService;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
+import com.jpsoft.employment.modules.common.utils.OSSUtil;
 import com.jpsoft.employment.modules.common.utils.PojoUtils;
 import com.jpsoft.employment.modules.common.dto.Sort;
 import com.jpsoft.employment.modules.base.entity.JobInformationInfo;
@@ -13,12 +15,19 @@ import com.jpsoft.employment.modules.base.service.JobInformationInfoService;
 import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -38,11 +47,14 @@ public class JobInformationInfoController {
 
     @Autowired
     private JobEnterpriseRelationService jobEnterpriseRelationService;
-	
-	
-	@ApiOperation(value="创建空记录")
+
+    @Autowired
+    private OSSConfig ossConfig;
+
+
+    @ApiOperation(value = "创建空记录")
     @GetMapping("create")
-    public MessageResult<JobInformationInfo> create(){
+    public MessageResult<JobInformationInfo> create() {
         MessageResult<JobInformationInfo> msgResult = new MessageResult<>();
 
         JobInformationInfo jobInformationInfo = new JobInformationInfo();
@@ -53,14 +65,14 @@ public class JobInformationInfoController {
         return msgResult;
     }
 
-    @ApiOperation(value="添加信息")
+    @ApiOperation(value = "添加信息")
     @PostMapping("add")
-    public MessageResult<JobInformationInfo> add(@RequestBody JobInformationInfo jobInformationInfo,@RequestAttribute String subject){
+    public MessageResult<JobInformationInfo> add(@RequestBody JobInformationInfo jobInformationInfo, @RequestAttribute String subject) {
         MessageResult<JobInformationInfo> msgResult = new MessageResult<>();
 
         try {
             jobInformationInfo.setId(UUID.randomUUID().toString());
-			jobInformationInfo.setDelFlag(false);
+            jobInformationInfo.setDelFlag(false);
             jobInformationInfo.setCreateBy(subject);
             jobInformationInfo.setCreateTime(new Date());
             jobInformationInfo.setUpdateTime(new Date());
@@ -74,9 +86,8 @@ public class JobInformationInfoController {
                 msgResult.setResult(false);
                 msgResult.setMessage("数据库添加失败");
             }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
             msgResult.setMessage(ex.getMessage());
@@ -85,9 +96,9 @@ public class JobInformationInfoController {
         return msgResult;
     }
 
-    @ApiOperation(value="获取信息")
+    @ApiOperation(value = "获取信息")
     @GetMapping("edit/{id}")
-    public MessageResult<JobInformationInfo> edit(@PathVariable("id") String id){
+    public MessageResult<JobInformationInfo> edit(@PathVariable("id") String id) {
         MessageResult<JobInformationInfo> msgResult = new MessageResult<>();
 
         try {
@@ -100,9 +111,8 @@ public class JobInformationInfoController {
                 msgResult.setResult(false);
                 msgResult.setMessage("数据库不存在该记录!");
             }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
             msgResult.setMessage(ex.getMessage());
@@ -111,15 +121,15 @@ public class JobInformationInfoController {
         return msgResult;
     }
 
-    @ApiOperation(value="更新用户")
+    @ApiOperation(value = "更新用户")
     @PostMapping("update")
-    public MessageResult<JobInformationInfo> update(@RequestBody JobInformationInfo jobInformationInfo,@RequestAttribute String subject){
+    public MessageResult<JobInformationInfo> update(@RequestBody JobInformationInfo jobInformationInfo, @RequestAttribute String subject) {
         MessageResult<JobInformationInfo> msgResult = new MessageResult<>();
 
         try {
-		    jobInformationInfo.setUpdateBy(subject);
+            jobInformationInfo.setUpdateBy(subject);
             jobInformationInfo.setUpdateTime(new Date());
-		
+
             int affectCount = jobInformationInfoService.update(jobInformationInfo);
 
             if (affectCount > 0) {
@@ -129,9 +139,8 @@ public class JobInformationInfoController {
                 msgResult.setResult(false);
                 msgResult.setMessage("数据库更新失败");
             }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
             msgResult.setMessage(ex.getMessage());
@@ -140,19 +149,19 @@ public class JobInformationInfoController {
         return msgResult;
     }
 
-    @ApiOperation(value="删除用户")
+    @ApiOperation(value = "删除用户")
     @PostMapping("delete/{id}")
-    public MessageResult<JobInformationInfo> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+    public MessageResult<JobInformationInfo> delete(@PathVariable("id") String id, @RequestAttribute String subject) {
         MessageResult<JobInformationInfo> msgResult = new MessageResult<>();
 
         try {
-			
-			JobInformationInfo jobInformationInfo = jobInformationInfoService.get(id);
+
+            JobInformationInfo jobInformationInfo = jobInformationInfoService.get(id);
             jobInformationInfo.setDelFlag(true);
             jobInformationInfo.setUpdateBy(subject);
             jobInformationInfo.setUpdateTime(new Date());
-			
-			int affectCount = jobInformationInfoService.update(jobInformationInfo);
+
+            int affectCount = jobInformationInfoService.update(jobInformationInfo);
 
             if (affectCount > 0) {
                 msgResult.setResult(true);
@@ -160,9 +169,8 @@ public class JobInformationInfoController {
                 msgResult.setResult(false);
                 msgResult.setMessage("数据库删除失败");
             }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
             msgResult.setMessage(ex.getMessage());
@@ -172,9 +180,9 @@ public class JobInformationInfoController {
     }
 
 
-    @ApiOperation(value="批量删除")
+    @ApiOperation(value = "批量删除")
     @PostMapping("batchDelete")
-    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList, @RequestAttribute String subject) {
         MessageResult<Integer> msgResult = new MessageResult<>();
 
         try {
@@ -196,9 +204,8 @@ public class JobInformationInfoController {
                 msgResult.setResult(false);
                 msgResult.setMessage("删除失败");
             }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
             msgResult.setMessage(ex.getMessage());
@@ -207,101 +214,197 @@ public class JobInformationInfoController {
         return msgResult;
     }
 
-    @ApiOperation(value="列表")
-    @RequestMapping(value = "pageList",method = RequestMethod.POST)
-    public MessageResult<Map> pageList(
-            String name,String intendedIndustries,String intendedPosition,String method,
-            String workExperience,String education,String status,
-            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
-            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
-            HttpServletRequest request){
-        String subject = (String)request.getAttribute("subject");
+    @ApiOperation(value = "列表")
+    @RequestMapping(value = "pageList", method = RequestMethod.POST)
+    public MessageResult<Object> pageList(
+            String name, String intendedIndustries, String intendedPosition, String method,
+            String workExperience, String education, String status,
+            @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
+            @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
+            @RequestParam(value = "exportFlag", defaultValue = "false") Boolean exportFlag,
+            HttpServletRequest request) {
+        String subject = (String) request.getAttribute("subject");
 
         //当前用户ID
         System.out.println(subject);
 
-        MessageResult<Map> msgResult = new MessageResult<>();
+        MessageResult<Object> msgResult = new MessageResult<>();
 
-        Map<String,Object> searchParams = new HashMap<>();
+        try {
 
-        List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("create_time","desc"));
+            Map<String, Object> searchParams = new HashMap<>();
 
-        if (StringUtils.isNotEmpty(name)) {
-            searchParams.put("name","%" + name + "%");
-        }
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_time", "desc"));
 
-        if (StringUtils.isNotEmpty(intendedPosition)) {
-            searchParams.put("intendedPosition","%" + intendedPosition + "%");
-        }
+            if (StringUtils.isNotEmpty(name)) {
+                searchParams.put("name", "%" + name + "%");
+            }
 
-        if (StringUtils.isNotEmpty(intendedIndustries)) {
-            searchParams.put("intendedIndustries",intendedIndustries);
-        }
+            if (StringUtils.isNotEmpty(intendedPosition)) {
+                searchParams.put("intendedPosition", "%" + intendedPosition + "%");
+            }
 
-        if (StringUtils.isNotEmpty(method)) {
-            searchParams.put("method",method);
-        }
+            if (StringUtils.isNotEmpty(intendedIndustries)) {
+                searchParams.put("intendedIndustries", intendedIndustries);
+            }
 
-        if (StringUtils.isNotEmpty(workExperience)) {
-            searchParams.put("workExperience",workExperience);
-        }
+            if (StringUtils.isNotEmpty(method)) {
+                searchParams.put("method", method);
+            }
 
-        if (StringUtils.isNotEmpty(education)) {
-            searchParams.put("education",education);
-        }
+            if (StringUtils.isNotEmpty(workExperience)) {
+                searchParams.put("workExperience", workExperience);
+            }
 
-        if (StringUtils.isNotEmpty(status)) {
-            searchParams.put("status",status);
-        }
+            if (StringUtils.isNotEmpty(education)) {
+                searchParams.put("education", education);
+            }
+
+            if (StringUtils.isNotEmpty(status)) {
+                searchParams.put("status", status);
+            }
 
 
-        Page<JobInformationInfo> page = jobInformationInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+            Page<JobInformationInfo> page = jobInformationInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
 
-        for (JobInformationInfo jobInformationInfo:page) {
-            PersonInfo personInfo = personInfoService.get(jobInformationInfo.getPersonId());
-            if(personInfo!=null){
-                jobInformationInfo.setPersonName(personInfo.getRealName());
-            }
+            List<Map> mapList = new ArrayList<>();
 
-            String intendedIndustriesN = dataDictionaryService.findNameByCatalogNameAndValue("意向行业",jobInformationInfo.getIntendedIndustries());
-            if(StringUtils.isNotEmpty(intendedIndustriesN)){
-                jobInformationInfo.setIntendedIndustriesN(intendedIndustriesN);
-            }
+            for (JobInformationInfo jobInformationInfo : page) {
+                Map map = new HashMap();
+                map.put("id", jobInformationInfo.getId());
+
+                String personName = "";
+                PersonInfo personInfo = personInfoService.get(jobInformationInfo.getPersonId());
+                if (personInfo != null) {
+                    personName = personInfo.getRealName();
+                }
 
-            String methodN = dataDictionaryService.findNameByCatalogNameAndValue("结算方式",jobInformationInfo.getMethod());
-            if(StringUtils.isNotEmpty(methodN)){
-                jobInformationInfo.setMethodN(methodN);
+                String intendedIndustriesN = dataDictionaryService.findNameByCatalogNameAndValue("意向行业", jobInformationInfo.getIntendedIndustries());
+                if (StringUtils.isNotEmpty(intendedIndustriesN)) {
+                    jobInformationInfo.setIntendedIndustriesN(intendedIndustriesN);
+                }
+
+                String methodN = dataDictionaryService.findNameByCatalogNameAndValue("结算方式", jobInformationInfo.getMethod());
+                if (StringUtils.isNotEmpty(methodN)) {
+                    jobInformationInfo.setMethodN(methodN);
+                }
+
+                String workExperienceN = dataDictionaryService.findNameByCatalogNameAndValue("工作经验", jobInformationInfo.getWorkExperience());
+                if (StringUtils.isNotEmpty(workExperienceN)) {
+                    jobInformationInfo.setWorkExperienceN(workExperienceN);
+                }
+
+
+                String educationN = dataDictionaryService.findNameByCatalogNameAndValue("学历", jobInformationInfo.getEducation());
+                if (StringUtils.isNotEmpty(educationN)) {
+                    jobInformationInfo.setEducationN(educationN);
+                }
+
+                Integer isReadNumber = jobEnterpriseRelationService.countByJobInformationId(jobInformationInfo.getId());
+
+                jobInformationInfo.setIsReadNumber(isReadNumber);
+
+
+                map.put("personName", personName);
+                map.put("serviceDesc", jobInformationInfo.getServiceDesc());
+                map.put("intendedIndustriesN", intendedIndustriesN);
+                map.put("intendedPosition", jobInformationInfo.getIntendedPosition());
+                map.put("hopeSalary", jobInformationInfo.getHopeSalary());
+                map.put("methodN", jobInformationInfo.getMethod());
+                map.put("address", jobInformationInfo.getAddress());
+                map.put("educationN", educationN);
+                map.put("status", jobInformationInfo.getStatus());
+
+                String statusN = "";
+                if (jobInformationInfo.getStatus() != null && "1".equals(jobInformationInfo.getStatus())) {
+                    statusN = "未审核";
+                } else {
+                    statusN = "已审核";
+                }
+                map.put("statusN", statusN);
+                map.put("isReadNumber", isReadNumber);
+
+                mapList.add(map);
             }
 
-            String workExperienceN = dataDictionaryService.findNameByCatalogNameAndValue("工作经验",jobInformationInfo.getWorkExperience());
-            if(StringUtils.isNotEmpty(workExperienceN)){
-                jobInformationInfo.setWorkExperienceN(workExperienceN);
+            if (exportFlag) {
+                String filePath = exportXls(mapList);
+                msgResult.setData(filePath);
+            } else {
+                Map<String, Object> dataMap = PojoUtils.pageWrapper(page);
+                dataMap.put("data", mapList);
+                msgResult.setData(dataMap);
             }
 
+            msgResult.setResult(true);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+        }
+
+        return msgResult;
 
-            String educationN = dataDictionaryService.findNameByCatalogNameAndValue("学历",jobInformationInfo.getEducation());
-            if(StringUtils.isNotEmpty(educationN)){
-                jobInformationInfo.setEducationN(educationN);
-            }
+    }
 
-            Integer isReadNumber = jobEnterpriseRelationService.countByJobInformationId(jobInformationInfo.getId());
 
-            jobInformationInfo.setIsReadNumber(isReadNumber);
+    private String exportXls(List<Map> mapList) {
+        String downloadUrl = "";
+
+        Workbook workbook = new HSSFWorkbook();
+        Sheet sheet = workbook.createSheet();
+
+        //表头
+        Row rowTitle = sheet.createRow(0);
+
+        String[] titles = new String[]{"序号", "求职人员", "服务描述",
+                "意向行业", "意向岗位", "期望薪资", "结算方式", "居住地",
+                "最高学历", "审核状态"};
+
+        for (int i = 0; i < titles.length; i++) {
+            Cell cell = rowTitle.createCell(i);
+            cell.setCellValue(titles[i]);
         }
 
+        for (int i = 0; i < mapList.size(); i++) {
+            Map<String, Object> map = mapList.get(i);
 
-        msgResult.setResult(true);
-        msgResult.setData(PojoUtils.pageWrapper(page));
+            Row row = sheet.createRow(i + 1);
 
-        return msgResult;
-    }
+            int colIndex = 0;
+            row.createCell(colIndex++).setCellValue(i + 1);
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("personName"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("serviceDesc"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("intendedIndustriesN"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("intendedPosition"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("hopeSalary"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("methodN"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("address"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("educationN"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("statusN"), ""));
 
+        }
 
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
 
-    @ApiOperation(value="审核信息")
+        try {
+            workbook.write(output);
+
+            byte[] buffer = output.toByteArray();
+            ByteArrayInputStream input = new ByteArrayInputStream(buffer);
+
+            downloadUrl = OSSUtil.upload(ossConfig, "jobInformationList", "求职信息列表.xls", input);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+        }
+
+        return downloadUrl;
+    }
+
+
+    @ApiOperation(value = "审核信息")
     @PostMapping("check/{id}")
-    public MessageResult<JobInformationInfo> check(@PathVariable("id") String id,@RequestAttribute String subject){
+    public MessageResult<JobInformationInfo> check(@PathVariable("id") String id, @RequestAttribute String subject) {
         MessageResult<JobInformationInfo> msgResult = new MessageResult<>();
 
         try {
@@ -319,9 +422,8 @@ public class JobInformationInfoController {
                 msgResult.setResult(false);
                 msgResult.setMessage("数据库审核失败");
             }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
             msgResult.setMessage(ex.getMessage());

+ 14 - 2
web/src/main/java/com/jpsoft/employment/modules/base/controller/PersonInfoController.java

@@ -302,6 +302,15 @@ public class PersonInfoController {
 
                 map.put("lastLoginTime", lastLoginTime);
 
+
+                //认证时间
+                String checkTime = "";
+                if (personInfo.getCheckTime() != null) {
+                    checkTime = sdf.format(personInfo.getCheckTime());
+                }
+
+                map.put("checkTime", checkTime);
+
                 mapList.add(map);
             }
 
@@ -469,10 +478,12 @@ public class PersonInfoController {
 
         try {
 
+            Date now = new Date();
             PersonInfo personInfo = personInfoService.get(id);
             personInfo.setStatus("1");
             personInfo.setUpdateBy(subject);
-            personInfo.setUpdateTime(new Date());
+            personInfo.setUpdateTime(now);
+            personInfo.setCheckTime(now);
 
             if (StringUtils.isNotEmpty(personInfo.getIdCard())) {
                 int gender = IdcardUtil.getGenderByIdCard(personInfo.getIdCard());
@@ -511,7 +522,7 @@ public class PersonInfoController {
         //表头
         Row rowTitle = sheet.createRow(0);
 
-        String[] titles = new String[]{"序号", "姓名", "联系电话", "身份证号", "性别", "年龄","最后登录时间", "认证状态"};
+        String[] titles = new String[]{"序号", "姓名", "联系电话", "身份证号", "性别", "年龄", "最后登录时间", "认证状态","认证时间"};
 
         for (int i = 0; i < titles.length; i++) {
             Cell cell = rowTitle.createCell(i);
@@ -532,6 +543,7 @@ public class PersonInfoController {
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("age"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("lastLoginTime"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("statusN"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("checkTime"), ""));
         }
 
         ByteArrayOutputStream output = new ByteArrayOutputStream();

+ 154 - 60
web/src/main/java/com/jpsoft/employment/modules/base/controller/ReportController.java

@@ -2,15 +2,24 @@ package com.jpsoft.employment.modules.base.controller;
 
 
 import com.github.pagehelper.Page;
+import com.jpsoft.employment.config.OSSConfig;
 import com.jpsoft.employment.modules.base.entity.JobInformationInfo;
 import com.jpsoft.employment.modules.base.entity.RecruitInformationInfo;
 import com.jpsoft.employment.modules.base.entity.RecruitPersonRelation;
 import com.jpsoft.employment.modules.base.service.*;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.common.dto.Sort;
+import com.jpsoft.employment.modules.common.utils.OSSUtil;
 import com.jpsoft.employment.modules.common.utils.PojoUtils;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -18,6 +27,8 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -27,6 +38,7 @@ import java.util.Map;
 @RestController
 @RequestMapping("/statistical/report")
 public class ReportController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
 
     @Autowired
     private PersonLoginLogService personLoginLogService;
@@ -43,99 +55,181 @@ public class ReportController {
     @Autowired
     private RecruitInformationInfoService recruitInformationInfoService;
 
+    @Autowired
+    private OSSConfig ossConfig;
+
 
     @ApiOperation(value = "日报表")
     @RequestMapping(value = "dailyReport", method = RequestMethod.POST)
-    public MessageResult<List<Map>> dailyReport(String date) {
+    public MessageResult<Object> dailyReport(String date,@RequestParam(value = "exportFlag", defaultValue = "false") Boolean exportFlag) {
 
-        MessageResult<List<Map>> msgResult = new MessageResult<>();
+        MessageResult<Object> msgResult = new MessageResult<>();
 
-        Map<String, Object> searchParams = new HashMap<>();
+        try {
 
-        Map<String, Object> searchParams1 = new HashMap<>();
+            Map<String, Object> searchParams = new HashMap<>();
 
-        if (StringUtils.isNotEmpty(date)) {
-            String startTime = date + " 00:00:00";
-            String endTime = date + " 23:59:59";
-            searchParams.put("startTime", startTime);
-            searchParams.put("endTime", endTime);
+            Map<String, Object> searchParams1 = new HashMap<>();
 
+            if (StringUtils.isNotEmpty(date)) {
+                String startTime = date + " 00:00:00";
+                String endTime = date + " 23:59:59";
+                searchParams.put("startTime", startTime);
+                searchParams.put("endTime", endTime);
 
-            searchParams1.put("endTime", endTime);
-        }
 
+                searchParams1.put("endTime", endTime);
+            }
 
 
-        List<Map> mapList = new ArrayList<>();
+            List<Map> mapList = new ArrayList<>();
 
-        Map map = new HashMap();
+            Map map = new HashMap();
 
-        //登录人数,新增人数
-        Integer loginNum = personLoginLogService.dailyReportList(searchParams);
+            //登录人数,新增人数
+            Integer loginNum = personLoginLogService.dailyReportList(searchParams);
 
-        //登录人数,累计人数
-        List<String> personIdList = personLoginLogService.totalDailyReportList(searchParams1);
-        Integer totalLoginNum = personIdList.size();
+            //登录人数,累计人数
+            List<String> personIdList = personLoginLogService.totalDailyReportList(searchParams1);
+            Integer totalLoginNum = personIdList.size();
 
-        //求职登记人数,新增人数
-        Integer personNum = personInfoService.dailyReportList(searchParams);
+            //今日注册人数
+            Integer dailyPersonRegNum = personInfoService.dailyPersonReg(searchParams);
 
-        //求职登记人数,累计人数
-        Integer totalPersonNum = personInfoService.dailyReportList(searchParams1);
+            //求职登记人数,新增人数
+            Integer personNum = personInfoService.dailyReportList(searchParams);
 
-        //认证企业数,新增
-        Integer enterpriseNum = enterpriseInfoService.dailyReportList(searchParams);
+            //求职登记人数,累计人
+            Integer totalPersonNum = personInfoService.dailyReportList(searchParams1);
 
-        //认证企业数,累计
-        Integer totalEnterpriseNum = enterpriseInfoService.dailyReportList(searchParams1);
+            //认证企业数,新增
+            Integer enterpriseNum = enterpriseInfoService.dailyReportList(searchParams);
 
-        //累计岗位
-        Integer totalRecruitStatusNum = recruitInformationInfoService.dailyReportList(searchParams1);
+            //认证企业数,累计数
+            Integer totalEnterpriseNum = enterpriseInfoService.dailyReportList(searchParams1);
 
-        //新增岗位数量
-        searchParams.put("status","1");
-        searchParams.put("isOnline",true);
-        searchParams.put("delFlag",false);
-        Integer recruitNum = recruitInformationInfoService.dailyReportList(searchParams);
+            //累计岗位数量
+            Integer totalRecruitStatusNum = recruitInformationInfoService.dailyReportList(searchParams1);
 
-        //实时岗位数量
-        searchParams1.put("status","1");
-        searchParams1.put("isOnline",true);
-        searchParams1.put("delFlag",false);
-        Integer totalRecruitNum = recruitInformationInfoService.dailyReportList(searchParams1);
+            //岗位需求人数
+            Integer jobRequirementNum = recruitInformationInfoService.sumJobRequirementNum(searchParams1);
 
-        //今日报名人数
-        searchParams = new HashMap<>();
+            //新增岗位数量
+            searchParams.put("status", "1");
+            searchParams.put("isOnline", true);
+            searchParams.put("delFlag", false);
+            Integer recruitNum = recruitInformationInfoService.dailyReportList(searchParams);
 
-        if (StringUtils.isNotEmpty(date)) {
-            String startTime = date + " 00:00:00";
-            String endTime = date + " 23:59:59";
-            searchParams.put("startTime", startTime);
-            searchParams.put("endTime", endTime);
-        }
-        Integer jobInformationNum = recruitPersonRelationService.dailyReportList(searchParams);
+            //实时岗位数量
+            searchParams1.put("status", "1");
+            searchParams1.put("isOnline", true);
+            searchParams1.put("delFlag", false);
+            Integer totalRecruitNum = recruitInformationInfoService.dailyReportList(searchParams1);
+
+            //今日报名人数
+            searchParams = new HashMap<>();
+
+            if (StringUtils.isNotEmpty(date)) {
+                String startTime = date + " 00:00:00";
+                String endTime = date + " 23:59:59";
+                searchParams.put("startTime", startTime);
+                searchParams.put("endTime", endTime);
+            }
+            Integer jobInformationNum = recruitPersonRelationService.dailyReportList(searchParams);
+
+            map.put("loginNum", loginNum);
+            map.put("totalLoginNum", totalLoginNum);
 
-        map.put("loginNum", loginNum);
-        map.put("totalLoginNum", totalLoginNum);
+            map.put("personNum", personNum);
+            map.put("totalPersonNum", totalPersonNum);
 
-        map.put("personNum", personNum);
-        map.put("totalPersonNum", totalPersonNum);
+            map.put("dailyPersonRegNum", dailyPersonRegNum);
 
-        map.put("enterpriseNum", enterpriseNum);
-        map.put("totalEnterpriseNum", totalEnterpriseNum);
+            map.put("enterpriseNum", enterpriseNum);
+            map.put("totalEnterpriseNum", totalEnterpriseNum);
 
-        map.put("recruitNum", recruitNum);
-        map.put("totalRecruitNum", totalRecruitNum);
-        map.put("totalRecruitStatusNum", totalRecruitStatusNum);
+            map.put("recruitNum", recruitNum);
+            map.put("totalRecruitNum", totalRecruitNum);
+            map.put("totalRecruitStatusNum", totalRecruitStatusNum);
 
-        map.put("jobInformationNum", jobInformationNum);
+            map.put("jobInformationNum", jobInformationNum);
 
-        mapList.add(map);
+            map.put("jobRequirementNum", jobRequirementNum);
 
-        msgResult.setResult(true);
-        msgResult.setData(mapList);
+            mapList.add(map);
+
+            if (exportFlag) {
+                String filePath = exportXls(mapList);
+                msgResult.setData(filePath);
+            } else {
+                Map<String, Object> dataMap = new HashMap<>();
+                dataMap.put("data", mapList);
+                msgResult.setData(dataMap);
+            }
+
+            msgResult.setResult(true);
+        }
+        catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+        }
 
         return msgResult;
     }
 
+
+    private String exportXls(List<Map> mapList) {
+        String downloadUrl = "";
+
+        Workbook workbook = new HSSFWorkbook();
+        Sheet sheet = workbook.createSheet();
+
+        //表头
+        Row rowTitle = sheet.createRow(0);
+
+        String[] titles = new String[]{"序号", "新增登录人数", "累计登录人数", "今日注册人数", "新增求职登记人数", "累计求职登记人数",
+                "新增线上认证企业数量", "累计认证企业数量","新增岗位发布数量","实时发布岗位数","累计发布岗位数","岗位需求人数","今日报名人数"};
+
+        for (int i = 0; i < titles.length; i++) {
+            Cell cell = rowTitle.createCell(i);
+            cell.setCellValue(titles[i]);
+        }
+
+        for (int i = 0; i < mapList.size(); i++) {
+            Map<String, Object> map = mapList.get(i);
+
+            Row row = sheet.createRow(i + 1);
+
+            int colIndex = 0;
+            row.createCell(colIndex++).setCellValue(i + 1);
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("loginNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalLoginNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("dailyPersonRegNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("personNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalPersonNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("enterpriseNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalEnterpriseNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("recruitNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalRecruitNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalRecruitStatusNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("jobRequirementNum"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("jobInformationNum"), ""));
+        }
+
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
+
+        try {
+            workbook.write(output);
+
+            byte[] buffer = output.toByteArray();
+            ByteArrayInputStream input = new ByteArrayInputStream(buffer);
+
+            downloadUrl = OSSUtil.upload(ossConfig, "personList", "统计日报表.xls", input);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+        }
+
+        return downloadUrl;
+    }
+
 }