Upd:添加显示条件,根据条件显示不同布局

master
duLingLing 5 years ago
parent 0e4901bfb3
commit 4da2eb338a

@ -106,7 +106,6 @@ import org.springframework.ui.Model;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
@ -124,11 +123,12 @@ import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.security.*;
import java.security.InvalidParameterException;
import java.security.KeyPair;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.util.List;
import java.util.*;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
@ -271,8 +271,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private ClientConfigMapper clientConfigMapper;
@Resource
private PermissionPartnerModuleMapper permissionPartnerModuleMapper;
@Resource
private PermissionPartnerManagerImpl permissionPartnerManagerImpl;
@Resource
private RiskAttentionMerchantsMapper riskAttentionMerchantsMapper;
@ -360,7 +358,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (manager != null) {
checkClientOrg(manager, client);
}
String same_phone = clientMapper.findSamePhone(client.getString("contact_phone")).getString("a");
if (same_phone != null && client.getString("contact_phone") != null && same_phone.contains(" ")) {
same_phone = same_phone.replace(client.getString("client_moniker"), "");
@ -1584,7 +1581,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private void checkPhoneAndWechatExist(NewAccountBean account) {
List<JSONObject> accounts = clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+") ? account.getNation_code() : "+" + account.getNation_code());
if ( accounts != null && accounts.size()>0) {
if (accounts != null && accounts.size() > 0) {
throw new BadRequestException("Mobile phone number has been bound to other accounts");
}
}
@ -1657,13 +1654,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (account == null) {
throw new BadRequestException("account not exists");
}
if(user.getString("openid")!=null && !"".equals(user.getString("openid"))) {
if (user.getString("openid") != null && !"".equals(user.getString("openid"))) {
if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size() > 0) {
throw new BadRequestException("The WeChat has been linked to other accounts");
}
}
if(user.getString("unioinid")!=null && !"".equals(user.getString("unioinid"))){
if(clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>0 ){
if (user.getString("unioinid") != null && !"".equals(user.getString("unioinid"))) {
if (clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size() > 0) {
throw new BadRequestException("The WeChat has been linked to other accounts");
}
}
@ -5903,76 +5900,76 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return key;
}
public JSONObject partnerIncrementalService(String clientMoniker){
public JSONObject partnerIncrementalService(String clientMoniker) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if(client==null){
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> service = clientIncrementalMapper.findAllByclientMoniker(client.getInteger("client_id"));
List<String> incrementalChannels = new ArrayList<>();
List<String> incrementalChannels = new ArrayList<>();
for (IncrementalChannel e : IncrementalChannel.values()) {
boolean exist = false;
for(JSONObject s : service){
exist = e.getChannel().equals(s.getString("channel"));
if(exist){
break;
}
}
if(!exist){
incrementalChannels.add(e.getChannel());
}
for (JSONObject s : service) {
exist = e.getChannel().equals(s.getString("channel"));
if (exist) {
break;
}
}
if (!exist) {
incrementalChannels.add(e.getChannel());
}
}
incrementalChannels.remove("system");
return new JSONObject(){{
put("all_service",service);
put("incremental_channel",incrementalChannels);
}};
return new JSONObject() {{
put("all_service", service);
put("incremental_channel", incrementalChannels);
}};
}
public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService,JSONObject manager){
public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if(client==null){
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"),incrementalService.getString("channel"));
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel"));
JSONObject saveIncrementalService = new JSONObject();
if(existIncrementalService==null){
saveIncrementalService.put("incremental_id",UUID.randomUUID().toString());
saveIncrementalService.put("channel",incrementalService.getString("channel"));
saveIncrementalService.put("create_time",new Date());
saveIncrementalService.put("update_time",new Date());
saveIncrementalService.put("is_valid",1);
}else{
saveIncrementalService.put("incremental_id",incrementalService.getString("incremental_id"));
saveIncrementalService.put("update_time",new Date());
}
saveIncrementalService.put("client_id",client.getInteger("client_id"));
saveIncrementalService.put("operator",manager.getString("display_name"));
saveIncrementalService.put("incremental_mode",incrementalService.getInteger("incremental_mode"));
saveIncrementalService.put("incremental_rate_value",incrementalService.getInteger("incremental_mode")==1?incrementalService.getString("incremental_rate_value"):0);
saveIncrementalService.put("total_incremental_amount",incrementalService.getInteger("incremental_mode")!=1?incrementalService.getString("total_incremental_amount"):0);
if(existIncrementalService==null){
if (existIncrementalService == null) {
saveIncrementalService.put("incremental_id", UUID.randomUUID().toString());
saveIncrementalService.put("channel", incrementalService.getString("channel"));
saveIncrementalService.put("create_time", new Date());
saveIncrementalService.put("update_time", new Date());
saveIncrementalService.put("is_valid", 1);
} else {
saveIncrementalService.put("incremental_id", incrementalService.getString("incremental_id"));
saveIncrementalService.put("update_time", new Date());
}
saveIncrementalService.put("client_id", client.getInteger("client_id"));
saveIncrementalService.put("operator", manager.getString("display_name"));
saveIncrementalService.put("incremental_mode", incrementalService.getInteger("incremental_mode"));
saveIncrementalService.put("incremental_rate_value", incrementalService.getInteger("incremental_mode") == 1 ? incrementalService.getString("incremental_rate_value") : 0);
saveIncrementalService.put("total_incremental_amount", incrementalService.getInteger("incremental_mode") != 1 ? incrementalService.getString("total_incremental_amount") : 0);
if (existIncrementalService == null) {
clientIncrementalMapper.save(saveIncrementalService);
}else{
} else {
clientIncrementalMapper.update(saveIncrementalService);
}
}
public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager){
public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if(client==null){
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"),incrementalService.getString("channel"));
if(existIncrementalService==null){
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel"));
if (existIncrementalService == null) {
throw new BadRequestException("Incremental service is not exist");
}
existIncrementalService.put("update_time",new Date());
existIncrementalService.put("incremental_id",incrementalService.getString("incremental_id"));
existIncrementalService.put("is_valid",incrementalService.getInteger("is_valid"));
existIncrementalService.put("operator",manager.getString("display_name"));
existIncrementalService.put("update_time", new Date());
existIncrementalService.put("incremental_id", incrementalService.getString("incremental_id"));
existIncrementalService.put("is_valid", incrementalService.getInteger("is_valid"));
existIncrementalService.put("operator", manager.getString("display_name"));
clientIncrementalMapper.update(existIncrementalService);
}
}

@ -60,7 +60,6 @@ public class SignInController {
private ManagerTodoNoticeProvider[] managerTodoNoticeProviders;
@Resource
private ClientManager clientManager;
@Resource
private ManagerAccountsService managerAccountsService;
@ -191,6 +190,7 @@ public class SignInController {
@PartnerMapping(value = "/current_partner", method = RequestMethod.GET)
public JSONObject partnerLoginStatus(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
partner.put("has_incremental_setvice",clientManager.partnerIncrementalService(partner.getString("client_moniker")).getJSONArray("all_service").size()>0);
return partner;
}

@ -1040,7 +1040,7 @@ margin-bottom: 10%;"/>
</ul>
</li>
<li class="has-submenu" ui-sref-active="active">
<li class="has-submenu" ng-if="currentUser.has_incremental_setvice" ui-sref-active="active">
<a ui-sref="partnerIncrementalService"><i class="fa fa-plus-square-o"></i>R Service</a>
</li>

@ -26,20 +26,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.serviceAll = [];
$scope.channelOptions = [];
$scope.windowHeight = document.body.clientWidth;
document.getElementsByTagName("body").
debugger
$scope.clientInfo = angular.copy(partner.data);
$scope.initDate = function(){
$http.get("/client/partner_info/"+$scope.clientInfo.client_moniker+"/incremental_service").then(function (res) {
$scope.serviceAll = res.data.all_service;
$scope.serviceAll.forEach(function(service){
service.logo_url = '/static/images/'+'yangmatou'+'.jpg'
service.logo_url = '/static/images/'+service.channel+'.jpg'
})
for (var i=0;i<5;i++){
$scope.serviceAll.forEach(function(service){
service.logo_url = '/static/images/'+'yangmatou'+'.jpg'
})
}
$scope.channelOptions = res.data.incremental_channel;
})
}

@ -30,19 +30,21 @@
}
.img_auto_height_width {
width: 100%;
height: 100%;
width: 75%;
height: 60%;
display: flex;
align-items: center;
justify-content: center;
padding-left: 12%;
padding-left: 32%;
text-align: center;
margin-bottom: 30px;
}
.label-right{
float: right;
}
.border-show{
margin: 4px 0px;
font-size: 16px;
}
.service-background:hover{
background: #7C8085;
@ -62,41 +64,52 @@
<li class="active">Service List</li>
</ol>
</section>
<div class="content" style="background-color: white;"ng-style="{'height':windowHeight}">
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="col-md-3 col-sm-4 col-xs-12 " title="点击查看交易详情"
ng-repeat=" service in serviceAll">
<div style="margin:15px 0px 15px 17%" class="service-background" ng-click="queryServiceInfo(service)">
<img class="row img_auto_height_width" ng-src="{{service.logo_url}}">
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-right">Name:</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
{{service.channel+'小程序'}}
</div>
</div>
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-right ">Mode:</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
{{service.incremental_mode==1?'固定手续费':'固定金额扣款'}}
</div>
</div>
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-right ">{{service.incremental_mode==1?'Rate':'Amount'}}:</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
{{service.incremental_mode==1?service.incremental_rate_value+'%':service.total_incremental_amount}}
<div class="box-solid">
<div class="box box-info" ng-style="{'height':windowHeight}">
<div class="box-header">
<div ng-class="{'col-md-3 col-sm-4 col-xs-12 ': serviceAll.length>1, 'col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-2 col-xs-12 ' : serviceAll.length==1}" title="点击查看交易详情" ng-repeat=" service in serviceAll">
<div style="margin:15px 0px 15px 17%" class="service-background" ng-click="queryServiceInfo(service)">
<img class="row img_auto_height_width" ng-src="{{service.logo_url}}">
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-right">Name:</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
{{service.channel+'小程序'}}
</div>
</div>
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-right ">Mode:</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
{{service.incremental_mode==1?'固定手续费':'固定金额扣款'}}
</div>
</div>
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-right ">{{service.incremental_mode==1?'Rate':'Amount'}}:</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
{{service.incremental_mode==1?service.incremental_rate_value+'%':service.total_incremental_amount}}
</div>
</div>
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-right ">Status:</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
<span ng-style="{'color':service.is_valid?'#00A65A':'#DD4B39'}">{{service.is_valid?'启用':'禁用' }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<h2 ng-if="serviceAll.length==0" style="text-align: center;margin-top: 10%">您尚未开通任何增值渠道<a
ng-href="#">点击去开通</a></h2>
</div>
</div>
</div>

@ -5295,7 +5295,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$http.post('/sys/partners/'+params.clientMoniker+'/incremental_service',$scope.model).then(function(res){
commonDialog.alert({
title: 'Success',
content: $scope.isCreate?'Create':'Update'+' Service Successful!',
content: $scope.isCreate?'Create Service Successful!':'Update Service Successful!',
type: 'success'
});
$scope.ctrl.sending = false;

@ -6,10 +6,9 @@
<div class="row">
<div class="col-sm-12">
<form novalidate name="service_form" class="form-horizontal">
<div class="form-group has-feedback" ng-if="isCreate"
ng-class="{'has-error':service_form.channel.$invalid && service_form.channel.$dirty}">
<label class="control-label col-sm-5">Service Channel:</label>
<label class="control-label col-sm-4">Service Channel:</label>
<div class="col-sm-6">
<select class="form-control" name="channel" id="channel-input" required
ng-model="model.channel"
@ -21,7 +20,7 @@
<div class="form-group has-feedback"
ng-class="{'has-error':service_form.incremental_mode.$invalid && service_form.incremental_mode.$dirty}">
<label class="control-label col-sm-5">Mode:</label>
<label class="control-label col-sm-4">Mode:</label>
<div class="col-sm-6">
<select class="form-control" name="incrementalMode" id="incrementalMode-input" required
ng-model="model.incremental_mode">
@ -31,31 +30,36 @@
<span ng-messages="service_form.incremental_mode.$error" ng-if="service_form.incremental_mode.$dirty" ng-message="required">Required Field</span>
</div>
</div>
<div class="form-group has-feedback" ng-if="model.incremental_mode==1" ng-class="{'has-error':service_form.incremental_rate_value.$invalid && service_form.incremental_rate_value.$dirty}">>
<label class="control-label col-sm-5" style="text-align: right">Rate Value:</label>
<div class="form-group has-feedback" ng-if="model.incremental_mode==1" ng-class="{'has-error':service_form.incremental_rate_value.$invalid && service_form.incremental_rate_value.$dirty}">
<label class="control-label col-sm-4" style="text-align: right">Rate Value:</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="incremental_rate_value" stringToNumber2 class="form-control" ng-model="model.incremental_rate_value"
min="0.0" step="0.1" id="incremental_rate_value" required>
<input type="number" name="incremental_rate_value" stringToNumber2 class="form-control" ng-model="model.incremental_rate_value" max="100" min="0" step="0" id="incremental_rate_value" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="service_form.incremental_rate_value.$error" ng-if="service_form.incremental_rate_value.$dirty" ng-message="required">
<div ng-messages="service_form.incremental_rate_value.$error" ng-if="service_form.incremental_rate_value.$dirty">
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.0%
<i class="glyphicon glyphicon-alert"></i> No less than 0%
</div>
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No less than 100%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group has-feedback" ng-if="model.incremental_mode==2" ng-class="{'has-error':service_form.total_incremental_amount.$invalid && service_form.total_incremental_amount.$dirty}">>
<label class="control-label col-sm-5" style="text-align: right">Amount:</label>
<div class="form-group has-feedback" ng-if="model.incremental_mode==2" ng-class="{'has-error':service_form.total_incremental_amount.$invalid && service_form.total_incremental_amount.$dirty}">
<label class="control-label col-sm-4" style="text-align: right">Amount:</label>
<div class="col-sm-6">
<input type="number" name="total_incremental_amount" stringToNumber2 class="form-control" ng-model="model.total_incremental_amount"
min="0" id="total_incremental_amount" required>
<div ng-messages="service_form.total_incremental_amount.$error" ng-if="service_form.total_incremental_amount.$dirty" ng-message="required"></div>
min="0" maxlength="20" id="total_incremental_amount" required>
<div ng-messages="service_form.total_incremental_amount.$error" ng-if="service_form.total_incremental_amount.$dirty">
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
</form>

Loading…
Cancel
Save