Browse Source

技术中心CRUD接口

Antiloveg 8 years ago
parent
commit
48fdd2aaf1

+ 42 - 0
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -24,6 +24,7 @@ import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.OrgRatepay;
 import com.goafanti.common.model.OrgStandard;
 import com.goafanti.common.model.OrgTechAchievement;
+import com.goafanti.common.model.OrgTechCenter;
 import com.goafanti.common.model.OrgTechProduct;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.UserIdentity;
@@ -40,6 +41,7 @@ import com.goafanti.techservice.cognizance.service.OrgIntellectualPropertyServic
 import com.goafanti.techservice.cognizance.service.OrgRatepayService;
 import com.goafanti.techservice.cognizance.service.OrgStandardService;
 import com.goafanti.techservice.cognizance.service.OrgTechAchievementService;
+import com.goafanti.techservice.cognizance.service.OrgTechCenterService;
 import com.goafanti.techservice.cognizance.service.OrgTechProductService;
 import com.goafanti.user.bo.OrgListBo;
 import com.goafanti.user.bo.UserListBo;
@@ -77,6 +79,8 @@ public class AdminApiController extends BaseApiController {
 	private OrgTechAchievementService       orgTechAchievementService;
 	@Resource
 	private OrgHonorDatumService            orgHonorDatumService;
+	@Resource
+	private OrgTechCenterService			orgTechCenterService;
 
 	/**
 	 * 个人用户列表
@@ -702,6 +706,44 @@ public class AdminApiController extends BaseApiController {
 		}
 		return res;
 	}
+	
+	/**
+	 * 技术中心入口
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/center", method = RequestMethod.POST)
+	public Result center(String uid) {
+		Result res = new Result();
+		res = checkCertify(res);
+		if (res.getError().isEmpty()) {
+			res.setData(orgTechCenterService.selectOrgTechCenterByUid(uid));
+		}
+		return res;
+	}
+
+	/**
+	 * 技术中心新增+修改
+	 * 
+	 * @return
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
+	public Result disposeCenter(OrgTechCenter orgTechCenter, String foundingTimeFormattedDate, String uid) throws ParseException {
+		Result res = new Result();
+		if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
+			orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
+		}
+		if (null == orgTechCenter.getId()) {
+			orgTechCenter.setId(UUID.randomUUID().toString());
+			orgTechCenter.setUid(uid);
+			orgTechCenter.setDeletedSign(0);
+			orgTechCenterService.insert(orgTechCenter);
+		} else {
+			orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
+		}
+		return res;
+	}
 
 	// 判断用户是否通过认证
 	private Result checkCertify(Result res, String uid) {

+ 21 - 0
src/main/java/com/goafanti/common/dao/OrgTechCenterDetailMapper.java

@@ -0,0 +1,21 @@
+package com.goafanti.common.dao;
+
+import java.util.List;
+
+import com.goafanti.common.model.OrgTechCenterDetail;
+
+public interface OrgTechCenterDetailMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(OrgTechCenterDetail record);
+
+    int insertSelective(OrgTechCenterDetail record);
+
+    OrgTechCenterDetail selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(OrgTechCenterDetail record);
+
+    int updateByPrimaryKey(OrgTechCenterDetail record);
+
+	int batchDeleteByPrimaryKey(List<String> id);
+}

+ 21 - 0
src/main/java/com/goafanti/common/dao/OrgTechCenterMapper.java

@@ -0,0 +1,21 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.OrgTechCenter;
+
+public interface OrgTechCenterMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(OrgTechCenter record);
+
+    int insertSelective(OrgTechCenter record);
+
+    OrgTechCenter selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(OrgTechCenter record);
+
+    int updateByPrimaryKeyWithBLOBs(OrgTechCenter record);
+
+    int updateByPrimaryKey(OrgTechCenter record);
+
+	OrgTechCenter selectOrgTechCenterByUid(String uid);
+}

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

@@ -350,7 +350,7 @@
   
   
   <select id="selectOrgActivityNumberBoByUid" parameterType="java.lang.String" resultType="com.goafanti.techservice.cognizance.bo.ActivityNumberBo">
-  	  select id as aid, uid as uid, activity_number as activityNumber 
+  	  select id as aid, uid as uid, activity_number as activityNumber, activity_name as activityName
   	  from org_activity 
   	  where uid = #{uid,jdbcType=VARCHAR} and deleted_sign = 0
   </select>

+ 159 - 0
src/main/java/com/goafanti/common/mapper/OrgTechCenterDetailMapper.xml

@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.OrgTechCenterDetailMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgTechCenterDetail" >
+    <id column="id" property="id" jdbcType="VARCHAR" />
+    <result column="cid" property="cid" jdbcType="VARCHAR" />
+    <result column="project_time" property="projectTime" jdbcType="TIMESTAMP" />
+    <result column="project_name" property="projectName" jdbcType="VARCHAR" />
+    <result column="term_time" property="termTime" jdbcType="TIMESTAMP" />
+    <result column="institution" property="institution" jdbcType="VARCHAR" />
+    <result column="protocol_url" property="protocolUrl" jdbcType="VARCHAR" />
+    <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, cid, project_time, project_name, term_time, institution, protocol_url, deleted_sign
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from org_tech_center_detail
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from org_tech_center_detail
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.OrgTechCenterDetail" >
+    insert into org_tech_center_detail (id, cid, project_time, 
+      project_name, term_time, institution, 
+      protocol_url, deleted_sign)
+    values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{projectTime,jdbcType=TIMESTAMP}, 
+      #{projectName,jdbcType=VARCHAR}, #{termTime,jdbcType=TIMESTAMP}, #{institution,jdbcType=VARCHAR}, 
+      #{protocolUrl,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgTechCenterDetail" >
+    insert into org_tech_center_detail
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="cid != null" >
+        cid,
+      </if>
+      <if test="projectTime != null" >
+        project_time,
+      </if>
+      <if test="projectName != null" >
+        project_name,
+      </if>
+      <if test="termTime != null" >
+        term_time,
+      </if>
+      <if test="institution != null" >
+        institution,
+      </if>
+      <if test="protocolUrl != null" >
+        protocol_url,
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="cid != null" >
+        #{cid,jdbcType=VARCHAR},
+      </if>
+      <if test="projectTime != null" >
+        #{projectTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="projectName != null" >
+        #{projectName,jdbcType=VARCHAR},
+      </if>
+      <if test="termTime != null" >
+        #{termTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="institution != null" >
+        #{institution,jdbcType=VARCHAR},
+      </if>
+      <if test="protocolUrl != null" >
+        #{protocolUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="deletedSign != null" >
+        #{deletedSign,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgTechCenterDetail" >
+    update org_tech_center_detail
+    <set >
+      <if test="cid != null" >
+        cid = #{cid,jdbcType=VARCHAR},
+      </if>
+      <if test="projectTime != null" >
+        project_time = #{projectTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="projectName != null" >
+        project_name = #{projectName,jdbcType=VARCHAR},
+      </if>
+      <if test="termTime != null" >
+        term_time = #{termTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="institution != null" >
+        institution = #{institution,jdbcType=VARCHAR},
+      </if>
+      <if test="protocolUrl != null" >
+        protocol_url = #{protocolUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgTechCenterDetail" >
+    update org_tech_center_detail
+    set cid = #{cid,jdbcType=VARCHAR},
+      project_time = #{projectTime,jdbcType=TIMESTAMP},
+      project_name = #{projectName,jdbcType=VARCHAR},
+      term_time = #{termTime,jdbcType=TIMESTAMP},
+      institution = #{institution,jdbcType=VARCHAR},
+      protocol_url = #{protocolUrl,jdbcType=VARCHAR},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+   <select id="findOrgTechCenterDetailListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
+  	 select 
+    <include refid="Base_Column_List" />
+    from org_tech_center_detail
+    where deleted_sign = 0
+    <if test="uid != null">
+	    and  cid = #{cid,jdbcType=VARCHAR}
+	</if>
+	order by project_time desc
+    <if test="page_sql != null">
+    	${page_sql}
+    </if>
+  </select>
+  
+  <select id="findOrgTechCenterDetailCount" resultType="java.lang.Integer" parameterType="String">
+   	select count(1) 
+	    from org_tech_center_detail
+    where deleted_sign = 0
+	    <if test="cid != null">
+		    and  cid = #{cid,jdbcType=VARCHAR}
+		</if>
+  </select>
+  
+  <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
+  	update org_tech_center_detail set deleted_sign = 1
+  	where  id in 
+	<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
+		#{item}
+	</foreach>
+  </update>
+</mapper>

+ 142 - 0
src/main/java/com/goafanti/common/mapper/OrgTechCenterMapper.xml

@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.OrgTechCenterMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgTechCenter" >
+    <id column="id" property="id" jdbcType="VARCHAR" />
+    <result column="uid" property="uid" jdbcType="VARCHAR" />
+    <result column="founding_time" property="foundingTime" jdbcType="TIMESTAMP" />
+    <result column="principal" property="principal" jdbcType="VARCHAR" />
+    <result column="system_url" property="systemUrl" jdbcType="VARCHAR" />
+    <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
+  </resultMap>
+  <resultMap id="ResultMapWithBLOBs" type="com.goafanti.common.model.OrgTechCenter" extends="BaseResultMap" >
+    <result column="system_catalog" property="systemCatalog" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, uid, founding_time, principal, system_url, deleted_sign
+  </sql>
+  <sql id="Blob_Column_List" >
+    system_catalog
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from org_tech_center
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from org_tech_center
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.OrgTechCenter" >
+    insert into org_tech_center (id, uid, founding_time, 
+      principal, system_url, deleted_sign, 
+      system_catalog)
+    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{foundingTime,jdbcType=TIMESTAMP}, 
+      #{principal,jdbcType=VARCHAR}, #{systemUrl,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, 
+      #{systemCatalog,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgTechCenter" >
+    insert into org_tech_center
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="uid != null" >
+        uid,
+      </if>
+      <if test="foundingTime != null" >
+        founding_time,
+      </if>
+      <if test="principal != null" >
+        principal,
+      </if>
+      <if test="systemUrl != null" >
+        system_url,
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign,
+      </if>
+      <if test="systemCatalog != null" >
+        system_catalog,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="foundingTime != null" >
+        #{foundingTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="principal != null" >
+        #{principal,jdbcType=VARCHAR},
+      </if>
+      <if test="systemUrl != null" >
+        #{systemUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="deletedSign != null" >
+        #{deletedSign,jdbcType=INTEGER},
+      </if>
+      <if test="systemCatalog != null" >
+        #{systemCatalog,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgTechCenter" >
+    update org_tech_center
+    <set >
+      <if test="uid != null" >
+        uid = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="foundingTime != null" >
+        founding_time = #{foundingTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="principal != null" >
+        principal = #{principal,jdbcType=VARCHAR},
+      </if>
+      <if test="systemUrl != null" >
+        system_url = #{systemUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
+      <if test="systemCatalog != null" >
+        system_catalog = #{systemCatalog,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.OrgTechCenter" >
+    update org_tech_center
+    set uid = #{uid,jdbcType=VARCHAR},
+      founding_time = #{foundingTime,jdbcType=TIMESTAMP},
+      principal = #{principal,jdbcType=VARCHAR},
+      system_url = #{systemUrl,jdbcType=VARCHAR},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      system_catalog = #{systemCatalog,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgTechCenter" >
+    update org_tech_center
+    set uid = #{uid,jdbcType=VARCHAR},
+      founding_time = #{foundingTime,jdbcType=TIMESTAMP},
+      principal = #{principal,jdbcType=VARCHAR},
+      system_url = #{systemUrl,jdbcType=VARCHAR},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  <select id="selectOrgTechCenterByUid" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
+  	select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from org_tech_center
+    where uid = #{uid,jdbcType=VARCHAR}
+  </select>
+</mapper>

+ 107 - 0
src/main/java/com/goafanti/common/model/OrgTechCenter.java

@@ -0,0 +1,107 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class OrgTechCenter {
+    private String id;
+
+    private String uid;
+
+    /**
+    * 成立时间
+    */
+    private Date foundingTime;
+
+    /**
+    * 负责人
+    */
+    private String principal;
+
+    /**
+    * 制度目录URL
+    */
+    private String systemUrl;
+
+    /**
+    * 删除标记
+    */
+    private Integer deletedSign;
+
+    /**
+    * 制度目录
+    */
+    private String systemCatalog;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Date getFoundingTime() {
+        return foundingTime;
+    }
+
+    public void setFoundingTime(Date foundingTime) {
+        this.foundingTime = foundingTime;
+    }
+
+    public String getPrincipal() {
+        return principal;
+    }
+
+    public void setPrincipal(String principal) {
+        this.principal = principal;
+    }
+
+    public String getSystemUrl() {
+        return systemUrl;
+    }
+
+    public void setSystemUrl(String systemUrl) {
+        this.systemUrl = systemUrl;
+    }
+    
+    @JsonIgnore
+    public Integer getDeletedSign() {
+        return deletedSign;
+    }
+
+    public void setDeletedSign(Integer deletedSign) {
+        this.deletedSign = deletedSign;
+    }
+
+    public String getSystemCatalog() {
+        return systemCatalog;
+    }
+
+    public void setSystemCatalog(String systemCatalog) {
+        this.systemCatalog = systemCatalog;
+    }
+    
+    public String getFoundingTimeFormattedDate(){
+		if (this.foundingTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getFoundingTime(), "yyyy-MM-dd");
+		}
+	}
+	
+	public void setFoundingTimeFormattedDate(String foundingTimeFormattedDate){
+		
+	}
+}

