Просмотр исходного кода

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

anderx лет назад: 7
Родитель
Сommit
3762218407

+ 8 - 0
src/main/java/com/goafanti/common/dao/OrganizationManagementMapper.java

@@ -72,6 +72,14 @@ public interface OrganizationManagementMapper {
 	 * 根据组织名称查组织编号
 	 */
 	String selectDepNoByName(String name);
+	
+	/**
+	 * 根据上级组织查组织编号
+	 */
+	String  selectDepNo(String id);
+	/**
+	
+	
 	/**
 	 * 查询相同上级下编号数量
 	 */

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

@@ -353,7 +353,7 @@
       select df.id ,df.demand_id as demandId,df.organization,df.contacts,df.contact_mobile contactMobile,df.remark,
   df.`result`,df.last_follow_time as lastFollowTime,d.name,d.employer_name as employerName,df.sources,
   d.employer_contacts_mobile as employerContactsMobile,d.employer_contacts_mailbox as employerContactsMailbox,
-  d.create_time as createTime, a.name as adminName 
+  d.create_time as createTime, a.name as adminName ,df.sources
     from  demand_follow df
     left join demand d on df.demand_id=d.id
     left join admin a on d.tech_broker_id=a.id 

+ 15 - 10
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -30,7 +30,7 @@
     <result column="employer_contacts" property="employerContacts" jdbcType="VARCHAR" />
     <result column="employer_contacts_mobile" property="employerContactsMobile" jdbcType="VARCHAR" />
     <result column="employer_contacts_mailbox" property="employerContactsMailbox" jdbcType="VARCHAR" />
-    <result column="contacts" property="contacts" jdbcType="INTEGER" />
+    <result column="contacts" property="contacts" jdbcType="VARCHAR" />
     <result column="status" property="status" jdbcType="INTEGER" />
     <result column="release_status" property="releaseStatus" jdbcType="INTEGER" />
     <result column="release_date" property="releaseDate" jdbcType="TIMESTAMP" />
@@ -68,7 +68,7 @@
     d.employer_address AS employerAddress, d.employer_contacts AS employerContacts, d.employer_contacts_mobile AS employerContactsMobile, d.employer_contacts_mailbox AS employerContactsMailbox, 
     d.contacts, d.status, d.release_status AS releaseStatus, d.release_date AS releaseDate , d.create_time AS createTime, d.principal_id AS principalId, d.deleted_sign AS deletedSign,
     d.audit_status AS auditStatus, d.tech_broker_id AS techBrokerId,d.boutique,d.urgent_money AS urgentMoney,d.urgent_days as urgentDays
-    ,ifnull(t.x,0) as orderIntentionCount,ifnull(t2.x,0) as orderCount,j.easemob_name as easemobName
+    ,ifnull(t.x,0) as orderIntentionCount,ifnull(t2.x,0) as orderCount,j.easemob_name as easemobName,d.contacts,d.contact_mobile as contactMobile
     from demand d
     left join jpush_easemob_account j on d.employer_id=j.uid
     left join (select count(0) as x,tl.commodity_id from t_order tr
@@ -97,7 +97,7 @@
       employer_address, employer_contacts, employer_contacts_mobile, 
       employer_contacts_mailbox, contacts, status, 
       release_status, release_date, create_time, 
-      principal_id, deleted_sign, audit_status, tech_broker_id,boutique,remark,urgent_days,urgent_money)
+      principal_id, deleted_sign, audit_status, tech_broker_id,boutique,remark,urgent_days,urgent_money,contact_mobile)
     values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER}, 
       #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{infoSources,jdbcType=INTEGER}, 
       #{industryCategoryA,jdbcType=INTEGER}, #{industryCategoryB,jdbcType=INTEGER}, #{industryCategoryC,jdbcType=INTEGER}, 
@@ -107,10 +107,10 @@
       #{fixedScheme,jdbcType=VARCHAR}, #{costEscrow,jdbcType=DECIMAL}, #{budgetCost,jdbcType=DECIMAL}, 
       #{validityPeriod,jdbcType=TIMESTAMP}, #{employerId,jdbcType=VARCHAR}, #{employerName,jdbcType=VARCHAR}, 
       #{employerAddress,jdbcType=VARCHAR}, #{employerContacts,jdbcType=VARCHAR}, #{employerContactsMobile,jdbcType=VARCHAR}, 
-      #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
+      #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
       #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
       #{principalId,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
