Browse Source

Merge branch 'master' of jishutao/jitao-server into test

liliang4869 7 years ago
parent
commit
967fcef942

+ 5 - 5
GeneratorConfig.xml

@@ -2,14 +2,14 @@
 <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
 <generatorConfiguration>
   <!-- <classPathEntry location="C:/Users/Administrator/.dbeaver-drivers/maven/maven-central/mysql/mysql-connector-java-5.1.44.jar" /> -->
-  <classPathEntry location="E:/mysql-connector-java-5.1.46.jar" />
+  <classPathEntry location="E:/mysql-connector-java-5.1.40.jar" />
   <context id="context1">	
  	<property name="javaFileEncoding" value="UTF-8"/>
     <jdbcConnection connectionURL="jdbc:mysql://192.168.1.213:3306/aft" 
     	driverClass="com.mysql.jdbc.Driver" password="123456" userId="dev" />
-   <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="jitao_server" />
-   <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao_server" />
-   <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao_server" type="XMLMAPPER" />
-   <table schema="aft" tableName="policy"/>
+   <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="jitao-server" />
+   <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao-server" />
+   <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" />
+   <table schema="aft" tableName="jt_business_project"/>
   </context>
 </generatorConfiguration>

+ 26 - 4
src/main/java/com/goafanti/business/controller/AdminJtBusinessController.java

@@ -1,7 +1,5 @@
 package com.goafanti.business.controller;
 
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -15,11 +13,12 @@ import com.goafanti.business.service.JtBusinessServiceWithCategoryMapper;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.enums.ProjectAuditStatus;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
-
-import okhttp3.Request;
+import com.goafanti.portal.bo.AchievementResultObject;
 
 @RestController
 @RequestMapping(value = "/api/admin/jtBusiness")
@@ -254,4 +253,27 @@ public class AdminJtBusinessController extends CertifyApiController{
 		}
 		return res;
 	}
+	
+	@RequestMapping(value="/project/audit" ,method=RequestMethod.POST)
+    private Result auditAchievemnt(String id,Integer auditResult,String auditInfo) {
+    	Result result=new Result();
+    	if(id == null || auditResult == null || auditResult.intValue()!=0 && auditResult.intValue()!=1)
+    	{
+    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));return result;
+    	}
+    	JtBusinessProject jtBusinessProject = jtBusinessService.getBusinessProjectDetail(id);
+    	if(jtBusinessProject==null) {
+    		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;
+    	}
+    	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; 
+	}
+	
+	
 }

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

@@ -1,6 +1,5 @@
 package com.goafanti.business.controller;
 
-import java.util.List;
 
 import javax.annotation.Resource;
 
@@ -21,15 +20,14 @@ public class JtBusinessController extends CertifyApiController {
 	@RequestMapping(value = "/jtBusiness/getCategoryList" , method = RequestMethod.GET)
 	public Result getCategoryList() {
 		Result result=new Result();
-result.setData(jtBusinessService.getCategoryBoList());
+		result.setData(jtBusinessService.getCategoryBoList());
 		return result;
 	}
 	
-	
 	@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;
 	}
 	

+ 68 - 1
src/main/java/com/goafanti/business/controller/UserJtBusinessController.java

@@ -1,5 +1,7 @@
 package com.goafanti.business.controller;
 
+import java.util.Date;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
@@ -13,6 +15,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.enums.ProjectAuditStatus;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
 
