Antiloveg лет назад: 8
Родитель
Сommit
61a1a778fa
20 измененных файлов с 323 добавлено и 132 удалено
  1. 3 0
      schema/2017-03-12.sql
  2. 67 26
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  3. 5 0
      src/main/java/com/goafanti/common/dao/OrgCognizanceMapper.java
  4. 15 0
      src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml
  5. 4 4
      src/main/java/com/goafanti/common/mapper/PatentCostMapper.xml
  6. 30 23
      src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml
  7. 2 2
      src/main/java/com/goafanti/common/mapper/PatentLogMapper.xml
  8. 4 4
      src/main/java/com/goafanti/common/mapper/PatentRegistrationMapper.xml
  9. 9 7
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  10. 2 4
      src/main/java/com/goafanti/common/model/OrgCognizance.java
  11. 16 0
      src/main/java/com/goafanti/common/model/PatentInfo.java
  12. 0 1
      src/main/java/com/goafanti/techservice/cognizance/bo/CognizanceDetailBo.java
  13. 91 57
      src/main/java/com/goafanti/techservice/cognizance/controller/CognizanceApiController.java
  14. 5 0
      src/main/java/com/goafanti/techservice/cognizance/service/OrgCognizanceService.java
  15. 12 1
      src/main/java/com/goafanti/techservice/cognizance/service/impl/OrgCognizanceServiceImpl.java
  16. 22 0
      src/main/java/com/goafanti/techservice/patent/controller/PatentApiController.java
  17. 3 1
      src/main/java/com/goafanti/techservice/patent/service/impl/AdminServiceImpl.java
  18. 11 1
      src/main/java/com/goafanti/user/bo/OrgListBo.java
  19. 10 0
      src/main/java/com/goafanti/user/bo/UserListBo.java
  20. 12 1
      src/main/java/com/goafanti/user/controller/UserRegisterController.java

+ 3 - 0
schema/2017-03-12.sql

@@ -0,0 +1,3 @@
+alter table org_cognizance_log drop foreign key fk_org_cognizance_log_org_cognizance1;
+
+alter table patent_info add deleted_sign INT(1) NULL COMMENT '删除标记' 

+ 67 - 26
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -3,6 +3,7 @@ package com.goafanti.admin.controller;
 import java.io.IOException;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.ParseException;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Calendar;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.List;
@@ -116,7 +117,7 @@ public class AdminApiController extends BaseApiController {
 	@Resource
 	@Resource
 	private OrgAnnualReportService			orgAnnualReportService;
 	private OrgAnnualReportService			orgAnnualReportService;
 	@Resource
 	@Resource
-	private AftFileService                  aftFileService;
+	private AftFileService					aftFileService;
 
 
 	/**
 	/**
 	 * 个人用户列表
 	 * 个人用户列表
@@ -165,10 +166,14 @@ public class AdminApiController extends BaseApiController {
 	 * 修改个人用户信息
 	 * 修改个人用户信息
 	 * 
 	 * 
 	 * @return
 	 * @return
+	 * @throws ParseException
 	 */
 	 */
 	@RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
 	@RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
-	public Result updateUserDetail(UserIdentity userIdentity) {
+	public Result updateUserDetail(UserIdentity userIdentity, String paymentDateFormattedDate) throws ParseException {
 		Result res = new Result();
 		Result res = new Result();
+		if (!StringUtils.isBlank(paymentDateFormattedDate)) {
+			userIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, "yyyy-MM-dd"));
+		}
 		res.setData(userIdentityService.updateByPrimaryKeySelective(userIdentity));
 		res.setData(userIdentityService.updateByPrimaryKeySelective(userIdentity));
 		return res;
 		return res;
 	}
 	}
@@ -221,10 +226,15 @@ public class AdminApiController extends BaseApiController {
 	 * 
 	 * 
 	 * @param orgIdentity
 	 * @param orgIdentity
 	 * @return
 	 * @return
+	 * @throws ParseException
 	 */
 	 */
 	@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
 	@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
-	public Result updateOrgDetail(OrganizationIdentity orgIdentity) {
+	public Result updateOrgDetail(OrganizationIdentity orgIdentity, String paymentDateFormattedDate)
+			throws ParseException {
 		Result res = new Result();
 		Result res = new Result();
+		if (!StringUtils.isBlank(paymentDateFormattedDate)) {
+			orgIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, "yyyy-MM-dd"));
+		}
 		res.setData(organizationIdentityService.updateByPrimaryKeySelective(orgIdentity));
 		res.setData(organizationIdentityService.updateByPrimaryKeySelective(orgIdentity));
 		return res;
 		return res;
 	}
 	}
@@ -827,11 +837,17 @@ public class AdminApiController extends BaseApiController {
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
 	@RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
-	public Result applyCognizance(String contacts, String comment, String consultant, String uid, Integer year, Integer state) {
+	public Result applyCognizance(String contacts, String comment, String consultant, String uid, Integer year,
+			Integer state) {
 		Result res = new Result();
 		Result res = new Result();
-		if (null == year){
-			res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "申请认定年份不能为空!"));
+		if (null == year) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "申请认定年份不能为空!"));
+		}
+
+		if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, uid)) {
+			res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
 		}
 		}
+
 		OrgCognizance c = new OrgCognizance();
 		OrgCognizance c = new OrgCognizance();
 		c.setId(UUID.randomUUID().toString());
 		c.setId(UUID.randomUUID().toString());
 		c.setUid(uid);
 		c.setUid(uid);
@@ -841,7 +857,6 @@ public class AdminApiController extends BaseApiController {
 		c.setYear(year);
 		c.setYear(year);
 		c.setDeletedSign(0);
 		c.setDeletedSign(0);
 		orgCognizanceService.insert(c);
 		orgCognizanceService.insert(c);
-		
 
 
 		OrgCognizanceLog log = new OrgCognizanceLog();
 		OrgCognizanceLog log = new OrgCognizanceLog();
 		log.setId(UUID.randomUUID().toString());
 		log.setId(UUID.randomUUID().toString());
@@ -942,6 +957,22 @@ public class AdminApiController extends BaseApiController {
 		orgCognizanceService.updateByPrimaryKeySelective(cog);
 		orgCognizanceService.updateByPrimaryKeySelective(cog);
 		return res;
 		return res;
 	}
 	}
+	
+	/**
+	 * 刪除高企认定
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/deleteCognizance", method = RequestMethod.POST)
+	public Result deleteAnnualReport(@RequestParam(name = "ids[]", required = true) String[] ids) {
+		Result res = new Result();
+		List<String> id = new ArrayList<String>();
+		for (String s : ids) {
+			id.add(s);
+		}
+		res.setData(orgCognizanceService.batchDeleteByPrimaryKey(id));
+		return res;
+	}
 
 
 	/**
 	/**
 	 * 企业创新能力入口
 	 * 企业创新能力入口
@@ -1045,26 +1076,34 @@ public class AdminApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
-	 * 上传专利代理委托书模版
+	 * 上传相关模版
+	 * 
 	 * @param req
 	 * @param req
 	 * @return
 	 * @return
 	 */
 	 */