-      #{techBrokerId,jdbcType=VARCHAR},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{urgentDays,jdbcType=VARCHAR},#{urgentMoney,jdbcType=VARCHAR})
+      #{techBrokerId,jdbcType=VARCHAR},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{urgentDays,jdbcType=VARCHAR},#{urgentMoney,jdbcType=VARCHAR},#{contactMobile,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Demand" >
     insert into demand
@@ -438,7 +438,11 @@
         employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
       </if>
       <if test="contacts != null" >
-        contacts = #{contacts,jdbcType=INTEGER},
+        contacts = #{contacts,jdbcType=VARCHAR},
+      </if>
+      
+      <if test="contactMobile  != null" >
+        contact_mobile  = #{contactMobile ,jdbcType=VARCHAR},
       </if>
       <if test="status != null" >
         status = #{status,jdbcType=INTEGER},
@@ -474,7 +478,7 @@
         urgent_days = #{urgentDays,jdbcType=VARCHAR},
       </if>
       <if test="urgentMoney != null" >
-        urgent_money = #{urgentMoney,jdbcType=VARCHAR},
+        urgent_money = #{urgentMoney,jdbcType=VARCHAR}, 
       </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
@@ -894,7 +898,7 @@
   		d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
   		d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
   		d.tech_broker_id as techBrokerId,  u.mobile as contactsName,d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
-  		d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.remark
+  		d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.remark,d.contacts,d.contact_mobile as contactMobile
   	from demand d 
   	left join user_identity ui on ui.uid = d.employer_id
   	left join user u on u.id = d.employer_id
@@ -904,7 +908,8 @@
   
   
    <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
-  	select 
+  				
+select 
   		d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
   		d.name, d.keyword, d.info_sources as infoSources,
   		oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
@@ -918,7 +923,7 @@
   		d.tech_broker_id as techBrokerId,d.remark,d.urgent_days as urgentDays,d.urgent_money as urgentMoney, 
   		d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
   		d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
-  		d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
+  		d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.contacts,d.contact_mobile as contactMobile
   	from demand d 
   	left join organization_identity oi on oi.uid = d.employer_id
   	left join user u on u.id = d.employer_id

+ 10 - 1
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -467,6 +467,15 @@
 		#{depNo,jdbcType=VARCHAR},#{superId,jdbcType=VARCHAR},
 		#{desc,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})	
 	</insert>
+	<!-- 得到上级 -->
+	<select id="selectDepNo" resultType="String">
+	select
+	dep_no as depNo
+		from department_management
+		where
+		id=#{superId,jdbcType=VARCHAR}
+	</select>
+	
 	<select id="selectDepNoByName" resultType="String">
 		select
 		dep_no as depNo
@@ -537,7 +546,7 @@
 		remarks,status
   		from department_management 		
   		where
-  		super_id=#{superId,jdbcType=VARCHAR}
+  		id=#{superId,jdbcType=VARCHAR}
   		order by dep_no
   	</select>
   	<update id="updateByNumber" parameterType="com.goafanti.organization.bo.OrganizationListOut">

+ 16 - 7
src/main/java/com/goafanti/common/model/Demand.java

