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

Merge branch 'master' into test

anderx лет назад: 3
Родитель
Сommit
e3fffc5bb6

+ 3 - 1
src/main/java/com/goafanti/common/dao/OrganizationIdentityMapper.java

@@ -47,4 +47,6 @@ public interface OrganizationIdentityMapper {
     int updateServiceByUid(OrganizationIdentity org);
 
     void insertBatch(List<InputUserChannel> list);
-}
+
+    OrganizationIdentity selectByOrgCode(String orgCode);
+}

+ 73 - 63
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -77,22 +77,22 @@
     <result column="contacts_position" jdbcType="VARCHAR" property="contactsPosition" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, `uid`, contacts, contact_mobile, fixed_tel, qq, postal_address, postcode, unit_name, 
-    registered_capital, licence_number, licence_province, licence_city, licence_area, 
-    licence_scanning_url, org_code, org_code_url, bank_account, banks, bank_branch, bank_card_number, 
-    validation_amount, identity_type, location_province, location_city, location_area, 
-    legal_person, legal_person_id_card, last_year_tax_report_url, audit_status, `process`, 
-    wrong_count, payment_date, listed, listed_date, listed_type, stock_code, certificate_number, 
-    issuing_date, cog_contacts, tech_principal, contacts_fixed_tel, contacts_fax, legal_person_tel, 
-    legal_person_fax, legal_person_email, registration_time, ratepay_code, industry, 
-    enterprise_scale, register_type, foreign_investment, field, tax_authority, ratepay_method, 
-    high_tech_zone, risk_investment, business_scope, high_tech_name, patent_prory_statement_url, 
-    international, review_instructions, investment, year_sales_amount, last_year_research_amount, 
-    assets, qualification, cooperation_situation, honor_picture, sales_target, intended_project, 
+    id, `uid`, contacts, contact_mobile, fixed_tel, qq, postal_address, postcode, unit_name,
+    registered_capital, licence_number, licence_province, licence_city, licence_area,
+    licence_scanning_url, org_code, org_code_url, bank_account, banks, bank_branch, bank_card_number,
+    validation_amount, identity_type, location_province, location_city, location_area,
+    legal_person, legal_person_id_card, last_year_tax_report_url, audit_status, `process`,
+    wrong_count, payment_date, listed, listed_date, listed_type, stock_code, certificate_number,
+    issuing_date, cog_contacts, tech_principal, contacts_fixed_tel, contacts_fax, legal_person_tel,
+    legal_person_fax, legal_person_email, registration_time, ratepay_code, industry,
+    enterprise_scale, register_type, foreign_investment, field, tax_authority, ratepay_method,
+    high_tech_zone, risk_investment, business_scope, high_tech_name, patent_prory_statement_url,
+    international, review_instructions, investment, year_sales_amount, last_year_research_amount,
+    assets, qualification, cooperation_situation, honor_picture, sales_target, intended_project,
     contacts_dep, contacts_position
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from organization_identity
     where id = #{id,jdbcType=VARCHAR}
@@ -102,56 +102,56 @@
     where id = #{id,jdbcType=VARCHAR}
   </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.OrganizationIdentity">
