parent
d06cb3afa6
commit
b6bb133f19
@ -0,0 +1,273 @@
|
||||
<div class="content">
|
||||
<form novalidate name="subForm">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Apply Wechat Sub Merchant Id</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.merchant_name.$invalid && subForm.merchant_name.$dirty}">
|
||||
<label class="control-label col-sm-3" for="merchant_name_input">* Merchant Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.company_name"
|
||||
type="text" name="merchant_name" id="merchant_name_input" required maxlength="50">
|
||||
<div ng-messages="subForm.merchant_name.$error" ng-if="subForm.merchant_name.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.merchant_id.$invalid && subForm.merchant_id.$dirty}">
|
||||
<label class="control-label col-sm-3" for="business_category_input">* Merchant ID</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="merchant_id"
|
||||
ng-model="subMerchantInfo.merchant_id"
|
||||
id="merchant_id_input" required
|
||||
ng-options="merchant_id.merchant_id as merchant_id.merchant_id for merchant_id in merchantIds">
|
||||
<option value="">Please Choose</option>
|
||||
</select>
|
||||
<div ng-messages="subForm.merchant_id.$error" ng-if="subForm.merchant_id.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-messages="subForm.business_category.$error" ng-if="subForm.business_category.$dirty">
|
||||
<p class="small text-danger" ng-message="maxLength">More than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.merchant_storename.$invalid && subForm.merchant_storename.$dirty}">
|
||||
<label class="control-label col-sm-3" for="merchant_storename_input">* Merchant Store Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.store_name"
|
||||
type="text" name="merchant_storename" id="merchant_storename_input" required maxlength="50">
|
||||
<div ng-messages="subForm.merchant_storename.$error" ng-if="subForm.merchant_storename.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.business_category.$invalid && subForm.business_category.$dirty}">
|
||||
<label class="control-label col-sm-3" for="business_category_input">* Business Category</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="business_category"
|
||||
ng-model="subMerchantInfo.industry"
|
||||
id="business_category_input" required
|
||||
ng-options="industry.value as industry.label for industry in wxIndustries">
|
||||
<option value="">Please Choose</option>
|
||||
</select>
|
||||
<div ng-messages="subForm.business_category.$error" ng-if="subForm.business_category.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-messages="subForm.business_category.$error" ng-if="subForm.business_category.$dirty">
|
||||
<p class="small text-danger" ng-message="maxLength">More than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.company_website.$invalid && subForm.company_website.$dirty}">
|
||||
<label class="control-label col-sm-3" for="website_input">* Website</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.company_website"
|
||||
type="url" name="website" id="website_input" required maxlength="128">
|
||||
<div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.office_phone.$invalid && subForm.office_phone.$dirty}">
|
||||
<label class="control-label col-sm-3" for="office_phone_input">* Office Phone</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.company_phone"
|
||||
type="tel" name="office_phone" id="office_phone_input" required>
|
||||
<div ng-messages="subForm.office_phone.$error" ng-if="subForm.office_phone.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.contact_name.$invalid && subForm.contact_person.$dirty}">
|
||||
<label class="control-label col-sm-3" for="contact_name_input">* Contact Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.contact_person"
|
||||
type="text" name="contact_name" id="contact_name_input" required maxlength="32">
|
||||
<div ng-messages="subForm.contact_name.$error" ng-if="subForm.contact_name.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 32</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.contact_phone.$invalid && subForm.contact_phone.$dirty}">
|
||||
<label class="control-label col-sm-3" for="contact_phone_input">* Contact Phone</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.contact_phone"
|
||||
type="text" name="contact_phone" id="contact_phone_input" required maxlength="16">
|
||||
<div ng-messages="subForm.contact_phone.$error" ng-if="subForm.contact_phone.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 16</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.contact_email.$invalid && subForm.contact_email.$dirty}">
|
||||
<label class="control-label col-sm-3" for="contact_email_input">* Contact Email</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.contact_email"
|
||||
type="text" name="contact_email" id="contact_email_input" required maxlength="128">
|
||||
<div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- mcc code -->
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.mcc_code.$invalid && subForm.mcc_code.$dirty}">
|
||||
<label class="control-label col-sm-3" for="mcc_code_input">* Mcc Code</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="mcc_code"
|
||||
ng-model="subMerchantInfo.mcc_code"
|
||||
id="mcc_code_input" required
|
||||
ng-options="mccCode.value as mccCode.label for mccCode in wechatMccIndustries">
|
||||
<option value="">Please Choose</option>
|
||||
</select>
|
||||
<div ng-messages="subForm.mcc_code.$error" ng-if="subForm.mcc_code.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-messages="subForm.mcc_code.$error" ng-if="subForm.mcc_code.$dirty">
|
||||
<p class="small text-danger" ng-message="maxLength">More than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- store address 店铺地址 -->
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.address.$invalid && subForm.address.$dirty}">
|
||||
<label class="control-label col-sm-3" for="address_input">* Store Address</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.address"
|
||||
type="text" name="address" id="address_input" required maxlength="128">
|
||||
<div ng-messages="subForm.address.$error" ng-if="subForm.address.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 公司注册号 -->
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.company_register_no.$invalid && subForm.company_register_no.$dirty}">
|
||||
<label class="control-label col-sm-3" for="company_register_no_input">* Company registration document No</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.company_register_no"
|
||||
type="text" name="company_register_no" id="company_register_no_input" required maxlength="50">
|
||||
<div ng-messages="subForm.company_register_no.$error" ng-if="subForm.company_register_no.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 公司注册日期 -->
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.company_register_date.$invalid && subForm.company_register_date.$dirty}">
|
||||
<label class="control-label col-sm-3" for="company_register_date_input">* Company registration Date</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.company_register_date" required maxlength="50"
|
||||
type="text" name="company_register_date" id="company_register_date_input">
|
||||
<div ng-messages="subForm.company_register_date.$error" ng-if="subForm.company_register_date.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- director name 法人姓名 -->
|
||||
<div class="form-group" ng-if="subMerchantInfo.business_structure == 'Company'"
|
||||
ng-class="{'has-error':subForm.representative_person.$invalid && subForm.representative_person.$dirty}">
|
||||
<label class="control-label col-sm-3" for="representative_person_input">* Director Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.representative_person" required maxlength="128"
|
||||
type="text" name="representative_person" id="representative_person_input">
|
||||
<div ng-messages="subForm.representative_person.$error" ng-if="subForm.representative_person.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- director id number 法人身份证号-->
|
||||
<div class="form-group" ng-if="subMerchantInfo.business_structure == 'Company'"
|
||||
ng-class="{'has-error':subForm.representative_person_id_number.$invalid && subForm.representative_person_id_number.$dirty}">
|
||||
<label class="control-label col-sm-3" for="representative_person_id_number_input">* Director Id</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.representative_person_id_number" required maxlength="128"
|
||||
type="text" name="representative_person_id_number" id="representative_person_id_number_input">
|
||||
<div ng-messages="subForm.representative_person_id_number.$error" ng-if="subForm.representative_person_id_number.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- principal name 负责人姓名 -->
|
||||
<div class="form-group" ng-if="subMerchantInfo.business_structure != 'Company'"
|
||||
ng-class="{'has-error':subForm.marketing_person.$invalid && subForm.marketing_person.$dirty}">
|
||||
<label class="control-label col-sm-3" for="marketing_person_input">* Principal Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.marketing_person" required maxlength="128"
|
||||
type="text" name="marketing_person" id="marketing_person_input">
|
||||
<div ng-messages="subForm.marketing_person.$error" ng-if="subForm.marketing_person.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- principal id number 负责人身份证号 -->
|
||||
<div class="form-group" ng-if="subMerchantInfo.business_structure != 'Company'"
|
||||
ng-class="{'has-error':subForm.marketing_person_id_number.$invalid && subForm.marketing_person_id_number.$dirty}">
|
||||
<label class="control-label col-sm-3" for="marketing_person_id_number_input">* Marketing Person Id</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="subMerchantInfo.marketing_person_id_number" required maxlength="128"
|
||||
type="text" name="marketing_person_id_number" id="marketing_person_id_number_input">
|
||||
<div ng-messages="subForm.marketing_person_id_number.$error" ng-if="subForm.marketing_person_id_number.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end 商品基本资料-->
|
||||
<!--<div class="panel panel-default">-->
|
||||
<!--<div class="panel-heading">Goods Qr Code</div>-->
|
||||
<!--<div class="panel-body">-->
|
||||
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<!--end 商品二维码-->
|
||||
<div class="btn-group margin-bottom margin-top">
|
||||
<button class="btn btn-success" type="button"
|
||||
ng-click="saveAppliy(subForm)">Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -0,0 +1,122 @@
|
||||
package au.com.royalpay.payment.manage.alipayregisty;
|
||||
|
||||
import au.com.royalpay.payment.channels.alipay.config.AlipayConfig;
|
||||
import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment;
|
||||
import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient;
|
||||
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dom4j.Element;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootTest
|
||||
@RunWith(SpringRunner.class)
|
||||
public class AlipayOnlineRegistryTest {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Resource
|
||||
private ClientMapper clientMapper;
|
||||
@Resource
|
||||
private AlipayClient alipayClient;
|
||||
int applyNum = 0;
|
||||
/**
|
||||
* 查询缺失字段
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void findMissingFields() {
|
||||
///获取近半年有效交易的商户
|
||||
Date to = new Date();
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
calendar1.add(Calendar.MONTH, -6);
|
||||
calendar1.set(Calendar.DAY_OF_MONTH,1);
|
||||
Date from = calendar1.getTime();
|
||||
// List<JSONObject> clients = clientMapper.halfYearHaveTransactionClients(from,to);
|
||||
|
||||
List<String> clients = new ArrayList<>();
|
||||
clients.add("PLPR");
|
||||
clients.add("MZZI");
|
||||
clients.add("AGSH");
|
||||
clients.add("AGBC");
|
||||
clients.add("ISKI");
|
||||
clients.add("BTGL");
|
||||
clients.add("BTVL");
|
||||
clients.add("HJCO");
|
||||
clients.add("BAOC");
|
||||
clients.add("WANR");
|
||||
clients.add("XSPL");
|
||||
clients.add("H20C");
|
||||
clients.add("SDCN");
|
||||
List<JSONObject> result = new ArrayList<>();
|
||||
List<JSONObject> errorClients = new ArrayList<>();
|
||||
|
||||
clients.forEach(client->{
|
||||
JSONObject clientInfo = clientMapper.findClientByMonikerAll(client);
|
||||
try {
|
||||
Element resultElement = alipayClient.queryOnlineGmsPortalStatus("2088821643021586", clientInfo);
|
||||
if (StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
|
||||
Element responseElement = resultElement.element("response");
|
||||
Element element1 = responseElement.element("alipay");
|
||||
// if (!StringUtils.equalsIgnoreCase("SUCCESS", element1.elementText("status"))) {
|
||||
// return;
|
||||
// }
|
||||
Element registerAddress = element1.element("register_address");
|
||||
Element registrationNo = element1.element("registration_no");
|
||||
|
||||
if (registerAddress != null && registrationNo != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((clientInfo.containsKey("acn") || clientInfo.containsKey("abn"))
|
||||
&& clientInfo.containsKey("country")
|
||||
&& clientInfo.containsKey("state")
|
||||
&& clientInfo.containsKey("suburb")
|
||||
&& clientInfo.containsKey("address")) {
|
||||
//重新进件
|
||||
Element applyResponse = alipayClient.registerOnlineGmsPortal("2088821643021586", clientInfo);
|
||||
if(!StringUtils.equalsIgnoreCase("SUCCESS", applyResponse.element("is_success").getText())){
|
||||
logger.info("商户:"+clientInfo.getString("client_moniker")+",进件失败,失败原因:" + applyResponse.element("error").getText());
|
||||
clientInfo.put("error_message",applyResponse.elementText("result_code") +
|
||||
":" + responseElement.elementText("reject_reason"));
|
||||
errorClients.add(clientInfo);
|
||||
}else{
|
||||
logger.info("商户:"+clientInfo.getString("client_moniker")+",重新进件");
|
||||
|
||||
}
|
||||
} else {
|
||||
//打印缺失信息商户编码、所属BD
|
||||
result.add(clientInfo);
|
||||
}
|
||||
} else {
|
||||
System.out.println("非Alipay Online商户");
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
});
|
||||
logger.info("重新进件商户为 "+applyNum+" 个");
|
||||
logger.info("进见调用异常商户:"+errorClients.size());
|
||||
logger.info("以下为数据缺失商户需BD补充 :");
|
||||
result.forEach(client->{
|
||||
String registrationNo = client.containsKey("acn") ? client.getString("acn"): (client.containsKey("abn") ? client.getString("abn") : "缺失");
|
||||
logger.info("商户编码===>"+client.getString("client_moniker") +
|
||||
" , registration_no===>" + registrationNo +
|
||||
" , register_address===>" + (client.containsKey("country") ? (client.getString("country") + " " + client.getString("state") + " " + client.getString("suburb") + " " + client.getString("address")) : "缺失" )+
|
||||
" , bd===>"+(client.containsKey("bd_user_name") ? client.getString("bd_user_name") : "-"));
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in new issue