-	@RequestMapping(value = "/uploadPatentTemplate", method = RequestMethod.POST)
-	public Result uploadPatentTemplate(HttpServletRequest req){
+	@RequestMapping(value = "/uploadTemplate", method = RequestMethod.POST)
+	public Result uploadPatentTemplate(HttpServletRequest req, String sign) {
 		Result res = new Result();
 		Result res = new Result();
+		String fileName = "";
 		List<MultipartFile> files = getFiles(req);
 		List<MultipartFile> files = getFiles(req);
 		MultipartFile mf = files.get(0);
 		MultipartFile mf = files.get(0);
 		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
 		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
-		if (suffix.equals("doc") || suffix.equals("doxc")){
-			String fileName = "patent_prory_statement" + suffix;
+		if (suffix.equals("doc") || suffix.equals("doxc")) {
+			if ("patent_prory_statement".equals(sign)) {
+				fileName = "patent_prory_statement" + suffix;
+			} else {
+				fileName = System.nanoTime() + "";
+			}
 			res.setData(handleFile(res, req, fileName, files, mf));
 			res.setData(handleFile(res, req, fileName, files, mf));
-			if (res.getData() != ""){
+			if (res.getData() != "") {
 				AftFile f = new AftFile();
 				AftFile f = new AftFile();
 				f.setId(UUID.randomUUID().toString());
 				f.setId(UUID.randomUUID().toString());
-				f.setFileName("专利代理委托书模版");
-				f.setSign("patent_prory_statement");
+				if ("patent_prory_statement".equals(sign)) {
+					f.setFileName("专利代理委托书模版");
+					f.setSign(sign);
+				} 
 				f.setFilePath("/admin/" + fileName);
 				f.setFilePath("/admin/" + fileName);
 				f.setDeleletedSign(0);
 				f.setDeleletedSign(0);
 				aftFileService.insert(f);
 				aftFileService.insert(f);
@@ -1074,7 +1113,7 @@ public class AdminApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 
 	 * 
 	 * @return
 	 * @return
@@ -1119,7 +1158,8 @@ public class AdminApiController extends BaseApiController {
 				null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
 				null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
 		cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
 		cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
 
 
-		CognizanceResearchCostBo researchCost = orgCognizanceService.selectCognizanceResearchCostBoByUidAndYear(year, uid);
+		CognizanceResearchCostBo researchCost = orgCognizanceService.selectCognizanceResearchCostBoByUidAndYear(year,
+				uid);
 		cog.setResearchCost(
 		cog.setResearchCost(
 				null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
 				null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
 		cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
 		cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
@@ -1141,12 +1181,12 @@ public class AdminApiController extends BaseApiController {
 		cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
 		cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
 		cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
 		cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
 		cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
 		cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
-        BigDecimal revenue = orgCognizanceService.selectLastYearRevenueByUidAndYear(year, uid);
-        if (null != revenue){
-        	cog.setLastYearRevenue(revenue);
-        } else {
-        	cog.setLastYearRevenue(new BigDecimal(0));
-        }
+		BigDecimal revenue = orgCognizanceService.selectLastYearRevenueByUidAndYear(year, uid);
+		if (null != revenue) {
+			cog.setLastYearRevenue(revenue);
+		} else {
+			cog.setLastYearRevenue(new BigDecimal(0));
+		}
 		return cog;
 		return cog;
 	}
 	}
 
 
@@ -1199,8 +1239,9 @@ public class AdminApiController extends BaseApiController {
 
 
 		return report;
 		return report;
 	}
 	}
-	
-	private String handleFile(Result res, HttpServletRequest req, String fileName,List<MultipartFile> files, MultipartFile mf) {
+
+	private String handleFile(Result res, HttpServletRequest req, String fileName, List<MultipartFile> files,
+			MultipartFile mf) {
 		if (!files.isEmpty()) {
 		if (!files.isEmpty()) {
 			try {
 			try {
 				mf.transferTo(toAdminPrivateFile(fileName));
 				mf.transferTo(toAdminPrivateFile(fileName));

+ 5 - 0
src/main/java/com/goafanti/common/dao/OrgCognizanceMapper.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.dao;
 package com.goafanti.common.dao;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.List;
 
 
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.techservice.cognizance.bo.CognizanceCatagoryBo;
 import com.goafanti.techservice.cognizance.bo.CognizanceCatagoryBo;
@@ -30,4 +31,8 @@ public interface OrgCognizanceMapper {
 	CognizanceCatagoryBo selectCognizanceCatagoryBoByUidAndYear(Integer year, String uid);
 	CognizanceCatagoryBo selectCognizanceCatagoryBoByUidAndYear(Integer year, String uid);
 
 
 	BigDecimal selectLastYearRevenueByUidAndYear(Integer year, String uid);
 	BigDecimal selectLastYearRevenueByUidAndYear(Integer year, String uid);
+
+	OrgCognizance selectCognizanceByUidAndYear(Integer year, String uid);
+
+	int batchDeleteByPrimaryKey(List<String> id);
 }
 }

+ 15 - 0
src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml

@@ -386,4 +386,19 @@
 			from org_tech_product where uid = #{1}
 			from org_tech_product where uid = #{1}
 			and year = #{0} and deleted_sign = 0
 			and year = #{0} and deleted_sign = 0
 	</select>
 	</select>
+	
+	 <select id="selectCognizanceByUidAndYear" resultMap="BaseResultMap"  >
+    select 
+    <include refid="Base_Column_List" />
+    from org_cognizance
+    where year = #{0} and uid = #{1} and deleted_sign = 0
+  </select>
+  
+  <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
+  	update org_cognizance set deleted_sign = 1
+  	where  id in 
+	<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
+		#{item}
+	</foreach>
+  </update>
 </mapper>
 </mapper>

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

@@ -166,9 +166,9 @@
      	    o.location_province as locationProvince , o.unit_name as unitName , 
      	    o.location_province as locationProvince , o.unit_name as unitName , 
       		p.patent_name as patentName , p.patent_application_date as patentApplicationDate
       		p.patent_name as patentName , p.patent_application_date as patentApplicationDate
     from user u
     from user u
+		LEFT JOIN organization_identity o on o.uid = u.id  
 		INNER JOIN patent_info p on u.id =p.uid
 		INNER JOIN patent_info p on u.id =p.uid
-		INNER JOIN organization_identity o on o.uid = u.id  
-		where 1=1
+		where p.deleted_sign = 0
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		</if>
@@ -201,9 +201,9 @@
      	    o.location_province as locationProvince , o.unit_name as unitName , 
      	    o.location_province as locationProvince , o.unit_name as unitName , 
       		p.patent_name as patentName , p.patent_application_date as patentApplicationDate
       		p.patent_name as patentName , p.patent_application_date as patentApplicationDate
     from user u
     from user u
+        LEFT JOIN organization_identity o on o.uid = u.id  
 		INNER JOIN patent_info p on u.id =p.uid
 		INNER JOIN patent_info p on u.id =p.uid
-		INNER JOIN organization_identity o on o.uid = u.id  
-		where 1=1
+		where p.deleted_sign = 0
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		</if>

+ 30 - 23
src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml

@@ -32,6 +32,7 @@
     <result column="office" property="office" jdbcType="VARCHAR" />
     <result column="office" property="office" jdbcType="VARCHAR" />
     <result column="principal" property="principal" jdbcType="VARCHAR" />
     <result column="principal" property="principal" jdbcType="VARCHAR" />
     <result column="confirm_state" property="confirmState" jdbcType="INTEGER" />
     <result column="confirm_state" property="confirmState" jdbcType="INTEGER" />
+    <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List" >
   <sql id="Base_Column_List" >
     id, uid, serial_number, patent_number, patent_name, patent_catagory, patent_state, 
     id, uid, serial_number, patent_number, patent_name, patent_catagory, patent_state, 
@@ -39,7 +40,7 @@
     patent_certificate_url, patent_application_date, first_inventor_name, first_inventor_nationality, 
     patent_certificate_url, patent_application_date, first_inventor_name, first_inventor_nationality, 
     first_inventor_id_number, first_inventor_is_publish, second_inventor_name, second_inventor_nationality, 
     first_inventor_id_number, first_inventor_is_publish, second_inventor_name, second_inventor_nationality, 
     second_inventor_is_publish, third_inventor_name, third_inventor_nationality, third_inventor_is_publish, 
     second_inventor_is_publish, third_inventor_name, third_inventor_nationality, third_inventor_is_publish, 
-    create_time, author, authorized_date,office, principal ,confirm_state
+    create_time, author, authorized_date,office, principal ,confirm_state, deleted_sign
   </sql>
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
     select 
@@ -63,7 +64,7 @@
       second_inventor_nationality, second_inventor_is_publish, 
       second_inventor_nationality, second_inventor_is_publish, 
       third_inventor_name, third_inventor_nationality, 
       third_inventor_name, third_inventor_nationality, 
       third_inventor_is_publish, create_time, author, authorized_date, 
       third_inventor_is_publish, create_time, author, authorized_date, 
-      office, principal, confirm_state)
+      office, principal, confirm_state, deleted_sign)
      
      
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, 
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, 
       #{patentNumber,jdbcType=VARCHAR}, #{patentName,jdbcType=VARCHAR}, #{patentCatagory,jdbcType=INTEGER}, 
       #{patentNumber,jdbcType=VARCHAR}, #{patentName,jdbcType=VARCHAR}, #{patentCatagory,jdbcType=INTEGER}, 
@@ -77,7 +78,7 @@
       #{thirdInventorName,jdbcType=VARCHAR}, #{thirdInventorNationality,jdbcType=VARCHAR}, 
       #{thirdInventorName,jdbcType=VARCHAR}, #{thirdInventorNationality,jdbcType=VARCHAR}, 
       #{thirdInventorIsPublish,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{author,jdbcType=VARCHAR}, 
       #{thirdInventorIsPublish,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{author,jdbcType=VARCHAR}, 
       #{authorizedDate,jdbcType=TIMESTAMP},
       #{authorizedDate,jdbcType=TIMESTAMP},
-      #{office,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{confirmState,jdbcType=INTEGER})
+      #{office,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{confirmState,jdbcType=INTEGER}, #{deletedSign,jdbcType=INTEGER})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentInfo" >
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentInfo" >
     insert into patent_info
     insert into patent_info
@@ -172,6 +173,9 @@
       <if test="confirmState != null">
       <if test="confirmState != null">
         confirm_state,
         confirm_state,
       </if>
       </if>
+      <if test="deletedSign != null">
+        deleted_sign,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
       <if test="id != null" >
@@ -264,6 +268,9 @@
       <if test="confirmState != null">
       <if test="confirmState != null">
         #{confirmState,jdbcType=INTEGER}
         #{confirmState,jdbcType=INTEGER}
       </if>
       </if>
+      <if test="deletedSign != null">
+        #{deletedSign,jdbcType=INTEGER}
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentInfo" >
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentInfo" >
@@ -356,6 +363,9 @@
       <if test="confirmState != null">
       <if test="confirmState != null">
         confirm_state = #{confirmState,jdbcType=INTEGER},
         confirm_state = #{confirmState,jdbcType=INTEGER},
       </if>
       </if>
+       <if test="deletedSign != null">
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
     </set>
     </set>
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   </update>
@@ -389,7 +399,8 @@
       authorized_date = #{authorizedDate,jdbcType=VARCHAR},
       authorized_date = #{authorizedDate,jdbcType=VARCHAR},
       office = #{office,jdbcType=VARCHAR},
       office = #{office,jdbcType=VARCHAR},
       principal = #{principal,jdbcType=VARCHAR},
       principal = #{principal,jdbcType=VARCHAR},
-      confirmState = #{confirmState,jdbcType=INTEGER}
+      confirm_state = #{confirmState,jdbcType=INTEGER},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   </update>
   
   
@@ -397,14 +408,14 @@
     select 
     select 
       <include refid="Base_Column_List" />
       <include refid="Base_Column_List" />
       from patent_info
       from patent_info
-    where uid = #{uid,jdbcType=VARCHAR}
+    where uid = #{uid,jdbcType=VARCHAR} and deleted_sign = 0
   </select>
   </select>
   
   
    <select id="findClientApplyListByPage" resultMap="BaseResultMap" parameterType="String">
    <select id="findClientApplyListByPage" resultMap="BaseResultMap" parameterType="String">
  	select
  	select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from patent_info 
     from patent_info 
-    where 1=1
+    where deleted_sign = 0
     <if test ="uid != null">
     <if test ="uid != null">
         and uid = #{uid,jdbcType=VARCHAR}
         and uid = #{uid,jdbcType=VARCHAR}
     </if>
     </if>
@@ -430,7 +441,7 @@
   <select id="findClentApplyCount" resultType="java.lang.Integer" parameterType="String">
   <select id="findClentApplyCount" resultType="java.lang.Integer" parameterType="String">
  	select count(1)
  	select count(1)
     from patent_info
     from patent_info
-    where 1=1
+    where deleted_sign = 0
     <if test ="uid != null">
     <if test ="uid != null">
         and uid = #{uid,jdbcType=VARCHAR}
         and uid = #{uid,jdbcType=VARCHAR}
     </if>
     </if>
@@ -481,11 +492,11 @@
 			o.last_year_tax_report_url as lastYearTaxReportUrl, p.patent_writing_url as patentWritingUrl ,
 			o.last_year_tax_report_url as lastYearTaxReportUrl, p.patent_writing_url as patentWritingUrl ,
 		    p.authorization_notice_url as authorizationNoticeUrl , p.patent_certificate_url as patentCertificateUrl
 		    p.authorization_notice_url as authorizationNoticeUrl , p.patent_certificate_url as patentCertificateUrl
 	from user u 
 	from user u 
-	INNER JOIN organization_identity o
+	LEFT JOIN organization_identity o
 	on u.id = o.uid
 	on u.id = o.uid
 	INNER  JOIN patent_info p
 	INNER  JOIN patent_info p
 	on u.id = p.uid 
 	on u.id = p.uid 
-	where 1=1
+	where deleted_sign = 0
 	 
 	 
 	<if test="serialNumber != null">
 	<if test="serialNumber != null">
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
@@ -572,11 +583,11 @@
 			o.last_year_tax_report_url as lastYearTaxReportUrl, p.patent_writing_url as patentWritingUrl ,
 			o.last_year_tax_report_url as lastYearTaxReportUrl, p.patent_writing_url as patentWritingUrl ,
 		    p.authorization_notice_url as authorizationNoticeUrl , p.patent_certificate_url as patentCertificateUrl
 		    p.authorization_notice_url as authorizationNoticeUrl , p.patent_certificate_url as patentCertificateUrl
 	from user u 
 	from user u 
-	INNER JOIN organization_identity o
+	LEFT JOIN organization_identity o
 	on u.id = o.uid
 	on u.id = o.uid
 	INNER  JOIN patent_info p
 	INNER  JOIN patent_info p
 	on u.id = p.uid 
 	on u.id = p.uid 
-	where 1=1
+	where deleted_sign = 0
 	 
 	 
 	<if test="serialNumber != null">
 	<if test="serialNumber != null">
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
@@ -626,7 +637,6 @@
 	 <if test="page_sql!=null">
 	 <if test="page_sql!=null">
 		${page_sql}
 		${page_sql}
 	</if>
 	</if>
-		
 		) 
 		) 
 	as total
 	as total
   </select>
   </select>
@@ -638,8 +648,8 @@
                o.location_province as locationProvince , o.unit_name as unitName , p.patent_name as patentName,
                o.location_province as locationProvince , o.unit_name as unitName , p.patent_name as patentName,
                p.patent_catagory as patentCatagory ,p.patent_state as patentState , p.authorized_date as authorizedDate
                p.patent_catagory as patentCatagory ,p.patent_state as patentState , p.authorized_date as authorizedDate
         from user u
         from user u
-		INNER JOIN patent_info p on u.id =p.uid
-		INNER JOIN organization_identity o on o.uid = u.id 
+		LEFT JOIN organization_identity o on o.uid = u.id 
+		INNER JOIN patent_info p on u.id =p.uid where p.deleted_sign = 0
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		</if>
@@ -654,26 +664,23 @@
   
   
   <select id="findManagePendingPaymentCount" resultType="java.lang.Integer" parameterType="String">
   <select id="findManagePendingPaymentCount" resultType="java.lang.Integer" parameterType="String">
   	 select count(1) from (
   	 select count(1) from (
-  	 
   	   select n.*,c.id as cid ,c.annual_fee_state as annualFeeState 
   	   select n.*,c.id as cid ,c.annual_fee_state as annualFeeState 
   	   from patent_cost c INNER JOIN
   	   from patent_cost c INNER JOIN
        (select u.id as uid , p.id as pid ,o.id as oid , p.serial_number as serialNumber ,p.patent_number as patentNumber ,
        (select u.id as uid , p.id as pid ,o.id as oid , p.serial_number as serialNumber ,p.patent_number as patentNumber ,
                o.location_province as locationProvince , o.unit_name as unitName , p.patent_name as patentName,
                o.location_province as locationProvince , o.unit_name as unitName , p.patent_name as patentName,
                p.patent_catagory as patentCatagory ,p.patent_state as patentState , p.authorized_date as authorizedDate
                p.patent_catagory as patentCatagory ,p.patent_state as patentState , p.authorized_date as authorizedDate
         from user u
         from user u
-		INNER JOIN patent_info p on u.id =p.uid
-		INNER JOIN organization_identity o on o.uid = u.id where p.patent_state=8 
+		LEFT JOIN organization_identity o on o.uid = u.id 
+		INNER JOIN patent_info p on u.id = p.uid   where p.deleted_sign = 0
 		<if test="locationProvince != null">
 		<if test="locationProvince != null">
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		</if>
 		order by p.authorized_date DESC
 		order by p.authorized_date DESC
 		) n
 		) n
 		on n.pid= c.pid where c.annual_fee_state=0
 		on n.pid= c.pid where c.annual_fee_state=0
-		
 	<if test="page_sql!=null">
 	<if test="page_sql!=null">
 		${page_sql}
 		${page_sql}
 	</if>
 	</if>
-		
 		) as total
 		) as total
   </select>
   </select>
   
   
@@ -683,9 +690,9 @@
 		 o.location_province as locationProvince ,o.unit_name as unitName , p.patent_catagory as patentCatagory ,
 		 o.location_province as locationProvince ,o.unit_name as unitName , p.patent_catagory as patentCatagory ,
 		 p.patent_state as patentState , p.author , p.authorized_date as authorizedDate 
 		 p.patent_state as patentState , p.author , p.authorized_date as authorizedDate 
 		 FROM user u 
 		 FROM user u 
+		 LEFT JOIN organization_identity o ON u.id = o.uid
 		 INNER JOIN patent_info p on u.id = p.uid 
 		 INNER JOIN patent_info p on u.id = p.uid 
-		 INNER JOIN organization_identity o ON u.id = o.uid
-   where p.patent_state in (4,6) 
+   where p.patent_state in (4,6) and p.deleted_sign = 0
 	<if test="serialNumber != null">
 	<if test="serialNumber != null">
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
 	</if>
@@ -730,9 +737,9 @@
 		 o.location_province as locationProvince ,o.unit_name as unitName , p.patent_catagory as patentCatagory ,
 		 o.location_province as locationProvince ,o.unit_name as unitName , p.patent_catagory as patentCatagory ,
 		 p.patent_state as patentState , p.author , p.authorized_date as authorizedDate 
 		 p.patent_state as patentState , p.author , p.authorized_date as authorizedDate 
 		 FROM user u 
 		 FROM user u 
+		 LEFT JOIN organization_identity o ON u.id = o.uid
 		 INNER JOIN patent_info p on u.id = p.uid 
 		 INNER JOIN patent_info p on u.id = p.uid 
-		 INNER JOIN organization_identity o ON u.id = o.uid
-   where p.patent_state in (4,6) 
+   where p.patent_state in (4,6) and p.delete_sign = 0
 	<if test="serialNumber != null">
 	<if test="serialNumber != null">
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 	    and p.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
 	</if>

+ 2 - 2
src/main/java/com/goafanti/common/mapper/PatentLogMapper.xml

@@ -118,8 +118,8 @@
   <select id="selectProcessByPid"  parameterType="java.lang.String" resultMap="BaseResultMap">
   <select id="selectProcessByPid"  parameterType="java.lang.String" resultMap="BaseResultMap">
     select b.name as principal , m.operator , m.id , m.pid , m.state , m.comment , m.record_time from 
     select b.name as principal , m.operator , m.id , m.pid , m.state , m.comment , m.record_time from 
 		(select a.name as operator, p.id ,p.pid  , p.state , p.comment ,p.record_time , p.principal as pri
 		(select a.name as operator, p.id ,p.pid  , p.state , p.comment ,p.record_time , p.principal as pri
-		from patent_log p INNER JOIN admin a 
-		on a.id = p.operator order by p.record_time desc) m INNER JOIN admin b on m.pri = b. id
+		from patent_log p LEFT JOIN admin a 
+		on a.id = p.operator order by p.record_time desc) m LEFT JOIN admin b on m.pri = b. id
     where pid = #{pid,jdbcType=VARCHAR}
     where pid = #{pid,jdbcType=VARCHAR}
     
     
   </select>
   </select>

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

@@ -215,8 +215,8 @@
               o.location_province as locationProvince , o.unit_name as unitName ,
               o.location_province as locationProvince , o.unit_name as unitName ,
               p.patent_catagory as patentCatagory , p.patent_name as patentName
               p.patent_catagory as patentCatagory , p.patent_name as patentName
        from user u
        from user u
-	   INNER JOIN patent_info p on u.id =p.uid
-	   INNER JOIN organization_identity o on o.uid = u.id
+	   INNER JOIN patent_info p on u.id =p.uid and p.deleted_sign = 0
+	   LEFT JOIN organization_identity o on o.uid = u.id
 	   ) m
 	   ) m
   LEFT JOIN patent_registration r on m.pid = r.pid
   LEFT JOIN patent_registration r on m.pid = r.pid
   </select>
   </select>
@@ -235,8 +235,8 @@
               o.location_province as locationProvince , o.unit_name as unitName ,
               o.location_province as locationProvince , o.unit_name as unitName ,
               p.patent_catagory as patentCatagory , p.patent_name as patentName
               p.patent_catagory as patentCatagory , p.patent_name as patentName
        from user u
        from user u
-	   INNER JOIN patent_info p on u.id =p.uid
-	   INNER JOIN organization_identity o on o.uid = u.id
+	   INNER JOIN patent_info p on u.id =p.uid and p.deleted_sign = 0
+	   LEFT JOIN organization_identity o on o.uid = u.id
 	   ) m
 	   ) m
     LEFT JOIN patent_registration r on m.pid = r.pid
     LEFT JOIN patent_registration r on m.pid = r.pid
     
     

+ 9 - 7
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -197,10 +197,10 @@
   
   
   <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
   <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
   	select u.id ,u.mobile, u.email, u.create_time as createTime, 
   	select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , i.aft_username as aftUsername, i.audit_status as auditStatus
-    from user u LEFT JOIN user_identity i 
-    ON u.id = i.uid 
-    WHERE u.type = 0
+  	       u.number , i.aft_username as aftUsername, i.audit_status as auditStatus, a.name as adminName
+    from user u  LEFT JOIN admin a on a.id = u.aid
+   LEFT JOIN user_identity i 
+    ON u.id = i.uid  where u.type = 0
     <if test = "mobile != null">
     <if test = "mobile != null">
 	    and u.mobile = #{mobile,jdbcType=VARCHAR}
 	    and u.mobile = #{mobile,jdbcType=VARCHAR}
 	</if>
 	</if>
@@ -256,11 +256,13 @@
   </select>  
   </select>  
   
   
   <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
   <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
-  	select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , o.aft_username as aftUsername, o.audit_status as auditStatus
-    from user u LEFT JOIN organization_identity o 
+  select u.id ,u.mobile, u.email, u.create_time as createTime, 
+  	       u.number , o.aft_username as aftUsername, o.audit_status as auditStatus, a.name as adminName
+    from user u  LEFT JOIN admin a on a.id = u.aid 
+	LEFT JOIN organization_identity o 
     ON u.id = o.uid 
     ON u.id = o.uid 
     WHERE u.type = 1
     WHERE u.type = 1
+   
     <if test = "mobile != null">
     <if test = "mobile != null">
 	    and u.mobile = #{mobile,jdbcType=VARCHAR}
 	    and u.mobile = #{mobile,jdbcType=VARCHAR}
 	</if>
 	</if>

+ 2 - 4
src/main/java/com/goafanti/common/model/OrgCognizance.java

@@ -4,9 +4,7 @@ import java.util.Date;
 
 
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 
 
 public class OrgCognizance {
 public class OrgCognizance {
     private String id;
     private String id;
@@ -226,7 +224,7 @@ public class OrgCognizance {
         this.certificateUrl = certificateUrl;
         this.certificateUrl = certificateUrl;
     }
     }
     
     
-    @JsonFormat(shape = Shape.STRING)
+    
     public Integer getState() {
     public Integer getState() {
         return state;
         return state;
     }
     }
@@ -235,7 +233,7 @@ public class OrgCognizance {
         this.state = state;
         this.state = state;
     }
     }
     
     
-    @JsonIgnore
+    
     public Integer getYear() {
     public Integer getYear() {
 		return year;
 		return year;
 	}
 	}

+ 16 - 0
src/main/java/com/goafanti/common/model/PatentInfo.java

@@ -5,6 +5,7 @@ import java.util.Date;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.goafanti.common.utils.FileUtils;
 import com.goafanti.common.utils.FileUtils;
@@ -153,6 +154,11 @@ public class PatentInfo {
      * 用户确认申报材料
      * 用户确认申报材料
      */
      */
     private Integer confirmState;
     private Integer confirmState;
+    
+    /**
+     * 删除标记
+     */
+    private Integer deletedSign;
 
 
     public String getId() {
     public String getId() {
         return id;
         return id;
@@ -395,6 +401,16 @@ public class PatentInfo {
 	public void setConfirmState(Integer confirmState) {
 	public void setConfirmState(Integer confirmState) {
 		this.confirmState = confirmState;
 		this.confirmState = confirmState;
 	}
 	}
+	
+	
+    @JsonIgnore
+	public Integer getDeletedSign() {
+		return deletedSign;
+	}
+
+	public void setDeletedSign(Integer deletedSign) {
+		this.deletedSign = deletedSign;
+	}
 
 
 	//授权日/发文日
 	//授权日/发文日
 	public String getAuthorizedFormattedDate() {
 	public String getAuthorizedFormattedDate() {

+ 0 - 1
src/main/java/com/goafanti/techservice/cognizance/bo/CognizanceDetailBo.java

@@ -363,7 +363,6 @@ public class CognizanceDetailBo {
 		this.lastYearRevenue = lastYearRevenue;
 		this.lastYearRevenue = lastYearRevenue;
 	}
 	}
 
 
-	@JsonFormat(shape = Shape.STRING)
 	public Integer getAccident() {
 	public Integer getAccident() {
 		return accident;
 		return accident;
 	}
 	}

+ 91 - 57
src/main/java/com/goafanti/techservice/cognizance/controller/CognizanceApiController.java

@@ -99,7 +99,7 @@ public class CognizanceApiController extends BaseApiController {
 	@Resource
 	@Resource
 	private OrgTechCenterDetailService		orgTechCenterDetailService;
 	private OrgTechCenterDetailService		orgTechCenterDetailService;
 	@Resource
 	@Resource
-	private OrgCognizanceService            orgCognizanceService;
+	private OrgCognizanceService			orgCognizanceService;
 	@Resource
 	@Resource
 	private OrgAnnualReportService			orgAnnualReportService;
 	private OrgAnnualReportService			orgAnnualReportService;
 	@Resource
 	@Resource
@@ -507,7 +507,7 @@ public class CognizanceApiController extends BaseApiController {
 	public Result disposeRatepay(OrgRatepay orgRatepay) {
 	public Result disposeRatepay(OrgRatepay orgRatepay) {
 		Result res = new Result();
 		Result res = new Result();
 		if (null == orgRatepay.getId()) {
 		if (null == orgRatepay.getId()) {
-			if (null == orgRatepayService.selectRatepayByUidAndYear(TokenManager.getUserId(), orgRatepay.getYear())){
+			if (null == orgRatepayService.selectRatepayByUidAndYear(TokenManager.getUserId(), orgRatepay.getYear())) {
 				orgRatepay.setId(UUID.randomUUID().toString());
 				orgRatepay.setId(UUID.randomUUID().toString());
 				orgRatepay.setUid(TokenManager.getUserId());
 				orgRatepay.setUid(TokenManager.getUserId());
 				orgRatepay.setDeletedSign(0);
 				orgRatepay.setDeletedSign(0);
@@ -572,7 +572,7 @@ public class CognizanceApiController extends BaseApiController {
 	public Result disposeFinance(OrgFinance orgFinance) {
 	public Result disposeFinance(OrgFinance orgFinance) {
 		Result res = new Result();
 		Result res = new Result();
 		if (null == orgFinance.getId()) {
 		if (null == orgFinance.getId()) {
-			if (null == orgFinanceService.selectFinanceByUidAndYear(TokenManager.getUserId(), orgFinance.getYear())){
+			if (null == orgFinanceService.selectFinanceByUidAndYear(TokenManager.getUserId(), orgFinance.getYear())) {
 				orgFinance.setId(UUID.randomUUID().toString());
 				orgFinance.setId(UUID.randomUUID().toString());
 				orgFinance.setUid(TokenManager.getUserId());
 				orgFinance.setUid(TokenManager.getUserId());
 				orgFinance.setDeletedSign(0);
 				orgFinance.setDeletedSign(0);
@@ -632,7 +632,6 @@ public class CognizanceApiController extends BaseApiController {
 		res.setData(handleFile(res, "/cognizance/", true, req, sign, uid));
 		res.setData(handleFile(res, "/cognizance/", true, req, sign, uid));
 		return res;
 		return res;
 	}
 	}
-	
 
 
 	/**
 	/**
 	 * 科技成果转化情况列表入口
 	 * 科技成果转化情况列表入口
@@ -820,9 +819,10 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
-    
+
 	/**
 	/**
 	 * 技术中心明细新增+修改(管理+用户)
 	 * 技术中心明细新增+修改(管理+用户)
+	 * 
 	 * @param orgTechCenterDetail
 	 * @param orgTechCenterDetail
 	 * @param projectTimeFormattedDate
 	 * @param projectTimeFormattedDate
 	 * @param termTimeFormattedDate
 	 * @param termTimeFormattedDate
@@ -833,13 +833,13 @@ public class CognizanceApiController extends BaseApiController {
 	public Result disposeCenterDetail(OrgTechCenterDetail orgTechCenterDetail, String projectTimeFormattedDate,
 	public Result disposeCenterDetail(OrgTechCenterDetail orgTechCenterDetail, String projectTimeFormattedDate,
 			String termTimeFormattedDate) throws ParseException {
 			String termTimeFormattedDate) throws ParseException {
 		Result res = new Result();
 		Result res = new Result();
-		if (!StringUtils.isBlank(projectTimeFormattedDate)){
+		if (!StringUtils.isBlank(projectTimeFormattedDate)) {
 			orgTechCenterDetail.setProjectTime(DateUtils.parseDate(projectTimeFormattedDate, "yyyy-MM-dd"));
 			orgTechCenterDetail.setProjectTime(DateUtils.parseDate(projectTimeFormattedDate, "yyyy-MM-dd"));
 		}
 		}
-		if (!StringUtils.isBlank(termTimeFormattedDate)){
+		if (!StringUtils.isBlank(termTimeFormattedDate)) {
 			orgTechCenterDetail.setTermTime(DateUtils.parseDate(termTimeFormattedDate, "yyyy-MM-dd"));
 			orgTechCenterDetail.setTermTime(DateUtils.parseDate(termTimeFormattedDate, "yyyy-MM-dd"));
 		}
 		}
-		if (null == orgTechCenterDetail.getId()){
+		if (null == orgTechCenterDetail.getId()) {
 			orgTechCenterDetail.setId(UUID.randomUUID().toString());
 			orgTechCenterDetail.setId(UUID.randomUUID().toString());
 			orgTechCenterDetail.setDeletedSign(0);
 			orgTechCenterDetail.setDeletedSign(0);
 			orgTechCenterDetailService.inset(orgTechCenterDetail);
 			orgTechCenterDetailService.inset(orgTechCenterDetail);
@@ -848,9 +848,10 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 删除技术中心明细
 	 * 删除技术中心明细
+	 * 
 	 * @param ids
 	 * @param ids
 	 * @return
 	 * @return
 	 */
 	 */
@@ -864,32 +865,33 @@ public class CognizanceApiController extends BaseApiController {
 		res.setData(orgTechCenterDetailService.batchDeleteByPrimaryKey(id));
 		res.setData(orgTechCenterDetailService.batchDeleteByPrimaryKey(id));
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 获取公司联系人
 	 * 获取公司联系人
+	 * 
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/getContacts", method = RequestMethod.GET)
 	@RequestMapping(value = "/getContacts", method = RequestMethod.GET)
-	public Result getContacts(){
+	public Result getContacts() {
 		Result res = new Result();
 		Result res = new Result();
 		OrganizationIdentity i = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
 		OrganizationIdentity i = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
 		Map<String, String> map = new LinkedHashMap<String, String>();
 		Map<String, String> map = new LinkedHashMap<String, String>();
-		if (!StringUtils.isBlank(i.getFirstContacts()) && !StringUtils.isBlank(i.getFirstMobile())){
+		if (!StringUtils.isBlank(i.getFirstContacts()) && !StringUtils.isBlank(i.getFirstMobile())) {
 			map.put(i.getFirstContacts(), i.getFirstMobile());
 			map.put(i.getFirstContacts(), i.getFirstMobile());
 		}
 		}
-		
-		if (!StringUtils.isBlank(i.getSecondContacts()) && !StringUtils.isBlank(i.getSecondMobile())){
+
+		if (!StringUtils.isBlank(i.getSecondContacts()) && !StringUtils.isBlank(i.getSecondMobile())) {
 			map.put(i.getSecondContacts(), i.getSecondMobile());
 			map.put(i.getSecondContacts(), i.getSecondMobile());
 		}
 		}
-		
-		if (!StringUtils.isBlank(i.getThirdContacts()) && !StringUtils.isBlank(i.getThirdMobile())){
+
+		if (!StringUtils.isBlank(i.getThirdContacts()) && !StringUtils.isBlank(i.getThirdMobile())) {
 			map.put(i.getThirdContacts(), i.getThirdMobile());
 			map.put(i.getThirdContacts(), i.getThirdMobile());
 		}
 		}
-		
+
 		res.setData(map);
 		res.setData(map);
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 高企认定列表入口
 	 * 高企认定列表入口
 	 * 
 	 * 
@@ -898,7 +900,7 @@ public class CognizanceApiController extends BaseApiController {
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
 	@RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
-	public Result listCognizance( String locationProvince,  String pageNo, String pageSize) {
+	public Result listCognizance(String locationProvince, String pageNo, String pageSize) {
 		Result res = new Result();
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pNo = 1;
 		Integer pSize = 10;
 		Integer pSize = 10;
@@ -909,20 +911,26 @@ public class CognizanceApiController extends BaseApiController {
 			pNo = Integer.parseInt(pageNo);
 			pNo = Integer.parseInt(pageNo);
 		}
 		}
 
 
-		res.setData(orgCognizanceService.listCognizance(TokenManager.getUserId() , locationProvince,  pNo, pSize));
+		res.setData(orgCognizanceService.listCognizance(TokenManager.getUserId(), locationProvince, pNo, pSize));
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 申请高企认定
 	 * 申请高企认定
+	 * 
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
 	@RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
-	public Result applyCognizance(String contacts, String comment,  Integer year, Integer state){
+	public Result applyCognizance(String contacts, String comment, Integer year, Integer state) {
 		Result res = new Result();
 		Result res = new Result();
-		if (null == year){
+		if (null == year) {
 			res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "申请认定年份不能为空!"));
 			res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "申请认定年份不能为空!"));
 		}
 		}
+		
+		if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, TokenManager.getUserId())){
+			res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
+		}
+		
 		OrgCognizance c = new OrgCognizance();
 		OrgCognizance c = new OrgCognizance();
 		c.setId(UUID.randomUUID().toString());
 		c.setId(UUID.randomUUID().toString());
 		c.setUid(TokenManager.getUserId());
 		c.setUid(TokenManager.getUserId());
@@ -931,7 +939,7 @@ public class CognizanceApiController extends BaseApiController {
 		c.setDeletedSign(0);
 		c.setDeletedSign(0);
 		c.setYear(year);
 		c.setYear(year);
 		orgCognizanceService.insert(c);
 		orgCognizanceService.insert(c);
-		
+
 		OrgCognizanceLog log = new OrgCognizanceLog();
 		OrgCognizanceLog log = new OrgCognizanceLog();
 		log.setId(UUID.randomUUID().toString());
 		log.setId(UUID.randomUUID().toString());
 		log.setCid(c.getId());
 		log.setCid(c.getId());
@@ -944,7 +952,7 @@ public class CognizanceApiController extends BaseApiController {
 		orgCognizanceLogService.insert(log);
 		orgCognizanceLogService.insert(log);
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 高企认定详情入口
 	 * 高企认定详情入口
 	 * 
 	 * 
@@ -960,11 +968,36 @@ public class CognizanceApiController extends BaseApiController {
 	}
 	}
 	
 	
 	/**
 	/**
+	 * 高企认定流转状态
+	 * 
+	 * @param cid
+	 * @return
+	 */
+	@RequestMapping(value = "/cognizanceLog", method = RequestMethod.POST)
+	public Result cognizanceLog(String cid) {
+		Result res = new Result();
+		List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
+		res.setData(list);
+		return res;
+	}
+	
+	/**
+	 * 保存高企认定详情
+	 */
+	@RequestMapping(value = "/disposeCognizanceDetail", method = RequestMethod.POST)
+	public Result disposeCognizanceDetail(OrgCognizance cog){
+		Result res = new Result();
+		orgCognizanceService.updateByPrimaryKeySelective(cog);
+		return res;
+	}
+
+	/**
 	 * 年报列表
 	 * 年报列表
+	 * 
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/annualReport", method = RequestMethod.POST)
 	@RequestMapping(value = "/annualReport", method = RequestMethod.POST)
-	public Result annualReport(Integer year, Integer state, String pageSize, String pageNo ){
+	public Result annualReport(Integer year, Integer state, String pageSize, String pageNo) {
 		Result res = new Result();
 		Result res = new Result();
 		res = checkCertify(res);
 		res = checkCertify(res);
 		if (res.getError().isEmpty()) {
 		if (res.getError().isEmpty()) {
@@ -980,36 +1013,37 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 企业年报详情
 	 * 企业年报详情
+	 * 
 	 * @param uid
 	 * @param uid
 	 * @param year
 	 * @param year
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/annualReportDetail", method = RequestMethod.POST)
 	@RequestMapping(value = "/annualReportDetail", method = RequestMethod.POST)
-	public Result annualReportDetail(Integer year){
+	public Result annualReportDetail(Integer year) {
 		Result res = new Result();
 		Result res = new Result();
-		if (null == year){
+		if (null == year) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "当前年份年报数据异常!"));
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "当前年份年报数据异常!"));
 			return res;
 			return res;
 		}
 		}
 		res.setData(handleAnnualReport(TokenManager.getUserId(), year));
 		res.setData(handleAnnualReport(TokenManager.getUserId(), year));
 		return res;
 		return res;
 	}
 	}
-	
-	
 
 
 	/**
 	/**
 	 * 高企年报新增+修改
 	 * 高企年报新增+修改
+	 * 
 	 * @param orgAnnualReport
 	 * @param orgAnnualReport
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
 	@RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
-	public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport){
+	public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport) {
 		Result res = new Result();
 		Result res = new Result();
-		if (null == orgAnnualReport.getId()){
-			if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(), TokenManager.getUserId())){
+		if (null == orgAnnualReport.getId()) {
+			if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
+					TokenManager.getUserId())) {
 				res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
 				res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
 				return res;
 				return res;
 			} else {
 			} else {
@@ -1029,14 +1063,15 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
-	
+
 	/**
 	/**
 	 * 删除企业年报记录
 	 * 删除企业年报记录
+	 * 
 	 * @param ids
 	 * @param ids
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/deleteAnnualReport", method = RequestMethod.POST)
 	@RequestMapping(value = "/deleteAnnualReport", method = RequestMethod.POST)
-	public Result deleteAnnualReport(@RequestParam(name = "ids[]", required = true) String[] ids){
+	public Result deleteAnnualReport(@RequestParam(name = "ids[]", required = true) String[] ids) {
 		Result res = new Result();
 		Result res = new Result();
 		List<String> id = new ArrayList<String>();
 		List<String> id = new ArrayList<String>();
 		for (String s : ids) {
 		for (String s : ids) {
@@ -1045,14 +1080,12 @@ public class CognizanceApiController extends BaseApiController {
 		res.setData(orgAnnualReportService.batchDeleteByPrimaryKey(id));
 		res.setData(orgAnnualReportService.batchDeleteByPrimaryKey(id));
 		return res;
 		return res;
 	}
 	}
-	
-	
+
 	@RequestMapping(value = "/download", method = RequestMethod.POST)
 	@RequestMapping(value = "/download", method = RequestMethod.POST)
-	
-	
+
 	private AnnualReportBo handleAnnualReport(String uid, Integer year) {
 	private AnnualReportBo handleAnnualReport(String uid, Integer year) {
 		AnnualReportBo report = new AnnualReportBo();
 		AnnualReportBo report = new AnnualReportBo();
-		
+
 		AnnualReportPropertyRightBo p = orgAnnualReportService.selectAnnualReportPropertyRightBoByYearAndUid(year, uid);
 		AnnualReportPropertyRightBo p = orgAnnualReportService.selectAnnualReportPropertyRightBoByYearAndUid(year, uid);
 		report.setInventionPatent(null == p.getInventionPatent() ? 0 : p.getInventionPatent());
 		report.setInventionPatent(null == p.getInventionPatent() ? 0 : p.getInventionPatent());
 		report.setDefensePatent(null == p.getDefensePatent() ? 0 : p.getDefensePatent());
 		report.setDefensePatent(null == p.getDefensePatent() ? 0 : p.getDefensePatent());
@@ -1064,10 +1097,10 @@ public class CognizanceApiController extends BaseApiController {
 		report.setCircuitDesign(null == p.getCircuitDesign() ? 0 : p.getCircuitDesign());
 		report.setCircuitDesign(null == p.getCircuitDesign() ? 0 : p.getCircuitDesign());
 		report.setExteriorPatent(null == p.getExteriorPatent() ? 0 : p.getExteriorPatent());
 		report.setExteriorPatent(null == p.getExteriorPatent() ? 0 : p.getExteriorPatent());
 		report.setSoftwareWorks(null == p.getSoftwareWorks() ? 0 : p.getSoftwareWorks());
 		report.setSoftwareWorks(null == p.getSoftwareWorks() ? 0 : p.getSoftwareWorks());
-		
+
 		BigDecimal t = orgAnnualReportService.selectAnnualReportTerritoryByYearAndUid(year, uid);
 		BigDecimal t = orgAnnualReportService.selectAnnualReportTerritoryByYearAndUid(year, uid);
 		report.setTerritory(null == t ? new BigDecimal(0) : t);
 		report.setTerritory(null == t ? new BigDecimal(0) : t);
-		
+
 		AnnualReportMainBo m = orgAnnualReportService.selectAnnualReportMainBoByYearAndUid(year, uid);
 		AnnualReportMainBo m = orgAnnualReportService.selectAnnualReportMainBoByYearAndUid(year, uid);
 		report.setUid(m.getUid());
 		report.setUid(m.getUid());
 		report.setUnitName(m.getUnitName());
 		report.setUnitName(m.getUnitName());
@@ -1076,7 +1109,7 @@ public class CognizanceApiController extends BaseApiController {
 		report.setLocationCity(m.getLocationCity());
 		report.setLocationCity(m.getLocationCity());
 		report.setLocationArea(m.getLocationArea());
 		report.setLocationArea(m.getLocationArea());
 		report.setListed(m.getListed().toString());
 		report.setListed(m.getListed().toString());
-		if (null != m.getListedDate()){
+		if (null != m.getListedDate()) {
 			report.setListedDate(DateFormatUtils.format(m.getListedDate(), "yyyy-MM-dd"));
 			report.setListedDate(DateFormatUtils.format(m.getListedDate(), "yyyy-MM-dd"));
 		}
 		}
 		report.setListedType(m.getListedType().toString());
 		report.setListedType(m.getListedType().toString());
@@ -1089,24 +1122,24 @@ public class CognizanceApiController extends BaseApiController {
 		report.setGrossProfit(null == m.getGrossProfit() ? new BigDecimal(0) : m.getGrossProfit());
 		report.setGrossProfit(null == m.getGrossProfit() ? new BigDecimal(0) : m.getGrossProfit());
 		report.setNetAsset(null == m.getNetAsset() ? new BigDecimal(0) : m.getNetAsset());
 		report.setNetAsset(null == m.getNetAsset() ? new BigDecimal(0) : m.getNetAsset());
 		report.setCertificateNumber(m.getCertificateNumber());
 		report.setCertificateNumber(m.getCertificateNumber());
-		if (null != m.getIssuingDate()){
+		if (null != m.getIssuingDate()) {
 			report.setIssuingDate(DateFormatUtils.format(m.getIssuingDate(), "yyyy-MM-dd"));
 			report.setIssuingDate(DateFormatUtils.format(m.getIssuingDate(), "yyyy-MM-dd"));
 		}
 		}
 		report.setContacts(m.getContacts());
 		report.setContacts(m.getContacts());
 		report.setResearchCost(null == m.getResearchCost() ? new BigDecimal(0) : m.getResearchCost());
 		report.setResearchCost(null == m.getResearchCost() ? new BigDecimal(0) : m.getResearchCost());
 		report.setTotalRevenue(null == m.getTotalRevenue() ? new BigDecimal(0) : m.getTotalRevenue());
 		report.setTotalRevenue(null == m.getTotalRevenue() ? new BigDecimal(0) : m.getTotalRevenue());
 		report.setLastYearRevenue(null == m.getLastYearRevenue() ? new BigDecimal(0) : m.getLastYearRevenue());
 		report.setLastYearRevenue(null == m.getLastYearRevenue() ? new BigDecimal(0) : m.getLastYearRevenue());
-		
+
 		return report;
 		return report;
 	}
 	}
-	
 
 
 	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
 	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
 			String uid) {
 			String uid) {
 		List<MultipartFile> files = getFiles(req);
 		List<MultipartFile> files = getFiles(req);
 		MultipartFile mf = files.get(0);
 		MultipartFile mf = files.get(0);
-		
-		String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign,  path, StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
+
+		String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path,
+				StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
 		if (!files.isEmpty()) {
 		if (!files.isEmpty()) {
 			try {
 			try {
 				mf.transferTo(toPrivateFile(fileName));
 				mf.transferTo(toPrivateFile(fileName));
@@ -1130,7 +1163,7 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
-	
+
 	private CognizanceDetailBo handleCognizanceDetail(String uid, String cid, Integer year) {
 	private CognizanceDetailBo handleCognizanceDetail(String uid, String cid, Integer year) {
 		CognizanceDetailBo cog = new CognizanceDetailBo();
 		CognizanceDetailBo cog = new CognizanceDetailBo();
 
 
@@ -1148,7 +1181,8 @@ public class CognizanceApiController extends BaseApiController {
 				null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
 				null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
 		cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
 		cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
 
 
-		CognizanceResearchCostBo researchCost = orgCognizanceService.selectCognizanceResearchCostBoByUidAndYear(year, uid);
+		CognizanceResearchCostBo researchCost = orgCognizanceService.selectCognizanceResearchCostBoByUidAndYear(year,
+				uid);
 		cog.setResearchCost(
 		cog.setResearchCost(
 				null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
 				null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
 		cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
 		cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
@@ -1170,12 +1204,12 @@ public class CognizanceApiController extends BaseApiController {
 		cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
 		cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
 		cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
 		cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
 		cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
 		cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
-        BigDecimal revenue = orgCognizanceService.selectLastYearRevenueByUidAndYear(year, uid);
-        if (null != revenue){
-        	cog.setLastYearRevenue(revenue);
-        } else {
-        	cog.setLastYearRevenue(new BigDecimal(0));
-        }
+		BigDecimal revenue = orgCognizanceService.selectLastYearRevenueByUidAndYear(year, uid);
+		if (null != revenue) {
+			cog.setLastYearRevenue(revenue);
+		} else {
+			cog.setLastYearRevenue(new BigDecimal(0));
+		}
 		return cog;
 		return cog;
 	}
 	}
 
 

+ 5 - 0
src/main/java/com/goafanti/techservice/cognizance/service/OrgCognizanceService.java

@@ -1,6 +1,7 @@
 package com.goafanti.techservice.cognizance.service;
 package com.goafanti.techservice.cognizance.service;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.List;
 
 
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -28,5 +29,9 @@ public interface OrgCognizanceService {
 
 
 	int updateByPrimaryKeySelective(OrgCognizance cog);
 	int updateByPrimaryKeySelective(OrgCognizance cog);
 
 
+	OrgCognizance selectCognizanceByUidAndYear(Integer year, String uid);
+
+	int batchDeleteByPrimaryKey(List<String> id);
+
 
 
 }
 }

+ 12 - 1
src/main/java/com/goafanti/techservice/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -2,6 +2,7 @@ package com.goafanti.techservice.cognizance.service.impl;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -26,7 +27,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	@Override
 	@Override
 	public OrgCognizance insert(OrgCognizance c) {
 	public OrgCognizance insert(OrgCognizance c) {
 		orgCognizanceMapper.insert(c);
 		orgCognizanceMapper.insert(c);
-		return null;
+		return c;
 	}
 	}
 
 
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
@@ -84,4 +85,14 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	public int updateByPrimaryKeySelective(OrgCognizance cog) {
 	public int updateByPrimaryKeySelective(OrgCognizance cog) {
 		return orgCognizanceMapper.updateByPrimaryKeySelective(cog);
 		return orgCognizanceMapper.updateByPrimaryKeySelective(cog);
 	}
 	}
+
+	@Override
+	public OrgCognizance selectCognizanceByUidAndYear(Integer year, String uid) {
+		return orgCognizanceMapper.selectCognizanceByUidAndYear(year, uid);
+	}
+
+	@Override
+	public int batchDeleteByPrimaryKey(List<String> id) {
+		return orgCognizanceMapper.batchDeleteByPrimaryKey(id);
+	}
 }
 }

+ 22 - 0
src/main/java/com/goafanti/techservice/patent/controller/PatentApiController.java

@@ -54,6 +54,7 @@ import com.goafanti.techservice.patent.service.PatentInfoService;
 import com.goafanti.techservice.patent.service.PatentLogService;
 import com.goafanti.techservice.patent.service.PatentLogService;
 import com.goafanti.techservice.patent.service.PatentRegistrationService;
 import com.goafanti.techservice.patent.service.PatentRegistrationService;
 import com.goafanti.user.service.OrganizationIdentityService;
 import com.goafanti.user.service.OrganizationIdentityService;
+import com.goafanti.user.service.UserService;
 
 
 @Controller
 @Controller
 @RequestMapping(value = "/techservice/patent")
 @RequestMapping(value = "/techservice/patent")
@@ -72,6 +73,8 @@ public class PatentApiController extends BaseApiController {
 	private AdminService					adminService;
 	private AdminService					adminService;
 	@Resource
 	@Resource
 	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
 	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
+	@Resource
+	private UserService						userService;
 
 
 	/*
 	/*
 	 * @Autowired DownloadUtils downloadUtils;
 	 * @Autowired DownloadUtils downloadUtils;
@@ -92,16 +95,26 @@ public class PatentApiController extends BaseApiController {
 		now.set(Calendar.MILLISECOND, 0);
 		now.set(Calendar.MILLISECOND, 0);
 		patentInfo.setCreateTime(now.getTime());
 		patentInfo.setCreateTime(now.getTime());
 		patentInfoService.insert(patentInfo);
 		patentInfoService.insert(patentInfo);
+		
 		PatentRegistration patentRegistration = new PatentRegistration();
 		PatentRegistration patentRegistration = new PatentRegistration();
 		patentRegistration.setId(UUID.randomUUID().toString());
 		patentRegistration.setId(UUID.randomUUID().toString());
 		patentRegistration.setPid(patentInfo.getId());
 		patentRegistration.setPid(patentInfo.getId());
 		patentRegistrationService.insert(patentRegistration);
 		patentRegistrationService.insert(patentRegistration);
+		
 		PatentCost patentCost = new PatentCost();
 		PatentCost patentCost = new PatentCost();
 		patentCost.setId(UUID.randomUUID().toString());
 		patentCost.setId(UUID.randomUUID().toString());
 		patentCost.setPid(patentInfo.getId());
 		patentCost.setPid(patentInfo.getId());
 		patentCost.setAnnualFeeState(0);
 		patentCost.setAnnualFeeState(0);
 		patentCost.setPaymentState(0);
 		patentCost.setPaymentState(0);
 		patentCostService.insert(patentCost);
 		patentCostService.insert(patentCost);
+		
+		PatentLog log = new PatentLog();
+		log.setId(UUID.randomUUID().toString());
+		log.setPid(patentInfo.getId());
+		log.setRecordTime(patentInfo.getCreateTime());
+		log.setState(1);
+		log.setPrincipal(userService.selectByPrimaryKey(TokenManager.getUserId()).getAid());
+		patentLogService.insert(log);
 		res.setData(patentInfo);
 		res.setData(patentInfo);
 		return res;
 		return res;
 	}
 	}
@@ -229,6 +242,15 @@ public class PatentApiController extends BaseApiController {
 		patentCost.setAnnualFeeState(0);
 		patentCost.setAnnualFeeState(0);
 		patentCost.setPaymentState(0);
 		patentCost.setPaymentState(0);
 		patentCostService.insert(patentCost);
 		patentCostService.insert(patentCost);
+		
+		PatentLog log = new PatentLog();
+		log.setId(UUID.randomUUID().toString());
+		log.setPid(patentInfo.getId());
+		log.setRecordTime(patentInfo.getCreateTime());
+		log.setState(1);
+		log.setPrincipal(userService.selectByPrimaryKey(TokenManager.getUserId()).getAid());
+		log.setOperator(TokenManager.getAdminId());
+		patentLogService.insert(log);
 		res.setData(patentInfo);
 		res.setData(patentInfo);
 		return res;
 		return res;
 	}
 	}

+ 3 - 1
src/main/java/com/goafanti/techservice/patent/service/impl/AdminServiceImpl.java

@@ -8,15 +8,17 @@ import org.springframework.stereotype.Service;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
 import com.goafanti.techservice.patent.service.AdminService;
 import com.goafanti.techservice.patent.service.AdminService;
+
 @Service
 @Service
 public class AdminServiceImpl implements AdminService {
 public class AdminServiceImpl implements AdminService {
 	@Autowired
 	@Autowired
 	private AdminMapper adminMapper;
 	private AdminMapper adminMapper;
+
 	@Override
 	@Override
 	public List<Admin> selectAllAdmin() {
 	public List<Admin> selectAllAdmin() {
 		return adminMapper.selectAllAdmin();
 		return adminMapper.selectAllAdmin();
 	}
 	}
-	
+
 	@Override
 	@Override
 	public Admin selectByMobile(String mobile) {
 	public Admin selectByMobile(String mobile) {
 		return adminMapper.selectByMobile(mobile);
 		return adminMapper.selectByMobile(mobile);

+ 11 - 1
src/main/java/com/goafanti/user/bo/OrgListBo.java

@@ -18,6 +18,8 @@ public class OrgListBo {
     private String aftUsername;
     private String aftUsername;
     
     
     private Integer auditStatus;
     private Integer auditStatus;
+    
+    private String adminName;
 
 
 	public String getId() {
 	public String getId() {
 		return id;
 		return id;
@@ -74,7 +76,15 @@ public class OrgListBo {
 	public void setAuditStatus(Integer auditStatus) {
 	public void setAuditStatus(Integer auditStatus) {
 		this.auditStatus = auditStatus;
 		this.auditStatus = auditStatus;
 	}
 	}
-    
+	
+	public String getAdminName() {
+		return adminName;
+	}
+
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
+
 	//注册时间
 	//注册时间
 	public String getCreateTimeFormattedDate(){
 	public String getCreateTimeFormattedDate(){
 		if (this.createTime == null) {
 		if (this.createTime == null) {

+ 10 - 0
src/main/java/com/goafanti/user/bo/UserListBo.java

@@ -21,6 +21,8 @@ public class UserListBo {
     
     
     private Integer auditStatus;
     private Integer auditStatus;
     
     
+    private String adminName;
+    
     
     
 	public String getId() {
 	public String getId() {
 		return id;
 		return id;
@@ -78,6 +80,14 @@ public class UserListBo {
 	public void setAuditStatus(Integer auditStatus) {
 	public void setAuditStatus(Integer auditStatus) {
 		this.auditStatus = auditStatus;
 		this.auditStatus = auditStatus;
 	}
 	}
+	
+	public String getAdminName() {
+		return adminName;
+	}
+
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
 
 
 	//注册时间
 	//注册时间
 	public String getCreateTimeFormattedDate(){
 	public String getCreateTimeFormattedDate(){

+ 12 - 1
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -1,6 +1,8 @@
 package com.goafanti.user.controller;
 package com.goafanti.user.controller;
 
 
 import java.util.Calendar;
 import java.util.Calendar;
+import java.util.Collections;
+import java.util.List;
 import java.util.UUID;
 import java.util.UUID;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
@@ -16,11 +18,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.controller.BaseController;
+import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.techservice.patent.service.AdminService;
 import com.goafanti.user.service.UserService;
 import com.goafanti.user.service.UserService;
 
 
 @Controller
 @Controller
@@ -32,6 +36,9 @@ public class UserRegisterController extends BaseController {
 
 
 	Logger					logger	= Logger.getLogger(UserRegisterController.class);
 	Logger					logger	= Logger.getLogger(UserRegisterController.class);
 
 
+	@Resource
+	private AdminService	adminService;
+
 	/**
 	/**
 	 * 用户注册
 	 * 用户注册
 	 * 
 	 * 
@@ -82,7 +89,11 @@ public class UserRegisterController extends BaseController {
 			user.setCreateTime(now.getTime());
 			user.setCreateTime(now.getTime());
 			user.setPassword(passwordUtil.getEncryptPwd(user));
 			user.setPassword(passwordUtil.getEncryptPwd(user));
 			user.setLvl(0);
 			user.setLvl(0);
-			user.setAid("1");//分配管理员
+			List<Admin> admins = adminService.selectAllAdmin();
+			if (!admins.isEmpty()) {
+				Collections.shuffle(admins);
+				user.setAid(admins.get(0).getId());// 随机分配管理员
+			}
 			userService.insertRegister(user, contacts, companyName, user.getId());
 			userService.insertRegister(user, contacts, companyName, user.getId());
 		}
 		}