Browse Source

Merge remote-tracking branch 'origin/master' into test

Conflicts:
	src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
anderx 8 years ago
parent
commit
60e0364f34

+ 546 - 0
src/main/java/com/goafanti/admin/bo/BusinessProjectBo.java

@@ -0,0 +1,546 @@
+package com.goafanti.admin.bo;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
+public class BusinessProjectBo {
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.create_id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String createId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.create_time
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.update_time
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private Date updateTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.delete_sign
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private Integer deleteSign;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.bname
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String bname;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.cid
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String cid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private BigDecimal price;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.offset
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private BigDecimal offset;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.activity_price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private BigDecimal activityPrice;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.activity_flag
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String activityFlag;
+	
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.member_price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private BigDecimal memberPrice;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.introduce
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String introduce;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.status
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String status;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.country
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String country;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.province
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String province;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.city
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String city;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.district
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String district;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.principal_id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String principalId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.Value_effect
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String valueEffect;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column business_project.client_size
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	private String clientSize;
+	
+	/**
+	 * 分类名称
+	 */
+	private String cname;
+	/**
+	 * 创建人名称
+	 */
+	private String createName;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.id
+	 * @return  the value of business_project.id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.id
+	 * @param id  the value for business_project.id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.create_id
+	 * @return  the value of business_project.create_id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getCreateId() {
+		return createId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.create_id
+	 * @param createId  the value for business_project.create_id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setCreateId(String createId) {
+		this.createId = createId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.create_time
+	 * @return  the value of business_project.create_time
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.create_time
+	 * @param createTime  the value for business_project.create_time
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.update_time
+	 * @return  the value of business_project.update_time
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+	public String getUpdateTimeFormattedDate() {
+		if (this.updateTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getUpdateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.update_time
+	 * @param updateTime  the value for business_project.update_time
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.delete_sign
+	 * @return  the value of business_project.delete_sign
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public Integer getDeleteSign() {
+		return deleteSign;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.delete_sign
+	 * @param deleteSign  the value for business_project.delete_sign
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setDeleteSign(Integer deleteSign) {
+		this.deleteSign = deleteSign;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.bname
+	 * @return  the value of business_project.bname
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getBname() {
+		return bname;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.bname
+	 * @param bname  the value for business_project.bname
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setBname(String bname) {
+		this.bname = bname;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.cid
+	 * @return  the value of business_project.cid
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getCid() {
+		return cid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.cid
+	 * @param cid  the value for business_project.cid
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setCid(String cid) {
+		this.cid = cid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.price
+	 * @return  the value of business_project.price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public BigDecimal getPrice() {
+		return price;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.price
+	 * @param price  the value for business_project.price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setPrice(BigDecimal price) {
+		this.price = price;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.offset
+	 * @return  the value of business_project.offset
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public BigDecimal getOffset() {
+		return offset;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.offset
+	 * @param offset  the value for business_project.offset
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setOffset(BigDecimal offset) {
+		this.offset = offset;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.activity_price
+	 * @return  the value of business_project.activity_price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public BigDecimal getActivityPrice() {
+		return activityPrice;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.activity_price
+	 * @param activityPrice  the value for business_project.activity_price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setActivityPrice(BigDecimal activityPrice) {
+		this.activityPrice = activityPrice;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.activity_flag
+	 * @return  the value of business_project.activity_flag
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getActivityFlag() {
+		return activityFlag;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.activity_flag
+	 * @param activityFlag  the value for business_project.activity_flag
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setActivityFlag(String activityFlag) {
+		this.activityFlag = activityFlag;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.member_price
+	 * @return  the value of business_project.member_price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public BigDecimal getMemberPrice() {
+		return memberPrice;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.member_price
+	 * @param memberPrice  the value for business_project.member_price
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setMemberPrice(BigDecimal memberPrice) {
+		this.memberPrice = memberPrice;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.introduce
+	 * @return  the value of business_project.introduce
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getIntroduce() {
+		return introduce;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.introduce
+	 * @param introduce  the value for business_project.introduce
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setIntroduce(String introduce) {
+		this.introduce = introduce;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.status
+	 * @return  the value of business_project.status
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getStatus() {
+		return status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.status
+	 * @param status  the value for business_project.status
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.country
+	 * @return  the value of business_project.country
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getCountry() {
+		return country;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.country
+	 * @param country  the value for business_project.country
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setCountry(String country) {
+		this.country = country;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.province
+	 * @return  the value of business_project.province
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getProvince() {
+		return province;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.province
+	 * @param province  the value for business_project.province
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setProvince(String province) {
+		this.province = province;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.city
+	 * @return  the value of business_project.city
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getCity() {
+		return city;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.city
+	 * @param city  the value for business_project.city
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.district
+	 * @return  the value of business_project.district
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getDistrict() {
+		return district;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.district
+	 * @param district  the value for business_project.district
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setDistrict(String district) {
+		this.district = district;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.principal_id
+	 * @return  the value of business_project.principal_id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getPrincipalId() {
+		return principalId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.principal_id
+	 * @param principalId  the value for business_project.principal_id
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setPrincipalId(String principalId) {
+		this.principalId = principalId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.Value_effect
+	 * @return  the value of business_project.Value_effect
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getValueEffect() {
+		return valueEffect;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.Value_effect
+	 * @param valueEffect  the value for business_project.Value_effect
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setValueEffect(String valueEffect) {
+		this.valueEffect = valueEffect;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.client_size
+	 * @return  the value of business_project.client_size
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public String getClientSize() {
+		return clientSize;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.client_size
+	 * @param clientSize  the value for business_project.client_size
+	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
+	 */
+	public void setClientSize(String clientSize) {
+		this.clientSize = clientSize;
+	}
+
+	public String getCname() {
+		return cname;
+	}
+
+	public void setCname(String cname) {
+		this.cname = cname;
+	}
+
+	public String getCreateName() {
+		return createName;
+	}
+
+	public void setCreateName(String createName) {
+		this.createName = createName;
+	}
+
+	@Override
+	public String toString() {
+		return "BusinessProjectBo [id=" + id + ", createId=" + createId + ", createTime=" + createTime + ", updateTime="
+				+ updateTime + ", deleteSign=" + deleteSign + ", bname=" + bname + ", cid=" + cid + ", price=" + price
+				+ ", offset=" + offset + ", activityPrice=" + activityPrice + ", activityFlag=" + activityFlag
+				+ ", memberPrice=" + memberPrice + ", introduce=" + introduce + ", status=" + status + ", country="
+				+ country + ", province=" + province + ", city=" + city + ", district=" + district + ", principalId="
+				+ principalId + ", valueEffect=" + valueEffect + ", clientSize=" + clientSize + ", cname=" + cname
+				+ ", createName=" + createName + "]";
+	}
+	
+}

+ 30 - 0
src/main/java/com/goafanti/admin/bo/ProjectSizeBo.java

@@ -3,6 +3,10 @@ package com.goafanti.admin.bo;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
 public class ProjectSizeBo {
 
 	    /**
@@ -112,6 +116,10 @@ public class ProjectSizeBo {
 	     * @mbg.generated Mon Dec 04 09:52:04 CST 2017
 	     */
 	    private Integer status;
+	    /**
+	     * 项目名称
+	     */
+	    private String bname;
 
 	    /**
 	     * This method was generated by MyBatis Generator.
@@ -172,6 +180,13 @@ public class ProjectSizeBo {
 	    public Date getCreateTime() {
 	        return createTime;
 	    }
+	    public String getCreateTimeFormattedDate() {
+			if (this.createTime == null) {
+				return null;
+			} else {
+				return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+			}
+		}
 
 	    /**
 	     * This method was generated by MyBatis Generator.
@@ -196,6 +211,13 @@ public class ProjectSizeBo {
 	    public Date getUpdateTime() {
 	        return updateTime;
 	    }
+	    public String getUpdateTimeFormattedDate() {
+			if (this.updateTime == null) {
+				return null;
+			} else {
+				return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+			}
+		}
 
 	    /**
 	     * This method was generated by MyBatis Generator.
@@ -400,5 +422,13 @@ public class ProjectSizeBo {
 	    public void setStatus(Integer status) {
 	        this.status = status;
 	    }
+
+		public String getBname() {
+			return bname;
+		}
+
+		public void setBname(String bname) {
+			this.bname = bname;
+		}
 	}
 

+ 4 - 0
src/main/java/com/goafanti/admin/controller/AdminVarietiesApiController.java

@@ -40,6 +40,10 @@ public class AdminVarietiesApiController extends BaseController{
 			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "品类名称已存在", "品类名称"));
 			return res;
 		}
+		if (2<adminVarietiesService.getLayer(superId)) {
+			res.getError().add(buildError( "品类层级不能大于3", "品类层级不能大于3")); 
+			return res;
+		}
 		
 		res.setData(adminVarietiesService.insert(cname,superId));
 		

+ 190 - 2
src/main/java/com/goafanti/admin/controller/BusinessProjectController.java

@@ -1,22 +1,35 @@
 package com.goafanti.admin.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.admin.service.BusinessProjectService;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseController;
+
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.model.BusinessProject;
+import com.goafanti.common.model.ProjectSize;
 import com.goafanti.common.utils.StringUtils;
 
 @RestController
 @RequestMapping("open/api/admin/ProjectSize")
-public class BusinessProjectController extends BaseController{
+public class BusinessProjectController extends CertifyApiController{
 	
+	@Resource
 	BusinessProjectService businessprojectService;
 	
+	
+	
 	/**
 	 * 新增项目
 	 */
@@ -27,12 +40,187 @@ public class BusinessProjectController extends BaseController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "项目名称名称为空", "项目名称"));
 			return res;
 		}
+		
 		if (StringUtils.isBlank(cid)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "所属品类为空", "所属品类"));
 			return res;
 		}
+		if (businessprojectService.getBnamecount(bname)>0) {
+			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "项目名称已存在", "项目名称"));
+			return res;
+		}
+		if(Integer.valueOf(country)==0){
+			if (StringUtils.isBlank(province)) {
+				res.getError().add(buildError( "至少指定省", "至少指定省"));
+				return res;
+			}
+		}
 		res.setData(businessprojectService.insert(bname, cid, country,province,city,district));
+		return res; 
+	}
+	
+	/**
+	 * 项目搜索
+	 */
+	@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 pageNo, Integer pageSize ){
+		Result res=new Result();
+		if (country==AFTConstants.USER_TYPE_PERSONAL) {
+			if (StringUtils.isBlank(province)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "所属省份为空", "所属省份"));
+				return res;
+			}
+		}
+		
+		 res.setData(businessprojectService.listProject( bname, cid, country,province, city, district ,activityFlag, status, pageNo,pageSize ));
 		return res;
 	}
+	/**
+	 * 图片上传
+	 */
+	@RequestMapping(value = "/uploadPicture", method = RequestMethod.POST)
+	public Result uploadPicture(HttpServletRequest req, String sign) {
+		Result res = new Result();
+		AttachmentType attachmentType = AttachmentType.getField(sign);
 
+		if (attachmentType == AttachmentType.BUSINESS_PROJECT_MAX_PICTURE
+				|| attachmentType == AttachmentType.BUSINESS_PROJECT_MIN_PICTURE
+				) {
+			res.setData(handleFiles(res, "/Project/", false, req, sign, "project"));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件"));
+		}
+		return res;
+	}
+	/**
+	 * 获取项目详情
+	 */
+	@RequestMapping(value = "/orgProject", method = RequestMethod.GET)
+	public Result orgProject(String id){
+		Result res=new Result();
+		res.setData(businessprojectService.orgProject(id));
+		return res;
+	}
+	/**
+	 * 删除项目
+	 */
+	@RequestMapping(value = "/deleteProject", method = RequestMethod.GET)
+	public Result deleteProject(String id){
+		Result res=new Result();
+		res.setData(businessprojectService.deleteProject(id));
+		return res;
+	}
+	
+	/**
+	 * 停用项目
+	 */
+	@RequestMapping(value = "/stopProject", method = RequestMethod.GET)
+	public Result stopProject(String id){
+		Result res=new Result();
+		res.setData(businessprojectService.updateStopProject(id));
+		return res;
+	}
+	/**
+	 * 获取业务品类全路径()
+	 */
+	@RequestMapping(value = "/getAllCname", method = RequestMethod.GET)
+	public Result getAllCname(Integer flag){
+		Result res=new Result();
+		res.setData(businessprojectService.getAllCnames(flag));
+		return res;
+	}
+	
+	/**
+	 * 编辑基本保存
+	 */
+	@RequestMapping(value = "/updateProject", method = RequestMethod.POST)
+	public Result updateProject(BusinessProject s){
+		Result res=new Result();
+		if (StringUtils.isBlank(s.getBname())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "项目名称名称为空", "项目名称"));
+			return res;
+		}
+		
+		if (StringUtils.isBlank(s.getCid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "所属品类为空", "所属品类"));
+			return res;
+		}
+		if (businessprojectService.getBnamecount(s.getBname())>1) {
+			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "项目名称已存在", "项目名称"));
+			return res;
+		}
+		if(Integer.valueOf(s.getCountry())==0){
+			if (StringUtils.isBlank(s.getProvince())) {
+				res.getError().add(buildError( "至少指定省", "至少指定省"));
+				return res;
+			}
+		}
+		res.setData(businessprojectService.updateProject(s));
+		return res;
+	}
+	/**
+	 * 新建规格
+	 */
+	@RequestMapping(value = "/addProjectSize", method = RequestMethod.POST)
+	public Result addProjectSize(ProjectSize ps){
+		Result res=new Result();
+		if (businessprojectService.WhetherRepeat(ps)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "规格名称已存在", "规格名称"));
+				return res;
+			}
+		
+		res.setData(businessprojectService.addProjectSize(ps));
+		return res;
+	}
+	
+	/**
+	 * 编辑保存规格
+	 */
+	@RequestMapping(value = "/orgProjectSize", method = RequestMethod.POST)
+	public Result orgProjectSize(ProjectSize ps){
+		Result res=new Result();
+		res.setData(businessprojectService.updateOrgProjectSize(ps));
+		return res;
+	}
+	/**
+	 * 规格列表
+	 */
+	@RequestMapping(value = "/listProjectSize", method = RequestMethod.GET)
+	public Result listProjectSize(String pid,Integer pNo,Integer Psize){
+		Result res=new Result();
+		if (StringUtils.isBlank(pid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "项目名称名称为空", "项目"));
+			return res;
+		}
+		res.setData(businessprojectService.listProjectSize(pid,pNo, Psize));
+		return res;
+	}
+	
+	/**
+	 * 获取规格详情
+	 */
+	@RequestMapping(value = "/getProjectSize", method = RequestMethod.GET)
+	public Result getProjectSize(String  id){
+		Result res=new Result();
+		res.setData(businessprojectService.getProjectSize(id));
+		return res;
+	}
+	/**
+	 * 删除规格
+	 */
+	@RequestMapping(value = "/deleteProjectSize", method = RequestMethod.GET)
+	public Result deleteProjectSize(String  id){
+		Result res=new Result();
+		res.setData(businessprojectService.deleteProjectSize(id));
+		return res;
+	}
+	/**
+	 * 停用规格
+	 */
+	@RequestMapping(value = "/stopProjectSize", method = RequestMethod.GET)
+	public Result stopProjectSize(String  id){
+		Result res=new Result();
+		res.setData(businessprojectService.updateSotpProjectSize(id));
+		return res;
+	}
 }

+ 1 - 0
src/main/java/com/goafanti/admin/service/AdminVarietiesService.java

@@ -26,4 +26,5 @@ public interface AdminVarietiesService {
 	int isBeing(String cname);
 	
 	int getCountSon(String id);
+	int getLayer(String superId);
 }

+ 42 - 0
src/main/java/com/goafanti/admin/service/BusinessProjectService.java

@@ -1,5 +1,47 @@
 package com.goafanti.admin.service;
 
+
+
+import java.util.List;
+import java.util.Map;
+
+import com.goafanti.admin.bo.BusinessProjectBo;
+import com.goafanti.admin.bo.ProjectSizeBo;
+import com.goafanti.common.model.BusinessProject;
+import com.goafanti.common.model.ProjectSize;
+import com.goafanti.core.mybatis.page.Pagination;
+
 public interface BusinessProjectService {
 	int insert(String bname,String cid,String country,String province,String city,String district);
+	
+	Pagination<BusinessProjectBo> listProject(String bname,String cid,String country,String province,String city,String district,String activityFlag,
+										String status,Integer pageNo, Integer pageSize );
+	int getBnamecount(String bname);
+	
+	int deleteProject(String id);
+	
+	int updateStopProject(String id);
+	
+	
+	BusinessProjectBo orgProject(String id);
+	
+	List<Map<String, String>> getAllCnames(Integer flag);
+	
+	
+	int updateProject(BusinessProject s);
+	
+	int addProjectSize(ProjectSize ps);
+	
+	int updateOrgProjectSize(ProjectSize ps);
+	
+	Pagination<ProjectSizeBo> listProjectSize(String pid,Integer pNo,Integer pSize);
+
+	ProjectSizeBo getProjectSize(String id);
+
+	int  deleteProjectSize(String id);
+
+	int updateSotpProjectSize(String id);
+
+	boolean WhetherRepeat(ProjectSize ps);
+	
 }

+ 8 - 4
src/main/java/com/goafanti/admin/service/impl/AdminVarietiesServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
 
 import com.goafanti.admin.bo.BusinessVarietiesBo;
 import com.goafanti.admin.service.AdminVarietiesService;
-import com.goafanti.common.dao.AdminVarietiesMapper;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.dao.BusinessVarietiesMapper;
 import com.goafanti.common.model.BusinessVarieties;
 import com.goafanti.common.utils.StringUtils;
@@ -65,7 +65,8 @@ public class AdminVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesM
 		}
 		System.out.println("cid:"+buv.getCid());
 		buv.setLayer(buv.getCid().length()/2-1);
-		buv.setCreateId("f31c0d1a-05bc-4f5c-b4a8-95f983d24131");//测试
+		
+		//buv.setCreateId("f31c0d1a-05bc-4f5c-b4a8-95f983d24131");
 		if (StringUtils.isNotBlank(TokenManager.getAdminId())) {
 			buv.setCreateId(TokenManager.getAdminId());
 		}
@@ -88,8 +89,7 @@ public class AdminVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesM
 			pSize = 10;
 		} 
 		
-		Pagination<?> a = findPage("findVarietiesListByPage", "findVarietiesListCount",
-				disposeParams(cname,superId,layer,status),pNo,pSize);
+		
 		return (Pagination<BusinessVarieties>)findPage("findVarietiesListByPage", "findVarietiesListCount",
 				disposeParams(cname,superId,layer,status),pNo,pSize);
 	}
@@ -222,6 +222,10 @@ public class AdminVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesM
 		
 		return Integer.valueOf(businessVarietiesMapper.getCount(id));
 	}
+	@Override
+	public int getLayer(String superId) {
+		return businessVarietiesMapper.getLayer(superId);
+	}
 	
 	
 }

+ 321 - 4
src/main/java/com/goafanti/admin/service/impl/BusinessProjectServiceImpl.java

@@ -1,33 +1,350 @@
 package com.goafanti.admin.service.impl;
 
+
+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 org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.admin.bo.BusinessProjectBo;
+import com.goafanti.admin.bo.ProjectSizeBo;
 import com.goafanti.admin.service.BusinessProjectService;
 
 import com.goafanti.common.dao.BusinessProjectMapper;
+import com.goafanti.common.dao.BusinessVarietiesMapper;
+import com.goafanti.common.dao.ProjectSizeMapper;
 import com.goafanti.common.model.BusinessProject;
+import com.goafanti.common.model.BusinessVarieties;
+import com.goafanti.common.model.ProjectSize;
+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;
-
-public class BusinessProjectServiceImpl implements BusinessProjectService {
+@Service
+public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMapper> implements BusinessProjectService {
+	@Autowired
 	BusinessProjectMapper businessProjectMapper;
+	@Autowired
+	BusinessVarietiesMapper businessVarietiesMapper;
+	@Autowired
+	ProjectSizeMapper projectSizeMapper;
+	
 	@Override
 	public int insert(String bname, String cid, String country, String province, String city, String district) {
 		BusinessProject bp=new BusinessProject();
 		bp.setId(UUID.randomUUID().toString());
 		bp.setBname(bname);
+		bp.setCid(cid);
 		bp.setCountry(country);
 		if (1!=Integer.valueOf(country)) {
 			bp.setProvince(province);
 			bp.setCity(city);
 			bp.setDistrict(district);
 		}
-		bp.setCreateId(TokenManager.getAdminId());
+		bp.setDeleteSign(0);
+		//bp.setCreateId(TokenManager.getAdminId());
+		bp.setCreateId("f31c0d1a-05bc-4f5c-b4a8-95f983d24131");
 		bp.setCreateTime(new Date());
 		bp.setStatus("0");
 
 		return businessProjectMapper.insert(bp);
 	}
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<BusinessProjectBo> listProject(String bname, String cid, String country,String province,String city,String district, String activityFlag,
+			String status, Integer pNo, Integer pSize) {
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		} 	
+		Pagination<BusinessProjectBo> pt=(Pagination<BusinessProjectBo>)findPage("findProjectListByPage", "findProjectListCount",
+				disposeParams(bname,  cid,  country, province, city, district,  activityFlag,
+						 status),pNo,pSize);
+		List<BusinessProjectBo> list=(List<BusinessProjectBo>) pt.getList();
+		for (BusinessProjectBo o : list) {
+			o.setCname(getAllCname(o.getCid()));
+		}
+		return pt;
+	}
+	private Map<String, Object> disposeParams(String bname, String cid, String country,String province,String city,String district, String activityFlag,
+			String status) {
+		Map<String, Object> params = new HashMap<>();
+		if (StringUtils.isNotBlank(bname)) {
+			params.put("bname", bname);
+		}
+		if (StringUtils.isNotBlank(cid)) {
+			params.put("cid", cid);
+		}
+		if (StringUtils.isNotBlank(country)) {
+			params.put("country", country);
+		}
+		if (StringUtils.isNotBlank(province)) {
+			params.put("province", province);
+		}
+		if (StringUtils.isNotBlank(city)) {
+			params.put("city", city);
+		}
+		if (StringUtils.isNotBlank(district)) {
+			params.put("district", district);
+		}
+		if (StringUtils.isNotBlank(activityFlag)) {
+			params.put("activityFlag", activityFlag);
+		}
+		if (StringUtils.isNotBlank(status)) {
+			params.put("status", status);
+		}
+		return params;
+	}
+	@Override
+	public int getBnamecount(String bname) {
+		
+		return businessProjectMapper.getBnamecount(bname);
+	}
+	@Override
+	public int deleteProject(String id) {
+		BusinessProject bp=businessProjectMapper.selectByPrimaryKey(id);
+		if (bp.getDeleteSign()==0) {
+			bp.setDeleteSign(1);
+		}else {
+			bp.setDeleteSign(0);
+		}
+		
+		return businessProjectMapper.updateByPrimaryKey(bp);
+	}
+	@Override
+	public int updateStopProject(String id) {
+		BusinessProject bp=businessProjectMapper.selectByPrimaryKey(id);
+		if (Integer.valueOf(bp.getStatus())==0) {
+			bp.setStatus("1");
+		}else {
+			bp.setStatus("0");
+		}
+		
+		return businessProjectMapper.updateByPrimaryKey(bp);
+	}
+	@Override
+	public BusinessProjectBo orgProject(String id) {
+		BusinessProject bp=businessProjectMapper.selectByPrimaryKey(id);
+		
+		BusinessProjectBo bpo=new BusinessProjectBo();
+		BeanUtils.copyProperties(bp,bpo);
+		String cname=getAllCname(bpo.getCid());
+		String createId=bpo.getCreateId();
+		bpo.setCreateName(businessProjectMapper.getCreateName(createId));
+		bpo.setCname(cname);
+		return bpo;
+	}
+	@Override
+	public List<Map<String, String>> getAllCnames(Integer flag) {
+		List<Map<String, String>> list=new ArrayList<Map<String, String>>();
+		List<String> listcid=businessVarietiesMapper.getListId();
+		
+		for (String s : listcid) {
+			Map<String, String> map=new HashMap<>(); 
+			String cname=getAllCname(s);
+			map.put("id", s);
+			map.put("cname", cname);
+			if (flag==1) {
+				if (StringUtils.isBlank(cname)) {
+					map.put("cname", "平台超级业务品类");
+				}
+				list.add(map);
+			}else {
+				if (StringUtils.isNotBlank(cname)) {
+					list.add(map);
+				}
+			}
+			
+			
+			
+		}
+		return list;
+	}
+	/**
+	 * 递归获取上级来获取全路径
+	 * @param s	ID
+	 * @return  路径
+	 */
+	private String getAllCname(String s) {
+		String cid=businessVarietiesMapper.getThisCid(s);
+		String cname=businessVarietiesMapper.getThisCname(cid);
+		BusinessVarieties bv=businessVarietiesMapper.selectByPrimaryKey(s);
+		String sid=bv.getSuperId();
+		if (cid.length()>4) {
+			String w=getAllCname(sid)+"-"+cname;
+			 return w;
+		}else{
+			return cid.length()>3?cname:"";
+		}
+	}
+	
+	
+	
+	@Override
+	public int updateProject(BusinessProject s) {
+		BusinessProject bp=businessProjectMapper.selectByPrimaryKey(s.getId());
+		TheGinseng(s, bp);
+		return businessProjectMapper.updateByPrimaryKey(bp);
+	}
+	private void TheGinseng(BusinessProject s, BusinessProject bp) {
+		
+		if (StringUtils.isNotBlank(s.getBname())) {
+			bp.setBname(s.getBname());
+		}
+		if (StringUtils.isNotBlank(s.getCid())) {
+			bp.setCid(s.getCid());
+		}
+		if (StringUtils.isNotBlank(s.getCountry())) {
+			bp.setCountry(s.getCountry());
+		}
+		if (StringUtils.isNotBlank(s.getProvince())) {
+			bp.setProvince(s.getProvince());
+			bp.setCity(s.getCity());
+			bp.setDistrict(s.getDistrict());
+		}
+		if (StringUtils.isNotBlank(s.getCity())) {
+			bp.setCity(s.getCity());
+			bp.setDistrict(s.getDistrict());
+		}
+		if (StringUtils.isNotBlank(s.getDistrict())) {
+			bp.setDistrict(s.getDistrict());
+		}
+		if (null!=s.getPrice()) {
+			bp.setPrice(s.getPrice());
+		}
+		if (null!=(s.getOffset())) {
+			bp.setOffset(s.getOffset());
+		}
+		if (null!=(s.getActivityFlag())) {
+			bp.setActivityFlag(s.getActivityFlag());
+		}
+		if (null!=(s.getMemberPrice())) {
+			bp.setMemberPrice(s.getMemberPrice());
+		}
+		if (null!=(s.getActivityPrice())) {
+			bp.setActivityPrice(s.getActivityPrice());
+		}
+		if (StringUtils.isNotBlank(s.getIntroduce())) {
+			bp.setIntroduce(s.getIntroduce());
+		}
+		if (StringUtils.isNotBlank(s.getValueEffect())) {
+			bp.setValueEffect(s.getValueEffect());
+		}
+		if (StringUtils.isNotBlank(s.getClientSize())) {
+			bp.setClientSize(s.getClientSize());
+		}
+		if (StringUtils.isNotBlank(s.getMinLogo())) {
+			bp.setMinLogo(s.getMinLogo());
+		}
+		if (StringUtils.isNotBlank(s.getMaxLogo())) {
+			bp.setMaxLogo(s.getMaxLogo());
+		}
+		if (null!=(s.getStatus())) {
+			bp.setStatus(s.getStatus());
+		}
+		bp.setUpdateTime(new Date());
+	}
+	@Override
+	public int addProjectSize(ProjectSize ps) {
+		ps.setId(UUID.randomUUID().toString());
+		//bp.setCreateId(TokenManager.getAdminId());
+		ps.setCreateId("f31c0d1a-05bc-4f5c-b4a8-95f983d24131");
+		ps.setCreateTime(new Date());
+		ps.setStatus(0);
+		return projectSizeMapper.insert(ps);
+	}
+	@Override
+	public int updateOrgProjectSize(ProjectSize ps) {
+		ProjectSize psz=projectSizeMapper.selectByPrimaryKey(ps.getId());
+		projectSizeConfiguration(ps, psz);
+		System.out.println(psz);
+		return projectSizeMapper.updateByPrimaryKeySelective(psz);
+	}
+	private void projectSizeConfiguration(ProjectSize ps, ProjectSize psz) {
+		if (StringUtils.isNotBlank(ps.getPid())) {
+			psz.setId(ps.getPid());
+		}
+		if (StringUtils.isNotBlank(ps.getPname())) {
+			psz.setPname(ps.getPname());
+		}
+		if (null!=ps.getPrice()) {
+			psz.setPrice(ps.getPrice());
+		}
+		if (null!=(ps.getOffset())) {
+			psz.setOffset(ps.getOffset());
+		}
+		if (null!=(ps.getActivityFlag())) {
+			psz.setActivityFlag(ps.getActivityFlag());
+		}
+		if (null!=(ps.getMemberPrice())) {
+			psz.setMemberPrice(ps.getMemberPrice());
+		}
+		if (null!=(ps.getActivityPrice())) {
+			psz.setActivityPrice(ps.getActivityPrice());
+		}
+		if (null!=(ps.getStatus())) {
+			psz.setStatus(ps.getStatus());
+		}
+		psz.setUpdateTime(new Date());
+	}
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<ProjectSizeBo>  listProjectSize(String pid,Integer pNo,Integer pSize) {
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
 
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		} 
+		Map<String, Object>map=new HashMap<>();
+		map.put("pid", pid);
+			
+		
+		Pagination<ProjectSizeBo> pt=(Pagination<ProjectSizeBo>)findPage("findProjectSizeListByPage", "findProjectSizeListCount",
+				map,pNo,pSize);
+		return pt;
+	}
+	@Override
+	public ProjectSizeBo getProjectSize(String id) {
+		return projectSizeMapper.selectByBusinessId(id);
+	}
+	@Override
+	public int deleteProjectSize(String id) {
+		
+		return projectSizeMapper.deleteByPrimaryKey(id);
+	}
+	@Override
+	public int updateSotpProjectSize(String id) {
+		ProjectSize ps=projectSizeMapper.selectByPrimaryKey(id);
+			int i=ps.getStatus();
+			if (i==0) {
+				ps.setStatus(1);
+			}else {
+				ps.setStatus(0);
+			}
+		return projectSizeMapper.updateByPrimaryKey(ps);
+	}
+	@Override
+	public boolean WhetherRepeat(ProjectSize ps) {
+		List<ProjectSizeBo> list=projectSizeMapper.getgetPnamecount(ps.getPname());
+		if (null!=list&&list.isEmpty()) {
+		if (list.size()>1&&list.get(0).getPid().equals(ps.getPid())) {
+			System.out.println("true");
+			return true;
+		}
+		}
+		return false;
+	}
+	
+	
 }

+ 4 - 0
src/main/java/com/goafanti/common/dao/BusinessProjectMapper.java

@@ -73,4 +73,8 @@ public interface BusinessProjectMapper {
 	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
 	 */
 	int updateByPrimaryKey(BusinessProject record);
+	
+	int getBnamecount(String bname);
+	
+	String getCreateName(String id);
 }

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

@@ -105,6 +105,15 @@ public interface BusinessVarietiesMapper {
     
 	String ThanCid(String cid);
 	
-	int getcname(String cname);
+	int getcname(String cname);//获取有多少条
+	
 	List<BusinessVarietiesBo>  selectSuperid(String spuerId);
+	
+	String getThisCid(String id);
+	
+	String getThisCname(String cid);
+	
+	List<String> getListId();
+	
+	int getLayer(String superId);
 }

+ 6 - 0
src/main/java/com/goafanti/common/dao/ProjectSizeMapper.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.admin.bo.ProjectSizeBo;
 import com.goafanti.common.model.ProjectSize;
 import com.goafanti.common.model.ProjectSizeExample;
 import java.util.List;
@@ -72,4 +73,9 @@ public interface ProjectSizeMapper {
 	 * @mbg.generated  Mon Dec 04 15:29:25 CST 2017
 	 */
 	int updateByPrimaryKey(ProjectSize record);
+
+	List<ProjectSizeBo> selectByPrimaryBusinessId(String id);
+					
+	ProjectSizeBo selectByBusinessId(String id);
+	List<ProjectSizeBo> getgetPnamecount(String pname);
 }

+ 4 - 2
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -48,8 +48,10 @@ public enum AttachmentType {
 	LECTURE_PICTURE("lecture_picture", "科技讲堂展示图片"),
 	ACTIVITY_TITLE_PICTURE("activity_title_picture", "活动题图"),
 	ACTIVITY_CONTENT_PICTURE("activity_content_picture", "活动内容图片"),
-	CUSTOMER_SYS_FILE("customer_sys_file","客户系统文件");
-
+	CUSTOMER_SYS_FILE("customer_sys_file","客户系统文件"),
+	BUSINESS_PROJECT_MIN_PICTURE("business_project_min_picture","业务项目小图"),
+	BUSINESS_PROJECT_MAX_PICTURE("business_project_max_picture","业务项目大图");
+	
 	private AttachmentType(String code, String desc) {
 		this.code = code;
 		this.desc = desc;

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

@@ -1120,8 +1120,13 @@
 		    a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough, 
 		    a.patent_case as patentCase, a.awards, a.team_des as teamDes, 
 		    a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl, 
+<<<<<<< HEAD
 		    a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId,  a.international_flag as internationalFlag,
 		    a.create_time as createTime, a.release_status as releaseStatus, 
+=======
+		    a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, 
+		    a.create_time as createTime, a.release_status as releaseStatus,
+>>>>>>> refs/remotes/origin/master
 		    a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
 		    oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
 		    oi.org_code as iOwnerIdNumber, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) hot,mm.cover_img as coverImg

+ 107 - 0
src/main/java/com/goafanti/common/mapper/BusinessProjectMapper.xml

@@ -2,6 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.BusinessProjectMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.BusinessProject">
+  
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
@@ -537,4 +538,110 @@
       client_size = #{clientSize,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+  
+  	<select id="findProjectListByPage" resultType="com.goafanti.admin.bo.BusinessProjectBo">
+ 		select b.id, b.create_id as createId, b.create_time as createTime, b.update_time as updateTime,  b.delete_sign deleteSign, b.bname,
+ 		  b.cid,  b.price,  b.offset,  b.activity_price as activityPrice,  b.activity_flag as activityFlag,  b.member_price as memberPrice, 
+ 		  b.introduce,  b.status,  b.country,  b.province,  b.city,  b.district, 
+          b.principal_id as principalId,  b.Value_effect as ValueEffect,  b.client_size as  clientSize,b2.cname 
+  		from business_project b
+  		left join business_varieties b2 on b.cid = b2.id
+  		where b.delete_sign=0 
+  		<if test="bname != null">
+		and b.bname = #{bname,jdbcType=VARCHAR}
+		</if>
+		<if test="cid != null">
+		and b.cid = #{cid,jdbcType=VARCHAR}
+		</if>
+		<if test="country != null">
+		and b.country = #{country,jdbcType=INTEGER}
+		</if>
+		<if test="province != null">
+		and b.province = #{province,jdbcType=VARCHAR}
+		</if>
+		<if test="city != null">
+		and b.city = #{city,jdbcType=VARCHAR}
+		</if>
+		<if test="district != null">
+		and b.district = #{district,jdbcType=VARCHAR}
+		</if>
+		<if test="activityFlag != null">
+		and b.activity_flag = #{activityFlag,jdbcType=INTEGER}
+		</if>
+		<if test="status != null">
+		and b.status = #{status,jdbcType=VARCHAR}
+		</if>
+		<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  <select id="findProjectListCount" resultType="Integer">
+ 		select 
+  			count(0)
+  		from business_project b
+  		 left join business_varieties b2 on b.cid = b2.id
+  		where b.delete_sign=0 
+  		<if test="bname != null">
+		and b.bname = #{bname,jdbcType=VARCHAR}
+		</if>
+		<if test="cid != null">
+		and b.cid = #{cid,jdbcType=VARCHAR}
+		</if>
+		<if test="country != null">
+		and b.country = #{country,jdbcType=INTEGER}
+		</if>
+		<if test="province != null">
+		and b.province = #{province,jdbcType=VARCHAR}
+		</if>
+		<if test="city != null">
+		and b.city = #{city,jdbcType=VARCHAR}
+		</if>
+		<if test="district != null">
+		and b.district = #{district,jdbcType=VARCHAR}
+		</if>
+		<if test="activityFlag != null">
+		and b.activity_flag = #{activityFlag,jdbcType=INTEGER}
+		</if>
+		<if test="status != null">
+		and b.status = #{status,jdbcType=VARCHAR}
+		</if>
+		
+  </select>
+  
+  <select id="getBnamecount" resultType="Integer">
+  select 
+  			count(0)
+  		from business_project
+  where  bname = #{bname,jdbcType=VARCHAR}
+  
+  </select>
+  
+  <select id="getCreateName" resultType="string">
+  select 
+  			name
+  		from admin
+  where  id = #{id,jdbcType=VARCHAR}
+  
+  </select>
+  
+  <select id="findProjectSizeListByPage" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+  select 
+  	 p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
+    p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname
+    from project_size p
+    left join business_project b on  p.pid =b.id 
+    where p.pid = #{pid,jdbcType=VARCHAR}
+    <if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="findProjectSizeListCount" resultType="Integer">
+  select 
+  	count(0)
+    from project_size p
+    left join business_project b on  p.pid =b.id 
+    where p.pid = #{pid,jdbcType=VARCHAR}
+  </select>
+  
 </mapper>

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

@@ -361,7 +361,8 @@
       super_id = #{superId,jdbcType=VARCHAR},
       layer = #{layer,jdbcType=INTEGER},
       status = #{status,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=VARCHAR}
+    
+  	where id = #{id,jdbcType=VARCHAR}
   </update>
   
   <select id="getCount" resultType="string">
@@ -438,19 +439,48 @@
   <select id="ThanCid" resultType="string">
   		select b.id 
   		from business_varieties b
-  		where b.cid= #{cid,jdbcType=VARCHAR}
+  		where b.cid= #{cid,jdbcType=VARCHAR} 
   	</select>
   	
   	<select id="getcname" resultType="Integer">
   		select count(1) 
   		from business_varieties b
-  		where b.cname= #{cname,jdbcType=VARCHAR}
+  		where b.delete_sign=0
+  		and b.cname= #{cname,jdbcType=VARCHAR}
   	</select>
   	
   	<select id="selectSuperid" resultType="com.goafanti.admin.bo.BusinessVarietiesBo">
   		select b.id,b.create_id as createId ,b.create_time as createTime,b.update_time as updateTime,
   		b.delete_sign as deleteSign,b.cid,b.cname,b.super_id superId ,b.layer,b.status
   		from business_varieties b 
-  		where b.super_id= #{superId,jdbcType=VARCHAR}
+  		where b.delete_sign=0
+  		and b.super_id= #{superId,jdbcType=VARCHAR}
+  	</select>
+  	
+  	<select id="getThisCid" resultType="String">
+  		select b.cid
+  		from business_varieties b
+  		
+  		where b.id= #{id,jdbcType=VARCHAR}
+  	</select>
+  	
+  	<select id="getThisCname" resultType="String">
+  		select b.cname
+  		from business_varieties b
+  		where b.cid= #{cid,jdbcType=VARCHAR}
+  	</select>
+  	
+  	<select id="getListId" resultType="String">
+  		select b.id
+  		from business_varieties b
+  		where b.delete_sign=0
+  		and b.status=0
+  	</select>
+  	
+  	<select id="getLayer" resultType="Integer">
+  		select b.layer
+  		from business_varieties b
+  		where b.delete_sign=0
+  		and b.id= #{superId,jdbcType=VARCHAR}
   	</select>
 </mapper>

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

@@ -331,7 +331,7 @@
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ProjectSize">
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.admin.bo.ProjectSizeBo">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
@@ -395,4 +395,31 @@
       status = #{status,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+ 	
+  <select id="selectByPrimaryBusinessId" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+    
+    select 
+  	 p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
+    p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname
+    from project_size p
+    left join business_project b on  p.pid =b.id 
+    where p.pid = #{pid,jdbcType=VARCHAR}
+  </select>
+  
+  <select id="selectByBusinessId" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+    select 
+    p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
+    p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname
+    from project_size p
+    left join business_project b on  p.pid =b.id 
+    where p.id = #{id,jdbcType=VARCHAR}
+  </select>	
+  
+  <select id="getgetPnamecount" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+   select 
+   p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
+   p.activity_flag as activityFlag, p.member_price as memberPrice, p.status
+    from project_size p
+   where p.pname=#{pname,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 39 - 0
src/main/java/com/goafanti/common/model/BusinessProject.java

@@ -111,6 +111,32 @@ public class BusinessProject {
 	 */
 	private String clientSize;
 
+	
+	private String MinLogo;
+	
+	public String getMinLogo() {
+		return MinLogo;
+	}
+
+
+
+	public void setMinLogo(String minLogo) {
+		MinLogo = minLogo;
+	}
+
+
+
+	public String getMaxLogo() {
+		return MaxLogo;
+	}
+
+
+
+	public void setMaxLogo(String maxLogo) {
+		MaxLogo = maxLogo;
+	}
+
+	private String MaxLogo;
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.id
 	 * @return  the value of business_project.id
@@ -119,6 +145,8 @@ public class BusinessProject {
 	public String getId() {
 		return id;
 	}
+	
+	
 
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column business_project.id
@@ -488,4 +516,15 @@ public class BusinessProject {
 	public void setClientSize(String clientSize) {
 		this.clientSize = clientSize;
 	}
+
+	@Override
+	public String toString() {
+		return "BusinessProject [id=" + id + ", createId=" + createId + ", createTime=" + createTime + ", updateTime="
+				+ updateTime + ", deleteSign=" + deleteSign + ", bname=" + bname + ", cid=" + cid + ", price=" + price
+				+ ", offset=" + offset + ", activityPrice=" + activityPrice + ", activityFlag=" + activityFlag
+				+ ", memberPrice=" + memberPrice + ", introduce=" + introduce + ", status=" + status + ", country="
+				+ country + ", province=" + province + ", city=" + city + ", district=" + district + ", principalId="
+				+ principalId + ", valueEffect=" + valueEffect + ", clientSize=" + clientSize + "]";
+	}
+	
 }

+ 26 - 0
src/main/java/com/goafanti/common/model/ProjectSize.java

@@ -3,6 +3,10 @@ package com.goafanti.common.model;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
 public class ProjectSize {
 
 	/**
@@ -110,6 +114,13 @@ public class ProjectSize {
 	public Date getCreateTime() {
 		return createTime;
 	}
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column project_size.create_time
@@ -128,6 +139,13 @@ public class ProjectSize {
 	public Date getUpdateTime() {
 		return updateTime;
 	}
+	public String getUpdateTimeFormattedDate() {
+		if (this.updateTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column project_size.update_time
@@ -281,4 +299,12 @@ public class ProjectSize {
 	public void setStatus(Integer status) {
 		this.status = status;
 	}
+
+	@Override
+	public String toString() {
+		return "ProjectSize [id=" + id + ", createId=" + createId + ", createTime=" + createTime + ", updateTime="
+				+ updateTime + ", pid=" + pid + ", pname=" + pname + ", price=" + price + ", offset=" + offset
+				+ ", activityPrice=" + activityPrice + ", activityFlag=" + activityFlag + ", memberPrice=" + memberPrice
+				+ ", status=" + status + "]";
+	}
 }