-    insert into organization_identity (id, `uid`, contacts, 
-      contact_mobile, fixed_tel, qq, 
-      postal_address, postcode, unit_name, 
-      registered_capital, licence_number, licence_province, 
-      licence_city, licence_area, licence_scanning_url, 
-      org_code, org_code_url, bank_account, 
-      banks, bank_branch, bank_card_number, 
-      validation_amount, identity_type, location_province, 
-      location_city, location_area, legal_person, 
-      legal_person_id_card, last_year_tax_report_url, 
-      audit_status, `process`, wrong_count, 
-      payment_date, listed, listed_date, 
-      listed_type, stock_code, certificate_number, 
-      issuing_date, cog_contacts, tech_principal, 
-      contacts_fixed_tel, contacts_fax, legal_person_tel, 
-      legal_person_fax, legal_person_email, registration_time, 
-      ratepay_code, industry, enterprise_scale, 
-      register_type, foreign_investment, field, 
-      tax_authority, ratepay_method, high_tech_zone, 
-      risk_investment, business_scope, high_tech_name, 
-      patent_prory_statement_url, international, 
-      review_instructions, investment, year_sales_amount, 
-      last_year_research_amount, assets, qualification, 
-      cooperation_situation, honor_picture, sales_target, 
+    insert into organization_identity (id, `uid`, contacts,
+      contact_mobile, fixed_tel, qq,
+      postal_address, postcode, unit_name,
+      registered_capital, licence_number, licence_province,
+      licence_city, licence_area, licence_scanning_url,
+      org_code, org_code_url, bank_account,
+      banks, bank_branch, bank_card_number,
+      validation_amount, identity_type, location_province,
+      location_city, location_area, legal_person,
+      legal_person_id_card, last_year_tax_report_url,
+      audit_status, `process`, wrong_count,
+      payment_date, listed, listed_date,
+      listed_type, stock_code, certificate_number,
+      issuing_date, cog_contacts, tech_principal,
+      contacts_fixed_tel, contacts_fax, legal_person_tel,
+      legal_person_fax, legal_person_email, registration_time,
+      ratepay_code, industry, enterprise_scale,
+      register_type, foreign_investment, field,
+      tax_authority, ratepay_method, high_tech_zone,
+      risk_investment, business_scope, high_tech_name,
+      patent_prory_statement_url, international,
+      review_instructions, investment, year_sales_amount,
+      last_year_research_amount, assets, qualification,
+      cooperation_situation, honor_picture, sales_target,
       intended_project, contacts_dep, contacts_position
       )
-    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, 
-      #{contactMobile,jdbcType=VARCHAR}, #{fixedTel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, 
-      #{postalAddress,jdbcType=VARCHAR}, #{postcode,jdbcType=VARCHAR}, #{unitName,jdbcType=VARCHAR}, 
-      #{registeredCapital,jdbcType=DECIMAL}, #{licenceNumber,jdbcType=VARCHAR}, #{licenceProvince,jdbcType=INTEGER}, 
-      #{licenceCity,jdbcType=INTEGER}, #{licenceArea,jdbcType=INTEGER}, #{licenceScanningUrl,jdbcType=VARCHAR}, 
-      #{orgCode,jdbcType=VARCHAR}, #{orgCodeUrl,jdbcType=VARCHAR}, #{bankAccount,jdbcType=VARCHAR}, 
-      #{banks,jdbcType=VARCHAR}, #{bankBranch,jdbcType=VARCHAR}, #{bankCardNumber,jdbcType=VARCHAR}, 
-      #{validationAmount,jdbcType=DECIMAL}, #{identityType,jdbcType=INTEGER}, #{locationProvince,jdbcType=INTEGER}, 
-      #{locationCity,jdbcType=INTEGER}, #{locationArea,jdbcType=INTEGER}, #{legalPerson,jdbcType=VARCHAR}, 
-      #{legalPersonIdCard,jdbcType=VARCHAR}, #{lastYearTaxReportUrl,jdbcType=VARCHAR}, 
-      #{auditStatus,jdbcType=INTEGER}, #{process,jdbcType=INTEGER}, #{wrongCount,jdbcType=INTEGER}, 
-      #{paymentDate,jdbcType=TIMESTAMP}, #{listed,jdbcType=INTEGER}, #{listedDate,jdbcType=TIMESTAMP}, 
-      #{listedType,jdbcType=INTEGER}, #{stockCode,jdbcType=VARCHAR}, #{certificateNumber,jdbcType=VARCHAR}, 
-      #{issuingDate,jdbcType=TIMESTAMP}, #{cogContacts,jdbcType=INTEGER}, #{techPrincipal,jdbcType=VARCHAR}, 
-      #{contactsFixedTel,jdbcType=VARCHAR}, #{contactsFax,jdbcType=VARCHAR}, #{legalPersonTel,jdbcType=VARCHAR}, 
-      #{legalPersonFax,jdbcType=VARCHAR}, #{legalPersonEmail,jdbcType=VARCHAR}, #{registrationTime,jdbcType=TIMESTAMP}, 
-      #{ratepayCode,jdbcType=VARCHAR}, #{industry,jdbcType=INTEGER}, #{enterpriseScale,jdbcType=VARCHAR}, 
-      #{registerType,jdbcType=VARCHAR}, #{foreignInvestment,jdbcType=VARCHAR}, #{field,jdbcType=VARCHAR}, 
-      #{taxAuthority,jdbcType=INTEGER}, #{ratepayMethod,jdbcType=INTEGER}, #{highTechZone,jdbcType=INTEGER}, 
-      #{riskInvestment,jdbcType=INTEGER}, #{businessScope,jdbcType=VARCHAR}, #{highTechName,jdbcType=VARCHAR}, 
-      #{patentProryStatementUrl,jdbcType=VARCHAR}, #{international,jdbcType=INTEGER}, 
-      #{reviewInstructions,jdbcType=VARCHAR}, #{investment,jdbcType=INTEGER}, #{yearSalesAmount,jdbcType=DECIMAL}, 
-      #{lastYearResearchAmount,jdbcType=DECIMAL}, #{assets,jdbcType=DECIMAL}, #{qualification,jdbcType=VARCHAR}, 
-      #{cooperationSituation,jdbcType=VARCHAR}, #{honorPicture,jdbcType=VARCHAR}, #{salesTarget,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR},
+      #{contactMobile,jdbcType=VARCHAR}, #{fixedTel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR},
+      #{postalAddress,jdbcType=VARCHAR}, #{postcode,jdbcType=VARCHAR}, #{unitName,jdbcType=VARCHAR},
+      #{registeredCapital,jdbcType=DECIMAL}, #{licenceNumber,jdbcType=VARCHAR}, #{licenceProvince,jdbcType=INTEGER},
+      #{licenceCity,jdbcType=INTEGER}, #{licenceArea,jdbcType=INTEGER}, #{licenceScanningUrl,jdbcType=VARCHAR},
+      #{orgCode,jdbcType=VARCHAR}, #{orgCodeUrl,jdbcType=VARCHAR}, #{bankAccount,jdbcType=VARCHAR},
+      #{banks,jdbcType=VARCHAR}, #{bankBranch,jdbcType=VARCHAR}, #{bankCardNumber,jdbcType=VARCHAR},
+      #{validationAmount,jdbcType=DECIMAL}, #{identityType,jdbcType=INTEGER}, #{locationProvince,jdbcType=INTEGER},
+      #{locationCity,jdbcType=INTEGER}, #{locationArea,jdbcType=INTEGER}, #{legalPerson,jdbcType=VARCHAR},
+      #{legalPersonIdCard,jdbcType=VARCHAR}, #{lastYearTaxReportUrl,jdbcType=VARCHAR},
+      #{auditStatus,jdbcType=INTEGER}, #{process,jdbcType=INTEGER}, #{wrongCount,jdbcType=INTEGER},
+      #{paymentDate,jdbcType=TIMESTAMP}, #{listed,jdbcType=INTEGER}, #{listedDate,jdbcType=TIMESTAMP},
+      #{listedType,jdbcType=INTEGER}, #{stockCode,jdbcType=VARCHAR}, #{certificateNumber,jdbcType=VARCHAR},
+      #{issuingDate,jdbcType=TIMESTAMP}, #{cogContacts,jdbcType=INTEGER}, #{techPrincipal,jdbcType=VARCHAR},
+      #{contactsFixedTel,jdbcType=VARCHAR}, #{contactsFax,jdbcType=VARCHAR}, #{legalPersonTel,jdbcType=VARCHAR},
+      #{legalPersonFax,jdbcType=VARCHAR}, #{legalPersonEmail,jdbcType=VARCHAR}, #{registrationTime,jdbcType=TIMESTAMP},
+      #{ratepayCode,jdbcType=VARCHAR}, #{industry,jdbcType=INTEGER}, #{enterpriseScale,jdbcType=VARCHAR},
+      #{registerType,jdbcType=VARCHAR}, #{foreignInvestment,jdbcType=VARCHAR}, #{field,jdbcType=VARCHAR},
+      #{taxAuthority,jdbcType=INTEGER}, #{ratepayMethod,jdbcType=INTEGER}, #{highTechZone,jdbcType=INTEGER},
+      #{riskInvestment,jdbcType=INTEGER}, #{businessScope,jdbcType=VARCHAR}, #{highTechName,jdbcType=VARCHAR},
+      #{patentProryStatementUrl,jdbcType=VARCHAR}, #{international,jdbcType=INTEGER},
+      #{reviewInstructions,jdbcType=VARCHAR}, #{investment,jdbcType=INTEGER}, #{yearSalesAmount,jdbcType=DECIMAL},
+      #{lastYearResearchAmount,jdbcType=DECIMAL}, #{assets,jdbcType=DECIMAL}, #{qualification,jdbcType=VARCHAR},
+      #{cooperationSituation,jdbcType=VARCHAR}, #{honorPicture,jdbcType=VARCHAR}, #{salesTarget,jdbcType=VARCHAR},
       #{intendedProject,jdbcType=VARCHAR}, #{contactsDep,jdbcType=VARCHAR}, #{contactsPosition,jdbcType=VARCHAR}
       )
   </insert>
