Antiloveg 8 years ago
parent
commit
ed780b9874

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

@@ -189,6 +189,20 @@ public class AdminApiController extends CertifyApiController {
 	private CopyrightInfoService			copyrightInfoService;
 	@Resource
 	private OrgCognizanceProportionService	orgCognizanceProportionService;
+	
+	/**
+	 * 统计专利、软著及科技项目申报业务情况
+	 */
+	@RequestMapping(value = "/getBusinessCount", method = RequestMethod.GET )
+	public Result countBusiness(String uid){
+		Result res = new Result();
+		if (StringUtils.isBlank(uid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户ID"));
+			return res;
+		}
+		res.setData(orgCognizanceService.countBusiness(uid));
+		return res;
+	}
 
 	/**
 	 * 更改资料填写完成状态

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

@@ -153,7 +153,7 @@ public class AdminPatentApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/patentList", method = RequestMethod.GET)
 	public Result patentList(Integer serialNumber, String patentNumber, String office, String locationProvince,
-			String unitName, Integer patentCatagory, String patentName, Integer patentState,
+			String unitName, Integer patentCatagory, String patentName, Integer patentState, String uid,
 			@RequestParam(name = "createTime[]", required = false) String[] createTime,
 			@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
 			String author, String pageNo, String pageSize) {
@@ -167,7 +167,7 @@ public class AdminPatentApiController extends CertifyApiController {
 			pNo = Integer.parseInt(pageNo);
 		}
 		res.setData(patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince,
-				unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo,
+				unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, uid, pNo,
 				pSize));
 		return res;
 	}
@@ -809,7 +809,7 @@ public class AdminPatentApiController extends CertifyApiController {
 	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/exportComposite", method = RequestMethod.GET)
 	public Result exportComposite(@RequestParam(name = "serialNumber", required = false) String serialNumber,
-			String patentNumber, String office, String locationProvince, String unitName,
+			String patentNumber, String office, String locationProvince, String unitName, String uid,
 			@RequestParam(name = "patentCatagory", required = false) String patentCatagory, String patentName,
 			@RequestParam(name = "patentState", required = false) String patentState,
 			@RequestParam(name = "createTime[]", required = false) String[] createTime,
@@ -822,7 +822,7 @@ public class AdminPatentApiController extends CertifyApiController {
 		Integer ps = (!StringUtils.isNumeric(patentState) ? null : Integer.parseInt(patentState));
 		String lp = ("undefined".equals(locationProvince)) ? null : locationProvince;
 		List<PatentManageListBo> composites = (List<PatentManageListBo>) getManagePatentList(sn, patentNumber, office,
-				lp, unitName, pc, patentName, ps, createTime, patentApplicationDate, author, 1, 1000).getList();
+				lp, unitName, pc, patentName, ps, createTime, patentApplicationDate, author, uid, 1, 1000).getList();
 		if (res.getError().isEmpty()) {
 			exportComosites(response, composites);
 		} else {
@@ -1130,10 +1130,10 @@ public class AdminPatentApiController extends CertifyApiController {
 	// 管理端申请专利列表(专利综合管理)
 	private Pagination<PatentManageListBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
-			String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize)
+			String[] createTime, String[] patentApplicationDate, String author, String uid, Integer pNo, Integer pSize)
 			throws ParseException {
 		return patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince, unitName,
-				patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo, pSize);
+				patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, uid, pNo, pSize);
 	}
 
 	// 缴费截止日期

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

@@ -48,11 +48,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		Map<String, Object> params = new HashMap<>();
 
 		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
-			return null;
-		}
-
-		if (StringUtils.isNotBlank(province)) {
-			params.put("province", province);
+			params.put("province", TokenManager.getProvince());
 		}
 
 		if (StringUtils.isNotBlank(mobile)) {

+ 94 - 0
src/main/java/com/goafanti/cognizance/bo/BusinessCountBo.java

@@ -0,0 +1,94 @@
+package com.goafanti.cognizance.bo;
+
+public class BusinessCountBo {
+	private String uid;
+	
+	/**
+	 * 专利下证数
+	 */
+	private Integer patentDone;
+
+	/**
+	 * 专利未证数
+	 */
+	private Integer patentUndone;
+	
+	/**
+	 * 软著下证数
+	 */
+	private Integer copyrightDone;
+	
+	/**
+	 * 软著未下证数
+	 */
+	private Integer copyrightUndone;
+	
+	/**
+	 * 科技项目申报下证数
+	 */
+	private Integer techProjectDone;
+	
+	/**
+	 * 科技项目申报未下证数
+	 */
+	private Integer techProjectUndone;
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Integer getPatentDone() {
+		return patentDone;
+	}
+
+	public void setPatentDone(Integer patentDone) {
+		this.patentDone = patentDone;
+	}
+
+	public Integer getPatentUndone() {
+		return patentUndone;
+	}
+
+	public void setPatentUndone(Integer patentUndone) {
+		this.patentUndone = patentUndone;
+	}
+
+	public Integer getCopyrightDone() {
+		return copyrightDone;
+	}
+
+	public void setCopyrightDone(Integer copyrightDone) {
+		this.copyrightDone = copyrightDone;
+	}
+
+	public Integer getCopyrightUndone() {
+		return copyrightUndone;
+	}
+
+	public void setCopyrightUndone(Integer copyrightUndone) {
+		this.copyrightUndone = copyrightUndone;
+	}
+
+	public Integer getTechProjectDone() {
+		return techProjectDone;
+	}
+
+	public void setTechProjectDone(Integer techProjectDone) {
+		this.techProjectDone = techProjectDone;
+	}
+
+	public Integer getTechProjectUndone() {
+		return techProjectUndone;
+	}
+
+	public void setTechProjectUndone(Integer techProjectUndone) {
+		this.techProjectUndone = techProjectUndone;
+	}
+	
+	
+
+}

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

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
+import com.goafanti.cognizance.bo.BusinessCountBo;
 import com.goafanti.cognizance.bo.CognizanceBo;
 import com.goafanti.cognizance.bo.CognizanceCatagoryBo;
 import com.goafanti.cognizance.bo.CognizanceDetailBo;
@@ -50,5 +51,7 @@ public interface OrgCognizanceService {
 
 	LatelyCogRecord selectLatelyRecord(String uid);
 
+	BusinessCountBo countBusiness(String uid);
+
 
 }

+ 29 - 8
src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.cognizance.bo.BusinessCountBo;
 import com.goafanti.cognizance.bo.CognizanceBo;
 import com.goafanti.cognizance.bo.CognizanceCatagoryBo;
 import com.goafanti.cognizance.bo.CognizanceDetailBo;
@@ -22,11 +23,14 @@ import com.goafanti.cognizance.bo.CultivationListBo;
 import com.goafanti.cognizance.bo.LatelyCogRecord;
 import com.goafanti.cognizance.service.OrgCognizanceService;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.CopyrightInfoMapper;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrgCognizanceLogMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.dao.OrgCognizanceProportionMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
+import com.goafanti.common.dao.PatentInfoMapper;
+import com.goafanti.common.dao.TechProjectMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.CopyrightStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
@@ -58,6 +62,12 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	private OrgCognizanceProportionMapper	orgCognizanceProportionMapper;
 	@Autowired
 	private UserMapper						userMapper;
+	@Autowired
+	private CopyrightInfoMapper				copyrightInfoMapper;
+	@Autowired
+	private PatentInfoMapper				patentInfoMapper;
+	@Autowired
+	private TechProjectMapper				techProjectMapper;
 
 	@Override
 	public OrgCognizance insert(OrgCognizance c) {
@@ -307,8 +317,6 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 				pageNo, pageSize);
 	}
 