+ 134 - 0
src/main/java/com/goafanti/common/model/OrgTechCenterDetail.java

@@ -0,0 +1,134 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class OrgTechCenterDetail {
+    private String id;
+
+    private String cid;
+
+    /**
+    * 产学研时间
+    */
+    private Date projectTime;
+
+    /**
+    * 产学研名称
+    */
+    private String projectName;
+
+    /**
+    * 期限
+    */
+    private Date termTime;
+
+    /**
+    * 大学机构
+    */
+    private String institution;
+
+    /**
+    * 协议URL
+    */
+    private String protocolUrl;
+
+    /**
+    * 删除标记
+    */
+    private Integer deletedSign;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCid() {
+        return cid;
+    }
+
+    public void setCid(String cid) {
+        this.cid = cid;
+    }
+
+    public Date getProjectTime() {
+        return projectTime;
+    }
+
+    public void setProjectTime(Date projectTime) {
+        this.projectTime = projectTime;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public Date getTermTime() {
+        return termTime;
+    }
+
+    public void setTermTime(Date termTime) {
+        this.termTime = termTime;
+    }
+
+    public String getInstitution() {
+        return institution;
+    }
+
+    public void setInstitution(String institution) {
+        this.institution = institution;
+    }
+
+    public String getProtocolUrl() {
+        return protocolUrl;
+    }
+
+    public void setProtocolUrl(String protocolUrl) {
+        this.protocolUrl = protocolUrl;
+    }
+    
+    @JsonIgnore
+    public Integer getDeletedSign() {
+        return deletedSign;
+    }
+
+    public void setDeletedSign(Integer deletedSign) {
+        this.deletedSign = deletedSign;
+    }
+    
+    public String getProjectTimeFormattedDate(){
+		if (this.projectTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getProjectTime(), "yyyy-MM-dd");
+		}
+	}
+	
+	public void setProjectTimeFormattedDate(String projectTimeFormattedDate){
+		
+	}
+	
+	public String getTermTimeFormattedDate(){
+		if (this.termTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getTermTime(), "yyyy-MM-dd");
+		}
+	}
+	
+	public void setTermTimeFormattedDate(String termTimeFormattedDate){
+		
+	}
+	
+	
+}