@@ -1116,7 +1116,8 @@
 			</if>
   </select>
 
-  <update id="updateServiceByUid" parameterType="com.goafanti.common.model.OrganizationIdentity">
+
+    <update id="updateServiceByUid" parameterType="com.goafanti.common.model.OrganizationIdentity">
 
     update organization_identity
     <set>
@@ -1345,4 +1346,13 @@
       #{item.contactMobile,jdbcType=VARCHAR}, #{item.province,jdbcType=TIMESTAMP}, #{item.city,jdbcType=TIMESTAMP})
     </foreach>
   </insert>
-</mapper>
+
+  <select id="selectByOrgCode" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from organization_identity
+    where org_code = #{orgCode}
+  </select>
+
+</mapper>
+

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

@@ -1418,7 +1418,7 @@
 
   <select id="selectPrivateOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
     select a.id uid,a.aid,a.nickname name,a.society_tag societyTag,a.`level`,b.name aName,dg1.name as province,dg2.name as city,
-    a.guidance, dg3.name as area,d.intended_project  intendedProject,d.business_scope businessScope,
+    a.guidance, dg3.name as area,d.intended_project  intendedProject,d.business_scope businessScope,d.org_code orgCode,
     date_format(um.last_sign_time,'%Y-%m-%d %H:%i:%S') lastSignTime,
     date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
     date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,

