master
yuan 7 years ago
parent a8d6854670
commit 90c59d2b24

@ -5,6 +5,7 @@ import java.util.List;
import javax.annotation.Resource;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@ -23,6 +24,9 @@ public class PartnersAnalysisServiceImpl implements PartnersAnalysisService {
@Resource
private ClientAnalysisMapper clientAnalysisMapper;
@Resource
private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper;
@Override
public List<JSONObject> getNewPartnersAnalysis(JSONObject params) {
return clientAnalysisMapper.countNewClientsHistory(params);
@ -30,7 +34,7 @@ public class PartnersAnalysisServiceImpl implements PartnersAnalysisService {
@Override
public List<JSONObject> getTradePartnersAnalysis(JSONObject params){
return clientAnalysisMapper.countTradePartnersHistory(params);
return customerAndOrdersStatisticsMapper.countTradedClientsByDate(params);
}
@Override

@ -51,4 +51,6 @@ public interface CustomerAndOrdersStatisticsMapper {
JSONObject getCommonCount(JSONObject params);
PageList<JSONObject> getAreaMerchantTradeAnalysis(JSONObject params, PageBounds pageBounds);
List<JSONObject> countTradedClientsByDate(JSONObject parasm);
}

@ -404,11 +404,12 @@ public class PartnerViewController {
clientManager.sendVerifyEmail(account.getJSONObject("client"),account.getString("account_id"));
}
@PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT)
@PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT,roles = PartnerRole.ADMIN)
@ResponseBody
public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@RequestBody ClientRegisterInfo info) {
JSONObject client = account.getJSONObject("client");
if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){
if (client.getIntValue("approve_result") != 1){
clientManager.updateClientRegisterInfo(null,account.getString("client_moniker"),info);
}else {
throw new BadRequestException("已通过审核,暂不能提交和修改");

@ -383,4 +383,36 @@
</where>
GROUP BY s.client_id ORDER BY total DESC
</select>
<select id="countTradedClientsByDate" resultType="com.alibaba.fastjson.JSONObject">
SELECT date_format(s.date,'%d-%m-%Y') datelist,COUNT(DISTINCT s.client_id) num
FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where>
s.client_id != 0
<if test="begin!=null">and s.date &gt;= #{begin}</if>
<if test="end!=null">and s.date &lt; #{end}</if>
<if test="client_ids!=null">
AND s.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null and client_id != null">
and s.client_id=#{client_id}
</if>
<if test="channel!=null">and s.channel = #{channel}</if>
<if test="org_id!=null">and c.org_id = #{org_id}</if>
<if test="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (c.bd_group=#{bd_group} or c.manager_id=#{bd_group})
<if test="bd_group_bd">and c.manager_id=#{bd_group_bd}</if>
)
</if>
</where>
GROUP BY datelist ORDER BY datelist
</select>
</mapper>

@ -15,6 +15,15 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
return $http.get('/client/partner_info');
}]
}
}).state('edit', {
url: '/edit',
templateUrl: '/static/payment/partner/templates/client_partner_edit.html',
controller: 'clientPartnerEditCtrl',
resolve: {
partner: ['$http', function ($http) {
return $http.get('/client/partner_info');
}]
}
}).state('basic.payment_info', {
url: '/payment',
templateUrl: '/static/payment/partner/templates/client_payment_info.html',
@ -207,6 +216,112 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
});
}
}]);
app.controller('clientPartnerEditCtrl', ['$scope', '$http', 'commonDialog','stateMap','countryMap','partner','$state','Upload',function ($scope, $http, commonDialog,stateMap,countryMap,partner,$state,Upload) {
$scope.partner = partner.data;
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.updatePartner = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
if (!$scope.partner.logo_url) {
alert("Logo is necessary!");
return;
}
if($scope.partner.partner_type == 'photo'){
if (!$scope.partner.company_photo) {
alert('Shop Photo1 is necessary');
return;
}
if (!$scope.partner.store_photo) {
alert('Shop Photo2 is necessary');
return;
}
}
var content = '';
$http.put('/client/partner_info/update/partnerInfo', $scope.partner).then(function () {
if (content != '') {
commonDialog.alert({
title: 'Warning',
content: content,
type: 'error'
});
} else {
commonDialog.alert({
title: 'Success',
content: 'Update partner information successfully',
type: 'success'
});
}
$state.go('basic', {reload: true});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
}]);
app.controller('clientComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) {
$scope.file = file.data || {};

@ -48,6 +48,9 @@
<div class="panel panel-default">
<div class="panel-heading">
Partner Basic Information
<a role="button" class="pull-right" ui-sref="edit" ng-if="[1]|withRole">
<i class="fa fa-edit"></i> Edit
</a>
</div>
<div class="panel-body">
<div class="form-horizontal">
@ -173,6 +176,41 @@
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
Business Hours</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.business_hours"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Tag<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.merchant_tag"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Introduction<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.merchant_introduction"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Video Introduction<br><em class="small">(youtube link)</em></label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.merchant_video_url"></p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户基本资料-->
<div class="panel panel-default">
<div class="panel-heading">Partner Contact Information</div>

@ -0,0 +1,355 @@
<style>
.img-size{
max-height: 100px;
margin-left: 20px;
}
</style>
<section class="content-header">
<h1 ng-bind="partner.short_name"></h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> Payment
</li>
<li><a ui-sref="^" ui-sref-opts="{reload:true}">Client Detail</a></li>
<li class="active">Partner Edit</li>
</ol>
</section>
<div class="content">
<form novalidate name="partnerForm">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Partner Basic Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">* Partner Code</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.client_moniker"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">* Company Name</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.company_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">* Short Name</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.short_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Business Name</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.business_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Business Structure</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.business_structure"></p>
</div>
</div>
<div class="form-group" ng-if="!partner.parent_client_id || ('00110'|withRole)">
<label class="control-label col-sm-2">Logo</label>
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
<uib-progressbar value="logoProgress.value" ng-if="logoProgress"></uib-progressbar>
<img ng-src="{{partner.logo_url}}" ng-if="partner.logo_url" style="height: 100px;">
</div>
</div>
<div class="form-group" ng-if="partner.business_structure != 'Company'">
<label class="control-label col-sm-2">ABN</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.abn"></p>
</div>
</div>
<div class="form-group" ng-if="partner.business_structure == 'Company'">
<label class="control-label col-sm-2">ACN</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.acn"></p>
</div>
</div>
<div class="form-group" ng-if="!partner.parent_client_id || ('00110'|withRole)"
ng-class="{'has-error':partnerForm.partner_type.$invalid && partnerForm.partner_type.$dirty}">
<label class="control-label col-sm-2" for="partner-type-select">* Photo/Website</label>
<div class="col-sm-8">
<select class="form-control" ng-model="partner.partner_type"
id="partner-type-select"
name="partner_type">
<option value="">Please Choose</option>
<option value="photo">Photo</option>
<option value="companyWebsite">Website</option>
</select>
<p class="small text-info">If the partner is a offline shop then a photo of shop is
required while an online store shall choose company website</p>
<p class="small text-info">
只要有可能产生线下交易商户静态码、POS就必须上传照片否则支付宝会禁止交易</p>
<div ng-messages="partnerForm.partner_type.$error"
ng-if="partnerForm.partner_type.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-if="partner.partner_type == 'photo' && (!partner.parent_client_id || ('00110'|withRole))">
<label class="control-label col-sm-2">* Shop Photo</label>
<div class="col-sm-5">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*" ngf-max-size="2MB">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
<uib-progressbar value="shopPhotoProgress.value"
ng-if="shopPhotoProgress"></uib-progressbar>
<img ng-src="{{partner.company_photo}}" ng-if="partner.company_photo" class="thumbnail img-size">
</div>
<div class="col-sm-5">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadStorePhoto($file)" accept="image/*"
ngf-max-size="2MB">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>
<uib-progressbar value="storePhotoProgress.value"
ng-if="storePhotoProgress"></uib-progressbar>
<img ng-src="{{partner.store_photo}}" ng-if="partner.store_photo" class="thumbnail img-size">
</div>
</div>
<div class="form-group"
ng-if="partner.partner_type == 'companyWebsite' && (!partner.parent_client_id || ('00110'|withRole))"
ng-class="{'has-error':partnerForm.company_website.$invalid && partnerForm.company_website.$dirty}">
<label class="control-label col-sm-2" for="company_website-input">* Website</label>
<div class="col-sm-8">
<input type="text" name="company_website" class="form-control"
ng-model="partner.company_website"
id="company_website-input" required maxlength="200">
<div ng-messages="partnerForm.company_website.$error"
ng-if="partnerForm.company_website.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.company_phone.$invalid && partnerForm.company_phone.$dirty}">
<label class="control-label col-sm-2" for="service-phone-input">* Service Phone</label>
<div class="col-sm-8">
<input class="form-control" required type="text" ng-model="partner.company_phone"
name="company_phone" id="service-phone-input" maxlength="20">
<div ng-messages="partnerForm.company_phone.$error"
ng-if="partnerForm.company_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 20 Characters</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.description.$invalid && partnerForm.description.$dirty}">
<label class="control-label col-sm-2" for="desc-input">Description</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.description"
name="description" id="desc-input" maxlength="200" required></textarea>
<div ng-messages="partnerForm.description.$error"
ng-if="partnerForm.description.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.remark.$invalid && partnerForm.remark.$dirty}">
<label class="control-label col-sm-2" for="desc-input">Remark</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.remark"
name="remark" id="remark-input" maxlength="200" required></textarea>
<div ng-messages="partnerForm.remark.$error"
ng-if="partnerForm.remark.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--end 商户基本资料-->
<div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
Business Hours</label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.business_hours">
<p class="small text-info">
eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Tag<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.merchant_tag">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Introduction<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.merchant_introduction"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Video Introduction<br><em class="small">(youtube link)</em></label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.merchant_video_url">
<p class="small text-info">eg:https://www.baidu.com</p>
</div>
</div>
</div>
</div>
</div>
<!--支付宝资料-->
<div class="panel panel-default">
<div class="panel-heading">Contact Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.contact_person.$invalid && partnerForm.contact_person.$dirty}">
<label class="control-label col-sm-2" for="contact_person-input">* Contact Person
Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.contact_person" required
name="contact_person"
id="contact_person-input" maxlength="50">
<div ng-messages="partnerForm.contact_person.$error"
ng-if="partnerForm.contact_person.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.contact_phone.$invalid && partnerForm.contact_phone.$dirty}">
<label class="control-label col-sm-4" for="contact-phone-input">* Phone</label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.contact_phone" required
name="contact_phone" id="contact-phone-input" maxlength="20">
</div>
<div ng-messages="partnerForm.contact_phone.$error"
ng-if="partnerForm.contact_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 20
Characters(including symbols and spaces)</p>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.contact_email.$invalid && partnerForm.contact_email.$dirty}">
<label class="control-label col-sm-4" for="contact-email-id">* E-mail</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.contact_email" required
name="contact_email" id="contact-email-id" maxlength="50">
</div>
<div ng-messages="partnerForm.contact_email.$error"
ng-if="partnerForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户联系资料-->
<div class="panel panel-default">
<div class="panel-heading">Address Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group col-sm-6">
<label class="control-label col-sm-4" for="address-input">Address</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.address" name="address"
id="address-input" maxlength="200"></textarea>
<div ng-messages="partnerForm.address.$error" ng-if="partnerForm.address.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4" for="suburb-input">* Suburb</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.suburb" name="suburb"
id="suburb-input" maxlength="50">
<div ng-messages="partnerForm.suburb.$error" ng-if="partnerForm.suburb.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 50
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4" for="postcode-input">PostCode</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.postcode" name="postcode"
id="postcode-input" maxlength="10">
<div ng-messages="partnerForm.postcode.$error" ng-if="partnerForm.postcode.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 10
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4" for="state-input">State</label>
<div class="col-sm-8">
<select class="form-control" name="state" required ng-model="partner.state"
id="state-input"
ng-options="state.value as state.label for state in states">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.state.$error" ng-if="partnerForm.state.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group col-sm-6" ng-class="{'has-error':partnerForm.country.$invalid && partnerForm.country.$dirty}">
<label class="control-label col-sm-4" for="country-input">* Country</label>
<div class="col-sm-8">
<input class="form-control" ng-init="partner.country=partner.country||'AUS'" ng-model="partner.country" name="country"
id="country-input" maxlength="20" required placeholder="AUS" readonly="readonly">
<div ng-messages="partnerForm.country.$error" ng-if="partnerForm.country.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 20
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button" ng-click="updatePartner(partnerForm)">Save
</button>
<a class="btn btn-danger" role="button" ui-sref="basic" ui-sref-opts="{reload:true}">Back</a>
</div>
</div>
</div>
</form>
</div>
Loading…
Cancel
Save