Browse Source

限定项目本地开发

anderx 1 year ago
parent
commit
68bd67ac44

+ 9 - 10
src/main/java/com/goafanti/business/controller/AdminBusinessProjectController.java

@@ -1,13 +1,5 @@
 package com.goafanti.business.controller;
 
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.goafanti.business.service.BusinessProjectService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
@@ -17,6 +9,12 @@ import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.BusinessProjectModel;
 import com.goafanti.common.utils.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 
 @RestController
 @RequestMapping("/api/admin/ProjectSize")
@@ -62,7 +60,8 @@ public class AdminBusinessProjectController extends CertifyApiController{
 	 */
 	@RequestMapping(value = "/listProject" , method = RequestMethod.POST)
 	public Result listProject(String bname,String cid,String country,String province,String city,
-			String district,String activityFlag,String status,Integer type,Integer pageNo, Integer pageSize ){
+			String district,String activityFlag,String status,Integer type,Integer restrictStatus,
+							  Integer pageNo, Integer pageSize ){
 		Result res=new Result();
 		if (country==AFTConstants.USER_TYPE_PERSONAL) {
 			if (StringUtils.isBlank(province)) {
@@ -70,7 +69,7 @@ public class AdminBusinessProjectController extends CertifyApiController{
 				return res;
 			}
 		}
-		 res.setData(businessprojectService.listProject( bname, cid, country,province, city, district ,activityFlag, status, type,pageNo,pageSize ));
+		 res.setData(businessprojectService.listProject( bname, cid, country,province, city, district ,activityFlag, status, type,restrictStatus,pageNo,pageSize ));
 		return res;
 	}
 	/**

+ 5 - 5
src/main/java/com/goafanti/business/service/BusinessProjectService.java

@@ -1,23 +1,23 @@
 package com.goafanti.business.service;
 
 
-import java.util.List;
-import java.util.Map;
-
 import com.goafanti.app.bo.ProjectBo;
 import com.goafanti.app.bo.ProjectDetailBo;
 import com.goafanti.business.bo.BusinessProjectBo;
 import com.goafanti.business.bo.ProjectSizeBo;
-import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.BusinessCategory;
+import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.BusinessProjectModel;
 import com.goafanti.core.mybatis.page.Pagination;
 
+import java.util.List;
+import java.util.Map;
+
 public interface BusinessProjectService {
 	int insert(String bname,String cid,String country,String province,String city,String district,String boutique);
 
 	Pagination<BusinessProjectBo> listProject(String bname,String cid,String country,String province,String city,String district,String activityFlag,
-										String status,Integer type, Integer pageNo, Integer pageSize );
+										String status,Integer type,Integer restrictStatus, Integer pageNo, Integer pageSize );
 	int getBnamecount(String bname);
 
 	int deleteProject(String id);

+ 17 - 19
src/main/java/com/goafanti/business/service/impl/BusinessProjectServiceImpl.java

@@ -1,34 +1,28 @@
 package com.goafanti.business.service.impl;
 
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import com.goafanti.order.enums.ProjectType;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import com.goafanti.app.bo.ProjectBo;
 import com.goafanti.app.bo.ProjectDetailBo;
 import com.goafanti.business.bo.BusinessProjectBo;
 import com.goafanti.business.bo.ProjectSizeBo;
 import com.goafanti.business.service.BusinessProjectService;
-import com.goafanti.common.dao.BusinessProjectMapper;
 import com.goafanti.common.dao.BusinessCategoryMapper;
-import com.goafanti.common.dao.ProjectInterestMapper;
+import com.goafanti.common.dao.BusinessProjectMapper;
 import com.goafanti.common.dao.BusinessProjectModelMapper;
-import com.goafanti.common.model.BusinessProject;
+import com.goafanti.common.dao.ProjectInterestMapper;
 import com.goafanti.common.model.BusinessCategory;
+import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.BusinessProjectModel;
 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.ProjectType;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.*;
 
 @Service
 public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMapper> implements BusinessProjectService {
@@ -68,16 +62,16 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<BusinessProjectBo> listProject(String bname, String cid, String country,String province,String city,String district, String activityFlag,
-			String status,Integer type, Integer pNo, Integer pSize) {
+			String status,Integer type,Integer restrictStatus, Integer pNo, Integer pSize) {
 		if (pNo == null || pNo < 0)pNo = 1;
 		if (pSize == null || pSize < 0 )pSize = 10;
 		Pagination<BusinessProjectBo> pt=(Pagination<BusinessProjectBo>)findPage("findProjectListByPage", "findProjectListCount",
 				disposeParams(bname,  cid,  country, province, city, district,  activityFlag,
-						 status,type),pNo,pSize);
+						 status,type,restrictStatus),pNo,pSize);
 		return pt;
 	}
 	private Map<String, Object> disposeParams(String bname, String cid, String country,String province,String city,String district, String activityFlag,
-			String status,Integer type) {
+			String status,Integer type,Integer restrictStatus) {
 		Map<String, Object> params = new HashMap<>();
 		if (StringUtils.isNotBlank(bname)) {
 			params.put("bname", bname);
@@ -106,6 +100,9 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
 		if (type!=null ) {
 			params.put("type", type);
 		}
+		if (restrictStatus!=null ) {
+			params.put("restrictStatus", restrictStatus);
+		}
 		return params;
 	}
 	@Override
@@ -255,6 +252,7 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
 		bp.setFirstPayment(s.getFirstPayment());
 		bp.setType(s.getType());
 		bp.setPatentTransfer(s.getPatentTransfer());
+		bp.setRestrictStatus(s.getRestrictStatus());
 		if (null!=(s.getStatus())) {
 			bp.setStatus(s.getStatus());
 		}

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

@@ -306,6 +306,9 @@
         <if test="type != null">
             and b.type = #{type,jdbcType=VARCHAR}
         </if>
+        <if test="restrictStatus != null">
+            and b.restrict_status = #{restrictStatus,jdbcType=INTEGER}
+        </if>
         <if test="page_sql!=null">
             ${page_sql}
         </if>
@@ -317,7 +320,7 @@
         left join business_category b2 on b.cid = b2.id
         where b.delete_sign=0
         <if test="bname != null">
-            and b.bname = #{bname,jdbcType=VARCHAR}
+            and b.bname like concat('%',#{bname},'%')
         </if>
         <if test="cid != null">
             and b.cid = #{cid,jdbcType=VARCHAR}
@@ -343,6 +346,9 @@
         <if test="type != null">
             and b.type = #{type,jdbcType=VARCHAR}
         </if>
+        <if test="restrictStatus != null">
+            and b.restrict_status = #{restrictStatus,jdbcType=INTEGER}
+        </if>
     </select>
 
     <select id="getBnamecount" resultType="Integer">