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

新增统一信用代码添加

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

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

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

+ 5 - 1
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -316,7 +316,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 +325,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);
 		//将新增客户的空格去除

+ 2 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -551,4 +551,6 @@ public interface CustomerService {
 	Integer receiveEveryDay(String uid);
 
     int pushReceiveAsChannel(String uid);
+
+    boolean checkOrgCode(String orgCode);
 }

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

@@ -1308,6 +1308,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;
+	}
+
 
 	/**
 	 * 处理中间表