-	
-
 	@Override
 	public OrgCognizance selectByPrimaryKey(String id) {
 		return orgCognizanceMapper.selectByPrimaryKey(id);
@@ -319,6 +327,19 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		return orgCognizanceMapper.selectLatelyRecord(uid);
 	}
 
+	@Override
+	public BusinessCountBo countBusiness(String uid) {
+		BusinessCountBo bcb = new BusinessCountBo();
+		bcb.setUid(uid);
+		bcb.setCopyrightDone(copyrightInfoMapper.countCopyrightDone(uid));
+		bcb.setCopyrightUndone(copyrightInfoMapper.countCopyrightDone(uid));
+		bcb.setPatentDone(patentInfoMapper.countPatentDone(uid));
+		bcb.setPatentUndone(patentInfoMapper.countPatentUndone(uid));
+		bcb.setTechProjectDone(techProjectMapper.countTechProjectDone(uid));
+		bcb.setTechProjectUndone(techProjectMapper.countTechProjectUndone(uid));
+		return bcb;
+	}
+
 	private OrgCognizanceProportion disposeProportion(OrgCognizanceProportion o) {
 		o.setAbility(ProportionStatus.UNFINISHED.getCode());
 		o.setAchievement(ProportionStatus.UNFINISHED.getCode());
@@ -334,7 +355,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		o.setTechProject(ProportionStatus.UNFINISHED.getCode());
 		return o;
 	}