@@ -106,7 +109,6 @@ public class UserJtBusinessController extends CertifyApiController{
 	private Result updateProject(JtBusinessProject jtBusinessProject) {
 		Result result=new Result();
 		jtBusinessProject.setCreateTime(null);
-//		jtBusinessProject.setId(null);
 		jtBusinessProject.setNumber(null);
 		disposeProjectParam(result, jtBusinessProject);
 		if(result.getError().size()>0) {
@@ -145,4 +147,69 @@ public class UserJtBusinessController extends CertifyApiController{
 		 result.setData(JtBusinessServiceWithCategoryMapper.getCategoryListByCondition(jtBusinessCategory,pageNo,pageSize));
 		 return result;
 	}
+
+	/**
+	 * 发布项目
+	 * @param id
+	 * @param auditStatus
+	 * @return
+	 */
+	@RequestMapping(value = "/project/publish",method=RequestMethod.GET)
+	public Result publishProject(String id,Integer auditStatus){
+		Result res = new Result();
+	
+		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.SUBMIT.getCode());
+		jtBusinessProject.setReleaseDate(new Date());
+		jtBusinessService.updateProject(jtBusinessProject);
+		return res;
+	}
+	
+	/**
+	 * 撤销发布
+	 * @param id
+	 * @param auditStatus
+	 * @return
+	 */
+	@RequestMapping(value = "/project/offShelf",method=RequestMethod.GET)
+	public Result offShelf(String id,Integer auditStatus){
+		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);
+		jtBusinessProject.setAuditStatus(ProjectAuditStatus.REVOKE.getCode());
+		jtBusinessService.updateProject(jtBusinessProject);
+		return res;
+	}
+	
+	/**
+	 * 刷新发布时间
+	 * @param id
+	 * @param auditStatus
+	 * @return
+	 */
+	@RequestMapping(value = "/project/refreshPublish",method=RequestMethod.GET)
+	public Result refreshPublish(String id,Integer auditStatus){
+		Result res = new Result();
+		if(auditStatus != ProjectAuditStatus.AUDITED.getCode()){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法刷新发布"));
+		}
+		JtBusinessProject jtBusinessProject = new JtBusinessProject();
+		jtBusinessProject.setId(id);
+		jtBusinessProject.setReleaseDate(new Date());
+		jtBusinessService.updateProject(jtBusinessProject);
+		return res;
+	}
+	
+	
 }

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

@@ -9,19 +9,19 @@ import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.core.mybatis.page.Pagination;
 
 public interface JtBusinessService {
-JtBusinessCategory getBusinessCategoryByLayerAndName(Integer layer,String name);
-List<JtBusinessCategory> getBusinessCategoryBySuperId(String id,Integer size);
-List<JtBusinessProject>getBusinessProjectByCategoryId(String id,Integer size);
-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); 
-int insertCategory(JtBusinessCategory jtBusinessCategory);
-int deleteCategoryById(String id);
-JtBusinessCategory getCategoryById(String id);
-int updateCategory(JtBusinessCategory jtBusinessCategory);
-int insertProject(JtBusinessProject jtBusinessProject);
-int deleteProjectById(String id);
-int updateProject(JtBusinessProject jtBusinessProject);
-List<JtBusinessProject>getProjectsLimit(Integer size);
+	JtBusinessCategory getBusinessCategoryByLayerAndName(Integer layer,String name);
+	List<JtBusinessCategory> getBusinessCategoryBySuperId(String id,Integer size);
+	List<JtBusinessProject>getBusinessProjectByCategoryId(String id,Integer size,Integer isHot);
+	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,Integer auditStatus); 
+	int insertCategory(JtBusinessCategory jtBusinessCategory);
+	int deleteCategoryById(String id);
+	JtBusinessCategory getCategoryById(String id);
+	int updateCategory(JtBusinessCategory jtBusinessCategory);
+	int insertProject(JtBusinessProject jtBusinessProject);
+	int deleteProjectById(String id);
+	int updateProject(JtBusinessProject jtBusinessProject);
+	List<JtBusinessProject>getProjectsLimit(Integer size);
 }

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

@@ -15,12 +15,14 @@ import com.goafanti.business.bo.JtBusinessCategoryTree;
 import com.goafanti.business.service.JtBusinessService;
 import com.goafanti.common.dao.JtBusinessCategoryMapper;
 import com.goafanti.common.dao.JtBusinessProjectMapper;