+ 46 - 39
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -337,7 +337,8 @@
 			a.share_type as shareType,
 			a.channel ,
 			a.information_maintainer as mid,
-	 		a.new_channel as newChannel
+	 		a.new_channel as newChannel,
+			b.org_code orgCode
 		from  `user` a
 		left join user_names un on a.id=un.uid
 		left join organization_identity b on a.id = b.uid
@@ -347,44 +348,46 @@
 		left join admin d on a.aid = d.id
 		where a.type = 1 and a.status =0 and a.source in (1,2,3)
 	<if test="role == 0">
-		and un.name
-		<if test="names == null">
-			is null
-		</if>
 		<if test="names !=null">
-		in <foreach close=")" collection="names" item="name" open="(" separator=",">
+			and un.name in
+		<foreach close=")" collection="names" item="name" open="(" separator=",">
 			#{name}
 		</foreach>
 		</if>
-
+		<if test="names ==null and orgCode==null">
+			is null
+		</if>
 	</if>
-		<if test="role == 1 and name != null">
+	<if test="role == 1 and name != null">
 		and un.name like concat('%', #{name},'%')
 	</if>
-		<if test="aid != null and aid !=''">
-			and a.aid = #{aid,jdbcType=VARCHAR}
-		</if>
-		<if test="departmentId != null and departmentId !=''">
-			and d.department_id=#{departmentId,jdbcType=VARCHAR}
-		</if>
-		<if test="startDate != null and startDate != ''">
-			and a.transfer_time &gt; #{startDate}
-		</if>
-		<if test="endDate != null and endDate != ''">
-			and a.transfer_time &lt; #{endDate}
-		</if>
-		<if test="province != null">
-			and b.location_province = #{province,jdbcType=INTEGER}
-		</if>
-		<if test="city != null">
-			and b.location_city = #{city,jdbcType=INTEGER}
-		</if>
-		<if test="area != null">
-			and b.location_area = #{area,jdbcType=INTEGER}
-		</if>
-		<if test="page_sql != null">
-    		${page_sql}
-   		</if>
+	<if test="aid != null and aid !=''">
+		and a.aid = #{aid,jdbcType=VARCHAR}
+	</if>
+	<if test="departmentId != null and departmentId !=''">
+		and d.department_id=#{departmentId,jdbcType=VARCHAR}
+	</if>
+	<if test="startDate != null and startDate != ''">
+		and a.transfer_time &gt; #{startDate}
+	</if>
+	<if test="endDate != null and endDate != ''">
+		and a.transfer_time &lt; #{endDate}
+	</if>
+	<if test="province != null">
+		and b.location_province = #{province,jdbcType=INTEGER}
+	</if>
+	<if test="city != null">
+		and b.location_city = #{city,jdbcType=INTEGER}
+	</if>
+	<if test="area != null">
+		and b.location_area = #{area,jdbcType=INTEGER}
+	</if>
+	<if test="orgCode != null">
+		and b.org_code = #{orgCode}
+	</if>
+	<if test="page_sql != null">
+		${page_sql}
+	</if>
 	</select>
 	<!--因为查询到所有曾用名,所以在统计时需要用客户编号来归并-->
 	<select id="selectOrganizationCustomerCount" resultType="java.lang.Integer">
@@ -400,14 +403,14 @@
 		</if>
 		where a.type = 1 and a.status =0 and a.source in (1,2,3)
 		<if test="role == 0">
-			and un.name
-			<if test="names == null">
-				is null
-			</if>
 			<if test="names !=null">
-				in <foreach close=")" collection="names" item="name" open="(" separator=",">
-				#{name}
-			</foreach>
+				and un.name in
+				<foreach close=")" collection="names" item="name" open="(" separator=",">
+					#{name}
+				</foreach>
+			</if>
+			<if test="names ==null and orgCode==null">
+				is null
 			</if>
 		</if>
 	<if test="role == 1 and name != null">
@@ -431,6 +434,9 @@
 		<if test="area != null">
 			and b.location_area = #{area,jdbcType=INTEGER}
 		</if>
+		<if test="orgCode != null">
+			and b.org_code = #{orgCode}
+		</if>
 		group by a.id)x
 	</select>
 
