Browse Source

需求新增联系人与联系方式

anderx 7 years ago
parent
commit
f3fefaa13d

+ 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

+ 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;
+	}
+
 	
 }

+ 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;
+	}
+
 }

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

@@ -41,7 +41,7 @@ public class DemandManageDetailBo extends DemandManageListBo {
 
 	private String		mailbox;
 
-	private Integer		contacts;
+	private String		contacts;
 
 	private String		employerAddress;
 
@@ -51,6 +51,7 @@ public class DemandManageDetailBo extends DemandManageListBo {
 
 	private String      coverImg;
 	
+
 	public String getEmployerAddress() {
 		return employerAddress;
 	}
@@ -76,11 +77,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 +228,6 @@ 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;
 	}
 

+ 2 - 6
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());
@@ -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());
 		}