master
wangning 7 years ago
commit 522857d479

@ -0,0 +1,25 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Param;
import javax.validation.constraints.Max;
import java.util.List;
/**
* Created by yixian on 2017-03-14.
*/
@AutoMapper(tablename = "sys_wx_merchant_apply",pkName = "merchant_app_id")
public interface SysWxMerchantApplyMapper {
@AutoSql(type = SqlType.SELECT)
List<JSONObject> listWxMerchantApplices(@Param("client_id") int client_id, PageBounds pageBounds);
@AutoSql(type = SqlType.INSERT)
void insertWxMerchantApply(JSONObject params);
}

@ -0,0 +1,174 @@
package au.com.royalpay.payment.manage.merchants.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* Created by yuan on 2018/1/19.
*/
public class SubMerchantIdApply {
@NotBlank(message = "error.payment.valid.param_missing")
@Length(max = 50)
@JSONField(name = "company_name")
private String merchant_name;
@NotBlank(message = "error.payment.valid.param_missing")
@Length(max = 10)
@JSONField(name = "merchant_id")
private String merchant_id;
@NotBlank(message = "error.payment.valid.param_missing")
@Length(max = 20)
@JSONField(name = "short_name")
private String merchant_shortname;
@NotBlank(message = "error.payment.valid.param_missing")
@Length(max = 20)
@JSONField(name = "company_phone")
private String office_phone;
@JSONField(name = "contact_person")
private String contact_name;
private String contact_phone;
private String contact_email;
@NotBlank(message = "error.payment.valid.param_missing")
@JSONField(name = "industry")
private String business_category;
@NotBlank(message = "error.payment.valid.param_missing")
@Length(max = 20)
@JSONField(name = "remark")
private String merchant_remark;
@JSONField(name = "company_website")
private String website;
@NotBlank(message = "error.payment.valid.param_missing")
@Length(min = 10, max = 256)
@JSONField(name = "description")
private String merchant_introduction;
public JSONObject insertObject() {
JSONObject params = new JSONObject();
if(StringUtils.isNotEmpty(merchant_name)){
params.put("merchant_name",merchant_name);
}
if(StringUtils.isNotEmpty(merchant_shortname)){
params.put("merchant_shortname",merchant_shortname);
}
if(StringUtils.isNotEmpty(office_phone)){
params.put("office_phone",office_phone);
}
if(StringUtils.isNotEmpty(contact_name)){
params.put("contact_name",contact_name);
}
if(StringUtils.isNotEmpty(contact_phone)){
params.put("contact_phone",contact_phone);
}
if(StringUtils.isNotEmpty(contact_email)){
params.put("contact_email",contact_email);
}
if(StringUtils.isNotEmpty(business_category)){
params.put("business_category",business_category);
}
if(StringUtils.isNotEmpty(merchant_remark)){
params.put("merchant_remark",merchant_remark);
}
if(StringUtils.isNotEmpty(website)){
params.put("website",website);
}
if(StringUtils.isNotEmpty(merchant_introduction)){
params.put("merchant_introduction",merchant_introduction);
}
return params;
}
public SubMerchantIdApply() {
}
public String getMerchant_name() {
return this.merchant_name;
}
public String getMerchant_id() {
return merchant_id;
}
public void setMerchant_id(String merchant_id) {
this.merchant_id = merchant_id;
}
public void setMerchant_name(String merchant_name) {
this.merchant_name = merchant_name;
}
public String getMerchant_shortname() {
return this.merchant_shortname;
}
public void setMerchant_shortname(String merchant_shortname) {
this.merchant_shortname = merchant_shortname;
}
public String getOffice_phone() {
return this.office_phone;
}
public void setOffice_phone(String office_phone) {
this.office_phone = office_phone;
}
public String getContact_name() {
return this.contact_name;
}
public void setContact_name(String contact_name) {
this.contact_name = contact_name;
}
public String getContact_phone() {
return this.contact_phone;
}
public void setContact_phone(String contact_phone) {
this.contact_phone = contact_phone;
}
public String getContact_email() {
return this.contact_email;
}
public void setContact_email(String contact_email) {
this.contact_email = contact_email;
}
public String getBusiness_category() {
return this.business_category;
}
public void setBusiness_category(String business_category) {
this.business_category = business_category;
}
public String getMerchant_remark() {
return this.merchant_remark;
}
public void setMerchant_remark(String merchant_remark) {
this.merchant_remark = merchant_remark;
}
public String getMerchant_introduction() {
return this.merchant_introduction;
}
public void setMerchant_introduction(String merchant_introduction) {
this.merchant_introduction = merchant_introduction;
}
public String getWebsite() {
return this.website;
}
public void setWebsite(String website) {
this.website = website;
}
}

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.merchants.core; package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo;
import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.merchants.beans.*; import au.com.royalpay.payment.manage.merchants.beans.*;
@ -264,4 +265,12 @@ public interface ClientManager {
void validRefundPwd(JSONObject account, String pwd); void validRefundPwd(JSONObject account, String pwd);
void setWeekendDelay(int clientId, boolean delay); void setWeekendDelay(int clientId, boolean delay);
List<JSONObject> listSubMerchantIdApplys(JSONObject manager, String clientMoniker);
String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager);
List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager);
void clearCacheSubMerchantIdApplices(String clientMoniker);
} }