@@ -526,6 +532,7 @@
 			a.channel,
 			b.intended_project  intendedProject,
 			b.business_scope businessScope,
+			b.org_code orgCode,
 			d.name as adminName
 		from user a
 		left join organization_identity b on a.id = b.uid

+ 10 - 4
src/main/java/com/goafanti/common/utils/StringUtils.java

@@ -5,17 +5,18 @@ import java.util.regex.Pattern;
 public class StringUtils extends org.apache.commons.lang3.StringUtils {
 	private static Pattern FRACTIONAL_NUMERIC = Pattern.compile("^[\\-+]?\\d+(\\.\\d+)?$");
 
+	private static Pattern CHINESE_CODE=Pattern.compile("[\u4e00-\u9fa5]");
 	public static boolean isFractionalNumeric(String val) {
 		return FRACTIONAL_NUMERIC.matcher(val).matches();
 	}
-	
+
 	public static boolean isNull(Object value) {
 		return value == null;
 	}
 
 	/**
 	 * * 判断一个对象是否非空
-	 * 
+	 *
 	 * @param object Object
 	 * @return true:非空 false:空
 	 */
@@ -27,7 +28,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
 
 	/**
 	 * * 判断一个对象数组是否为空
-	 * 
+	 *
 	 * @param objects 要判断的对象数组
 	 ** @return true:为空 false:非空
 	 */
@@ -35,5 +36,10 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
 		return isNull(objects) || (objects.length == 0);
 	}
 
