Antiloveg 8 年 前
コミット
0607d4a34d

+ 4 - 0
schema/permission.sql

@@ -332,6 +332,10 @@ insert into `permission`(`id`, `url`, `name`)
 values
 (UUID(), 'api/admin/activityDetail', '研发活动--研发活动详情');
 
+insert into `permission`(`id`, `url`, `name`) 
+values
+(UUID(), 'api/admin/patent/circulation', '专利申请管理--专利批量流转');
+
 
 
 

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

@@ -117,21 +117,28 @@ public class AdminPatentApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到流转状态", "流转状态"));
 			return res;
 		}
-
-		if (null == pi.getPrincipal()) {
+		
+		if (StringUtils.isBlank(pi.getPrincipal())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到负责人", "负责人"));
 			return res;
 		}
-		
-		if (null == recordTimeFormattedDate) {
+
+		if (StringUtils.isBlank(recordTimeFormattedDate)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到记录流转时间", "记录流转时间"));
 			return res;
 		}
-		
+
+		if (PatentInfoStatus.DELIVERD.getCode() != pi.getState()
+				&& PatentInfoStatus.CIRCULATION.getCode() != pi.getState()
+				&& PatentInfoStatus.SETTLEMENT.getCode() != pi.getState()) {
+			res.getError().add(buildError(ErrorConstants.STATUS_ERROR, "仅派单、流转、结款可操作!"));
+			return res;
+		}
+
 		PatentLog pl = new PatentLog();
 		BeanUtils.copyProperties(pi, pl);
-		
-		res.setData(patentInfoService.batchCirculation(ids,recordTimeFormattedDate, pl));
+
+		res.setData(patentInfoService.batchCirculation(ids, recordTimeFormattedDate, pl));
 		return res;
 	}
 

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

@@ -32,6 +32,6 @@ public interface PatentInfoMapper {
 
 	PatentInfoDetailBo selectPatentInfoDetail(String id);
 
-	List<PatentInfo> selectByPrimaryKeys(String[] ids);
+	List<PatentInfo> selectByPrimaryKeys(List<String> id);
 	
 }

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

@@ -172,6 +172,7 @@
     <if test="aid != null">
     	and n.aid = #{aid,jdbcType=VARCHAR}
     </if>
+    order by n.create_time desc
     <if test="page_sql!=null">
 		${page_sql}
 	</if>
@@ -194,8 +195,9 @@
 		LEFT JOIN admin a on a.id = n.pid 
     where n.readed = 1 
     <if test="aid != null">
-    and n.aid = #{aid,jdbcType=VARCHAR}
+   		 and n.aid = #{aid,jdbcType=VARCHAR}
     </if>
+    order by n.create_time desc
     <if test="page_sql!=null">
 		${page_sql}
 	</if>

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

@@ -941,7 +941,7 @@
 		where p.deleted_sign =0 and p.id = #{id,jdbcType=VARCHAR}
 	</select>
 	
-	<select id="selectByPrimaryKeys" parameterType="java.util.List" >
+	<select id="selectByPrimaryKeys" parameterType="java.util.List" resultMap="BaseResultMap">
 	select 
 		<include refid="Base_Column_List" /> 
 	from patent_info where id in 

+ 13 - 7
src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java

@@ -2,6 +2,7 @@ package com.goafanti.patent.service.impl;
 
 import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
@@ -469,21 +470,26 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		}
 		pl.setRecordTime(recordTime);
 		List<PatentLog> p = new ArrayList<PatentLog>();
-		List<PatentInfo> list = patentInfoMapper.selectByPrimaryKeys(ids);
-		if (null != list && list.size() > 0){
-			for (PatentInfo patentInfo : list){
+		List<PatentInfo> list = patentInfoMapper.selectByPrimaryKeys(Arrays.asList(ids));
+		if (null != list && list.size() > 0) {
+			for (PatentInfo patentInfo : list) {
 				PatentLog patentLog = new PatentLog();
+				BeanUtils.copyProperties(pl, patentLog);
 				patentLog.setId(UUID.randomUUID().toString());
 				patentLog.setPid(patentInfo.getId());
-				patentLog.setOperator(TokenManager.getAdminId());;
-				BeanUtils.copyProperties(pl, patentLog);
+				patentLog.setOperator(TokenManager.getAdminId());
 				p.add(patentLog);
+				if (PatentInfoStatus.CIRCULATION.getCode() != patentLog.getState()) {
+					patentInfo.setPatentState(patentLog.getState());
+					patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
+				}
 				createNotice(patentInfo, patentLog);
 			}
+			patentLogMapper.batchInsert(p);
 		}
-		return patentLogMapper.batchInsert(p);
+		return 0;
 	}
-	
+
 	private void createNotice(PatentInfo p, PatentLog l) {
 		PatentInfo info = patentInfoMapper.selectByPrimaryKey(p.getId());
 

+ 1 - 1
src/main/resources/props/config_dev.properties

@@ -51,7 +51,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.20
+static.host=//afts.hnzhiming.com/1.0.21
 
 upload.path=/data/wwwroot/aft/upload
 upload.private.path=/data/upload

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.20
+static.host=//afts.hnzhiming.com/1.0.21
 
 upload.path=/Users/xiaolong/Sites/upload
 upload.private.path=/Users/xiaolong/Sites/doc

+ 1 - 1
src/main/resources/props/config_prod.properties

@@ -51,4 +51,4 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.20
+static.host=//afts.hnzhiming.com/1.0.21

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//aftts.hnzhiming.com/1.0.20
+static.host=//aftts.hnzhiming.com/1.0.21
 
 upload.path=/data/aft/public/upload
 upload.private.path=/data/aft/private/upload