@ -1,7 +1,10 @@
package au.com.royalpay.payment.manage.merchants.core.impls; package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig;
import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment;
import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi;
import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient;
import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo;
import au.com.royalpay.payment.core.PaymentChannelApi; import au.com.royalpay.payment.core.PaymentChannelApi;
import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
@ -54,6 +57,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.dom4j.Element;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -135,6 +139,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private MpPaymentApi mpPaymentApi; private MpPaymentApi mpPaymentApi;
@Resource @Resource
private SignInAccountService signInAccountService; private SignInAccountService signInAccountService;
@Resource
private WxPayClient wxPayClient;
@Resource @Resource
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
@ -152,6 +158,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private ClientAuditProcessMapper clientAuditProcessMapper; private ClientAuditProcessMapper clientAuditProcessMapper;
@Resource
private SysWxMerchantApplyMapper sysWxMerchantApplyMapper;
@Resource @Resource
private SpringTemplateEngine thymeleaf; private SpringTemplateEngine thymeleaf;
@ -2924,4 +2933,89 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
} }
@Override
@Cacheable(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
public List<JSONObject> listSubMerchantIdApplys(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
List<JSONObject> applices = sysWxMerchantApplyMapper.listWxMerchantApplices(client.getInteger("client_id"),new PageBounds(Order.formString("create_time.desc")));
if(!applices.isEmpty()){
return applices;
}else {
if(StringUtils.isNotEmpty(client.getString("sub_merchant_id")) && StringUtils.isNotEmpty(client.getString("merchant_id"))){
Element elem = wxPayClient.querySubMerchant(client.getString("merchant_id"),client.getString("sub_merchant_id"));
JSONObject object = new JSONObject();
object.put("sub_merchant_id",elem.elementText("sub_mch_id_0"));
object.put("client_id",client.getInteger("client_id"));
object.put("merchant_name",elem.elementText("merchant_name_0"));
object.put("merchant_shortname",elem.elementText("merchant_shortname_0"));
object.put("office_phone",elem.elementText("office_phone_0"));
object.put("contact_name",elem.elementText("contact_name_0"));
object.put("contact_email",elem.elementText("contact_email_0"));
object.put("contact_phone",elem.elementText("contact_phone_0"));
object.put("business_category",elem.elementText("business_category_0"));
object.put("merchant_remark",elem.elementText("merchant_remark_0"));
object.put("website",elem.elementText("website_0"));
object.put("merchant_introduction",elem.elementText("merchant_introduction_0"));
object.put("merchant_id",client.getString("merchant_id"));
object.put("create_time",new Date());
object.put("operator",manager.getString("display_name"));
List<JSONObject> applyQuery = new ArrayList<>();
applyQuery.add(object);
return applyQuery;
}
}
return null;
}
@Override
@CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
JSONObject params = subMerchantApply.insertObject();
SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params,SubMerchantInfo.class);
params.put("merchant_id",subMerchantApply.getMerchant_id());
params.put("client_id",client.getString("client_id"));
params.put("create_time",new Date());
params.put("operator",manager.getString("display_name"));
Element elem = wxPayClient.subMerchantApplication(subMerchantApply.getMerchant_id(),subMerchantInfo);
String sub_merchant_id = elem.elementText("sub_mch_id");
if(StringUtils.isNotEmpty(sub_merchant_id)){
params.put("sub_merchant_id",sub_merchant_id);
sysWxMerchantApplyMapper.insertWxMerchantApply(params);
clearCacheSubMerchantIdApplices(clientMoniker);
}else {
throw new BadRequestException(elem.elementText("return_msg"));
}
return sub_merchant_id;
}
@Override
public List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
List<JSONObject> list = new ArrayList<>();
for (WeChatPayConfig.Merchant mch : WechatPayEnvironment.getEnv().getWechatMerchantConfigs()){
JSONObject merchantIds = new JSONObject();
merchantIds.put("merchant_id",mch.getMerchantId());
list.add(merchantIds);
}
return list;
}
@Override
@CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
public void clearCacheSubMerchantIdApplices(String clientMoniker) {
}
} }