+import com.goafanti.common.enums.ProjectAuditStatus;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.enums.AuditState;
 
 @Service
 public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapper> implements JtBusinessService{
@@ -41,9 +43,9 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	}
 
 	@Override
-	public List<JtBusinessProject> getBusinessProjectByCategoryId(String id,Integer size) {
+	public List<JtBusinessProject> getBusinessProjectByCategoryId(String id,Integer size,Integer isHot) {
 		// TODO Auto-generated method stub
-		return jtBusinessProjectMapper.getBusinessProjectByCategoryId(id,size);
+		return jtBusinessProjectMapper.getBusinessProjectByCategoryId(id,size,isHot);
 	}
 
 	@Override
@@ -65,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;
@@ -74,12 +76,19 @@ 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());
 		
 		return (Pagination<JtBusinessProject>)findPage("findJtBusinessProjectByPage","findJtBusinessCountByPage",params,pageNo,pageSize);
 	}
+	
 	private Map<String, Object> disposeParams(String topId, String secondId,  String name) {
 		Map<String, Object> params = new HashMap<>();
 
@@ -155,7 +164,7 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		if(chidren.size()>0) {
 			return -1;
 		}
-		List<JtBusinessProject> childrenProject=jtBusinessProjectMapper.getBusinessProjectByCategoryId(id, 100);
+		List<JtBusinessProject> childrenProject=jtBusinessProjectMapper.getBusinessProjectByCategoryId(id, 100,null);
 		if(childrenProject!= null && childrenProject.size()>0) {
 			return -1;
 		}
@@ -200,6 +209,7 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		jtBusinessProject.setCreateTime(new Date());
 		jtBusinessProject.setId(UUID.randomUUID().toString());
 		jtBusinessProject.setOwnerId(TokenManager.getUserId());
+		jtBusinessProject.setAuditStatus(ProjectAuditStatus.CREATE.getCode());
 		List<JtBusinessProject>projects=jtBusinessProjectMapper.findProjectOrderByNumber();
 		int cSize = 1;
 		if(projects!=null && projects.size()>0)
@@ -245,7 +255,4 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		return jtBusinessProjectMapper.findProjectOrderByNumber();
 	}
 
-
-
-	
 }

+ 5 - 4
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -20,6 +20,7 @@ import com.goafanti.business.bo.JtBusinessCategoryTree;
 import com.goafanti.business.service.JtBusinessService;
 import com.goafanti.common.bo.PolicyEntity;
 import com.goafanti.common.bo.fieldGlossoryBo;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.PageConstants;
 import com.goafanti.common.model.Banners;
 import com.goafanti.common.model.IndustryCategory;
@@ -289,7 +290,7 @@ public class WebpageController extends BaseController {
 		JtBusinessCategory gaoqi2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "高企服务");
 		if(gaoqi2!=null)
 		{
-		List<JtBusinessProject>gaoqiList=jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(),6);
+		List<JtBusinessProject>gaoqiList=jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(),6,null);
 		for(JtBusinessProject project:gaoqiList) {
 			if(project.getMinImgUrl()!=null && project.getMinImgUrl().length()<=0)project.setMinImgUrl(null);
 		}
@@ -313,14 +314,14 @@ public class WebpageController extends BaseController {
 		JtBusinessCategory manageSys=jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系");
 		JtBusinessCategory manageSys2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "管理体系");
 		if(manageSys2!=null) {
-		List<JtBusinessProject>manageSysPro=jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(), 18);
+		List<JtBusinessProject>manageSysPro=jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(), 18,null);
 		modelview.addObject("manageSystemList",manageSysPro);
 		modelview.addObject("managerSysc1",manageSys);}
 		//科技项目
 				JtBusinessCategory scienceProject=jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
 				JtBusinessCategory scienceProject2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "科技项目");
 				if(scienceProject2!=null) {
-				List<JtBusinessProject>scienceProjects=jtBusinessService.getBusinessProjectByCategoryId(scienceProject2.getId(), 12);
+				List<JtBusinessProject>scienceProjects=jtBusinessService.getBusinessProjectByCategoryId(scienceProject2.getId(), 12,AFTConstants.YES);
 				modelview.addObject("scienceProjectList",scienceProjects);
 				modelview.addObject("spc1",scienceProject);}
 		//咨询师