-	
+
 	private void createNotice(OrgCognizance cog, OrgCognizanceLog l) {
 		OrgCognizance info = orgCognizanceMapper.selectByPrimaryKey(cog.getId());
 
@@ -344,17 +365,17 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		n.setId(UUID.randomUUID().toString());
 		n.setCreateTime(now.getTime());
 		n.setReaded(NoticeReadStatus.UNREAD.getCode());
-		
+
 		User u = userMapper.selectByPrimaryKey(cog.getUid());
-		if (null != u){
+		if (null != u) {
 			n.setPid(u.getAid());
 		}
-		
+
 		n.setUid(cog.getUid());
 		n.setRid(cog.getId());
-		
+
 		n.setYear(cog.getYear());
-		
+
 		n.setAid(l.getPrincipal());
 		n.setContent("编号" + info.getSerialNumber() + "  " + OrgCognizanceStatus.getStatus(l.getState()).getDesc());
 		n.setNoticeType(NoticeStatus.COGNIZANCE.getCode());

+ 2 - 0
src/main/java/com/goafanti/common/dao/CopyrightInfoMapper.java

@@ -29,4 +29,6 @@ public interface CopyrightInfoMapper {
 	int deleteByPrimaryKeys(List<String> id);
 
 	List<CopyrightInfo> selectByPrimaryKeys(List<String> asList);
+
+	Integer countCopyrightDone(String uid);
 }

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

@@ -38,4 +38,5 @@ public interface OrgCognizanceMapper {
 	int batchDeleteByPrimaryKey(List<String> id);
 
 	LatelyCogRecord selectLatelyRecord(String uid);
+
 }

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

@@ -33,5 +33,9 @@ public interface PatentInfoMapper {
 	PatentInfoDetailBo selectPatentInfoDetail(String id);
 
 	List<PatentInfo> selectByPrimaryKeys(List<String> id);
+
+	Integer countPatentDone(String uid);
+
+	Integer countPatentUndone(String uid);
 	
 }

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

@@ -21,4 +21,8 @@ public interface TechProjectMapper {
 	TechProjectDetailBo selectProjectDetail(String pid);
 
 	int batchDeleteByPrimaryKey(List<String> id);
+
+	Integer countTechProjectDone(String uid);
+
+	Integer countTechProjectUndone(String uid);
 }

+ 12 - 0
src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml

@@ -416,4 +416,16 @@
 		</foreach>
   </select>
   
+  <select id="countCopyrightDone" parameterType="java.lang.String" resultType="java.lang.Integer">
+   select count(1) from copyright_info 
+   where uid = #{uid,jdbcType=VARCHAR}
+   and delete_sign = 0 and status in (8,9) 
+  </select>
+  
+  <select id="countCopyrightUndone" parameterType="java.lang.String" resultType="java.lang.Integer">
+   select count(1) from copyright_info 
+   where uid = #{uid,jdbcType=VARCHAR}
+   and delete_sign = 0 and status <![CDATA[ < ]]> 8 
+  </select>
+  
 </mapper>

+ 18 - 0
src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml

@@ -651,6 +651,9 @@
 		<if test="author != null">
 			and p.author = #{author,jdbcType=VARCHAR}
 		</if>
+		<if test="uid != null">
+			and p.uid = #{uid,jdbcType=VARCHAR}
+		</if>
 		<if test="locationProvince != null">
 			and o.licence_province =
 			#{locationProvince,jdbcType=VARCHAR}
@@ -724,6 +727,9 @@
 		<if test="author != null">
 			and p.author = #{author,jdbcType=VARCHAR}
 		</if>
+		<if test="uid != null">
+			and p.uid = #{uid,jdbcType=VARCHAR}
+		</if>
 		<if test="locationProvince != null">
 			and
 			o.licence_province=#{locationProvince,jdbcType=VARCHAR}
@@ -950,5 +956,17 @@
 				#{item}
 		</foreach>
 	</select>
+	
+  <select id="countPatentDone" parameterType="java.lang.String" resultType="java.lang.Integer">
+	   select count(1) from patent_info 
+	   where uid = #{uid,jdbcType=VARCHAR}
+	   and deleted_sign = 0 and patent_state in (12,13) 
+  </select>
+  
+  <select id="countPatentUndone" parameterType="java.lang.String" resultType="java.lang.Integer">
+	   select count(1) from patent_info 
+	   where uid = #{uid,jdbcType=VARCHAR}
+	   and deleted_sign = 0 and patent_state <![CDATA[ < ]]> 12 
+  </select>
 
 </mapper>

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

@@ -433,4 +433,16 @@
 		#{item}
 	</foreach>
   </update>
+  
+  <select id="countTechProjectDone" parameterType="java.lang.String" resultType="java.lang.Integer">
+	   select count(1) from tech_project 
+	   where uid = #{uid,jdbcType=VARCHAR}
+	   and deleted_sign = 0 and state in (6,8) 
+  </select>
+  
+  <select id="countTechProjectUndone" parameterType="java.lang.String" resultType="java.lang.Integer">
+	   select count(1) from tech_project 
+	   where uid = #{uid,jdbcType=VARCHAR}
+	   and deleted_sign = 0 and state in (1,2,3,4,5,7)
+  </select>
 </mapper>

+ 11 - 9
src/main/java/com/goafanti/common/model/AftUser.java

@@ -3,13 +3,15 @@ package com.goafanti.common.model;
 import java.util.Date;
 
 public interface AftUser {
-	 String getId();
-	 
-	 String getPassword();
-	 
-	 Date getCreateTime();
-	 
-	 String getAid();
-	 
-	 String getMobile();
+	String getId();
+
+	String getPassword();
+
+	Date getCreateTime();
+
+	String getAid();
+
+	String getMobile();
+
+	String getProvince();
 }

+ 6 - 0
src/main/java/com/goafanti/common/model/User.java

@@ -143,6 +143,12 @@ public class User extends BaseModel implements AftUser{
 	public void setAid(String aid) {
 		this.aid = aid;
 	}
+
+	@JsonIgnore
+	@Override
+	public String getProvince() {
+		return null;
+	}
     
     
     

+ 9 - 0
src/main/java/com/goafanti/core/shiro/token/TokenManager.java

@@ -127,6 +127,15 @@ public class TokenManager {
 	public static String getAdminId() {
 		return getToken() == null ? null : getToken().getId();
 	}
+	
+	/**
+	 * 
+	 * 获取当前管理员所在省份
+	 * @return
+	 */
+	public static String getProvince(){
+		return getToken() == null ? null : getToken().getProvince();
+	}
 
 	/**
 	 * 获取验证码,获取一次后删除

+ 1 - 1
src/main/java/com/goafanti/patent/service/PatentInfoService.java

@@ -24,7 +24,7 @@ public interface PatentInfoService {
 
 	Pagination<PatentManageListBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
-			String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize);
+			String[] createTime, String[] patentApplicationDate, String author, String uid, Integer pNo, Integer pSize);
 
 	Pagination<PatentPendingBo> getManagePendingPaymentList(String locationProvince, Integer pNo, Integer pSize);
 

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

@@ -121,7 +121,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 	@Override
 	public Pagination<PatentManageListBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
-			String[] cDate, String[] pDate, String author, Integer pageNo, Integer pageSize) {
+			String[] cDate, String[] pDate, String author, String uid, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Date cStart = null;
 		Date cEnd = null;
@@ -201,6 +201,10 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		if (author != null && author != "") {
 			params.put("author", author);
 		}
+		
+		if (uid != null && uid != "") {
+			params.put("uid", uid);
+		}
 
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;