@ -482,4 +482,19 @@ public class PartnerManageController {
public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow")); clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow"));
} }
@ManagerMapping(value = "/{clientMoniker}/list_sub_applices",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})
public List<JSONObject> listSubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listSubMerchantIdApplys(manager,clientMoniker);
}
@ManagerMapping(value = "/{clientMoniker}/sub_apply",method = RequestMethod.POST,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})
public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.subMerchantApplication(clientMoniker,subMerchantIdApply,manager);
}
@ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})
public List<JSONObject> getMerchantIds(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listMerchantIds(clientMoniker,manager);
}
} }

@ -30,6 +30,56 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
{code: 2, label: 'Manager'}, {code: 2, label: 'Manager'},
{code: 3, label: 'Cashier'} {code: 3, label: 'Cashier'}
]; ];
var wxMerchantIndustries = [
{
"label": "鞋包服饰|Shoes&Garments",
"value": "343"
},
{
"label": "机票行业|Air Ticket",
"value": "493"
},
{
"label": "文具/办公用品|Stationery/office supplies",
"value": "492"
},
{
"label": "酒店行业|Hotel Industry",
"value": "491"
},
{
"label": "教育行业|Education Industry",
"value": "490"
},
{
"label": "国际物流|Logistics",
"value": "489"
},
{
"label": "数码电器|Digital appliance",
"value": "488"
},
{
"label": "母婴|Maternal and infant",
"value": "487"
},
{
"label": "化妆品|Cosmetics",
"value": "486"
},
{
"label": "食品|Food",
"value": "485"
},
{
"label": "综合商城|Comprehensive mall",
"value": "484"
},
{
"label": "其它货物贸易行业|Other trade industry",
"value": "494"
}
];
var app = angular.module('partnerManageApp', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ui.select', 'ngFileUpload']); var app = angular.module('partnerManageApp', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ui.select', 'ngFileUpload']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('partners', { $stateProvider.state('partners', {
@ -109,6 +159,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
url: '/partner_product', url: '/partner_product',
templateUrl: 'static/payment/product/templates/product.html', templateUrl: 'static/payment/product/templates/product.html',
controller: 'productCtrl' controller: 'productCtrl'
}).state('partners.detail.sub_merchant_applicaitons', {
url: '/sub_merchant_applicaitons',
templateUrl: 'static/payment/partner/templates/sub_merchant_id_apply.html',
controller: 'subMerchantIdApplicaitonsCtrl'
}); });
}]); }]);
app.controller('partnerListCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', app.controller('partnerListCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap',
@ -2522,6 +2576,90 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
} }
}]); }]);
app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal','$state','commonDialog', function ($scope, $http, $uibModal, $state,commonDialog) {
$scope.loadSubMerchantInfos = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', {params: {}}).then(function (resp) {
$scope.subMerchantInfos = resp.data;
});
};
$scope.useSubMerchantId = function (sub_merchant_id) {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
}
$scope.applySubMerchantId = function () {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html',
controller: 'applySubMerchantIdCtrl',
resolve: {
subMerchantInfo:function () {
return $scope.partner;
},
merchantIds: ['$http', '$stateParams', function ($http) {
return $http.get('/sys/partners/'+ $scope.partner.client_moniker +'/get_merchant_ids');
}]
}
}).result.then(function () {
$scope.loadSubMerchantInfos();
})
};
$scope.loadSubMerchantInfos();
}]);
app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal','$state','subMerchantInfo', '$filter','merchantIds','commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo,$filter,merchantIds,commonDialog) {
$scope.wxIndustries = angular.copy(wxMerchantIndustries);
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
$scope.merchantIds = merchantIds.data;
$scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry);
$scope.saveAppliy = function (form) {
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker+ '/sub_apply', $scope.subMerchantInfo).then(function (resp) {
$scope.apply_sub_merchant_id = resp.data;
$scope.$close();
if(subMerchantInfo.sub_merchant_id != null){
commonDialog.confirm({title:'Confirm',content:'已申请成功,是否确认使用'}).then(function () {
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
})
}else {
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Apply Success And Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
}
}, function (resp) {
$scope.errmsg = resp.data.message;
})
}
}]);
app.filter('bdOrg', function () { app.filter('bdOrg', function () {
return function (bdUsers, org_id) { return function (bdUsers, org_id) {
if (org_id) { if (org_id) {
@ -2538,7 +2676,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return bdUsers; return bdUsers;
} }
}); });
app.filter('wxMerchants', function () {
return function (values) {
var industry = '';
angular.forEach(wxMerchantIndustries, function (wxMerchant) {
if (wxMerchant.value == values) {
industry = wxMerchant.label;
}
});
return industry;
}
});
app.filter('bdOrgSelect', function () { app.filter('bdOrgSelect', function () {
return function (bdUsers, params) { return function (bdUsers, params) {
var org_id; var org_id;
@ -2565,5 +2713,57 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return bdUsers; return bdUsers;
} }
}); });
app.filter('wxindustries', function () {
return function (value) {
switch (value + '') {
case '327':
return '343';
case '339':
return '493';
case '337':
return '492';
case '328':
return '491';
case '362':
case '361':
case '363':
case '329':
return '490';
case '330':
return '489';
case '332':
return '487';
case '334':
return '486';
case '335':
return '485';
case '336':
return '484';
case '338':
case '358':
return '494'
}
}
});
app.filter('cut', function () {
return function (value, wordwise, max, tail) {
if (!value) return '';
max = parseInt(max, 10);
if (!max) return value;
if (value.length <= max) return value;
value = value.substr(0, max);
if (wordwise) {
var lastspace = value.lastIndexOf(' ');
if (lastspace != -1) {
value = value.substr(0, lastspace);
}
}
return value + (tail || ' …');
};
});
return app; return app;
}); });