@@ -738,7 +739,7 @@ public class WebpageController extends BaseController {
 	
 	private void businessHelper(ModelAndView modelAndView,String categoryName,List<JtBusinessCategory> jtBusinessCategories,int[] sizes) {
 		for(int i=0;i<jtBusinessCategories.size();i++) {
-			List<JtBusinessProject>projects=jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategories.get(i).getId(), sizes[i]);
+			List<JtBusinessProject>projects=jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategories.get(i).getId(), sizes[i],null);
 			modelAndView.addObject(categoryName+i,jtBusinessCategories.get(i)); 
 			modelAndView.addObject(categoryName+"List"+i,projects);
 		}

+ 57 - 78
src/main/java/com/goafanti/common/dao/JtBusinessProjectMapper.java

@@ -9,94 +9,73 @@ import org.apache.ibatis.annotations.Param;
 
 public interface JtBusinessProjectMapper {
     /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    long countByExample(JtBusinessProjectExample example);
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	long countByExample(JtBusinessProjectExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int deleteByExample(JtBusinessProjectExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int deleteByExample(JtBusinessProjectExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int deleteByPrimaryKey(String id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int deleteByPrimaryKey(String id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int insert(JtBusinessProject record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int insert(JtBusinessProject record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int insertSelective(JtBusinessProject record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int insertSelective(JtBusinessProject record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    List<JtBusinessProject> selectByExample(JtBusinessProjectExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	List<JtBusinessProject> selectByExample(JtBusinessProjectExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    JtBusinessProject selectByPrimaryKey(String id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	JtBusinessProject selectByPrimaryKey(String id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int updateByExampleSelective(@Param("record") JtBusinessProject record, @Param("example") JtBusinessProjectExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int updateByExampleSelective(@Param("record") JtBusinessProject record,
+			@Param("example") JtBusinessProjectExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int updateByExample(@Param("record") JtBusinessProject record, @Param("example") JtBusinessProjectExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int updateByExample(@Param("record") JtBusinessProject record, @Param("example") JtBusinessProjectExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int updateByPrimaryKeySelective(JtBusinessProject record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int updateByPrimaryKeySelective(JtBusinessProject record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table jt_business_project
-     *
-     * @mbg.generated Wed Jun 20 11:08:54 CST 2018
-     */
-    int updateByPrimaryKey(JtBusinessProject record);
-    
-     List<JtBusinessProject> getBusinessProjectByCategoryId(String id,Integer size);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_project
+	 * @mbg.generated  Fri Jul 06 18:31:16 CST 2018
+	 */
+	int updateByPrimaryKey(JtBusinessProject record);
+
+	List<JtBusinessProject> getBusinessProjectByCategoryId(@Param("id")String id,@Param("size")Integer size,@Param("isHot")Integer isHot);
      
   List<JtBusinessProject> findProjectOrderByNumber();
   

+ 57 - 0
src/main/java/com/goafanti/common/enums/ProjectAuditStatus.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 ProjectAuditStatus {
+	CREATE(0, "草稿"),
+	SUBMIT(1, "提交审核"),
+	AUDITED(2,"审核通过"),
+	UNAUDITED(3,"审核未通过"),
+	REVOKE(4,"撤销发布"),
+	OTHER(5, "其他");
+
+	private ProjectAuditStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, ProjectAuditStatus> status = new HashMap<Integer, ProjectAuditStatus>();
+
+	static {
+		for (ProjectAuditStatus value : ProjectAuditStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static ProjectAuditStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static ProjectAuditStatus 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;
+	}
+}

+ 160 - 72
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="name" jdbcType="VARCHAR" property="name" />
@@ -24,12 +24,17 @@
     <result column="max_img_url" jdbcType="VARCHAR" property="maxImgUrl" />
     <result column="value" jdbcType="VARCHAR" property="value" />
     <result column="apply_conditions" jdbcType="VARCHAR" property="applyConditions" />
+    <result column="owner_id" jdbcType="VARCHAR" property="ownerId" />
+    <result column="is_hot" jdbcType="INTEGER" property="isHot" />
+    <result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
+    <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
+    <result column="release_date" jdbcType="TIMESTAMP" property="releaseDate" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -63,7 +68,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -97,32 +102,17 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
-    id, name, category_id as categoryId, number, price, activity_price as activityPrice, member_price as memberPrice, offset, activity_flag as activityFlag, 
-    introduce, province, city, create_time as createTime, min_img_url as minImgUrl, max_img_url as maxImgUrl, value, apply_conditions as applyConditions,owner_id as ownerId
-  </sql>
-  
-    <sql id="My_Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
-    -->
-    jtbp.id,  jtbp.name, jtbp.category_id as categoryId,  jtbp.number,  jtbp.price,  jtbp.activity_price as activityPrice,  jtbp.member_price as memberPrice,  jtbp.offset, 
-     jtbp.activity_flag as activityFlag, 
-     jtbp.introduce, 
-      jtbp.province, 
-       jtbp.city,  jtbp.create_time as createTime,
-         jtbp.min_img_url as minImgUrl,
-           jtbp.max_img_url as maxImgUrl, 
-            jtbp.value,  jtbp.apply_conditions as applyConditions
+    id, name, category_id, number, price, activity_price, member_price, offset, activity_flag, 
+    introduce, province, city, create_time, min_img_url, max_img_url, value, apply_conditions, 
+    owner_id, is_hot, audit_status, audit_info, release_date
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     select
     <if test="distinct">
@@ -141,7 +131,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -152,7 +142,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     delete from jt_business_project
     where id = #{id,jdbcType=VARCHAR}
@@ -161,7 +151,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     delete from jt_business_project
     <if test="_parameter != null">
@@ -172,26 +162,30 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     insert into jt_business_project (id, name, category_id, 
       number, price, activity_price, 
       member_price, offset, activity_flag, 
       introduce, province, city, 
       create_time, min_img_url, max_img_url, 
-      value, apply_conditions)
+      value, apply_conditions, owner_id, 
+      is_hot, audit_status, audit_info, 
+      release_date)
     values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR}, 
       #{number,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{activityPrice,jdbcType=DECIMAL}, 
       #{memberPrice,jdbcType=DECIMAL}, #{offset,jdbcType=REAL}, #{activityFlag,jdbcType=INTEGER}, 
       #{introduce,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{minImgUrl,jdbcType=VARCHAR}, #{maxImgUrl,jdbcType=VARCHAR}, 
-      #{value,jdbcType=VARCHAR}, #{applyConditions,jdbcType=VARCHAR})
+      #{value,jdbcType=VARCHAR}, #{applyConditions,jdbcType=VARCHAR}, #{ownerId,jdbcType=VARCHAR}, 
+      #{isHot,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{auditInfo,jdbcType=VARCHAR}, 
+      #{releaseDate,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.JtBusinessProject">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     insert into jt_business_project
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -246,8 +240,20 @@
       <if test="applyConditions != null">
         apply_conditions,
       </if>
-      <if test="ownerId!=null">
-      owner_id,
+      <if test="ownerId != null">
+        owner_id,
+      </if>
+      <if test="isHot != null">
+        is_hot,
+      </if>
+      <if test="auditStatus != null">
+        audit_status,
+      </if>
+      <if test="auditInfo != null">
+        audit_info,
+      </if>
+      <if test="releaseDate != null">
+        release_date,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -302,8 +308,20 @@
       <if test="applyConditions != null">
         #{applyConditions,jdbcType=VARCHAR},
       </if>
-      <if test="ownerId!=null">
-      #{ownerId,jdbcType=VARCHAR}
+      <if test="ownerId != null">
+        #{ownerId,jdbcType=VARCHAR},
+      </if>
+      <if test="isHot != null">
+        #{isHot,jdbcType=INTEGER},
+      </if>
+      <if test="auditStatus != null">
+        #{auditStatus,jdbcType=INTEGER},
+      </if>
+      <if test="auditInfo != null">
+        #{auditInfo,jdbcType=VARCHAR},
+      </if>
+      <if test="releaseDate != null">
+        #{releaseDate,jdbcType=TIMESTAMP},
       </if>
     </trim>
   </insert>
@@ -311,7 +329,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     select count(*) from jt_business_project
     <if test="_parameter != null">
@@ -322,7 +340,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     update jt_business_project
     <set>
@@ -377,6 +395,21 @@
       <if test="record.applyConditions != null">
         apply_conditions = #{record.applyConditions,jdbcType=VARCHAR},
       </if>
+      <if test="record.ownerId != null">
+        owner_id = #{record.ownerId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isHot != null">
+        is_hot = #{record.isHot,jdbcType=INTEGER},
+      </if>
+      <if test="record.auditStatus != null">
+        audit_status = #{record.auditStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.auditInfo != null">
+        audit_info = #{record.auditInfo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.releaseDate != null">
+        release_date = #{record.releaseDate,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -386,7 +419,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     update jt_business_project
     set id = #{record.id,jdbcType=VARCHAR},
@@ -405,7 +438,12 @@
       min_img_url = #{record.minImgUrl,jdbcType=VARCHAR},
       max_img_url = #{record.maxImgUrl,jdbcType=VARCHAR},
       value = #{record.value,jdbcType=VARCHAR},
-      apply_conditions = #{record.applyConditions,jdbcType=VARCHAR}
+      apply_conditions = #{record.applyConditions,jdbcType=VARCHAR},
+      owner_id = #{record.ownerId,jdbcType=VARCHAR},
+      is_hot = #{record.isHot,jdbcType=INTEGER},
+      audit_status = #{record.auditStatus,jdbcType=INTEGER},
+      audit_info = #{record.auditInfo,jdbcType=VARCHAR},
+      release_date = #{record.releaseDate,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -414,7 +452,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     update jt_business_project
     <set>
@@ -466,6 +504,21 @@
       <if test="applyConditions != null">
         apply_conditions = #{applyConditions,jdbcType=VARCHAR},
       </if>
+      <if test="ownerId != null">
+        owner_id = #{ownerId,jdbcType=VARCHAR},
+      </if>
+      <if test="isHot != null">
+        is_hot = #{isHot,jdbcType=INTEGER},
+      </if>
+      <if test="auditStatus != null">
+        audit_status = #{auditStatus,jdbcType=INTEGER},
+      </if>
+      <if test="auditInfo != null">
+        audit_info = #{auditInfo,jdbcType=VARCHAR},
+      </if>
+      <if test="releaseDate != null">
+        release_date = #{releaseDate,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -473,7 +526,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 20 11:08:54 CST 2018.
+      This element was generated on Fri Jul 06 18:31:16 CST 2018.
     -->
     update jt_business_project
     set name = #{name,jdbcType=VARCHAR},
@@ -491,26 +544,52 @@
       min_img_url = #{minImgUrl,jdbcType=VARCHAR},
       max_img_url = #{maxImgUrl,jdbcType=VARCHAR},
       value = #{value,jdbcType=VARCHAR},
-      apply_conditions = #{applyConditions,jdbcType=VARCHAR}
+      apply_conditions = #{applyConditions,jdbcType=VARCHAR},
+      owner_id = #{ownerId,jdbcType=VARCHAR},
+      is_hot = #{isHot,jdbcType=INTEGER},
+      audit_status = #{auditStatus,jdbcType=INTEGER},
+      audit_info = #{auditInfo,jdbcType=VARCHAR},
+      release_date = #{releaseDate,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   
    <select id="getBusinessProjectByCategoryId" resultType="com.goafanti.common.model.JtBusinessProject">
-  select 
-  	id,
-  	name,
-  	introduce,
-  	min_img_url as minImgUrl
-  	from jt_business_project
-  	where 
-  	category_id=#{0}
-  	 order by create_time
-  	limit #{1}
+	  select 
+	  	id,
+	  	name,
+	  	introduce
+	  	from 
+	  	jt_business_project,
+	  	min_img_url as minImgUrl
+	  	where category_id= #{id,jdbcType=VARCHAR} and audit_status=2
+	  	<if test="isHot != null">
+	  		and is_hot = #{isHot,jdbcType=INTEGER}
+	  	</if>
+	  	order by release_date
+	  	limit #{size,jdbcType=INTEGER}
   </select>
   
   <select id="findJtBusinessProjectByPage" resultType="com.goafanti.common.model.JtBusinessProject">
   select 
-  <include refid="My_Base_Column_List" />
+	  jtbp.id,  
+	  jtbp.name, 
+	  jtbp.category_id as categoryId,  
+	  jtbp.number,  
+	  jtbp.price,  
+	  jtbp.activity_price as activityPrice,  
+	  jtbp.member_price as memberPrice,  
+	  jtbp.offset, 
+	  jtbp.activity_flag as activityFlag, 
+	  jtbp.introduce,  
+	  jtbp.province, jtbp.city,  
+	  jtbp.create_time as createTime,
+	  jtbp.min_img_url as minImgUrl,
+	  jtbp.max_img_url as maxImgUrl, 
+	  jtbp.value,  
+	  jtbp.apply_conditions as applyConditions,
+	  jtbp.is_hot as isHot,
+	  jtbp.audit_status as auditStatus,
+	  jtbp.release_Date as releaseDate
   from jt_business_project jtbp
   <if test="topId!=null">
   left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
@@ -528,35 +607,44 @@
   <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>
   </select>
-    <select id="findJtBusinessCountByPage" resultType="java.lang.Integer">
-  select 
- count(0)
- from jt_business_project jtbp
-  <if test="topId!=null">
-  left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
-  </if>
-  where 1=1
-  <if test="secondId!=null">
-  and jtbp.category_id=#{secondId,jdbcType=VARCHAR}
-  </if>
-  <if test="name!=null">
-  and jtbp.name like concat("%",#{name,jdbcType=VARCHAR},"%")
-  </if>
-  <if test="topId!=null">
- and jtbc.id=jtbp.category_id
-  </if>
-    <if test="ownerId!=null">
-  and jtbp.owner_id=#{ownerId,jdbcType=VARCHAR}
+  <select id="findJtBusinessCountByPage" resultType="java.lang.Integer">
+	 select 
+	 count(0)
+	 from jt_business_project jtbp
+	  <if test="topId!=null">
+	  left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
+	  </if>
+	  where 1=1
+	  <if test="secondId!=null">
+	  and jtbp.category_id=#{secondId,jdbcType=VARCHAR}
+	  </if>
+	  <if test="name!=null">
+	  and jtbp.name like concat("%",#{name,jdbcType=VARCHAR},"%")
+	  </if>
+	  <if test="topId!=null">
+	 and jtbc.id=jtbp.category_id
+	  </if>
+	    <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>

File diff suppressed because it is too large
+ 499 - 563
src/main/java/com/goafanti/common/model/JtBusinessProject.java


File diff suppressed because it is too large
+ 1672 - 1393
src/main/java/com/goafanti/common/model/JtBusinessProjectExample.java