Browse Source

techProject &&& techWebsite

Antiloveg 8 years ago
parent
commit
d8f2c368e4

+ 142 - 0
src/main/java/com/goafanti/admin/controller/AdminTechProjectController.java

@@ -0,0 +1,142 @@
+package com.goafanti.admin.controller;
+
+import java.text.ParseException;
+import java.util.Date;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.TechProject;
+import com.goafanti.common.model.TechProjectLog;
+import com.goafanti.common.model.TechWebsite;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.techproject.service.TechProjectLogService;
+import com.goafanti.techproject.service.TechProjectService;
+import com.goafanti.techproject.service.TechWebsiteService;
+import com.goafanti.user.service.UserService;
+
+@Controller
+@RequestMapping(value = "/api/admintechproject")
+public class AdminTechProjectController extends BaseApiController{
+	@Resource
+	private TechProjectService techProjectService;
+	@Resource
+	private TechWebsiteService techWebsiteService;
+	@Resource
+	private TechProjectLogService techProjectLogService;
+	@Resource
+	private UserService  userService;
+	
+	/**
+	 * 科技项目申报列表
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value = "/listTechProject", method = RequestMethod.POST)
+	public Result listClientTechProject(String province, String uid, String pageNo, String pageSize){
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(techProjectService.listManageTechProject(province, uid, pNo, pSize));
+		return res;
+	}
+	
+	
+	
+	/**
+	 * 科技项目申报
+	 * @return
+	 */
+	@RequestMapping(value = "/applyTechProject", method = RequestMethod.POST)
+	public Result applyTechProject(TechProject techProject, String uid){
+		Result res = new Result();
+		String aid = userService.selectByPrimaryKey(uid).getAid();
+		techProjectService.applyTechProject(techProject, uid, aid);
+		return res;
+		
+	}
+	
+	/**
+	 * 科技项目申报详情
+	 * @return
+	 */
+	@RequestMapping(value = "/techProjectDetial", method = RequestMethod.POST)
+	public Result techProjectDetial(String pid){
+		Result res = new Result();
+		return res;
+	}
+	
+	/**
+	 * 科技项目状态流转
+	 * @param pid
+	 * @return
+	 */
+	@RequestMapping(value = "/techProjectLog", method = RequestMethod.POST)
+	public Result techProjectLog(String pid){
+		Result res = new Result();
+		res.setData(techProjectLogService.selectTechProjectLogByPid(pid));
+		return res;
+	}
+	
+	/**
+	 * update科技项目 
+	 * @param t
+	 * @param l
+	 * @param recordTimeFormattedDate
+	 * @return
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/updateTechProject", method = RequestMethod.POST)
+	public Result updateTechProject(TechProject t, TechProjectLog l, String recordTimeFormattedDate) throws ParseException{
+		Result res = new Result();
+		Date recordTime =null;
+		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
+			recordTime = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
+		}
+		res.setData(techProjectService.updateTechProject(t, l, recordTime));
+		return res;
+	}
+	
+	/**
+	 * 科技单位网址管理list
+	 */
+	@RequestMapping(value = "/listTechWebsite", method = RequestMethod.POST)
+	public Result listTechWebsite(String province, String uid, String pageNo, String pageSize){
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(techWebsiteService.listTechWebsite(province, uid, pNo, pSize));
+		return res;
+	}
+	
+	/**
+	 * 科技单位网址add+update
+	 * @param t
+	 * @return
+	 */
+	@RequestMapping(value = "/disposeTechWebsite", method = RequestMethod.POST)
+	public Result disposeTechWebsite(TechWebsite t){
+		Result res = new Result();
+		res.setData(techWebsiteService.disposeTechWebsite(t));
+		return res;
+	}
+}

+ 9 - 4
src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -21,10 +21,12 @@ import com.goafanti.cognizance.bo.CognizanceResearchCostBo;
 import com.goafanti.cognizance.service.OrgCognizanceService;
 import com.goafanti.common.dao.OrgCognizanceLogMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
