add manual settle

master
wangning 7 years ago
parent 0a87728a96
commit 243a085b44

@ -327,7 +327,8 @@ alter table sys_clients add column `manual_settle` tinyint(1) DEFAULT 0;
create table log_clients_operation(
id varchar(50) not null,
client_id int(11) not null,
account_id varchar(50) not null comment '操作人者 账户ID',
operator_id varchar(50) not null comment '操作人者 账户ID',
operator_type SMALLINT (2) not null comment '操作人者类型',
create_time datetime not null,
operation varchar(50) DEFAULT NULL,
PRIMARY key(`id`)

@ -136,8 +136,7 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
device.put("rate", params.getBigDecimal("rate") == null ? new BigDecimal(0.15) : params.getBigDecimal("rate"));
device.put("expire_time", act.getDate("expire_date"));
actMonDelaySettleMapper.save(device);
clientManager.changeManualSettle(client_id,true);
saveActClientLog(device.getString("account_id"),client_id,"参加活动打开手动清算");
clientManager.changeManualSettle(client_id,true,device.getString("account_id"),1,"参加活动打开手动清算");
}
@ -159,19 +158,8 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
clientLog.put("is_valid", 0);
clientLog.put("expire_time", new Date());
actMonDelaySettleMapper.update(clientLog);
JSONObject act = actAppMapper.getActDetail("1");
clientManager.changeManualSettle(client_id,false);
saveActClientLog(device.getString("account_id"), client_id,"退出活动关闭手动清算");
clientManager.changeManualSettle(client_id,false,device.getString("account_id"),1,"退出活动关闭手动清算");
}
private void saveActClientLog(String account_id, int client_id,String operation) {
JSONObject actClientLog = new JSONObject();
actClientLog.put("client_id",client_id);
actClientLog.put("account_id",account_id);
actClientLog.put("operation",operation);
actClientLog.put("create_time",new Date());
clientsOperationLogMapper.save(actClientLog);
}
}

@ -231,7 +231,7 @@ public interface ClientManager {
void changePaymentPage(JSONObject account, String paypad_version);
void changeManualSettle(int client_id, boolean manual_settle);
void changeManualSettle(int client_id, boolean manual_settle,String operator_id,int type,String operation);
void changeQRCodePaySurcharge(JSONObject account, boolean paySurcharge);

@ -13,6 +13,7 @@ import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
@ -219,6 +220,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private ClientContractService clientContractService;
@Resource
private MessageSource messageSource;
@Resource
private ClientsOperationLogMapper clientsOperationLogMapper;
private static final String SOURCE_AGREE_FILE = "source_agree_file";
private static final String CLIENT_BANK_FILE = "client_bank_file";
@ -2608,11 +2611,25 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void changeManualSettle(int client_id, boolean manual_settle) {
@Transactional
public void changeManualSettle(int client_id, boolean manual_settle,String operator_id,int type,String operation) {
JSONObject client = getClientInfo(client_id);
if(client==null){
throw new BadRequestException("merchant not found");
}
JSONObject record = new JSONObject();
record.put("client_id",client_id);
record.put("manual_settle",manual_settle);
clientMapper.update(record);
JSONObject actClientLog = new JSONObject();
actClientLog.put("client_id",client_id);
actClientLog.put("operator_id",operator_id);
actClientLog.put("operation",operation);
actClientLog.put("create_time",new Date());
actClientLog.put("operator_type",type);
clientsOperationLogMapper.save(actClientLog);
}
@Override

@ -524,6 +524,12 @@ public class PartnerManageController {
return clientManager.listMerchantIds(clientMoniker,manager);
}
@ManagerMapping(value = "/{clientMoniker}/manual_settle",method = RequestMethod.PUT,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})
public void manualSettle(@PathVariable String clientMoniker, @RequestParam boolean manual_settle, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
clientManager.changeManualSettle(client.getIntValue("client_id"),manual_settle,manager.getString("manager_id"),2,"运营人员修改");
}
@PartnerMapping(value = "/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getCheckClientInfo(account.getIntValue("client_id"),account.getString("account_id"));

@ -2,14 +2,12 @@ package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl;
import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts;
@ -17,20 +15,31 @@ import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
/**
* view for partner client
* Created by yixian on 2016-07-03.
@ -348,4 +357,13 @@ public class PartnerViewController {
public void fullReleasePreAuthorization(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody TradeLogQuery query) throws Exception {
tradeLogService.fullReleasePreAuthorization(account, query);
}
@PartnerMapping(value = "/manual_settle", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void manualSettle(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam boolean manual_settle) {
clientManager.changeManualSettle(account.getIntValue("client_id"),manual_settle,account.getString("account_id"),1,"商户修改修改");
}
}

@ -143,7 +143,7 @@
if(is_weixin()){
return;
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_cancel_mondelay',waring:cancel_waring});
window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_cancel_mondelay',cancel_waring:cancel_waring});
} else if (/(Android)/i.test(navigator.userAgent)) {
android.appCmd('{\"type\":\"cmd_cancel_mondelay\"}');
} else {

@ -1339,6 +1339,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.manualSettle = function (manualSettle) {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/manual_settle?'+'manual_settle='+manualSettle).then(function (resp) {
})
};
$scope.settleHours = [{value: undefined, label: 'Default(24:00, GMT+10)'}];
for (var h = 24; h > 0; h--) {
$scope.settleHours.push({value: h, label: ('00' + h).substr(-2) + ':00, ' + $scope.partner.timezone});

@ -220,6 +220,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
})
});
};
$scope.manualSettle = function (manualSettle) {
$http.put('/client/partner_info/manual_settle?'+'manual_settle='+manualSettle).then(function (resp) {
})
};
$scope.getRates();
}]);
app.controller('clientSubPartnersCtrl', ['$scope', '$http', function ($scope, $http) {

@ -1,4 +1,11 @@
<div class="row">
<div class="form-group">
<label class="col-sm-4">Manual Settle</label>
<div class="col-sm-6">
<input type="checkbox" ng-model="partner.manual_settle" bs-switch
switch-change="manualSettle(partner.manual_settle)">
</div>
</div>
<div class="col-sm-12">
<h3>Bank Account</h3>
<div class="form-horizontal">

@ -5,6 +5,14 @@
}
</style>
<div class="row">
<div class="form-group">
<label class="col-sm-4">Manual Settle</label>
<div class="col-sm-6">
<input type="checkbox" ng-model="partner.manual_settle" bs-switch
switch-change="manualSettle(partner.manual_settle)">
</div>
</div>
<div class="col-sm-12">
<h3>Bank Account
<a class="small" role="button" ng-click="bankCtrl.edit=true"

Loading…
Cancel
Save