+ 10 - 0
src/main/java/com/goafanti/techservice/cognizance/bo/ActivityNumberBo.java

@@ -10,6 +10,8 @@ public class ActivityNumberBo {
 	private String uid;
 	
 	private String activityNumber;
+	
+	private String activityName;
 
 
 	public String getAid() {
@@ -35,6 +37,14 @@ public class ActivityNumberBo {
 	public void setActivityNumber(String activityNumber) {
 		this.activityNumber = activityNumber;
 	}
+
+	public String getActivityName() {
+		return activityName;
+	}
+
+	public void setActivityName(String activityName) {
+		this.activityName = activityName;
+	}
 	
 	
 	

+ 132 - 16
src/main/java/com/goafanti/techservice/cognizance/controller/CognizanceApiController.java

@@ -27,6 +27,8 @@ import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.OrgRatepay;
 import com.goafanti.common.model.OrgStandard;
 import com.goafanti.common.model.OrgTechAchievement;
+import com.goafanti.common.model.OrgTechCenter;
+import com.goafanti.common.model.OrgTechCenterDetail;
 import com.goafanti.common.model.OrgTechProduct;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
@@ -41,6 +43,8 @@ import com.goafanti.techservice.cognizance.service.OrgIntellectualPropertyServic
 import com.goafanti.techservice.cognizance.service.OrgRatepayService;
 import com.goafanti.techservice.cognizance.service.OrgStandardService;
 import com.goafanti.techservice.cognizance.service.OrgTechAchievementService;
+import com.goafanti.techservice.cognizance.service.OrgTechCenterDetailService;
+import com.goafanti.techservice.cognizance.service.OrgTechCenterService;
 import com.goafanti.techservice.cognizance.service.OrgTechProductService;
 import com.goafanti.user.service.OrganizationIdentityService;
 import com.goafanti.user.service.UserService;
@@ -70,6 +74,10 @@ public class CognizanceApiController extends BaseApiController {
 	private OrgTechAchievementService		orgTechAchievementService;
 	@Resource
 	private OrgHonorDatumService			orgHonorDatumService;
+	@Resource
+	private OrgTechCenterService			orgTechCenterService;
+	@Resource
+	private OrgTechCenterDetailService		orgTechCenterDetailService;
 
 	/**
 	 * 企业研究开发活动情况表入口
@@ -200,12 +208,12 @@ public class CognizanceApiController extends BaseApiController {
 	 * 企业年度研究开发费用结构明细表(新增+修改)
 	 * 
 	 * @return
-	 * @throws ParseException 
+	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/activityCost", method = RequestMethod.POST)
 	public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) throws ParseException {
 		Result res = new Result();
-		if (!StringUtils.isBlank(signDateFormattedDate)){
+		if (!StringUtils.isBlank(signDateFormattedDate)) {
 			orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
 		}
 		if (null == orgActivityCost.getId()) {
@@ -309,22 +317,22 @@ public class CognizanceApiController extends BaseApiController {
 	 * 用户端录入+修改知识产权信息(专利+软著)
 	 * 
 	 * @return
-	 * @throws ParseException 
+	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/intellectual", method = RequestMethod.POST)
-	public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate) throws ParseException {
+	public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate)
+			throws ParseException {
 		Result res = new Result();
 		if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
 			orgIntellectualProperty
-			.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
+					.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
 		}
 		if (null == orgIntellectualProperty.getId()) {
-				orgIntellectualProperty.setId(UUID.randomUUID().toString());
-				orgIntellectualProperty.setUid(TokenManager.getUserId());
-				orgIntellectualProperty.setEvaluationCategory(
-						(orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1
-								: 0);
-				orgIntellectualProperty.setDeletedSign(0);
+			orgIntellectualProperty.setId(UUID.randomUUID().toString());
+			orgIntellectualProperty.setUid(TokenManager.getUserId());
+			orgIntellectualProperty.setEvaluationCategory(
+					(orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1 : 0);
+			orgIntellectualProperty.setDeletedSign(0);
 			res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
 		} else {
 			orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
@@ -482,9 +490,10 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 刪除企业纳税申报信息
+	 * 
 	 * @param ids
 	 * @return
 	 */
@@ -541,9 +550,10 @@ public class CognizanceApiController extends BaseApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 删除财务报表
+	 * 
 	 * @param ids
 	 * @return
 	 */
@@ -617,7 +627,7 @@ public class CognizanceApiController extends BaseApiController {
 	 * 
 	 * @param achievement
 	 * @return
-	 * @throws ParseException 
+	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
 	public Result disposeAchievement(OrgTechAchievement achievement) throws ParseException {
@@ -678,12 +688,12 @@ public class CognizanceApiController extends BaseApiController {
 	 * 
 	 * @param achievement
 	 * @return
-	 * @throws ParseException 
+	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
 	public Result disposeHonor(OrgHonorDatum honor, String issuingTimeFormattedDate) throws ParseException {
 		Result res = new Result();
-		if (!StringUtils.isBlank(issuingTimeFormattedDate)){
+		if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
 			honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, "yyyy-MM-dd"));
 		}
 		if (null == honor.getId()) {
@@ -714,6 +724,112 @@ public class CognizanceApiController extends BaseApiController {
 		return res;
 	}
 
+	/**
+	 * 技术中心入口
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/center", method = RequestMethod.GET)
+	public Result center() {
+		Result res = new Result();
+		res = checkCertify(res);
+		if (res.getError().isEmpty()) {
+			res.setData(orgTechCenterService.selectOrgTechCenterByUid(TokenManager.getUserId()));
+		}
+		return res;
+	}
+
+	/**
+	 * 技术中心新增+修改
+	 * 
+	 * @return
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
+	public Result disposeCenter(OrgTechCenter orgTechCenter, String foundingTimeFormattedDate) throws ParseException {
+		Result res = new Result();
+		if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
+			orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
+		}
+		if (null == orgTechCenter.getId()) {
+			orgTechCenter.setId(UUID.randomUUID().toString());
+			orgTechCenter.setUid(TokenManager.getUserId());
+			orgTechCenter.setDeletedSign(0);
+			orgTechCenterService.insert(orgTechCenter);
+		} else {
+			orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
+		}
+		return res;
+	}
+
+	/**
+	 * 技术中心明细列表入口(管理+用户)
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/centerDetail", method = RequestMethod.POST)
+	public Result centerDetail(String pageNo, String pageSize, String cid) {
+		Result res = new Result();
+		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(orgTechCenterDetailService.listOrgTechCenterDetail(pNo, pSize, cid));
+		}
+		return res;
+	}
+    
+	/**
+	 * 技术中心明细新增+修改(管理+用户)
+	 * @param orgTechCenterDetail
+	 * @param projectTimeFormattedDate
+	 * @param termTimeFormattedDate
+	 * @return
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/disposeCenterDetail", method = RequestMethod.POST)
+	public Result disposeCenterDetail(OrgTechCenterDetail orgTechCenterDetail, String projectTimeFormattedDate,
+			String termTimeFormattedDate) throws ParseException {
+		Result res = new Result();
+		if (!StringUtils.isBlank(projectTimeFormattedDate)){
+			orgTechCenterDetail.setProjectTime(DateUtils.parseDate(projectTimeFormattedDate, "yyyy-MM-dd"));
+		}
+		if (!StringUtils.isBlank(termTimeFormattedDate)){
+			orgTechCenterDetail.setTermTime(DateUtils.parseDate(termTimeFormattedDate, "yyyy-MM-dd"));
+		}
+		if (null == orgTechCenterDetail.getId()){
+			orgTechCenterDetail.setId(UUID.randomUUID().toString());
+			orgTechCenterDetail.setDeletedSign(0);
+			orgTechCenterDetailService.inset(orgTechCenterDetail);
+		} else {
+			orgTechCenterDetailService.updateByPrimaryKeySelective(orgTechCenterDetail);
+		}
+		return res;
+	}
+	
+	/**
+	 * 删除技术中心明细
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/deleteOrgTechCenterDetail", method = RequestMethod.POST)
+	public Result deleteOrgTechCenterDetail(@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(orgTechCenterDetailService.batchDeleteByPrimaryKey(id));
+		return res;
+	}
+	
+
 	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
 			String uid) {
 		List<MultipartFile> files = getFiles(req);

+ 18 - 0
src/main/java/com/goafanti/techservice/cognizance/service/OrgTechCenterDetailService.java

@@ -0,0 +1,18 @@
+package com.goafanti.techservice.cognizance.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.OrgTechCenterDetail;
+import com.goafanti.core.mybatis.page.Pagination;
+
+public interface OrgTechCenterDetailService {
+
+	Pagination<OrgTechCenterDetail> listOrgTechCenterDetail(Integer pNo, Integer pSize, String cid);
+
+	OrgTechCenterDetail inset(OrgTechCenterDetail orgTechCenterDetail);
+
+	int updateByPrimaryKeySelective(OrgTechCenterDetail orgTechCenterDetail);
+
+	int batchDeleteByPrimaryKey(List<String> id);
+
+}

+ 13 - 0
src/main/java/com/goafanti/techservice/cognizance/service/OrgTechCenterService.java

@@ -0,0 +1,13 @@
+package com.goafanti.techservice.cognizance.service;
+
+import com.goafanti.common.model.OrgTechCenter;
+
+public interface OrgTechCenterService {
+
+	OrgTechCenter selectOrgTechCenterByUid(String userId);
+
+	OrgTechCenter insert(OrgTechCenter orgTechCenter);
+
+	int updateByPrimaryKeySelective(OrgTechCenter orgTechCenter);
+
+}

+ 56 - 0
src/main/java/com/goafanti/techservice/cognizance/service/impl/OrgTechCenterDetailServiceImpl.java

@@ -0,0 +1,56 @@
+package com.goafanti.techservice.cognizance.service.impl;
+
+import java.util.HashMap;
+import java.util.List;
+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.OrgTechCenterDetailMapper;
+import com.goafanti.common.model.OrgTechCenterDetail;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.techservice.cognizance.service.OrgTechCenterDetailService;
+@Service
+public class OrgTechCenterDetailServiceImpl extends BaseMybatisDao<OrgTechCenterDetailMapper> implements OrgTechCenterDetailService {
+	@Autowired
+	private OrgTechCenterDetailMapper orgTechCenterDetailMapper;
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrgTechCenterDetail> listOrgTechCenterDetail(Integer pageNo, Integer pageSize, String cid) {
+		Map<String, Object> params = new HashMap<>();
+		
+		if (!StringUtils.isBlank(cid)){
+			params.put("cid", cid);
+		}
+
+		if (pageNo == null || pageNo < 0) {
+			pageNo = 1;
+		}
+
+		if (pageSize == null || pageSize < 0) {
+			pageSize = 10;
+		}
+		return  (Pagination<OrgTechCenterDetail>)findPage("findOrgTechCenterDetailListByPage",
+				"findOrgTechCenterDetailCount", params, pageNo, pageSize);
+	}
+
+	@Override
+	public OrgTechCenterDetail inset(OrgTechCenterDetail orgTechCenterDetail) {
+		orgTechCenterDetailMapper.insert(orgTechCenterDetail);
+		return null;
+	}
+
+	@Override
+	public int updateByPrimaryKeySelective(OrgTechCenterDetail orgTechCenterDetail) {
+		return orgTechCenterDetailMapper.updateByPrimaryKeySelective(orgTechCenterDetail);
+	}
+
+	@Override
+	public int batchDeleteByPrimaryKey(List<String> id) {
+		return orgTechCenterDetailMapper.batchDeleteByPrimaryKey(id);
+	}
+}

+ 29 - 0
src/main/java/com/goafanti/techservice/cognizance/service/impl/OrgTechCenterServiceImpl.java

@@ -0,0 +1,29 @@
+package com.goafanti.techservice.cognizance.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.OrgTechCenterMapper;
+import com.goafanti.common.model.OrgTechCenter;
+import com.goafanti.techservice.cognizance.service.OrgTechCenterService;
+@Service
+public class OrgTechCenterServiceImpl implements OrgTechCenterService {
+	@Autowired
+	private OrgTechCenterMapper	orgTechCenterMapper;
+
+	@Override
+	public OrgTechCenter selectOrgTechCenterByUid(String uid) {
+		return orgTechCenterMapper.selectOrgTechCenterByUid(uid);
+	}
+
+	@Override
+	public OrgTechCenter insert(OrgTechCenter orgTechCenter) {
+		orgTechCenterMapper.insert(orgTechCenter);
+		return null;
+	}
+
+	@Override
+	public int updateByPrimaryKeySelective(OrgTechCenter orgTechCenter) {
+		return orgTechCenterMapper.updateByPrimaryKeySelective(orgTechCenter);
+	}
+}