liliang4869 преди 7 години
родител
ревизия
10f8a81819

+ 1 - 1
src/main/java/com/goafanti/achievement/controller/AdminAchievementApiController.java

@@ -82,7 +82,7 @@ public class AdminAchievementApiController extends CertifyApiController {
     public Result list(String name,String ownerName,Integer auditStatus,Integer category,Integer dataCategory,
     		String startDate,String endDate,Integer pageNo, Integer pageSize){
     	Result res = new Result();
-    	res.setData(achievementService.listAchievement(name, ownerName, dataCategory, dataCategory, auditStatus, startDate, endDate, pageNo, pageSize));
+    	res.setData(achievementService.listAchievement(name, ownerName, category, dataCategory, auditStatus, startDate, endDate, pageNo, pageSize));
     	return res;
     }
     

+ 7 - 2
src/main/java/com/goafanti/achievement/controller/UserAchievementApiController.java

@@ -108,11 +108,15 @@ public class UserAchievementApiController extends CertifyApiController {
 		}
 
 		Achievement a = achievementService.selectByPrimaryKey(id);
-
 		if (null == a) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "成果ID"));
 			return res;
 		}
+		if(a.getAuditStatus() != AchievementAuditStatus.AUDITED.getCode()) {
+			res.getError().add(buildError(ErrorConstants.STATUS_ERROR,"","当前状态不可撤销发布"));
+			return res;
+		}
+
 
 		res.setData(achievementService.updateReleaseStatus(a));
 		return res;
@@ -302,7 +306,8 @@ public class UserAchievementApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
 			return res;
 		}
-		if (AchievementAuditStatus.CREATE.getCode() != achievementResultObject.getAuditStatus() && AchievementAuditStatus.UNAUDITED.getCode()!=achievementResultObject.getAuditStatus()) {
+		if (AchievementAuditStatus.CREATE.getCode() != achievementResultObject.getAuditStatus() && AchievementAuditStatus.REVOKE.getCode()!=achievementResultObject.getAuditStatus()
+				&&AchievementAuditStatus.UNAUDITED.getCode()!=achievementResultObject.getAuditStatus()) {
 		res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法提交审核,"));
 		return res;
 	} 

+ 7 - 5
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -221,11 +221,13 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	@Override
 	public Pagination<AchievementObject> listMyAchievement(Integer auditStatus, String name,Integer dataCategory, 
 			String startDate,String endDate, Integer pNo, Integer pSize) {
+		System.out.println("as:"+auditStatus+" dc:"+ dataCategory);
 		Map<String,Object> params = new HashMap<>();
 		params.put("ownerId", TokenManager.getUserId());
 		if (null != startDate) params.put("startDate", startDate);
 		if (null != endDate) params.put("endDate", endDate);
 		if (null != auditStatus) params.put("auditStatus", auditStatus);
+		if(null != dataCategory) params.put("dataCategory", dataCategory);
 		if (!StringUtils.isBlank(name)) params.put("name", name);
 		return (Pagination<AchievementObject>) findPage("listMyAchievementByPage", "listMyAchievementCount",params,
 				pNo, pSize);
@@ -399,11 +401,11 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	@Override
 	public int updateReleaseStatus(Achievement a) {
 		a.setAuditStatus(AchievementAuditStatus.REVOKE.getCode());
-		if(a.getReleaseStatus()==1){
-			Calendar now = Calendar.getInstance();
-			now.set(Calendar.MILLISECOND, 0);
-			a.setReleaseDate(now.getTime());
-		}
+//		if(a.getReleaseStatus()==1){
+//			Calendar now = Calendar.getInstance();
+//			now.set(Calendar.MILLISECOND, 0);
+//			a.setReleaseDate(now.getTime());
+//		}
 		achievementDemandMapper.deleteByAchievementId(a.getId());
 		achievementKeywordMapper.batchDeleteByAchievementId(a.getId());
 		achievementPublishMapper.batchDeleteByAchievementId(a.getId());

+ 4 - 4
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1252,7 +1252,7 @@ order by release_date limit #{0}
   		and a.owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>
   	<if test="name != null">
-		and a.name like concat('%',#{name,jdbcType=VARCHAR},'%');
+		and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
 	<if test="ownerName != null">
 		and b.identify_name =#{ownerName,jdbcType=VARCHAR}
@@ -1263,7 +1263,7 @@ order by release_date limit #{0}
 	<if test="category != null">
 		and a.category = #{category,jdbcType=INTEGER}
 	</if>
-	<if test="dataCategory != null and dataCategory != ''">
+	<if test="dataCategory != null ">
   		and a.data_category = #{dataCategory,jdbcType=INTEGER}
   	</if>
 	<if test="startDate != null">
@@ -1286,7 +1286,7 @@ order by release_date limit #{0}
   		and a.owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>
   	<if test="name != null">
-		and a.name like concat('%',#{name,jdbcType=VARCHAR},'%'}
+		and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
 	<if test="ownerName != null">
 		and b.identify_name=#{ownerName,jdbcType=VARCHAR}
@@ -1297,7 +1297,7 @@ order by release_date limit #{0}
 	<if test="category != null">
 		and a.category = #{category,jdbcType=INTEGER}
 	</if>
-	<if test="dataCategory != null and dataCategory != ''">
+	<if test="dataCategory != null ">
   		and a.data_category = #{dataCategory,jdbcType=INTEGER}
   	</if>
 	<if test="startDate != null">