+import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizanceLog;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 @Service
 public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper> implements OrgCognizanceService {
 	@Autowired
@@ -160,18 +162,18 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 
 	@Override
 	public void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid) {
-		if (null != log.getState()) {
+		if (null != log.getState() && null != recordTime) {
 			log.setRecordTime(recordTime);
 			cog.setState(log.getState());
 			switch (log.getState()) {
 			case 1:
-				cog.setCreateTime(log.getRecordTime());
+				cog.setCreateTime(recordTime);
 				break;
 			case 2:
-				cog.setAcceptDate(log.getRecordTime());
+				cog.setAcceptDate(recordTime);
 				break;
 			case 5:
-				cog.setIssuingDate(log.getRecordTime());
+				cog.setIssuingDate(recordTime);
 				break;
 			}
 			log.setId(UUID.randomUUID().toString());
@@ -206,6 +208,9 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		log.setState(state);
 		log.setComment(comment);
 		log.setPrincipal(aid);
+		if (TokenManager.getToken() instanceof  Admin) {
+			log.setOperator(TokenManager.getAdminId());
+		}
 		orgCognizanceLogMapper.insert(log);
 		
 	}

+ 4 - 0
src/main/java/com/goafanti/common/dao/TechProjectLogMapper.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.dao;
 
+import java.util.List;
+
 import com.goafanti.common.model.TechProjectLog;
 
 public interface TechProjectLogMapper {
@@ -14,4 +16,6 @@ public interface TechProjectLogMapper {
     int updateByPrimaryKeySelective(TechProjectLog record);
 
     int updateByPrimaryKey(TechProjectLog record);
+
+	List<TechProjectLog> selectTechProjectLogByPid(String pid);
 }

+ 7 - 0
src/main/java/com/goafanti/common/mapper/TechProjectLogMapper.xml

@@ -114,4 +114,11 @@
       comment = #{comment,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+  
+   <select id="selectTechProjectLogByPid" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from tech_project_log
+    where pid = #{pid,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 43 - 0
src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml

@@ -326,4 +326,47 @@
         and p.uid = #{uid,jdbcType=VARCHAR}
     </if>
   </select>
+  
+  <select id ="findTechProjectManageListByPage" parameterType="java.lang.String" 
+     resultType="com.goafanti.techproject.bo.TechProjectManageListBo">
+  	 select p.id, p.uid, i.location_province as province, 
+	        i.unit_name as unitName,  
+		    CONCAT(i.first_contacts,'  ', i.first_mobile) as firstContacts,
+		    CONCAT(i.second_contacts,'  ', i.second_mobile) as secondContacts,
+		    CONCAT(i.third_contacts,'  ', i.third_mobile) as thirdContacts, 
+		    p.serial_number as serialNumber, p.create_time as createTime, p.approved_date as approvedDate, 
+		    p.accept_date as acceptDate, a.name as consultant, p.contacts,
+		    p.project_name as projectName, p.project_catagory as projectCatagory, p.tech_field as techField, p.state,
+        w.id as wid, w.website, w.account_number as accountNumber, w.department, w.password
+	  FROM  tech_project p
+		LEFT JOIN organization_identity i on i.uid = p.uid
+		LEFT JOIN admin a on p.consultant = a.id 
+    LEFT JOIN tech_website w on p.department = w.id 
+		where p.deleted_sign = 0 and w.deleted_sign = 0
+		 <if test="province != null">
+    	and i.location_province = #{province,jdbcType=VARCHAR}
+    </if>
+    <if test="uid != null" >
+    	and p.uid = #{uid,jdbcType=VARCHAR}
+    </if>
+    order by p.serial_number desc
+   <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findTechProjectManageCount" resultType="java.lang.Integer" parameterType="String">
+ 	select count(1)
+    FROM  tech_project p
+		LEFT JOIN organization_identity i on i.uid = p.uid
+		LEFT JOIN admin a on p.consultant = a.id 
+   		 LEFT JOIN tech_website w on p.department = w.id 
+		where p.deleted_sign = 0 and w.deleted_sign = 0
+	 <if test="province != null">
+    	and i.location_province = #{province,jdbcType=VARCHAR}
+    </if>
+    <if test="uid != null" >
+    	and p.uid = #{uid,jdbcType=VARCHAR}
+    </if>
+  </select>
 </mapper>

+ 31 - 0
src/main/java/com/goafanti/common/mapper/TechWebsiteMapper.xml

@@ -132,4 +132,35 @@
     from tech_website
     where uid = #{uid,jdbcType=VARCHAR} and deleted_sign = 0
   </select>
+  
+   <select id="findTechWebsiteListByPage" resultType="com.goafanti.techproject.bo.TechWebsiteListBo" parameterType="java.lang.String" >
+   select w.id, w.uid, i.unit_name as unitName, i.location_province as province, 
+		w.department, w.website, w.account_number as accountNumber,
+		w.password
+		from tech_website w 
+	LEFT JOIN organization_identity i on w.uid = i.uid where w.deleted_sign = 0 
+    <if test="province != null">
+    	and i.location_province = #{province,jdbcType=VARCHAR}
+    </if>
+    <if test="uid != null" >
+    	and w.uid = #{uid,jdbcType=VARCHAR}
+    </if>
+    order by w.create_time desc
+   <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findTechWebsiteCount" resultType="java.lang.Integer" parameterType="String">
+  	select count(1)
+		from tech_website w 
+	LEFT JOIN organization_identity i on w.uid = i.uid 
+	where w.deleted_sign = 0 
+    <if test="province != null">
+    	and i.location_province = #{province,jdbcType=VARCHAR}
+    </if>
+    <if test="uid != null" >
+    	and w.uid = #{uid,jdbcType=VARCHAR}
+    </if>
+  </select>
 </mapper>

+ 5 - 1
src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java

@@ -18,6 +18,7 @@ import com.goafanti.common.dao.PatentInfoMapper;
 import com.goafanti.common.dao.PatentLogMapper;
 import com.goafanti.common.dao.PatentRegistrationMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentInfo;
@@ -305,13 +306,16 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setRecordTime(patentInfo.getCreateTime());
 		log.setState(1);
 		log.setPrincipal(aid);
+		if (TokenManager.getToken() instanceof  Admin) {
+			log.setOperator(TokenManager.getAdminId());
+		}
 		patentLogMapper.insert(log);
 		return patentInfo;
 	}
 
 	@Override
 	public void updatePatentInfo(PatentInfo patentInfo, PatentLog patentLog, Date recordTime) {
-		if (null != patentLog.getState()) {
+		if (null != patentLog.getState() && recordTime != null) {
 			switch (patentLog.getState()) {
 			case 2:
 				patentInfo.setCreateTime(recordTime);

+ 50 - 0
src/main/java/com/goafanti/techproject/bo/TechProjectManageListBo.java

@@ -0,0 +1,50 @@
+package com.goafanti.techproject.bo;
+/**
+ * 科技申报项目
+ */
+public class TechProjectManageListBo extends TechProjectClientListBo {
+	private String wid;
+	
+	private String website;
+	
+	private String accountNumber;
+	
+	private String password;
+	
+	public String getWid() {
+		return wid;
+	}
+
+	public void setWid(String wid) {
+		this.wid = wid;
+	}
+
+	public String getWebsite() {
+		return website;
+	}
+
+	public void setWebsite(String website) {
+		this.website = website;
+	}
+
+	public String getAccountNumber() {
+		return accountNumber;
+	}
+
+	public void setAccountNumber(String accountNumber) {
+		this.accountNumber = accountNumber;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	
+	
+	
+	
+}

+ 85 - 0
src/main/java/com/goafanti/techproject/bo/TechWebsiteListBo.java

@@ -0,0 +1,85 @@
+package com.goafanti.techproject.bo;
+
+public class TechWebsiteListBo {
+	private String id;
+	
+	private String uid;
+	
+	private String unitName;
+	
+	private String province;
+	
+	private String department;
+	
+	private String website;
+	
+	private String accountNumber;
+	
+	private String password;
+
+	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 String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	public String getProvince() {
+		return province;
+	}
+
+	public void setProvince(String province) {
+		this.province = province;
+	}
+
+	public String getDepartment() {
+		return department;
+	}
+
+	public void setDepartment(String department) {
+		this.department = department;
+	}
+
+	public String getWebsite() {
+		return website;
+	}
+
+	public void setWebsite(String website) {
+		this.website = website;
+	}
+
+	public String getAccountNumber() {
+		return accountNumber;
+	}
+
+	public void setAccountNumber(String accountNumber) {
+		this.accountNumber = accountNumber;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	
+	
+}

+ 50 - 6
src/main/java/com/goafanti/techproject/controller/TechProjectApiController.java

@@ -1,6 +1,10 @@
 package com.goafanti.techproject.controller;
 
 
+
+import java.text.ParseException;
+import java.util.Date;
+
 import javax.annotation.Resource;
 
 import org.springframework.stereotype.Controller;
@@ -9,8 +13,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.TechProject;
+import com.goafanti.common.model.TechProjectLog;
+import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.techproject.service.TechProjectLogService;
 import com.goafanti.techproject.service.TechProjectService;
 import com.goafanti.techproject.service.TechWebsiteService;
 
@@ -21,6 +29,8 @@ public class TechProjectApiController extends BaseApiController{
 	private TechProjectService techProjectService;
 	@Resource
 	private TechWebsiteService techWebsiteService;
+	@Resource
+	private TechProjectLogService techProjectLogService;
 	
 	/**
 	 * 科技项目申报列表
@@ -43,15 +53,18 @@ public class TechProjectApiController extends BaseApiController{
 		return res;
 	}
 	
+	
+	
 	/**
-	 * 获取科技部门
+	 * 科技项目申报
 	 * @return
 	 */
-	@RequestMapping(value = "/getDepartment", method = RequestMethod.POST)
-	public Result getDepartment(){
+	@RequestMapping(value = "/applyTechProject", method = RequestMethod.POST)
+	public Result applyTechProject(TechProject techProject){
 		Result res = new Result();
-		 res.setData(techWebsiteService.getDepartment(TokenManager.getUserId()));
-		 return res;
+		techProjectService.applyTechProject(techProject, TokenManager.getUserId(), TokenManager.getToken().getAid());
+		return res;
+		
 	}
 	
 	/**
@@ -59,11 +72,42 @@ public class TechProjectApiController extends BaseApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/techProjectDetial", method = RequestMethod.POST)
-	public Result techProjectDetial(){
+	public Result techProjectDetial(String pid){
 		Result res = new Result();
 		return res;
 	}
 	
+	/**
+	 * 科技项目状态流转
+	 * @param pid
+	 * @return
+	 */
+	@RequestMapping(value = "/techProjectLog", method = RequestMethod.POST)
+	public Result techProjectLog(String pid){
+		Result res = new Result();
+		res.setData(techProjectLogService.selectTechProjectLogByPid(pid));
+		return res;
+	}
+	
+	/**
+	 * update科技项目 
+	 * @param t
+	 * @param l
+	 * @param recordTimeFormattedDate
+	 * @return
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/updateTechProject", method = RequestMethod.POST)
+	public Result updateTechProject(TechProject t, TechProjectLog l, String recordTimeFormattedDate) throws ParseException{
+		Result res = new Result();
+		Date recordTime =null;
+		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
+			recordTime = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
+		}
+		res.setData(techProjectService.updateTechProject(t, l, recordTime));
+		return res;
+	}
+	
 	
 
 }

+ 11 - 0
src/main/java/com/goafanti/techproject/service/TechProjectLogService.java

@@ -0,0 +1,11 @@
+package com.goafanti.techproject.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.TechProjectLog;
+
+public interface TechProjectLogService {
+
+	List<TechProjectLog> selectTechProjectLogByPid(String pid);
+
+}

+ 11 - 0
src/main/java/com/goafanti/techproject/service/TechProjectService.java

@@ -1,10 +1,21 @@
 package com.goafanti.techproject.service;
 
+import java.util.Date;
+
+import com.goafanti.common.model.TechProject;
+import com.goafanti.common.model.TechProjectLog;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.techproject.bo.TechProjectClientListBo;
+import com.goafanti.techproject.bo.TechProjectManageListBo;
 
 public interface TechProjectService {
 
 	Pagination<TechProjectClientListBo> listClientTechProject(String userId, Integer pNo, Integer pSize);
 
+	int updateTechProject(TechProject t, TechProjectLog l, Date recordTime);
+
+	void applyTechProject(TechProject techProject, String uid, String aid);
+
+	Pagination<TechProjectManageListBo> listManageTechProject(String province, String uid, Integer pNo, Integer pSize);
+
 }

+ 7 - 0
src/main/java/com/goafanti/techproject/service/TechWebsiteService.java

@@ -2,8 +2,15 @@ package com.goafanti.techproject.service;
 
 import java.util.Map;
 
+import com.goafanti.common.model.TechWebsite;
+import com.goafanti.core.mybatis.page.Pagination;
+
 public interface TechWebsiteService {
 
 	Map<String, String> getDepartment(String uid);
 
+	Pagination<TechWebsite> listTechWebsite(String province, String uid, Integer pNo, Integer pSize);
+
+	int disposeTechWebsite(TechWebsite t);
+
 }

+ 21 - 0
src/main/java/com/goafanti/techproject/service/impl/TechProjectLogServiceImpl.java

@@ -0,0 +1,21 @@
+package com.goafanti.techproject.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.TechProjectLogMapper;
+import com.goafanti.common.model.TechProjectLog;
+import com.goafanti.techproject.service.TechProjectLogService;
+@Service
+public class TechProjectLogServiceImpl implements TechProjectLogService {
+    @Autowired
+    private TechProjectLogMapper techProjectLogMapper;
+	
+	@Override
+	public List<TechProjectLog> selectTechProjectLogByPid(String pid) {
+		return techProjectLogMapper.selectTechProjectLogByPid(pid);
+	}
+
+}

+ 82 - 2
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -1,22 +1,32 @@
 package com.goafanti.techproject.service.impl;
 
+import java.util.Calendar;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.UUID;
 
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.common.dao.TechProjectLogMapper;
 import com.goafanti.common.dao.TechProjectMapper;
-import com.goafanti.common.model.OrgRatepay;
+import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.TechProject;
+import com.goafanti.common.model.TechProjectLog;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.techproject.bo.TechProjectClientListBo;
+import com.goafanti.techproject.bo.TechProjectManageListBo;
 import com.goafanti.techproject.service.TechProjectService;
 @Service
 public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> implements TechProjectService {
 	@Autowired
 	private TechProjectMapper techProjectMapper;
+	@Autowired
+	private TechProjectLogMapper techProjectLogMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -36,4 +46,74 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 				"findTechProjectClientCount", params, pageNo, pageSize);
 	}
 
+	@Override
+	public int updateTechProject(TechProject t, TechProjectLog log, Date recordTime) {
+		if (null != recordTime && null != log.getState()) {
+			log.setId(UUID.randomUUID().toString());
+			log.setPid(t.getId());
+			log.setRecordTime(recordTime);
+			switch (log.getState()) {
+			case 1:
+				t.setCreateTime(recordTime);
+				break;
+			case 2:
+				t.setAcceptDate(recordTime);
+				break;
+			case 5:
+				t.setApprovedDate(recordTime);
+				break;
+			}
+			t.setState(log.getState());
+			techProjectLogMapper.insert(log);
+		}
+		
+		return techProjectMapper.updateByPrimaryKey(t);
+	}
+
+	@Override
+	public void applyTechProject(TechProject techProject, String uid, String aid) {
+		techProject.setId(UUID.randomUUID().toString());
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		techProject.setRecordTime(now.getTime());
+		techProject.setState(0);
+		techProject.setDeletedSign(0);
+	    techProjectMapper.insert(techProject);
+		
+		TechProjectLog log = new TechProjectLog();
+		log.setId(UUID.randomUUID().toString());
+		log.setPid(techProject.getId());
+		log.setRecordTime(techProject.getRecordTime());
+		log.setPrincipal(aid);
+		log.setState(0);
+		if (TokenManager.getToken() instanceof  Admin) {
+			log.setOperator(TokenManager.getAdminId());
+		}
+		techProjectLogMapper.insert(log);
+		
+		
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TechProjectManageListBo> listManageTechProject(String province, String uid, Integer pageNo,
+			Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+		if (!StringUtils.isBlank(province)){
+			params.put("province", province);
+		}
+		if (!StringUtils.isBlank(uid)){
+			params.put("uid", uid);
+		}
+		if (pageNo == null || pageNo < 0) {
+			pageNo = 1;
+		}
+
+		if (pageSize == null || pageSize < 0) {
+			pageSize = 10;
+		}
+		return (Pagination<TechProjectManageListBo>)findPage("findTechProjectManageListByPage",
+				"findTechProjectManageCount", params, pageNo, pageSize);
+	}
+
 }

+ 46 - 2
src/main/java/com/goafanti/techproject/service/impl/TechWebsiteServiceImpl.java

@@ -1,17 +1,24 @@
 package com.goafanti.techproject.service.impl;
 
+import java.util.Calendar;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.UUID;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.dao.TechWebsiteMapper;
 import com.goafanti.common.model.TechWebsite;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.techproject.service.TechWebsiteService;
+
 @Service
-public class TechWebsiteServiceImpl implements TechWebsiteService {
+public class TechWebsiteServiceImpl extends BaseMybatisDao<TechWebsiteMapper> implements TechWebsiteService {
 	@Autowired
 	private TechWebsiteMapper techWebsiteMapper;
 
@@ -19,11 +26,48 @@ public class TechWebsiteServiceImpl implements TechWebsiteService {
 	public Map<String, String> getDepartment(String uid) {
 		Map<String, String> map = new TreeMap<String, String>();
 		List<TechWebsite> list = techWebsiteMapper.selectTechWebsiteByUid(uid);
-		if (null != list && 0 != list.size()){
+		if (null != list && 0 != list.size()) {
 			for (TechWebsite t : list) {
 				map.put(t.getId(), t.getDepartment());
 			}
 		}
 		return map;
 	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TechWebsite> listTechWebsite(String province, String uid, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+		if (!StringUtils.isBlank(province)) {
+			params.put("province", province);
+		}
+		if (!StringUtils.isBlank(uid)) {
+			params.put("uid", uid);
+		}
+
+		if (pageNo == null || pageNo < 0) {
+			pageNo = 1;
+		}
+
+		if (pageSize == null || pageSize < 0) {
+			pageSize = 10;
+		}
+		return (Pagination<TechWebsite>) findPage("findTechWebsiteListByPage", "findTechWebsiteCount", params, pageNo,
+				pageSize);
+	}
+
+	@Override
+	public int disposeTechWebsite(TechWebsite t) {
+		if (StringUtils.isBlank(t.getId())) {
+			t.setId(UUID.randomUUID().toString());
+			t.setDeletedSign(0);
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			t.setCreateTime(now.getTime());
+			return techWebsiteMapper.insert(t);
+		} else {
+			return techWebsiteMapper.updateByPrimaryKeySelective(t);
+		}
+		
+	}
 }

+ 15 - 0
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -41,6 +41,7 @@ import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.techproject.service.TechWebsiteService;
 import com.goafanti.user.bo.OrgIdentityBo;
 import com.goafanti.user.bo.OrgProBo;
 import com.goafanti.user.bo.UidAndTypeBo;
@@ -87,6 +88,8 @@ public class UserApiController extends BaseApiController {
 	private OrganizationPropertiesService	organizationPropertiesService;
 	@Resource
 	private OrgHumanResourceService			orgHumanResourceService;
+	@Resource
+	private TechWebsiteService  techWebsiteService;
 
 	/**
 	 * 修改密码
@@ -860,6 +863,18 @@ public class UserApiController extends BaseApiController {
 	}
 	
 	
+	/**
+	 * 获取科技部门
+	 * @return
+	 */
+	@RequestMapping(value = "/getDepartment", method = RequestMethod.POST)
+	public Result getDepartment(String uid){
+		Result res = new Result();
+		 res.setData(techWebsiteService.getDepartment(null == uid ? TokenManager.getUserId() : uid));
+		 return res;
+	}
+	
+	
 
 	// 认证失败清除相关认证信息
 	private Result dealFaild(Result res) {