@ -0,0 +1,163 @@
<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 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_shortname.$invalid && subForm.merchant_shortname.$dirty}">
<label class="control-label col-sm-3" for="merchant_shortname_input">* Merchant Short Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.short_name"
type="text" name="merchant_shortname" id="merchant_shortname_input" required maxlength="50">
<div ng-messages="subForm.merchant_shortname.$error" ng-if="subForm.merchant_shortname.$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.website.$invalid && subForm.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>
<div ng-messages="subForm.website.$error" ng-if="subForm.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.merchant_remark.$invalid && subForm.merchant_remark.$dirty}">
<label class="control-label col-sm-3" for="merchant_remark_input">* Merchant Remark</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.remark"
type="text" name="merchant_remark" id="merchant_remark_input" maxlength="20" required>
<div ng-messages="subForm.merchant_remark.$error" ng-if="subForm.merchant_remark.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 20</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.merchant_introduction.$invalid && subForm.merchant_introduction.$dirty}">
<label class="control-label col-sm-3" for="merchant_introduction_input">* Merchant Introduction</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.description"
type="text" name="merchant_introduction" id="merchant_introduction_input" required maxlength="256" MINLENGTH="10">
<div ng-messages="subForm.merchant_introduction.$error" ng-if="subForm.merchant_introduction.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 256</p>
<p class="small text-danger" ng-message="minlength">Length is less than 10</p>
</div>
</div>
</div>
<div class="form-group">
<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="text" name="office_phone" id="office_phone_input">
</div>
</div>
<div class="form-group">
<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">
</div>
</div>
<div class="form-group">
<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">
</div>
</div>
<div class="form-group">
<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">
</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 ng-disabled="subForm.$dirty&&subForm.$invalid" class="btn btn-success" type="button"
ng-click="saveAppliy(subForm)">Submit
</button>
</div>
</div>
</div>
</form>
</div>