@@ -155,10 +155,7 @@ public class Demand {
     */
     private String employerContactsMailbox;
 
-    /**
-    * 联系人&联系方式
-    */
-    private Integer contacts;
+    
 
     /**
     * 需求状态(0-进行中,1-未解决,2-已解决)
@@ -215,6 +212,10 @@ public class Demand {
 	
     private String orderCount;
 	private String orderIntentionCount; 
+	
+	private String contacts; 
+	
+	private String contactMobile;
 
     public String getOrderCount() {
 		return orderCount;
@@ -475,12 +476,12 @@ public class Demand {
         this.employerContactsMailbox = employerContactsMailbox;
     }
 
-    @JsonFormat(shape = Shape.STRING)
-    public Integer getContacts() {
+    
+    public String getContacts() {
         return contacts;
     }
 
-    public void setContacts(Integer contacts) {
+    public void setContacts(String  contacts) {
         this.contacts = contacts;
     }
     
@@ -618,5 +619,13 @@ public class Demand {
 		this.urgentMoney =  Integer.valueOf(urgentMoney);
 	}
 
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile;
+	}
+
 	
 }

+ 5 - 1
src/main/java/com/goafanti/common/model/DemandFollowDetail.java

@@ -34,10 +34,13 @@ public class DemandFollowDetail {
 	 */
 	private Date createTime;
 
+	
+	
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column demand_follow_detail.id
 	 * @return  the value of demand_follow_detail.id
 	 * @mbg.generated  Thu Mar 22 14:44:52 CST 2018
+	 *
 	 */
 	public String getId() {
 		return id;
@@ -124,7 +127,6 @@ public class DemandFollowDetail {
 		this.createTime = createTime;
 	}
 	
-
 	public String getCreateTimeFormattedDate(){
 		if (null==getCreateTime()) {
 			return null;
@@ -133,5 +135,7 @@ public class DemandFollowDetail {
 		}
 		
 	}
+
+	
 	
 }

+ 1 - 1
src/main/java/com/goafanti/demand/bo/DemandFollowDetailListBo.java

@@ -15,7 +15,7 @@ public class DemandFollowDetailListBo  extends DemandFollowDetail{
 		if (null==getCreateTime()) {
 			return null;
 		}else {
-			return DateFormatUtils.format(getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+			return DateFormatUtils.format(getCreateTime(), AFTConstants.YYYYMMDD);
 		}
 		
 	}

+ 14 - 16
src/main/java/com/goafanti/demand/bo/DemandFollowListBo.java

@@ -1,6 +1,7 @@
 package com.goafanti.demand.bo;
 
-import java.util.Date;
+
+import java.util.List;
 
 import org.apache.commons.lang3.time.DateFormatUtils;
 
@@ -12,8 +13,9 @@ public class DemandFollowListBo extends DemandFollow{
 	private String employerName;
 	private String employerContactsMobile;
 	private String employerContactsMailbox;
-	private Date createTime;
-	private String adminName; 
+	private String adminName;
+	private List<?> demandFollowDetail;
+	
 	
 	public String getName() {
 		return name;
@@ -39,9 +41,7 @@ public class DemandFollowListBo extends DemandFollow{
 	public void setEmployerContactsMailbox(String employerContactsMailbox) {
 		this.employerContactsMailbox = employerContactsMailbox;
 	}
-	public Date getCreateTime() {
-		return createTime;
-	}
+	
 	public String getLastFollowTimeFormattedDate() {
 		if (getLastFollowTime() == null) {
 			return null;
@@ -49,20 +49,18 @@ public class DemandFollowListBo extends DemandFollow{
 			return DateFormatUtils.format(getLastFollowTime(), AFTConstants.YYYYMMDD);
 		}
 	}
-	public String getCreateTimeFormattedDate() {
-		if (this.createTime == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
+	
+	
 	public String getAdminName() {
 		return adminName;
 	}
 	public void setAdminName(String adminName) {
 		this.adminName = adminName;
 	}
+	public List<?> getDemandFollowDetail() {
+		return demandFollowDetail;
+	}
+	public void setDemandFollowDetail(List<?> demandFollowDetail) {
+		this.demandFollowDetail = demandFollowDetail;
+	}
 }

+ 19 - 0
src/main/java/com/goafanti/demand/bo/DemandListBo.java

@@ -117,6 +117,9 @@ public class DemandListBo {
 	
 	private String		industryCategoryAS;
 	
+	private String contacts;
+	private String contactMobile;
+	
 
 	@JsonFormat(shape = Shape.STRING)
 	public String getIndustryCategory1() {
@@ -447,4 +450,20 @@ public class DemandListBo {
 		this.industryCategoryAS = industryCategoryAS;
 	}
 
+	public String getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile;
+	}
+
 }

+ 9 - 3
src/main/java/com/goafanti/demand/bo/DemandManageDetailBo.java

@@ -1,9 +1,11 @@
 package com.goafanti.demand.bo;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.model.DemandFollowDetail;
 
 public class DemandManageDetailBo extends DemandManageListBo {
 
@@ -41,7 +43,7 @@ public class DemandManageDetailBo extends DemandManageListBo {
 
 	private String		mailbox;
 
-	private Integer		contacts;
+	private String		contacts;
 
 	private String		employerAddress;
 
@@ -51,6 +53,9 @@ public class DemandManageDetailBo extends DemandManageListBo {
 
 	private String      coverImg;
 	
+	
+	
+
 	public String getEmployerAddress() {
 		return employerAddress;
 	}
@@ -76,11 +81,11 @@ public class DemandManageDetailBo extends DemandManageListBo {
 	}
 
 	@JsonFormat(shape = Shape.STRING)
-	public Integer getContacts() {
+	public String getContacts() {
 		return contacts;
 	}
 
-	public void setContacts(Integer contacts) {
+	public void setContacts(String contacts) {
 		this.contacts = contacts;
 	}
 
@@ -227,4 +232,5 @@ public class DemandManageDetailBo extends DemandManageListBo {
 	public void setCoverImg(String coverImg) {
 		this.coverImg = coverImg;
 	}
+
 }

+ 15 - 6
src/main/java/com/goafanti/demand/bo/InputDemand.java

@@ -105,10 +105,6 @@ public class InputDemand {
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		employerContactsMailbox;
 
-	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer		contacts;
-
 	@Max(value = 2, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		status;
@@ -142,6 +138,19 @@ public class InputDemand {
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String urgentMoney;
 	
+	@Size(min = 0, max = 256, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String contacts; 
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String contactMobile;
+	
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile;
+	}
+
 	public String getRemark() {
 		return remark;
 	}
@@ -366,11 +375,11 @@ public class InputDemand {
 		this.employerContactsMailbox = employerContactsMailbox;
 	}
 
-	public Integer getContacts() {
+	public String getContacts() {
 		return contacts;
 	}
 
-	public void setContacts(Integer contacts) {
+	public void setContacts(String contacts) {
 		this.contacts = contacts;
 	}
 

+ 3 - 7
src/main/java/com/goafanti/demand/controller/AdminDemandApiController.java

@@ -6,12 +6,10 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
-
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
-
 import org.springframework.beans.BeanUtils;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
-
 import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.service.AftFileService;
 import com.goafanti.common.bo.Result;
@@ -33,7 +30,6 @@ import com.goafanti.common.enums.DemandAuditStatus;
 import com.goafanti.common.enums.DemandFields;
 import com.goafanti.common.enums.DemandImportFields;
 import com.goafanti.common.enums.DemandOrderStatus;
-import com.goafanti.common.enums.DemandReleaseStatus;
 import com.goafanti.common.enums.DemandSwitchSign;
 import com.goafanti.common.enums.MarketingPage;
 import com.goafanti.common.model.AftFile;
@@ -270,6 +266,7 @@ public class AdminDemandApiController extends CertifyApiController {
 			return res;
 		}
 		Demand d = new Demand();
+		
 		BeanUtils.copyProperties(demand, d);
 		if (StringUtils.isNotBlank(demand.getUrgentDays())) {
 			d.setUrgentDays(demand.getUrgentDays());
@@ -318,7 +315,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	 * 组织用户详情(个人组织合并)
 	 */
 	@RequestMapping(value = "/orgDemandDetail", method = RequestMethod.GET)
-	public Result orgDemandDetail(String id,int dataCategory) {
+	public Result orgDemandDetail(String id,Integer dataCategory) {
 		Result res = new Result();
 
 		if (StringUtils.isBlank(id)) {
@@ -428,7 +425,7 @@ public class AdminDemandApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "开关标记"));
 			return res;
 		}
-
+		
 		if (!DemandAuditStatus.CREATE.getCode().equals(demand.getAuditStatus())
 				&& !DemandAuditStatus.SUBMIT.getCode().equals(demand.getAuditStatus())
 				&& !DemandAuditStatus.UNAUDITED.getCode().equals(demand.getAuditStatus())) {
@@ -443,7 +440,6 @@ public class AdminDemandApiController extends CertifyApiController {
 
 		Demand d = new Demand();
 		BeanUtils.copyProperties(demand, d);
-		BeanUtils.copyProperties(demand, d);
 		if (StringUtils.isNotBlank(demand.getUrgentDays())) {
 			d.setUrgentDays(demand.getUrgentDays());
 		}

+ 7 - 1
src/main/java/com/goafanti/demand/service/impl/DemandFollowServiceImpl.java

@@ -79,7 +79,13 @@ public class DemandFollowServiceImpl extends BaseMybatisDao<DemandFollowMapper>
 		}
 		Map<String, Object> params=new HashMap<String, Object>();
 		params.put("id", id);
-		return (Pagination<DemandFollowListBo>) findPage("findDemandFollowListByPage", "findDemandFollowCount", params, pNo, pSize);
+		Pagination<DemandFollowListBo> p=(Pagination<DemandFollowListBo>) findPage("findDemandFollowListByPage", "findDemandFollowCount", params, pNo, pSize);
+		List<DemandFollowListBo> list =(List<DemandFollowListBo>) p.getList();
+		for (DemandFollowListBo d : list) {
+			d.setDemandFollowDetail(demandFollowDetailMapper.selectDemandFollowDetail(d.getId()));
+			
+		}
+		return p;
 	}
 
 	@Override

+ 6 - 0
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -24,6 +24,7 @@ import com.goafanti.common.dao.AchievementDemandMapper;
 
 import com.goafanti.common.dao.AchievementKeywordMapper;
 import com.goafanti.common.dao.AchievementMapper;
+import com.goafanti.common.dao.DemandFollowDetailMapper;
 import com.goafanti.common.dao.DemandInterestMapper;
 import com.goafanti.common.dao.DemandKeywordMapper;
 import com.goafanti.common.dao.DemandMapper;
@@ -52,6 +53,7 @@ import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.AchievementDemand;
 import com.goafanti.common.model.AchievementDemandCount;
 import com.goafanti.common.model.Demand;
+import com.goafanti.common.model.DemandFollowDetail;
 import com.goafanti.common.model.DemandKeyword;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrganizationIdentity;
@@ -113,6 +115,9 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	private UserInterestMapper	userInterestMapper;
 	@Autowired
 	ProjectInterestMapper	projectInterestMapper; 
+	
+	
+	DemandFollowDetailMapper	demandFollowDetailMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -301,6 +306,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 	@Override
 	public DemandManageDetailBo selectOrgDemandDetail(String id) {
+		
 		return demandMapper.selectOrgDemandDetail(id);
 	}
 

+ 5 - 5
src/main/java/com/goafanti/organization/controller/AdminOrganizationController.java

@@ -41,8 +41,7 @@ public class AdminOrganizationController extends BaseApiController{
 	@RequestMapping(value = "/addOrganization" , method = RequestMethod.POST)
 	public Result addOrganization(String name, String managerId, String type, String superId, String remarks) throws Exception{
 		Result res = new Result();
-		if(StringUtils.isBlank(name) || StringUtils.isBlank(type) 
-				|| StringUtils.isBlank(superId)){
+		if(StringUtils.isBlank(name) || StringUtils.isBlank(type) || StringUtils.isBlank(superId)){
 			res.getError().add(buildError("","组织名称、组织类型、上级组织不能为空"));
 			return res;
 		}
@@ -51,7 +50,7 @@ public class AdminOrganizationController extends BaseApiController{
 			res.getError().add(buildError("","部门已存在"));
 			return res;
 		}		
-		String sdepNo=organizationManagementMapper.selectDepNoByName(superId);
+		String sdepNo=organizationManagementMapper.selectDepNo(superId);
 		int Count=organizationManagementMapper.selectDepNoCount(superId);
 		if((Count+1)>99){
 			res.getError().add(buildError("","每层最多存在99个子类"));
@@ -108,8 +107,9 @@ public class AdminOrganizationController extends BaseApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,""));
 			return res;
 		}		
-		String sdepNo=organizationManagementMapper.selectDepNoByName(superId);
-		superId=organizationManagementMapper.selectIdByName(superId);
+		String sdepNo=organizationManagementMapper.selectDepNo(superId);
+	/*	String sdepNo=organizationManagementMapper.selectDepNoByName(superId);*/
+     /*superId=organizationManagementMapper.selectIdByName(superId);*/
 		int Count=organizationManagementMapper.selectDepNoCount(superId);
 		if((Count+1)>99){
 			res.getError().add(buildError("","每层最多存在99个子类"));

+ 5 - 4
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -58,7 +58,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 	 *
 	 */
 	@Override
-	public int addOrganization(String name, String managerId, String type, String superId, String remarks,String dep) {
+	public int addOrganization( String name, String managerId, String type, String superId, String remarks,String dep) {
 		String id = UUID.randomUUID().toString();
 		Date now = new Date();
 		OrganizationManagement om=new OrganizationManagement(); 
@@ -72,7 +72,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 		om.setType(type);
 		om.setManagerId(managerId);
 		om.setDepNo(dep);
-		superId=organizationManagementMapper.selectIdByName(superId);
+	//	superId=organizationManagementMapper.selectIdByName(superId);
 		om.setSuperId(superId);
 		om.setRemarks(remarks);
 		om.setStatus("0");
@@ -114,7 +114,8 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 		int n=0;
 		List<OrganizationListOut> Nos =organizationManagementMapper.selectIDNBySuperId(id);
 		for(OrganizationListOut i:Nos){			
-			String sdepNo=organizationManagementMapper.selectDepNoById(i.getSuperId());
+	//		String sdepNo=organizationManagementMapper.selectDepNoById(i.getSuperId());
+			String sdepNo=organizationManagementMapper.selectDepNo(i.getSuperId());
 			if(n<10){
 				String dep=sdepNo+"0"+n;			
 				if(n>=10){
@@ -137,7 +138,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 			List<OrganizationListOut> Noss =organizationManagementMapper.selectIDNBySuperId(i.getId());
 			System.out.println("noss="+Noss);
 			for(OrganizationListOut o:Noss){			
-				sdepNo=organizationManagementMapper.selectDepNoById(o.getSuperId());
+				sdepNo=organizationManagementMapper.selectDepNo(o.getSuperId());
 				if(m<10){
 					String dep=sdepNo+"0"+m;			
 					if(m>=10){