Antiloveg %!s(int64=8) %!d(string=hai) anos
pai
achega
d16acab4fe
Modificáronse 19 ficheiros con 302 adicións e 97 borrados
  1. 3 3
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  2. 1 1
      src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java
  3. 3 1
      src/main/java/com/goafanti/admin/controller/AdminNoticeApiController.java
  4. 1 1
      src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java
  5. 1 1
      src/main/java/com/goafanti/admin/controller/AdminTechProjectApiController.java
  6. 1 1
      src/main/java/com/goafanti/admin/service/NoticeService.java
  7. 2 1
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  8. 19 7
      src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java
  9. 21 1
      src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java
  10. 11 0
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  11. 4 0
      src/main/java/com/goafanti/common/dao/NoticeMapper.java
  12. 57 0
      src/main/java/com/goafanti/common/enums/NoticeStatus.java
  13. 14 5
      src/main/java/com/goafanti/common/mapper/NoticeMapper.xml
  14. 88 56
      src/main/java/com/goafanti/common/model/Notice.java
  15. 19 1
      src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java
  16. 2 1
      src/main/java/com/goafanti/patent/service/impl/PatentCostServiceImpl.java
  17. 33 15
      src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java
  18. 2 1
      src/main/java/com/goafanti/patent/service/impl/PatentRegistrationServiceImpl.java
  19. 20 1
      src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

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

@@ -176,7 +176,7 @@ public class AdminApiController extends CertifyApiController {
 			return res;
 			return res;
 		}
 		}
 		
 		
-		if (TokenManager.hasRole("999999")) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
 			return res;
 			return res;
 		}
 		}
@@ -243,7 +243,7 @@ public class AdminApiController extends CertifyApiController {
 		if (!checkAdminLogin(res)) {
 		if (!checkAdminLogin(res)) {
 			return res;
 			return res;
 		}
 		}
-		if (TokenManager.hasRole("999999")) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
 			return res;
 			return res;
 		}
 		}