@ -238,6 +238,9 @@
<li ui-sref-active="active" ng-if="partner.show_all_permission"> <li ui-sref-active="active" ng-if="partner.show_all_permission">
<a ui-sref=".product">Product</a> <a ui-sref=".product">Product</a>
</li> </li>
<li ui-sref-active="active" ng-if="('10'|withRole)">
<a ui-sref=".sub_merchant_applicaitons">Sub Merchant Id Applicaitons</a>
</li>
</ul> </ul>
<div class="tab-content" ui-view> <div class="tab-content" ui-view>
<div class="panel panel-default"> <div class="panel panel-default">

@ -0,0 +1,91 @@
<style>
.box_desk{
width: 96%;
height: 87%;
background: rgba(0, 0, 0, .65);
position: absolute;
bottom: 28px;
transition: all linear 0.5s;
opacity:0;
}
.box-body:hover .box_desk{
padding: 0px;
opacity: 0.8;
display: block;
}
.content_button{
display: block;
position: absolute;
top: 50%;
margin-left: 50%;
transform: translate(-50%, -50%);
color: #fff;
text-align: left;
font-size: 14px;
}
</style>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<h3 class="box-title pull-left" ng-if="partner.sub_merchant_id">
Sub Merchant Id : {{partner.sub_merchant_id}}
<i class="fa fa-clock-o text-danger" title="Using temp Sub Merchant ID" ng-if="partner.temp_sub_merchant"></i>
</h3>
<button role="button" class="btn btn-info pull-right" title="Apply Sub Merchant Id"
ng-click="applySubMerchantId()">
<i class="fa fa-plus"></i>
Apply Sub Merchant Id
</button>
</div>
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title">List of Sub Merchant Id</h3>
</div>
<div class="box-body col-sm-6" ng-repeat="id_apply in subMerchantInfos">
<ul class="list-group ui_desk">
<li class="list-group-item list-group-item-success">
<b>Sub Merchant Id</b>
<b style="float: right"><span
ng-if="partner.sub_merchant_id == id_apply.sub_merchant_id"><small
class="text-red">(当前使用)</small></span>{{id_apply.sub_merchant_id}}</b>
</li>
<li class="list-group-item list-group-item-success">
Apply Time
<span style="float: right" ng-bind="id_apply.create_time"></span>
</li>
<li class="list-group-item list-group-item-success">
Merchant Short Name
<span style="float:right;">{{id_apply.merchant_shortname | cut:true:20:' ...'}}</span>
</li>
<li class="list-group-item list-group-item-success">
Business Category
<span style="float: right">{{id_apply.business_category | wxMerchants}}</span>
</li>
<li class="list-group-item list-group-item-success">
Description
<span style="float: right;">{{id_apply.merchant_introduction | cut:true:20:' ...'}}</span>
</li>
<li class="list-group-item list-group-item-success">
Operator
<span style="float: right" ng-bind="id_apply.operator"></span>
</li>
</ul>
<div class="box_desk">
<div class="content_button">
<button role="button" class="btn btn-info" title="use"
ng-click="useSubMerchantId(id_apply.sub_merchant_id)">
USE
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Loading…
Cancel
Save