liliang4869 пре 7 година
родитељ
комит
7ccb21a311

+ 2 - 1
src/main/java/com/goafanti/business/controller/AdminJtBusinessController.java

@@ -266,10 +266,11 @@ public class AdminJtBusinessController extends CertifyApiController{
     		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"未找到服务","服务Id"));return result;
     	}
     	if(jtBusinessProject.getAuditStatus()!= ProjectAuditStatus.SUBMIT.getCode()) {
-    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"未找到成果","当前状态不可审核"));return result;
+    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"未找到服务","当前状态不可审核"));return result;
     	}
     	if(auditResult.intValue() == 0) jtBusinessProject.setAuditStatus(ProjectAuditStatus.AUDITED.getCode());
     	if(auditResult.intValue() == 1) jtBusinessProject.setAuditStatus(ProjectAuditStatus.UNAUDITED.getCode());
+    	jtBusinessProject.setAuditInfo(auditInfo);
     	jtBusinessService.updateProject(jtBusinessProject);
     	return result; 
 	}

+ 2 - 2
src/main/java/com/goafanti/business/controller/JtBusinessController.java

@@ -25,9 +25,9 @@ public class JtBusinessController extends CertifyApiController {
 	}
 	
 	@RequestMapping(value="/jtProject/list", method=RequestMethod.GET)
-	public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject) {
+	public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus) {
 		Result result=new Result();
-		result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject));
+		result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject,auditStatus));
 		return result;
 	}
 	

+ 7 - 2
src/main/java/com/goafanti/business/controller/UserJtBusinessController.java

@@ -157,12 +157,16 @@ public class UserJtBusinessController extends CertifyApiController{
 	@RequestMapping(value = "/project/publish",method=RequestMethod.GET)
 	public Result publishProject(String id,Integer auditStatus){
 		Result res = new Result();
-		if(auditStatus != ProjectAuditStatus.CREATE.getCode()){
+	
+		JtBusinessProject currentP=jtBusinessService.getBusinessProjectDetail(id);
+		Integer audit=currentP.getAuditStatus();
+		if(audit != ProjectAuditStatus.CREATE.getCode()  && audit !=ProjectAuditStatus.REVOKE.getCode()&& audit!=ProjectAuditStatus.UNAUDITED.getCode()){
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法发布"));
+			return res;
 		}
 		JtBusinessProject jtBusinessProject = new JtBusinessProject();
 		jtBusinessProject.setId(id);
-		jtBusinessProject.setAuditStatus(ProjectAuditStatus.AUDITED.getCode());
+		jtBusinessProject.setAuditStatus(ProjectAuditStatus.SUBMIT.getCode());
 		jtBusinessProject.setReleaseDate(new Date());
 		jtBusinessService.updateProject(jtBusinessProject);
 		return res;
@@ -179,6 +183,7 @@ public class UserJtBusinessController extends CertifyApiController{
 		Result res = new Result();
 		if(auditStatus != ProjectAuditStatus.AUDITED.getCode()){
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法撤销发布"));
+			return res;
 		}
 		JtBusinessProject jtBusinessProject = new JtBusinessProject();
 		jtBusinessProject.setId(id);

+ 1 - 1
src/main/java/com/goafanti/business/service/JtBusinessService.java

@@ -15,7 +15,7 @@ public interface JtBusinessService {
 	JtBusinessProject getBusinessProjectDetail(String id);
 	JtBusinessCategoryTree getCategoryTree(String id);
 	List<JtBusinessCategoryBo>getCategoryBoList();
-	Pagination<JtBusinessProject>getProjects(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject); 
+	Pagination<JtBusinessProject>getProjects(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus); 
 	int insertCategory(JtBusinessCategory jtBusinessCategory);
 	int deleteCategoryById(String id);
 	JtBusinessCategory getCategoryById(String id);

+ 7 - 1
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -67,7 +67,7 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<JtBusinessProject> getProjects(String topId, String secondId, String name, Integer pageSize,
-			Integer pageNo,Integer privateProject) {
+			Integer pageNo,Integer privateProject,Integer auditStatus) {
 		// TODO Auto-generated method stub
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;
@@ -76,7 +76,13 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		if (pageSize == null || pageSize < 0 ) {
 			pageSize = 10;
 		} 
+		
+		
+		
 		Map<String, Object> params=disposeParams(topId, secondId, name);
+if(auditStatus!=null ) {
+			params.put("auditStatus", auditStatus);
+		}
 		if(privateProject!=null && privateProject ==0)
 		params.put("ownerId", TokenManager.getUserId());
 		

+ 10 - 2
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -561,7 +561,7 @@
 	  	from 
 	  	jt_business_project,
 	  	min_img_url as minImgUrl
-	  	where category_id= #{id,jdbcType=VARCHAR}
+	  	where category_id= #{id,jdbcType=VARCHAR} and audit_status=2
 	  	<if test="isHot != null">
 	  		and is_hot = #{isHot,jdbcType=INTEGER}
 	  	</if>
@@ -607,6 +607,9 @@
   <if test="ownerId!=null">
   and jtbp.owner_id=#{ownerId,jdbcType=VARCHAR}
   </if>
+  <if test="auditStatus!=null">
+  and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
+  </if>
   	<if test="page_sql!=null">
 		${page_sql}
 	</if>
@@ -631,12 +634,17 @@
 	    <if test="ownerId!=null">
 	  and jtbp.owner_id=#{ownerId,jdbcType=VARCHAR}
 	  </if>
+	    <if test="auditStatus!=null">
+  and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
+  </if>
   </select>
   
   <select id="findProjectOrderByNumber" resultType="com.goafanti.common.model.JtBusinessProject">
   select
  <include refid="Base_Column_List" />
-  from jt_business_project order by create_time desc
+  from jt_business_project 
+  where audit_status=2
+  order by create_time desc
   </select>
   
 </mapper>