@@ -3193,7 +3193,7 @@ public class AdminApiController extends CertifyApiController {
 	
 	
 	private Map<String, String> disposeCognizanceStatus() {
 	private Map<String, String> disposeCognizanceStatus() {
 		Map<String, String> status = new  TreeMap<String, String>();
 		Map<String, String> status = new  TreeMap<String, String>();
-		if (TokenManager.hasRole("999999")) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			for (OrgCognizanceStatus p :  OrgCognizanceStatus.values()){
 			for (OrgCognizanceStatus p :  OrgCognizanceStatus.values()){
 				status.put(p.getCode().toString(), p.getDesc());
 				status.put(p.getCode().toString(), p.getDesc());
 				status.remove(OrgCognizanceStatus.OTHER.getCode().toString());
 				status.remove(OrgCognizanceStatus.OTHER.getCode().toString());

+ 1 - 1
src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java

@@ -254,7 +254,7 @@ public class AdminCopyrightApiController extends CertifyApiController {
 	
 	
 	private Map<String, String> disposeStatus() {
 	private Map<String, String> disposeStatus() {
 		Map<String, String> status = new  TreeMap<String, String>();
 		Map<String, String> status = new  TreeMap<String, String>();
-		if (TokenManager.hasRole("999999")) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			for (CopyrightStatus p :  CopyrightStatus.values()){
 			for (CopyrightStatus p :  CopyrightStatus.values()){
 				status.put(p.getCode().toString(), p.getDesc());
 				status.put(p.getCode().toString(), p.getDesc());
 				status.remove(CopyrightStatus.OTHER.getCode().toString());
 				status.remove(CopyrightStatus.OTHER.getCode().toString());

+ 3 - 1
src/main/java/com/goafanti/admin/controller/AdminNoticeApiController.java

@@ -1,5 +1,6 @@
 package com.goafanti.admin.controller;
 package com.goafanti.admin.controller;
 
 
+
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 
 
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -53,7 +54,8 @@ public class AdminNoticeApiController extends CertifyApiController{
 		if (StringUtils.isNumeric(pageNo)) {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 			pNo = Integer.parseInt(pageNo);
 		}
 		}
-		res.setData(noticeService.ListUnreadNoticeByAid(pNo, pSize, TokenManager.getAdminId()));
+		
+		res.setData(noticeService.updateListUnreadNoticeByAid(pNo, pSize, TokenManager.getAdminId()));
 		return res;
 		return res;
 	}
 	}
 	
 	

+ 1 - 1
src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java

@@ -1091,7 +1091,7 @@ public class AdminPatentApiController extends CertifyApiController {
 	
 	
 	private Map<String, String> disposePatentStatus(){
 	private Map<String, String> disposePatentStatus(){
 		Map<String, String> status = new  TreeMap<String, String>();
 		Map<String, String> status = new  TreeMap<String, String>();
-		if (TokenManager.hasRole("999999")) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			for (PatentInfoStatus p :  PatentInfoStatus.values()){
 			for (PatentInfoStatus p :  PatentInfoStatus.values()){
 				status.put(p.getCode().toString(), p.getDesc());
 				status.put(p.getCode().toString(), p.getDesc());
 				status.remove(PatentInfoStatus.OTHER.getCode().toString());
 				status.remove(PatentInfoStatus.OTHER.getCode().toString());

+ 1 - 1
src/main/java/com/goafanti/admin/controller/AdminTechProjectApiController.java

@@ -458,7 +458,7 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	
 	
 	private Object disposeStatus() {
 	private Object disposeStatus() {
 		Map<String, String> status = new  TreeMap<String, String>();
 		Map<String, String> status = new  TreeMap<String, String>();
-		if (TokenManager.hasRole("999999")) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			for (TechProjectStatus p :  TechProjectStatus.values()){
 			for (TechProjectStatus p :  TechProjectStatus.values()){
 				status.put(p.getCode().toString(), p.getDesc());
 				status.put(p.getCode().toString(), p.getDesc());
 				status.remove(TechProjectStatus.OTHER.getCode().toString());
 				status.remove(TechProjectStatus.OTHER.getCode().toString());

+ 1 - 1
src/main/java/com/goafanti/admin/service/NoticeService.java

@@ -5,7 +5,7 @@ import com.goafanti.core.mybatis.page.Pagination;
 
 
 public interface NoticeService {
 public interface NoticeService {
 
 
-	Pagination<Notice> ListUnreadNoticeByAid(Integer pageNo, Integer pageSize, String adminId);
+	Pagination<Notice> updateListUnreadNoticeByAid(Integer pageNo, Integer pageSize, String adminId);
 
 
 	Pagination<Notice> ListReadedNoticeByAid(Integer pNo, Integer pSize, String adminId);
 	Pagination<Notice> ListReadedNoticeByAid(Integer pNo, Integer pSize, String adminId);
 
 

+ 2 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
 
 
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.admin.service.AdminService;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
@@ -46,7 +47,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 			Integer pageSize) {
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 
 
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			return null;
 			return null;
 		}
 		}
 
 

+ 19 - 7
src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java

@@ -1,12 +1,15 @@
 package com.goafanti.admin.service.impl;
 package com.goafanti.admin.service.impl;
 
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import com.goafanti.admin.service.NoticeService;
 import com.goafanti.admin.service.NoticeService;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.Notice;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -20,10 +23,10 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 
 
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
 	@Override
 	@Override
-	public Pagination<Notice> ListUnreadNoticeByAid(Integer pageNo, Integer pageSize, String aid) {
+	public Pagination<Notice> updateListUnreadNoticeByAid(Integer pageNo, Integer pageSize, String aid) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 
 
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("aid", aid);
 			params.put("aid", aid);
 		}
 		}
 
 
@@ -34,8 +37,18 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 		if (pageSize == null || pageSize < 0) {
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 10;
 			pageSize = 10;
 		}
 		}
-		return (Pagination<Notice>) findPage("findUnreadNoticeListByPage", "findUnreadNoticeCount", params, pageNo,
-				pageSize);
+		Pagination<Notice> notice = (Pagination<Notice>) findPage("findUnreadNoticeListByPage", "findUnreadNoticeCount",
+				params, pageNo, pageSize);
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && null != notice.getList() && notice.getList().size()>0) {
+			List<Notice> list = (List<Notice>) notice.getList();
+			List<String> dl = new ArrayList<String>();
+			for (Notice n : list) {
+				dl.add(n.getId());
+			}
+			noticeMapper.batchUpdateUnreaded(dl);
+		}
+		return notice;
 	}
 	}
 
 
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
@@ -43,7 +56,7 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 	public Pagination<Notice> ListReadedNoticeByAid(Integer pageNo, Integer pageSize, String aid) {
 	public Pagination<Notice> ListReadedNoticeByAid(Integer pageNo, Integer pageSize, String aid) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 
 
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("aid", aid);
 			params.put("aid", aid);
 		}
 		}
 
 
@@ -61,10 +74,9 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 	@Override
 	@Override
 	public int findUnreadNoticeCount() {
 	public int findUnreadNoticeCount() {
 		String aid = null;
 		String aid = null;
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			aid = TokenManager.getAdminId();
 			aid = TokenManager.getAdminId();
 		}
 		}
-		System.out.println(aid);
 
 
 		return noticeMapper.selectUnreadedCount(aid);
 		return noticeMapper.selectUnreadedCount(aid);
 	}
 	}

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

@@ -20,11 +20,15 @@ import com.goafanti.cognizance.bo.CognizanceOrgInfoBo;
 import com.goafanti.cognizance.bo.CognizanceResearchCostBo;
 import com.goafanti.cognizance.bo.CognizanceResearchCostBo;
 import com.goafanti.cognizance.bo.CultivationListBo;
 import com.goafanti.cognizance.bo.CultivationListBo;
 import com.goafanti.cognizance.service.OrgCognizanceService;
 import com.goafanti.cognizance.service.OrgCognizanceService;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrgCognizanceLogMapper;
 import com.goafanti.common.dao.OrgCognizanceLogMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
+import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrgCognizanceStatus;
 import com.goafanti.common.enums.OrgCognizanceStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizanceLog;
 import com.goafanti.common.model.OrgCognizanceLog;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.OrganizationIdentity;
@@ -40,6 +44,8 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	private OrgCognizanceLogMapper		orgCognizanceLogMapper;
 	private OrgCognizanceLogMapper		orgCognizanceLogMapper;
 	@Autowired
 	@Autowired
 	private OrganizationIdentityMapper	organizationIdentityMapper;
 	private OrganizationIdentityMapper	organizationIdentityMapper;
+	@Autowired
+	private NoticeMapper noticeMapper;
 
 
 	@Override
 	@Override
 	public OrgCognizance insert(OrgCognizance c) {
 	public OrgCognizance insert(OrgCognizance c) {
@@ -53,7 +59,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 			Integer pageSize) {
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 		
 		
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}
 
 
@@ -207,6 +213,20 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 			log.setCid(cog.getId());
 			log.setCid(cog.getId());
 			log.setOperator(aid);
 			log.setOperator(aid);
 			orgCognizanceLogMapper.insert(log);
 			orgCognizanceLogMapper.insert(log);
+			
+			OrgCognizance info = orgCognizanceMapper.selectByPrimaryKey(cog.getId());
+			
+			Notice n = new Notice();
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			n.setId(UUID.randomUUID().toString());
+			n.setCreateTime(now.getTime());
+			n.setReaded(0);
+			n.setAid(log.getPrincipal());
+			n.setContent("编号" + info.getSerialNumber() + "  " + OrgCognizanceStatus.getStatus(log.getState()).getDesc());
+			n.setNoticeType(NoticeStatus.COGNIZANCE.getCode());
+			noticeMapper.insert(n);
+			
 		}
 		}
 		orgCognizanceMapper.updateByPrimaryKeySelective(cog);
 		orgCognizanceMapper.updateByPrimaryKeySelective(cog);
 	}
 	}

+ 11 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -5,4 +5,15 @@ public class AFTConstants {
 
 
 	public static final String	YYYYMMDD		= "yyyy-MM-dd";
 	public static final String	YYYYMMDD		= "yyyy-MM-dd";
 
 
+	public static final String	SUPERADMIN		= "999999";
+
+	public static final String	PATENTINFO		= "专利申请管理";
+
+	public static final String	COGNIZANCE		= "高企认定管理";
+
+	public static final String	COPYRIGHT		= "软著申请管理";
+
+	public static final String	TECHPROJECT		= "科技项目申报管理";
+	
+
 }
 }

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

@@ -1,5 +1,7 @@
 package com.goafanti.common.dao;
 package com.goafanti.common.dao;
 
 
+import java.util.List;
+
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.Notice;
 
 
 public interface NoticeMapper {
 public interface NoticeMapper {
@@ -19,4 +21,6 @@ public interface NoticeMapper {
 	int findUnreadNoticeCount(String aid);
 	int findUnreadNoticeCount(String aid);
 
 
 	int selectUnreadedCount(String aid);
 	int selectUnreadedCount(String aid);
+
+	int batchUpdateUnreaded(List<String> dl);
 }
 }

+ 57 - 0
src/main/java/com/goafanti/common/enums/NoticeStatus.java

@@ -0,0 +1,57 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum NoticeStatus {
+	PATENTINFO(1, "专利申请管理"),
+	COGNIZANCE(2, "高企认定管理"),
+	COPYRIGHT(3, "软著申请管理"),
+	TECHPROJECT(4, "科技项目申报管理"),
+	OTHER(5, "其他");
+
+	private NoticeStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, NoticeStatus> status = new HashMap<Integer, NoticeStatus>();
+
+	static {
+		for (NoticeStatus value : NoticeStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static NoticeStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static NoticeStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 14 - 5
src/main/java/com/goafanti/common/mapper/NoticeMapper.xml

@@ -4,7 +4,7 @@
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.Notice" >
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.Notice" >
     <id column="id" property="id" jdbcType="VARCHAR" />
     <id column="id" property="id" jdbcType="VARCHAR" />
     <result column="aid" property="aid" jdbcType="VARCHAR" />
     <result column="aid" property="aid" jdbcType="VARCHAR" />
-    <result column="notice_type" property="noticeType" jdbcType="VARCHAR" />
+    <result column="notice_type" property="noticeType" jdbcType="INTEGER" />
     <result column="content" property="content" jdbcType="VARCHAR" />
     <result column="content" property="content" jdbcType="VARCHAR" />
     <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
     <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
     <result column="readed" property="readed" jdbcType="INTEGER" />
     <result column="readed" property="readed" jdbcType="INTEGER" />
@@ -26,7 +26,7 @@
     insert into notice (id, aid, notice_type, 
     insert into notice (id, aid, notice_type, 
       content, create_time, readed
       content, create_time, readed
       )
       )
-    values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{noticeType,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{noticeType,jdbcType=INTEGER}, 
       #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{readed,jdbcType=INTEGER}
       #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{readed,jdbcType=INTEGER}
       )
       )
   </insert>
   </insert>
@@ -60,7 +60,7 @@
         #{aid,jdbcType=VARCHAR},
         #{aid,jdbcType=VARCHAR},
       </if>
       </if>
       <if test="noticeType != null" >
       <if test="noticeType != null" >
-        #{noticeType,jdbcType=VARCHAR},
+        #{noticeType,jdbcType=INTEGER},
       </if>
       </if>
       <if test="content != null" >
       <if test="content != null" >
         #{content,jdbcType=VARCHAR},
         #{content,jdbcType=VARCHAR},
@@ -80,7 +80,7 @@
         aid = #{aid,jdbcType=VARCHAR},
         aid = #{aid,jdbcType=VARCHAR},
       </if>
       </if>
       <if test="noticeType != null" >
       <if test="noticeType != null" >
-        notice_type = #{noticeType,jdbcType=VARCHAR},
+        notice_type = #{noticeType,jdbcType=INTEGER},
       </if>
       </if>
       <if test="content != null" >
       <if test="content != null" >
         content = #{content,jdbcType=VARCHAR},
         content = #{content,jdbcType=VARCHAR},
@@ -97,7 +97,7 @@
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Notice" >
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Notice" >
     update notice
     update notice
     set aid = #{aid,jdbcType=VARCHAR},
     set aid = #{aid,jdbcType=VARCHAR},
-      notice_type = #{noticeType,jdbcType=VARCHAR},
+      notice_type = #{noticeType,jdbcType=INTEGER},
       content = #{content,jdbcType=VARCHAR},
       content = #{content,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       readed = #{readed,jdbcType=INTEGER}
       readed = #{readed,jdbcType=INTEGER}
@@ -154,4 +154,13 @@
     	and aid = #{_parameter,jdbcType=VARCHAR}
     	and aid = #{_parameter,jdbcType=VARCHAR}
    </if>
    </if>
   </select>
   </select>
+  
+  <update id="batchUpdateUnreaded" parameterType="java.util.List">
+		update notice set readed = 1
+		where id in
+		<foreach item="item" index="index" collection="list" open="("
+			separator="," close=")">
+			#{item}
+		</foreach>
+	</update>
 </mapper>
 </mapper>

+ 88 - 56
src/main/java/com/goafanti/common/model/Notice.java

@@ -5,83 +5,115 @@ import java.util.Date;
 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.JsonIgnore;
+import com.goafanti.common.enums.NoticeStatus;
 
 
 public class Notice {
 public class Notice {
-    private String id;
+	private String	id;
 
 
-    private String aid;
+	private String	aid;
 
 
-    /**
-    * 通知类型
-    */
-    private String noticeType;
+	/**
+	 * 通知类型
+	 */
+	private Integer	noticeType;
 
 
-    /**
-    * 通知内容
-    */
-    private String content;
+	/**
+	 * 通知内容
+	 */
+	private String	content;
 
 
-    /**
-    * 创建时间
-    */
-    private Date createTime;
-    
-    private Integer readed;
+	/**
+	 * 创建时间
+	 */
+	private Date	createTime;
 
 
-    public String getId() {
-        return id;
-    }
+	private Integer	readed;
 
 
-    public void setId(String id) {
-        this.id = id;
-    }
+	public String getId() {
+		return id;
+	}
 
 
-    public String getAid() {
-        return aid;
-    }
+	public void setId(String id) {
+		this.id = id;
+	}
 
 
-    public void setAid(String aid) {
-        this.aid = aid;
-    }
+	public String getAid() {
+		return aid;
+	}
 
 
-    public String getNoticeType() {
-        return noticeType;
-    }
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
 
 
-    public void setNoticeType(String noticeType) {
-        this.noticeType = noticeType;
-    }
 
 
-    public String getContent() {
-        return content;
-    }
+	public Integer getNoticeType() {
+		return noticeType;
+	}
 
 
-    public void setContent(String content) {
-        this.content = content;
-    }
+	public void setNoticeType(Integer noticeType) {
+		this.noticeType = noticeType;
+	}
 
 
-    public Date getCreateTime() {
-        return createTime;
-    }
+	public String getContent() {
+		return content;
+	}
 
 
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-    
-    @JsonIgnore
-    public Integer getReaded() {
-        return readed;
-    }
-
-    public void setReaded(Integer readed) {
-        this.readed = readed;
-    }
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	@JsonIgnore
+	public Integer getReaded() {
+		return readed;
+	}
+
+	public void setReaded(Integer readed) {
+		this.readed = readed;
+	}
+	
+	public String getNoticeTypeName(){
+		if (null == this.noticeType){
+			return null;
+		} else {
+			if (NoticeStatus.PATENTINFO.getCode() == this.noticeType){
+				return NoticeStatus.PATENTINFO.getDesc();
+			} 
+			if (NoticeStatus.COGNIZANCE.getCode() == this.noticeType){
+				return NoticeStatus.COGNIZANCE.getDesc();
+			}
+			if (NoticeStatus.COPYRIGHT.getCode() == this.noticeType){
+				return NoticeStatus.COPYRIGHT.getDesc();
+			}
+			if (NoticeStatus.TECHPROJECT.getCode() == this.noticeType){
+				return NoticeStatus.TECHPROJECT.getDesc();
+			}
+			return NoticeStatus.OTHER.getDesc();
+		}
+	}
     
     
-    public String getCreateTimeFormattedDate(){
+	public void setNoticeTypeName(Integer noticeType){
+		
+	}
+	
+	public String getCreateTimeFormattedDate() {
 		if (this.createTime == null) {
 		if (this.createTime == null) {
 			return null;
 			return null;
 		} else {
 		} else {
 			return DateFormatUtils.format(this.getCreateTime(), "yyyy-MM-dd");
 			return DateFormatUtils.format(this.getCreateTime(), "yyyy-MM-dd");
 		}
 		}
 	}
 	}
+
+	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
+
+	}
+	
+	
 }
 }

+ 19 - 1
src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java

@@ -15,10 +15,13 @@ import org.springframework.stereotype.Service;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.CopyrightInfoMapper;
 import com.goafanti.common.dao.CopyrightInfoMapper;
 import com.goafanti.common.dao.CopyrightLogMapper;
 import com.goafanti.common.dao.CopyrightLogMapper;
+import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
 import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
 import com.goafanti.common.enums.CopyrightStatus;
 import com.goafanti.common.enums.CopyrightStatus;
+import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.model.CopyrightInfo;
 import com.goafanti.common.model.CopyrightInfo;
 import com.goafanti.common.model.CopyrightLog;
 import com.goafanti.common.model.CopyrightLog;
+import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
 import com.goafanti.copyright.bo.CopyrightLogBO;
 import com.goafanti.copyright.bo.CopyrightLogBO;
@@ -35,6 +38,8 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 	private CopyrightLogMapper				copyrightLogMapper;
 	private CopyrightLogMapper				copyrightLogMapper;
 	@Autowired
 	@Autowired
 	private OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
 	private OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
+	@Autowired
+	private NoticeMapper noticeMapper;
 
 
 	@Override
 	@Override
 	public CopyrightInfo insert(CopyrightInfo copyrightInfo) {
 	public CopyrightInfo insert(CopyrightInfo copyrightInfo) {
@@ -58,6 +63,19 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 		if (copyrightLog.getRecordTime() != null && copyrightLog.getStatus() != null
 		if (copyrightLog.getRecordTime() != null && copyrightLog.getStatus() != null
 				&& copyrightLog.getPrincipal() != null) {
 				&& copyrightLog.getPrincipal() != null) {
 			copyrightLogMapper.insertSelective(copyrightLog);
 			copyrightLogMapper.insertSelective(copyrightLog);
+			
+			CopyrightInfo info = copyrightInfoMapper.selectByPrimaryKey(copyrightInfo.getId());
+			Notice n = new Notice();
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			n.setId(UUID.randomUUID().toString());
+			n.setCreateTime(now.getTime());
+			n.setReaded(0);
+			n.setAid(copyrightLog.getPrincipal());
+			n.setContent("编号" + info.getSerialNumber() + "  " + CopyrightStatus.getStatus(copyrightLog.getStatus()).getDesc());
+			n.setNoticeType(NoticeStatus.COPYRIGHT.getCode());
+			noticeMapper.insert(n);
+			
 			if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.ACCEPT) {
 			if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.ACCEPT) {
 				copyrightInfo.setAcceptTime(copyrightLog.getRecordTime());
 				copyrightInfo.setAcceptTime(copyrightLog.getRecordTime());
 			} else if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.DELIVERD) {
 			} else if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.DELIVERD) {
@@ -112,7 +130,7 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 			Integer pageSize, String uid) {
 			Integer pageSize, String uid) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 		
 		
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}
 		if (StringUtils.isNotBlank(province)) {
 		if (StringUtils.isNotBlank(province)) {

+ 2 - 1
src/main/java/com/goafanti/patent/service/impl/PatentCostServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.Map;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.PatentCostMapper;
 import com.goafanti.common.dao.PatentCostMapper;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.DateUtils;
@@ -36,7 +37,7 @@ public class PatentCostServiceImpl extends BaseMybatisDao<PatentCostMapper> impl
 		Date pStart = null;
 		Date pStart = null;
 		Date pEnd = null;
 		Date pEnd = null;
 
 
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}
 
 

+ 33 - 15
src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java

@@ -11,15 +11,19 @@ import java.util.UUID;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
 import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
 import com.goafanti.common.dao.PatentCostMapper;
 import com.goafanti.common.dao.PatentCostMapper;
 import com.goafanti.common.dao.PatentInfoMapper;
 import com.goafanti.common.dao.PatentInfoMapper;
 import com.goafanti.common.dao.PatentLogMapper;
 import com.goafanti.common.dao.PatentLogMapper;
 import com.goafanti.common.dao.PatentRegistrationMapper;
 import com.goafanti.common.dao.PatentRegistrationMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.enums.TechProjectStatus;
 import com.goafanti.common.enums.TechProjectStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentInfo;
@@ -50,6 +54,8 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 	PatentLogMapper					patentLogMapper;
 	PatentLogMapper					patentLogMapper;
 	@Autowired
 	@Autowired
 	OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
 	OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
+	@Autowired
+	NoticeMapper noticeMapper;
 
 
 	@Override
 	@Override
 	public PatentInfo insert(PatentInfo patentInfo) {
 	public PatentInfo insert(PatentInfo patentInfo) {
@@ -116,11 +122,10 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		Date cEnd = null;
 		Date cEnd = null;
 		Date pStart = null;
 		Date pStart = null;
 		Date pEnd = null;
 		Date pEnd = null;
-		
-		if (!TokenManager.hasRole("999999")) {
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}
-		
 
 
 		if (cDate != null && cDate.length > 0) {
 		if (cDate != null && cDate.length > 0) {
 			try {
 			try {
@@ -137,7 +142,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 						: DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
 						: DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
 			} catch (ParseException e) {
 			} catch (ParseException e) {
 			}
 			}
-			
+
 		}
 		}
 
 
 		if (cStart != null) {
 		if (cStart != null) {
@@ -209,10 +214,10 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			Integer pageSize) {
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 
 
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}
-		
+
 		if (locationProvince != null && locationProvince != "") {
 		if (locationProvince != null && locationProvince != "") {
 			params.put("locationProvince", locationProvince);
 			params.put("locationProvince", locationProvince);
 		}
 		}
@@ -234,12 +239,11 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			String patentNumber, String office, String locationProvince, String unitName, Integer patentCatagory,
 			String patentNumber, String office, String locationProvince, String unitName, Integer patentCatagory,
 			String patentName, Integer patentState, String author, Integer pageNo, Integer pageSize) {
 			String patentName, Integer patentState, String author, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
-		
-		
-		if (!TokenManager.hasRole("999999")) {
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}
-		
+
 		if (authorizedDate != null) {
 		if (authorizedDate != null) {
 			params.put("authorizedDate", authorizedDate);
 			params.put("authorizedDate", authorizedDate);
 		}
 		}
@@ -325,7 +329,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setPid(patentInfo.getId());
 		log.setPid(patentInfo.getId());
 		log.setRecordTime(patentInfo.getCreateTime());
 		log.setRecordTime(patentInfo.getCreateTime());
 		log.setState(PatentInfoStatus.CREATE.getCode());
 		log.setState(PatentInfoStatus.CREATE.getCode());
-		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin? TokenManager.getAdminId() : "");
+		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin ? TokenManager.getAdminId() : "");
 		if (TokenManager.getToken() instanceof Admin) {
 		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 			log.setOperator(TokenManager.getAdminId());
 		}
 		}
@@ -355,6 +359,20 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			}
 			}
 			p.setPrincipal(log.getPrincipal());
 			p.setPrincipal(log.getPrincipal());
 			patentLogMapper.insert(log);
 			patentLogMapper.insert(log);
+
+			PatentInfo info = patentInfoMapper.selectByPrimaryKey(p.getId());
+
+			Notice n = new Notice();
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			n.setId(UUID.randomUUID().toString());
+			n.setCreateTime(now.getTime());
+			n.setReaded(0);
+			n.setAid(log.getPrincipal());
+			n.setContent("编号" + info.getSerialNumber() + "  " + PatentInfoStatus.getStatus(log.getState()).getDesc());
+			n.setNoticeType(NoticeStatus.PATENTINFO.getCode());
+			noticeMapper.insert(n);
+			
 		}
 		}
 		patentInfoMapper.updateByPrimaryKeySelective(p);
 		patentInfoMapper.updateByPrimaryKeySelective(p);
 		if (PatentInfoStatus.getStatus(p.getPatentState()) == PatentInfoStatus.AUTHORIZE) {
 		if (PatentInfoStatus.getStatus(p.getPatentState()) == PatentInfoStatus.AUTHORIZE) {
@@ -405,9 +423,9 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			patentInfo.setPatentState(PatentInfoStatus.REVIEWREPLY.getCode());
 			patentInfo.setPatentState(PatentInfoStatus.REVIEWREPLY.getCode());
 		} else if (patentState == PatentInfoStatus.CORRECTIONNOTICE.getCode()) {
 		} else if (patentState == PatentInfoStatus.CORRECTIONNOTICE.getCode()) {
 			patentInfo.setPatentState(PatentInfoStatus.CORRECTIONREPLY.getCode());
 			patentInfo.setPatentState(PatentInfoStatus.CORRECTIONREPLY.getCode());
-		} 
+		}
 		patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
 		patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
-		
+
 		PatentLog patentLog = new PatentLog();
 		PatentLog patentLog = new PatentLog();
 		PatentInfo p = patentInfoMapper.selectByPrimaryKey(pid);
 		PatentInfo p = patentInfoMapper.selectByPrimaryKey(pid);
 		patentLog.setId(UUID.randomUUID().toString());
 		patentLog.setId(UUID.randomUUID().toString());
@@ -415,11 +433,11 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		patentLog.setState(p.getPatentState());
 		patentLog.setState(p.getPatentState());
 		patentLog.setOperator(TokenManager.getAdminId());
 		patentLog.setOperator(TokenManager.getAdminId());
 		patentLog.setPrincipal(p.getPrincipal());
 		patentLog.setPrincipal(p.getPrincipal());
-		
+
 		Calendar now = Calendar.getInstance();
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
 		now.set(Calendar.MILLISECOND, 0);
 		patentLog.setRecordTime(now.getTime());
 		patentLog.setRecordTime(now.getTime());
-		
+
 		patentLogMapper.insert(patentLog);
 		patentLogMapper.insert(patentLog);
 	}
 	}
 
 

+ 2 - 1
src/main/java/com/goafanti/patent/service/impl/PatentRegistrationServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.Map;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.PatentRegistrationMapper;
 import com.goafanti.common.dao.PatentRegistrationMapper;
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -36,7 +37,7 @@ public class PatentRegistrationServiceImpl extends BaseMybatisDao<PatentRegistra
 	public Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pageNo, Integer pageSize) {
 	public Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 		
 		
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}
 		
 		

+ 20 - 1
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -10,10 +10,14 @@ import java.util.UUID;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.TechProjectLogMapper;
 import com.goafanti.common.dao.TechProjectLogMapper;
 import com.goafanti.common.dao.TechProjectMapper;
 import com.goafanti.common.dao.TechProjectMapper;
+import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.TechProjectStatus;
 import com.goafanti.common.enums.TechProjectStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.model.TechProjectLog;
 import com.goafanti.common.model.TechProjectLog;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
@@ -31,6 +35,8 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	private TechProjectMapper		techProjectMapper;
 	private TechProjectMapper		techProjectMapper;
 	@Autowired
 	@Autowired
 	private TechProjectLogMapper	techProjectLogMapper;
 	private TechProjectLogMapper	techProjectLogMapper;
+	@Autowired
+	private NoticeMapper noticeMapper;
 
 
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
 	@Override
 	@Override
@@ -71,6 +77,19 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 				t.setState(log.getState());
 				t.setState(log.getState());
 			}
 			}
 			techProjectLogMapper.insert(log);
 			techProjectLogMapper.insert(log);
+			
+			TechProject info = techProjectMapper.selectByPrimaryKey(t.getId());
+			
+			Notice n = new Notice();
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			n.setId(UUID.randomUUID().toString());
+			n.setCreateTime(now.getTime());
+			n.setReaded(0);
+			n.setAid(log.getPrincipal());
+			n.setContent("编号" + info.getSerialNumber() + "  " + TechProjectStatus.getStatus(log.getState()).getDesc());
+			n.setNoticeType(NoticeStatus.TECHPROJECT.getCode());
+			noticeMapper.insert(n);
 		}
 		}
 
 
 		return techProjectMapper.updateByPrimaryKeySelective(t);
 		return techProjectMapper.updateByPrimaryKeySelective(t);
@@ -104,7 +123,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 			Integer pageSize) {
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 		
 		
-		if (!TokenManager.hasRole("999999")) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 			params.put("principal", TokenManager.getAdminId());
 		}
 		}