-	
+	public static boolean isContainChinese(String str){
+		if (CHINESE_CODE.matcher(str).find()){
+			return true;
+		}
+		return false;
+	}
 }

+ 13 - 0
src/main/java/com/goafanti/customer/bo/CustomerListIn.java

@@ -74,6 +74,19 @@ public class CustomerListIn {
 
 	private String intendedProject;
 
+	/**
+	 * 企业信用代码
+	 */
+	private String orgCode;
+
+	public String getOrgCode() {
+		return orgCode;
+	}
+
+	public void setOrgCode(String orgCode) {
+		this.orgCode = orgCode;
+	}
+
 	public String getIntendedProject() {
 		return intendedProject;
 	}

+ 9 - 1
src/main/java/com/goafanti/customer/bo/InputAddCustomer.java

@@ -24,7 +24,7 @@ public class InputAddCustomer {
     private Integer area;
     private Integer source;
     private String societyTag;
-
+    private String orgCode;
     private String position;
     private Integer industry;
     private String businessScope;
@@ -50,6 +50,14 @@ public class InputAddCustomer {
     private Integer   channelType;
 
 
+    public String getOrgCode() {
+        return orgCode;
+    }
+
+    public void setOrgCode(String orgCode) {
+        this.orgCode = orgCode;
+    }
+
     public Integer getNewChannel() {
         return newChannel;
     }

+ 18 - 7
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.goafanti.common.utils.*;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.*;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Value;
@@ -229,6 +230,10 @@ public class AdminCustomerApiController extends BaseApiController{
 	@RequestMapping(value = "/listAllOrganizationCustomer" , method = RequestMethod.POST)
 	public Result listAllOrganizationCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
 		Result res = new Result();
+		if (StringUtils.isBlank(cli.getName())){
+			res.setData( new Pagination<>());
+			return res;
+		}
 		res.setData(customerService.listAllOrganizationCustomer(cli, pageNo, pageSize));
 		return res;
 	}
@@ -316,7 +321,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		Result res = new Result();
 		if(StringUtils.isBlank(in.getName()) || StringUtils.isBlank(in.getContacts())
 				|| StringUtils.isBlank(in.getContactMobile()) ||null==in.getProvince()||null==in.getCity()||null==in.getArea()
-				|| StringUtils.isBlank(in.getBusinessScope())
+				|| StringUtils.isBlank(in.getBusinessScope())||null==in.getOrgCode()
 				|| StringUtils.isBlank(in.getIntendedProject())){
 			res.getError().add(buildError("","创建客户参数不全"));
 			return res;
@@ -325,6 +330,10 @@ public class AdminCustomerApiController extends BaseApiController{
 			res.getError().add(buildError("","私有客户已达最大限制"));
 			return res;
 		}
+		if (customerService.checkOrgCode(in.getOrgCode())){
+			res.getError().add(buildError("","统一信用代码已存在"));
+			return res;
+		}
 		//新增为私有客户
 		in.setShareType(0);
 		//将新增客户的空格去除
@@ -1477,10 +1486,15 @@ public class AdminCustomerApiController extends BaseApiController{
 	/** 修改客户关键资料 **/
 	@RequestMapping(value = "/updateUserDate", method = RequestMethod.POST)
 	public Result updateUserDate(String uid,Integer province,Integer city,Integer area,String businessScope,String intendedProject,String introduction
-	,Integer channelType){
+	,Integer channelType,String orgCode){
 		Result res = new Result();
-
-		res.data(customerService.updateUserDate(uid, province, city, area, businessScope, intendedProject,introduction,channelType));
+		if (orgCode!=null){
+			if (customerService.checkOrgCode(orgCode)){
+				res.getError().add(buildError("","统一信用代码已存在"));
+				return res;
+			}
+		}
+		res.data(customerService.updateUserDate(uid, province, city, area, businessScope, intendedProject,introduction,channelType,orgCode));
 		return res;
 	}
 
@@ -1538,6 +1552,3 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 }
-
-
-

+ 4 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -537,7 +537,8 @@ public interface CustomerService {
 
 	boolean checkData(String uid, String aid);
 
-    int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,String introduction,Integer channelType);
+    int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,
+					   String introduction,Integer channelType,String orgCode);
 
 	Pagination<OutChannelListBo> channelUserList(InputChannelListBo in);
 
@@ -551,4 +552,6 @@ public interface CustomerService {
 	Integer receiveEveryDay(String uid);
 
     int pushReceiveAsChannel(String uid);
+
+    boolean checkOrgCode(String orgCode);
 }

+ 29 - 7
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -216,17 +216,29 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
 		Map<String, Object> params = disposeParams(cli);
+		String name=null;
+		String orgCode=null;
+		if (StringUtils.isContainChinese(cli.getName())){
+			name= cli.getName();
+		}else {
+			orgCode= cli.getName();
+		}
 		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)) {
 			params.put("role", 1);
-			params.put("name", cli.getName());
+			if (name!=null)params.put("name",name);
+			else params.put("orgCode",orgCode);
 		} else {
 			//处理为空报错
 			params.put("role", 0);
-			String [] names =pushNames(cli.getName());
-			if (names.length>0){
-				params.put("names", names);
+			if (orgCode!=null) {
+				params.put("orgCode",orgCode);
 			}else {
-				return new Pagination<>();
+				String [] names =pushNames(name);
+				if (names.length>0){
+					params.put("names", names);
+				}else {
+					return new Pagination<>();
+				}
 			}
 		}
 		Pagination<CustomerListOut> p = (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList",
@@ -382,6 +394,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			oi.setUnitName(in.getName());
 			oi.setId(identifyId);
 			oi.setUid(uid);
+			oi.setOrgCode(in.getOrgCode());
 			oi.setContacts(in.getContacts());
 			oi.setContactMobile(in.getContactMobile());
 			oi.setContactsPosition(in.getPosition());
@@ -1308,6 +1321,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return userMapper.updateByPrimaryKeySelective(u);
 	}
 
+	@Override
+	public boolean checkOrgCode(String orgCode) {
+		OrganizationIdentity organizationIdentity = organizationIdentityMapper.selectByOrgCode(orgCode);
+		if (organizationIdentity!=null)return true;
+		return false;
+	}
+
 
 	/**
 	 * 处理中间表
@@ -2485,13 +2505,15 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 	@Override
-	public int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,String introduction,Integer channelType) {
+	public int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,
+							  String introduction,Integer channelType,String orgCode) {
 		OrganizationIdentity oi =new OrganizationIdentity();
 		oi.setUid(uid);
-		if (province!=null ||city !=null ||area!=null|| businessScope!=null ||intendedProject!=null){
+		if (province!=null ||city !=null ||area!=null|| businessScope!=null ||intendedProject!=null||orgCode!=null){
 			if(province!=null)oi.setLocationProvince(province);
 			if(city!=null)oi.setLocationCity(city);
 			if(area!=null)oi.setLocationArea(area);
+			if (orgCode!=null)oi.setOrgCode(orgCode);
 			if (businessScope!=null){
 				OrganizationIdentity use=organizationIdentityMapper.selectOrgIdentityByUserId(uid);
 				updateBusinessScope(uid,businessScope,use.getBusinessScope(),new Date());

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -50,7 +50,7 @@ yxy_max=100
 yxjl_max=100
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.44
+static.host=//static.jishutao.com/1.2.45
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.27
 #static.host=http://172.16.1.187/prod/1.2.25

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -47,7 +47,7 @@ yxzj_max=800
 yxy_max=100
 yxjl_max=100
 
-static.host=//static.jishutao.com/1.2.44
+static.host=//static.jishutao.com/1.2.45
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload