Przeglądaj źródła

update OrgHumanResource

Antiloveg 9 lat temu
rodzic
commit
6b4b654429

+ 17 - 6
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -175,9 +175,20 @@ public class AdminApiController extends BaseApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/orgHumanResource", method = RequestMethod.POST)
-	public Result orgHumanResource(String uid) {
+	public Result orgHumanResource(Integer year, String pageNo, String pageSize, String uid) {
 		Result res = new Result();
-		res.setData(orgHumanResourceService.selectOrgHumanResourceByUserId(uid));
+		res = checkCertify(res);
+		if (res.getError().isEmpty()) {
+			Integer pNo = 1;
+			Integer pSize = 10;
+			if (StringUtils.isNumeric(pageSize)) {
+				pSize = Integer.parseInt(pageSize);
+			}
+			if (StringUtils.isNumeric(pageNo)) {
+				pNo = Integer.parseInt(pageNo);
+			}
+			res.setData(orgHumanResourceService.listOrgHumanResource(year, pNo, pSize, uid));
+		}
 		return res;
 	}
 
@@ -190,14 +201,12 @@ public class AdminApiController extends BaseApiController {
 	@RequestMapping(value = "/updateOrgHumanResource", method = RequestMethod.POST)
 	public Result updateOrgHumanResource(OrgHumanResource orgHumanResource) {
 		Result res = new Result();
-		OrgHumanResource org = orgHumanResourceService.selectOrgHumanResourceByUserId(orgHumanResource.getUid());
-		if (null == org) {
+		if (null == orgHumanResource.getId()) {
 			orgHumanResource.setId(UUID.randomUUID().toString());
 			orgHumanResourceService.insert(orgHumanResource);
 		} else {
 			orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
 		}
-		res.setData(orgHumanResource);
 		return res;
 	}
 
@@ -264,7 +273,9 @@ public class AdminApiController extends BaseApiController {
 			try {
 				orgIntellectualProperty.setId(UUID.randomUUID().toString());
 				orgIntellectualProperty.setUid(uid);
-				orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
+				orgIntellectualProperty.setEvaluationCategory(
+						(orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1
+								: 0);
 				orgIntellectualProperty
 						.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
 				orgIntellectualProperty.setDeletedSign(0);

+ 15 - 4
src/main/java/com/goafanti/common/mapper/OrgFinanceMapper.xml

@@ -16,11 +16,12 @@
     <result column="net_profit" property="netProfit" jdbcType="INTEGER" />
     <result column="sales_revenue" property="salesRevenue" jdbcType="INTEGER" />
     <result column="finance_url" property="financeUrl" jdbcType="VARCHAR" />
+    <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
     id, uid, main_business_income, management_cost, operating_profit, various_tax, current_asset, 
     net_fixed_asset, total_asset, net_asset, gross_profit, net_profit, sales_revenue, 
-    finance_url
+    finance_url, deleted_sign
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
@@ -37,12 +38,12 @@
       management_cost, operating_profit, various_tax, 
       current_asset, net_fixed_asset, total_asset, 
       net_asset, gross_profit, net_profit, 
-      sales_revenue, finance_url)
+      sales_revenue, finance_url, deleted_sign)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{mainBusinessIncome,jdbcType=INTEGER}, 
       #{managementCost,jdbcType=INTEGER}, #{operatingProfit,jdbcType=INTEGER}, #{variousTax,jdbcType=INTEGER}, 
       #{currentAsset,jdbcType=INTEGER}, #{netFixedAsset,jdbcType=INTEGER}, #{totalAsset,jdbcType=INTEGER}, 
       #{netAsset,jdbcType=INTEGER}, #{grossProfit,jdbcType=INTEGER}, #{netProfit,jdbcType=INTEGER}, 
-      #{salesRevenue,jdbcType=INTEGER}, #{financeUrl,jdbcType=VARCHAR})
+      #{salesRevenue,jdbcType=INTEGER}, #{financeUrl,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgFinance" >
     insert into org_finance
@@ -89,6 +90,9 @@
       <if test="financeUrl != null" >
         finance_url,
       </if>
+      <if test="deletedSign != null" >
+        deleted_sign,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
@@ -133,6 +137,9 @@
       <if test="financeUrl != null" >
         #{financeUrl,jdbcType=VARCHAR},
       </if>
+      <if test="deletedSign != null" >
+        #{deletedSign,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgFinance" >
@@ -177,6 +184,9 @@
       <if test="financeUrl != null" >
         finance_url = #{financeUrl,jdbcType=VARCHAR},
       </if>
+       <if test="deletedSign != null" >
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -194,7 +204,8 @@
       gross_profit = #{grossProfit,jdbcType=INTEGER},
       net_profit = #{netProfit,jdbcType=INTEGER},
       sales_revenue = #{salesRevenue,jdbcType=INTEGER},
-      finance_url = #{financeUrl,jdbcType=VARCHAR}
+      finance_url = #{financeUrl,jdbcType=VARCHAR},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   

+ 53 - 6
src/main/java/com/goafanti/common/mapper/OrgHumanResourceMapper.xml

@@ -30,13 +30,15 @@
     <result column="thirtyone_to_thirtyfour" property="thirtyoneToThirtyfour" jdbcType="INTEGER" />
     <result column="fortyone_to_fifty" property="fortyoneToFifty" jdbcType="INTEGER" />
     <result column="above_fifty" property="aboveFifty" jdbcType="INTEGER" />
+    <result column="year" property="year" jdbcType="INTEGER" />
+    <result column="roster_url" property="rosterUrl" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     id, uid, firm_total, tech_total, firm_in_service, tech_in_service, firm_part_time, 
     tech_part_time, firm_temporary, tech_temporary, firm_foreign, tech_foreign, firm_abroad, 
     tech_abroad, firm_core, tech_core, doctor, master, undergraduate, college, 
     senior_title, intermediate_title, junior_title, senior_mechanic, below_thirty, 
-    thirtyone_to_thirtyfour, fortyone_to_fifty, above_fifty
+    thirtyone_to_thirtyfour, fortyone_to_fifty, above_fifty, year, roster_url
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
@@ -58,7 +60,7 @@
       undergraduate, college, senior_title, 
       intermediate_title, junior_title, senior_mechanic, 
       below_thirty, thirtyone_to_thirtyfour, fortyone_to_fifty, 
-      above_fifty)
+      above_fifty, year, roster_url)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{firmTotal,jdbcType=INTEGER}, 
       #{techTotal,jdbcType=INTEGER}, #{firmInService,jdbcType=INTEGER}, #{techInService,jdbcType=INTEGER}, 
       #{firmPartTime,jdbcType=INTEGER}, #{techPartTime,jdbcType=INTEGER}, #{firmTemporary,jdbcType=INTEGER}, 
@@ -68,7 +70,7 @@
       #{undergraduate,jdbcType=INTEGER}, #{college,jdbcType=INTEGER}, #{seniorTitle,jdbcType=INTEGER}, 
       #{intermediateTitle,jdbcType=INTEGER}, #{juniorTitle,jdbcType=INTEGER}, #{seniorMechanic,jdbcType=INTEGER}, 
       #{belowThirty,jdbcType=INTEGER}, #{thirtyoneToThirtyfour,jdbcType=INTEGER}, #{fortyoneToFifty,jdbcType=INTEGER}, 
-      #{aboveFifty,jdbcType=INTEGER})
+      #{aboveFifty,jdbcType=INTEGER}, #{year,jdbcType=INTEGER}, #{rosterUrl,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgHumanResource" >
     insert into org_human_resource
@@ -157,6 +159,12 @@
       <if test="aboveFifty != null" >
         above_fifty,
       </if>
+      <if test="year != null" >
+        year,
+      </if>
+      <if test="rosterUrl != null" >
+        roster_url,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
@@ -243,6 +251,12 @@
       <if test="aboveFifty != null" >
         #{aboveFifty,jdbcType=INTEGER},
       </if>
+      <if test="year != null" >
+        #{year,jdbcType=INTEGER},
+      </if>
+      <if test="rosterUrl != null" >
+        #{rosterUrl,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgHumanResource" >
@@ -329,6 +343,12 @@
       <if test="aboveFifty != null" >
         above_fifty = #{aboveFifty,jdbcType=INTEGER},
       </if>
+      <if test="year != null" >
+        year = #{year,jdbcType=INTEGER},
+      </if>
+      <if test="rosterUrl != null" >
+        roster_url = #{rosterUrl,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -360,14 +380,41 @@
       below_thirty = #{belowThirty,jdbcType=INTEGER},
       thirtyone_to_thirtyfour = #{thirtyoneToThirtyfour,jdbcType=INTEGER},
       fortyone_to_fifty = #{fortyoneToFifty,jdbcType=INTEGER},
-      above_fifty = #{aboveFifty,jdbcType=INTEGER}
+      above_fifty = #{aboveFifty,jdbcType=INTEGER},
+      year = #{year,jdbcType=INTEGER},
+      roster_url = #{rosterUrl,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   
-  <select id="selectOrgHumanResourceByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
+  <select id="findOrgHumanResourceListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
   	 select 
     <include refid="Base_Column_List" />
     from org_human_resource
-    where uid = #{uid,jdbcType=VARCHAR}
+    where 1=1
+    <if test="uid != null">
+	    and  uid = #{uid,jdbcType=VARCHAR}
+	</if>
+	<if test="year != null">
+		and year = #{year,jdbcType=INTEGER}
+	</if>
+	order by year desc
+    <if test="page_sql != null">
+    	${page_sql}
+    </if>
+    
   </select>
+  
+  <select id="findOrgHumanResourceCount" resultType="java.lang.Integer" parameterType="String">
+   	select count(1) 
+	    from org_human_resource
+	     where 1=1
+	    <if test="uid != null">
+		    and  uid = #{uid,jdbcType=VARCHAR}
+		</if>
+		<if test="year != null">
+		and year = #{year,jdbcType=INTEGER}
+	    </if>
+    </select>
+  
+  
 </mapper>

+ 15 - 4
src/main/java/com/goafanti/common/mapper/OrgRatepayMapper.xml

@@ -12,10 +12,11 @@
     <result column="tax_exempt_income" property="taxExemptIncome" jdbcType="INTEGER" />
     <result column="subsidy_income" property="subsidyIncome" jdbcType="INTEGER" />
     <result column="tax_return_url" property="taxReturnUrl" jdbcType="VARCHAR" />
+    <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
     id, uid, operating_income, management_cost, operating_profit, non_operating_income, 
-    non_taxable_income, tax_exempt_income, subsidy_income, tax_return_url
+    non_taxable_income, tax_exempt_income, subsidy_income, tax_return_url, deleted_sign
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
@@ -31,11 +32,11 @@
     insert into org_ratepay (id, uid, operating_income, 
       management_cost, operating_profit, non_operating_income, 
       non_taxable_income, tax_exempt_income, subsidy_income, 
-      tax_return_url)
+      tax_return_url, deleted_sign)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{operatingIncome,jdbcType=INTEGER}, 
       #{managementCost,jdbcType=INTEGER}, #{operatingProfit,jdbcType=INTEGER}, #{nonOperatingIncome,jdbcType=INTEGER}, 
       #{nonTaxableIncome,jdbcType=INTEGER}, #{taxExemptIncome,jdbcType=INTEGER}, #{subsidyIncome,jdbcType=INTEGER}, 
-      #{taxReturnUrl,jdbcType=VARCHAR})
+      #{taxReturnUrl,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgRatepay" >
     insert into org_ratepay
@@ -70,6 +71,9 @@
       <if test="taxReturnUrl != null" >
         tax_return_url,
       </if>
+      <if test="deletedSign != null" >
+        deleted_sign,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
@@ -102,6 +106,9 @@
       <if test="taxReturnUrl != null" >
         #{taxReturnUrl,jdbcType=VARCHAR},
       </if>
+      <if test="deletedSign != null" >
+        #{deletedSign,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgRatepay" >
@@ -134,6 +141,9 @@
       <if test="taxReturnUrl != null" >
         tax_return_url = #{taxReturnUrl,jdbcType=VARCHAR},
       </if>
+      <if test="deletedSign != null" >
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -147,7 +157,8 @@
       non_taxable_income = #{nonTaxableIncome,jdbcType=INTEGER},
       tax_exempt_income = #{taxExemptIncome,jdbcType=INTEGER},
       subsidy_income = #{subsidyIncome,jdbcType=INTEGER},
-      tax_return_url = #{taxReturnUrl,jdbcType=VARCHAR}
+      tax_return_url = #{taxReturnUrl,jdbcType=VARCHAR},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   

+ 15 - 0
src/main/java/com/goafanti/common/model/OrgFinance.java

@@ -64,6 +64,11 @@ public class OrgFinance {
     * 财务报表URL
     */
     private String financeUrl;
+    
+    /**
+     * 删除标记
+     */
+    private Integer deletedSign;
 
     public String getId() {
         return id;
@@ -176,4 +181,14 @@ public class OrgFinance {
     public void setFinanceUrl(String financeUrl) {
         this.financeUrl = financeUrl;
     }
+
+	public Integer getDeletedSign() {
+		return deletedSign;
+	}
+
+	public void setDeletedSign(Integer deletedSign) {
+		this.deletedSign = deletedSign;
+	}
+    
+    
 }

+ 28 - 0
src/main/java/com/goafanti/common/model/OrgHumanResource.java

@@ -134,6 +134,16 @@ public class OrgHumanResource {
     * 五十岁以上员工人数
     */
     private Integer aboveFifty;
+    
+    /**
+     * 年份
+     */
+    private Integer year;
+    
+    /**
+     * 花名册URL
+     */
+    private String rosterUrl;
 
     public String getId() {
         return id;
@@ -360,4 +370,22 @@ public class OrgHumanResource {
     public void setAboveFifty(Integer aboveFifty) {
         this.aboveFifty = aboveFifty;
     }
+
+	public Integer getYear() {
+		return year;
+	}
+
+	public void setYear(Integer year) {
+		this.year = year;
+	}
+
+	public String getRosterUrl() {
+		return rosterUrl;
+	}
+
+	public void setRosterUrl(String rosterUrl) {
+		this.rosterUrl = rosterUrl;
+	}
+    
+    
 }

+ 15 - 0
src/main/java/com/goafanti/common/model/OrgRatepay.java

@@ -44,6 +44,11 @@ public class OrgRatepay {
     * 纳税申报表url
     */
     private String taxReturnUrl;
+    
+    /**
+     * 删除标记
+     */
+    private Integer deletedSign;
 
     public String getId() {
         return id;
@@ -124,4 +129,14 @@ public class OrgRatepay {
     public void setTaxReturnUrl(String taxReturnUrl) {
         this.taxReturnUrl = taxReturnUrl;
     }
+
+	public Integer getDeletedSign() {
+		return deletedSign;
+	}
+
+	public void setDeletedSign(Integer deletedSign) {
+		this.deletedSign = deletedSign;
+	}
+    
+    
 }

+ 87 - 76
src/main/java/com/goafanti/techservice/cognizance/controller/CognizanceApiController.java

@@ -48,15 +48,15 @@ public class CognizanceApiController extends BaseApiController {
 	@Resource
 	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
 	@Resource
-	private OrganizationIdentityService     organizationIdentityService;
+	private OrganizationIdentityService		organizationIdentityService;
 	@Resource
-	private OrgTechProductService           orgTechProductService;
+	private OrgTechProductService			orgTechProductService;
 	@Resource
-	private OrgActivityCostService          orgActivityCostService;
+	private OrgActivityCostService			orgActivityCostService;
 	@Resource
-	private OrgRatepayService               orgRatepayService;
+	private OrgRatepayService				orgRatepayService;
 	@Resource
-	private OrgFinanceService               orgFinanceService;
+	private OrgFinanceService				orgFinanceService;
 
 	/**
 	 * 企业研究开发活动情况表入口
@@ -71,11 +71,11 @@ public class CognizanceApiController extends BaseApiController {
 	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/activityList", method = RequestMethod.POST)
-	public Result activityList(String activityNumber, String activityName, String startDateFormattedDate, String endDateFormattedDate, String pageNo,
-			String pageSize) throws ParseException {
+	public Result activityList(String activityNumber, String activityName, String startDateFormattedDate,
+			String endDateFormattedDate, String pageNo, String pageSize) throws ParseException {
 		Result res = new Result();
 		res = checkCertify(res);
-		if (res.getError().isEmpty()){
+		if (res.getError().isEmpty()) {
 			Integer pNo = 1;
 			Integer pSize = 10;
 			if (StringUtils.isNumeric(pageSize)) {
@@ -84,8 +84,8 @@ public class CognizanceApiController extends BaseApiController {
 			if (StringUtils.isNumeric(pageNo)) {
 				pNo = Integer.parseInt(pageNo);
 			}
-			res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate, endDateFormattedDate, pNo, pSize,
-					TokenManager.getUserId()));
+			res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate,
+					endDateFormattedDate, pNo, pSize, TokenManager.getUserId()));
 		}
 		return res;
 	}
@@ -98,7 +98,8 @@ public class CognizanceApiController extends BaseApiController {
 	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/activity", method = RequestMethod.POST)
-	public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate) throws ParseException {
+	public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate)
+			throws ParseException {
 		Result res = new Result();
 		orgActivity.setDeletedSign(0);
 		orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, "yyyy-MM-dd"));
@@ -111,56 +112,57 @@ public class CognizanceApiController extends BaseApiController {
 			orgActivityService.updateByPrimaryKeySelective(orgActivity);
 			Boolean flag = false;
 			OrgActivityCost cost = orgActivityCostService.selectOrgActivityCostByAid(orgActivity.getId());
-			if (null != cost){
-				if (!StringUtils.isBlank(orgActivity.getActivityNumber())){
+			if (null != cost) {
+				if (!StringUtils.isBlank(orgActivity.getActivityNumber())) {
 					cost.setActivityNumber(orgActivity.getActivityNumber());
 					flag = true;
 				}
-				if (null == orgActivity.getStartDate()){
+				if (null == orgActivity.getStartDate()) {
 					cost.setStartDate(orgActivity.getStartDate());
 					flag = true;
 				}
-				if (null == orgActivity.getEndDate()){
+				if (null == orgActivity.getEndDate()) {
 					cost.setEndDate(orgActivity.getEndDate());
 					flag = true;
 				}
 			}
-			if (flag){
+			if (flag) {
 				orgActivityCostService.updateByPrimaryKeySelective(cost);
 			}
 		}
 		res.setData(orgActivity);
 		return res;
 	}
-	
+
 	/**
 	 * 删除企业研究开发活动情况
+	 * 
 	 * @param ids
 	 * @return
 	 */
 	@RequestMapping(value = "/deleteActivity", method = RequestMethod.POST)
-	public Result deleteActivity(@RequestParam(name = "ids[]", required = true) String[] ids){
+	public Result deleteActivity(@RequestParam(name = "ids[]", required = true) String[] ids) {
 		Result res = new Result();
 		List<String> id = new ArrayList<String>();
-		for (String s : ids){
+		for (String s : ids) {
 			id.add(s);
 		}
 		res.setData(orgActivityService.batchDeleteByPrimaryKey(id));
 		return res;
 	}
-	
-	
+
 	/**
 	 * 企业年度研究开发费用结构明细表列表入口
+	 * 
 	 * @return
-	 * @throws ParseException 
+	 * @throws ParseException
 	 */
-	@RequestMapping(value = "/activityCostList", method = RequestMethod.POST )
-	public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate, String pageNo,
-			String pageSize) throws ParseException{
+	@RequestMapping(value = "/activityCostList", method = RequestMethod.POST)
+	public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate,
+			String pageNo, String pageSize) throws ParseException {
 		Result res = new Result();
 		res = checkCertify(res);
-		if (res.getError().isEmpty()){
+		if (res.getError().isEmpty()) {
 			Integer pNo = 1;
 			Integer pSize = 10;
 			if (StringUtils.isNumeric(pageSize)) {
@@ -169,18 +171,19 @@ public class CognizanceApiController extends BaseApiController {
 			if (StringUtils.isNumeric(pageNo)) {
 				pNo = Integer.parseInt(pageNo);
 			}
-			res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate, endDateFormattedDate, pNo, pSize,
-					TokenManager.getUserId()));
+			res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate,
+					endDateFormattedDate, pNo, pSize, TokenManager.getUserId()));
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 企业年度研究开发费用结构明细表(新增+修改)
+	 * 
 	 * @return
 	 */
 	@RequestMapping(value = "/activityCost", method = RequestMethod.POST)
-	public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate){
+	public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) {
 		Result res = new Result();
 		try {
 			orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
@@ -188,7 +191,7 @@ public class CognizanceApiController extends BaseApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式不正确"));
 			return res;
 		}
-		if (null == orgActivityCost.getId()){
+		if (null == orgActivityCost.getId()) {
 			OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
 			orgActivityCost.setStartDate(ac.getStartDate());
 			orgActivityCost.setEndDate(ac.getEndDate());
@@ -201,17 +204,18 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 删除企业年度研究开发费用结构明细表
+	 * 
 	 * @param ids
 	 * @return
 	 */
 	@RequestMapping(value = "/deleteActivityCost", method = RequestMethod.POST)
-	public Result deleteActivityCost(@RequestParam(name = "ids[]", required = true) String[] ids){
+	public Result deleteActivityCost(@RequestParam(name = "ids[]", required = true) String[] ids) {
 		Result res = new Result();
 		List<String> id = new ArrayList<String>();
-		for (String s : ids){
+		for (String s : ids) {
 			id.add(s);
 		}
 		res.setData(orgActivityCostService.batchDeleteByPrimaryKey(id));
@@ -228,7 +232,7 @@ public class CognizanceApiController extends BaseApiController {
 			String pageNo, String pageSize) {
 		Result res = new Result();
 		res = checkCertify(res);
-		if (res.getError().isEmpty()){
+		if (res.getError().isEmpty()) {
 			Integer pNo = 1;
 			Integer pSize = 10;
 			if (StringUtils.isNumeric(pageSize)) {
@@ -237,8 +241,8 @@ public class CognizanceApiController extends BaseApiController {
 			if (StringUtils.isNumeric(pageNo)) {
 				pNo = Integer.parseInt(pageNo);
 			}
-			res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay, pNo,
-					pSize, TokenManager.getUserId()));
+			res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay,
+					pNo, pSize, TokenManager.getUserId()));
 		}
 		return res;
 	}
@@ -277,7 +281,7 @@ public class CognizanceApiController extends BaseApiController {
 	public Result deleteStandard(@RequestParam(name = "ids[]", required = true) String[] ids) {
 		Result res = new Result();
 		List<String> id = new ArrayList<String>();
-		for (String s : ids){
+		for (String s : ids) {
 			id.add(s);
 		}
 		res.setData(orgStandardService.batchDeleteByPrimaryKey(id));
@@ -292,14 +296,16 @@ public class CognizanceApiController extends BaseApiController {
 	@RequestMapping(value = "/intellectual", method = RequestMethod.POST)
 	public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate) {
 		Result res = new Result();
-		if (null == authorizationDateFormattedDate){
+		if (null == authorizationDateFormattedDate) {
 			res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, "授权日期不能为空"));
 		}
-		if (null == orgIntellectualProperty.getId()){
+		if (null == orgIntellectualProperty.getId()) {
 			try {
 				orgIntellectualProperty.setId(UUID.randomUUID().toString());
 				orgIntellectualProperty.setUid(TokenManager.getUserId());
-				orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
+				orgIntellectualProperty.setEvaluationCategory(
+						(orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1
+								: 0);
 				orgIntellectualProperty
 						.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
 				orgIntellectualProperty.setDeletedSign(0);
@@ -312,7 +318,7 @@ public class CognizanceApiController extends BaseApiController {
 			orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
 			try {
 				orgIntellectualProperty
-				.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
+						.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
 			} catch (ParseException e) {
 				res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式不正确"));
 				return res;
@@ -321,19 +327,20 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-    
+
 	/**
 	 * 用户知识产权列表
+	 * 
 	 * @param pageNo
 	 * @param pageSize
 	 * @return
 	 */
-	
+
 	@RequestMapping(value = "/intellectualList", method = RequestMethod.GET)
 	public Result intellectualList(String pageNo, String pageSize) {
 		Result res = new Result();
 		res = checkCertify(res);
-		if (res.getError().isEmpty()){
+		if (res.getError().isEmpty()) {
 			Integer pNo = 1;
 			Integer pSize = 10;
 			if (StringUtils.isNumeric(pageSize)) {
@@ -346,34 +353,36 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 删除选中知识产权记录
+	 * 
 	 * @param id
 	 * @return
 	 */
 	@RequestMapping(value = "/deleteIntellectual", method = RequestMethod.POST)
-	public Result deleteIntellectual(@RequestParam(name = "ids[]", required = true) String[] ids){
+	public Result deleteIntellectual(@RequestParam(name = "ids[]", required = true) String[] ids) {
 		Result res = new Result();
 		List<String> id = new ArrayList<String>();
-		for (String s : ids){
+		for (String s : ids) {
 			id.add(s);
 		}
 		res.setData(orgIntellectualPropertyService.batchDeleteByPrimaryKey(id));
 		return res;
 	}
-	
+
 	/**
 	 * 上年度高新技术产品(服务)情况列表
+	 * 
 	 * @param pageNo
 	 * @param pageSize
 	 * @return
 	 */
 	@RequestMapping(value = "/techProductList", method = RequestMethod.GET)
-	public Result techProductList(String pageNo, String pageSize){
+	public Result techProductList(String pageNo, String pageSize) {
 		Result res = new Result();
 		res = checkCertify(res);
-		if (res.getError().isEmpty()){
+		if (res.getError().isEmpty()) {
 			Integer pNo = 1;
 			Integer pSize = 10;
 			if (StringUtils.isNumeric(pageSize)) {
@@ -386,16 +395,17 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 上年度高新技术产品(服务)情况(新增+修改)
+	 * 
 	 * @param orgTechProduct
 	 * @return
 	 */
 	@RequestMapping(value = "/techProduct", method = RequestMethod.POST)
-	public Result techProduct(OrgTechProduct orgTechProduct){
+	public Result techProduct(OrgTechProduct orgTechProduct) {
 		Result res = new Result();
-		if (StringUtils.isBlank(orgTechProduct.getId())){
+		if (StringUtils.isBlank(orgTechProduct.getId())) {
 			orgTechProduct.setId(UUID.randomUUID().toString());
 			orgTechProduct.setUid(TokenManager.getUserId());
 			orgTechProduct.setDeletedSign(0);
@@ -406,41 +416,43 @@ public class CognizanceApiController extends BaseApiController {
 		res.setData(orgTechProduct);
 		return res;
 	}
-	
+
 	/**
 	 * 删除选中上年度高新技术产品(服务)情况记录
+	 * 
 	 * @param ids
 	 * @return
 	 */
 	@RequestMapping(value = "/deleteTechProduct", method = RequestMethod.POST)
-	public Result deleteTechProduct(@RequestParam(name = "ids[]", required = true) String[] ids){
+	public Result deleteTechProduct(@RequestParam(name = "ids[]", required = true) String[] ids) {
 		Result res = new Result();
 		List<String> id = new ArrayList<String>();
-		for (String s : ids){
+		for (String s : ids) {
 			id.add(s);
 		}
 		res.setData(orgTechProductService.batchDeleteByPrimaryKey(id));
 		return res;
 	}
-	
+
 	/**
 	 * 企业纳税申报信息入口
+	 * 
 	 * @return
 	 */
 	@RequestMapping(value = "/ratepay", method = RequestMethod.GET)
-	public Result ratepay (){
+	public Result ratepay() {
 		Result res = new Result();
 		res.setData(orgRatepayService.selectOrgRatepayByUid(TokenManager.getUserId()));
 		return res;
 	}
-	
+
 	/**
 	 * 企业纳税申报信息录入+修改
 	 */
 	@RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
-	public Result disposeRatepay(OrgRatepay orgRatepay){
+	public Result disposeRatepay(OrgRatepay orgRatepay) {
 		Result res = new Result();
-		if (null == orgRatepay.getId()){
+		if (null == orgRatepay.getId()) {
 			orgRatepay.setId(UUID.randomUUID().toString());
 			orgRatepay.setUid(TokenManager.getUserId());
 			orgRatepayService.insert(orgRatepay);
@@ -449,27 +461,29 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 财务报表信息入口
+	 * 
 	 * @return
 	 */
 	@RequestMapping(value = "/finance", method = RequestMethod.GET)
-	public Result finance(){
+	public Result finance() {
 		Result res = new Result();
 		res.setData(orgFinanceService.selectOrgFinanceByUid(TokenManager.getUserId()));
 		return res;
 	}
-	
+
 	/**
 	 * 财务报表录入+修改
+	 * 
 	 * @param orgFinance
 	 * @return
 	 */
 	@RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
-	public Result disposeFinance(OrgFinance orgFinance){
+	public Result disposeFinance(OrgFinance orgFinance) {
 		Result res = new Result();
-		if (null == orgFinance.getId()){
+		if (null == orgFinance.getId()) {
 			orgFinance.setId(UUID.randomUUID().toString());
 			orgFinance.setUid(TokenManager.getUserId());
 			orgFinanceService.insert(orgFinance);
@@ -478,16 +492,13 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-	 
-	
-	
-	//判断用户是否通过认证
-	private Result checkCertify(Result res){
-		if (5 != organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()).getAuditStatus()){
+
+	// 判断用户是否通过认证
+	private Result checkCertify(Result res) {
+		if (5 != organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()).getAuditStatus()) {
 			res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
-		} 
+		}
 		return res;
 	}
-	
-	
+
 }

+ 22 - 6
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -608,9 +608,20 @@ public class UserApiController extends BaseApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/humanResource", method = RequestMethod.GET)
-	public Result humanResource() {
+	public Result humanResource(Integer year, String pageNo, String pageSize ) {
 		Result res = new Result();
-        res.setData(orgHumanResourceService.selectOrgHumanResourceByUserId(TokenManager.getUserId()));
+		res = checkCertify(res);
+		if (res.getError().isEmpty()) {
+			Integer pNo = 1;
+			Integer pSize = 10;
+			if (StringUtils.isNumeric(pageSize)) {
+				pSize = Integer.parseInt(pageSize);
+			}
+			if (StringUtils.isNumeric(pageNo)) {
+				pNo = Integer.parseInt(pageNo);
+			}
+			res.setData(orgHumanResourceService.listOrgHumanResource(year, pNo, pSize, TokenManager.getUserId()));
+		}
 		return res;
 	}
 	
@@ -622,16 +633,13 @@ public class UserApiController extends BaseApiController {
 	@RequestMapping(value = "/SaveHumanResource", method = RequestMethod.POST)
 	public Result SaveHumanResource(OrgHumanResource orgHumanResource){
 		Result res = new Result();
-		OrgHumanResource org = orgHumanResourceService.selectOrgHumanResourceByUserId(TokenManager.getUserId());
-		if (null == org){
+		if (null == orgHumanResource.getId()){
 			orgHumanResource.setId(UUID.randomUUID().toString());
 			orgHumanResource.setUid(TokenManager.getUserId());
 			orgHumanResourceService.insert(orgHumanResource);
 		} else {
-			orgHumanResource.setId(org.getId());
 			orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
 		}
-		res.setData(orgHumanResource); 
 		return res;
 	}
 
@@ -908,5 +916,13 @@ public class UserApiController extends BaseApiController {
 		ub.setUid(u.getId());
 		return ub;
 	}
+	
+	// 判断用户是否通过认证
+		private Result checkCertify(Result res) {
+			if (5 != organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()).getAuditStatus()) {
+				res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
+			}
+			return res;
+		}
 
 }

+ 2 - 1
src/main/java/com/goafanti/user/service/OrgHumanResourceService.java

@@ -1,10 +1,11 @@
 package com.goafanti.user.service;
 
 import com.goafanti.common.model.OrgHumanResource;
+import com.goafanti.core.mybatis.page.Pagination;
 
 public interface OrgHumanResourceService {
 
-	OrgHumanResource selectOrgHumanResourceByUserId(String uid);
+	Pagination<OrgHumanResource> listOrgHumanResource(Integer year, Integer pageNo, Integer pageSize, String uid);
 
 	OrgHumanResource insert(OrgHumanResource orgHumanResource);
 

+ 28 - 3
src/main/java/com/goafanti/user/service/impl/OrgHumanResourceServiceImpl.java

@@ -1,19 +1,44 @@
 package com.goafanti.user.service.impl;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.dao.OrgHumanResourceMapper;
 import com.goafanti.common.model.OrgHumanResource;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.service.OrgHumanResourceService;
 @Service
-public class OrgHumanResourceServiceImpl implements OrgHumanResourceService{
+public class OrgHumanResourceServiceImpl extends BaseMybatisDao<OrgHumanResourceMapper> implements OrgHumanResourceService{
 	@Autowired
 	private OrgHumanResourceMapper  orgHumanResourceMapper;
 	
+	@SuppressWarnings("unchecked")
 	@Override
-	public OrgHumanResource selectOrgHumanResourceByUserId(String uid) {
-		return orgHumanResourceMapper.selectOrgHumanResourceByUserId(uid);
+	public Pagination<OrgHumanResource> listOrgHumanResource(Integer year, Integer pageNo, Integer pageSize, String uid) {
+		Map<String, Object> params = new HashMap<>();
+		
+		if (!StringUtils.isBlank(uid)){
+			params.put("uid", uid);
+		}
+		
+		if (null != year){
+			params.put("year", year);
+		}
+
+		if (pageNo == null || pageNo < 0) {
+			pageNo = 1;
+		}
+
+		if (pageSize == null || pageSize < 0) {
+			pageSize = 10;
+		}
+		return  (Pagination<OrgHumanResource>)findPage("findOrgHumanResourceListByPage",
+				"findOrgHumanResourceCount", params, pageNo, pageSize);
 	}
 	
 	@Override