Merge branch 'develop_app' into develop

# Conflicts:
#	src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java
#	src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java
#	src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java
master
wangning 7 years ago
commit 5e870b307a

@ -2,6 +2,8 @@ package au.com.royalpay.payment.manage.appclient.core;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo;
import au.com.royalpay.payment.manage.notice.beans.NoticeInfo;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
@ -88,6 +90,8 @@ public interface RetailAppService {
JSONObject getClientInfoRealtime(JSONObject device);
JSONObject getClientInfoMe(JSONObject device);
JSONObject updateRetailConfig(JSONObject device, boolean paySurcharge);
JSONObject setRequireRemarkConfig(JSONObject device, boolean enabled);
@ -135,4 +139,10 @@ public interface RetailAppService {
void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception;
Map<String,JSONObject> channelAndDayOfAnalysis(int client_id, String clearingDetailId, String channel, JSONObject device);
JSONObject getAuthFiles(JSONObject device);
void uploadAuthFiles(JSONObject device,ClientAuthFilesInfo clientAuthFilesInfo);
void updateMerchantInfo(JSONObject device, ClientUpdateInfo clientUpdateInfo);
}

@ -20,9 +20,12 @@ import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientSettleDelayConfMapper;
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
@ -160,9 +163,14 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource
private ClientConfigService clientConfigService;
@Resource
private ClientMapper clientMapper;
@Resource
private ClientModifySupport clientModifySupport;
private Map<String, AppMsgSender> senderMap = new HashMap<>();
private final String fileName[] = { "source_agree_file", "client_bank_file", "client_id_file", "client_agree_file", "client_company_file",
"client_apply_file" };
@Resource
public void setAppMsgSenders(AppMsgSender[] senders) {
Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender));
@ -250,7 +258,7 @@ public class RetailAppServiceImp implements RetailAppService {
}
@Override
public JSONObject getQrcode(JSONObject device, QRCodeConfig config,int client_id) {
public JSONObject getQrcode(JSONObject device, QRCodeConfig config, int client_id) {
JSONObject client = merchantInfoProvider.getClientInfo(client_id);
String url = PlatformEnvironment.getEnv().concatUrl("/api/payment/v1.0/partners/" + client.getString("client_moniker"));
if (config.isCNY()) {
@ -260,7 +268,8 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject res = new JSONObject();
res.put("url", url);
res.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false));
// res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config,clientAccountMapper.findById(device.getString("account_id")),"APP"));
// res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client,
// config,clientAccountMapper.findById(device.getString("account_id")),"APP"));
res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config));
return res;
}
@ -290,7 +299,7 @@ public class RetailAppServiceImp implements RetailAppService {
public JSONObject getInvoiceData(JSONObject device, AppQueryBean appQueryBean) throws Exception {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id") ;
int client_id = device.getIntValue("client_id");
JSONObject client = clientManager.getClientInfo(client_id);
String timezone = client.getString("timezone");
appQueryBean.setTimezone(timezone);
@ -300,7 +309,7 @@ public class RetailAppServiceImp implements RetailAppService {
params.put("client_id", client_id);
JSONObject analysis = transactionMapper.analysisTransFlow(params);
BigDecimal total_surcharge = analysis.getBigDecimal("total_surcharge").add(analysis.getBigDecimal("tax_amount"));
analysis.put("total_surcharge",total_surcharge);
analysis.put("total_surcharge", total_surcharge);
return analysis;
}
@ -308,24 +317,60 @@ public class RetailAppServiceImp implements RetailAppService {
public void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id") ;
int client_id = device.getIntValue("client_id");
JSONObject client = clientManager.getClientInfo(client_id);
device.put("client_moniker",client.getString("client_moniker"));
device.put("client_moniker", client.getString("client_moniker"));
TradeLogQuery tradeLogQuery = new TradeLogQuery();
tradeLogQuery.setDatefrom(appQueryBean.getBegin());
tradeLogQuery.setDateto(appQueryBean.getEnd());
if (appQueryBean.getApp_client_ids()==null){
if (appQueryBean.getApp_client_ids() == null) {
appQueryBean.setApp_client_ids(String.valueOf(client_id));
}
tradeLogQuery.setClient_ids(appQueryBean.getApp_client_ids().split(","));
tradeLogService.exportTransFlow(tradeLogQuery,device,httpResponse);
tradeLogService.exportTransFlow(tradeLogQuery, device, httpResponse);
}
@Override
public Map<String, JSONObject> channelAndDayOfAnalysis(int client_id, String clearingDetailId, String channel, JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
return cleanService.channelAndDayOfAnalysis(client_id, clearingDetailId,channel,device.getJSONObject("client"));
return cleanService.channelAndDayOfAnalysis(client_id, clearingDetailId, channel, device.getJSONObject("client"));
}
@Override
public JSONObject getAuthFiles(JSONObject device) {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
return clientManager.getAuthFiles(account,client.getString("client_moniker"));
}
@Override
public void uploadAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientAuthFilesInfo.setFile_id_info(null);
clientAuthFilesInfo.setAuthStatus(0);
clientAuthFilesInfo.setFile_agreement_info(null);
clientManager.uploadAuthFiles(account,client.getString("client_moniker"),clientAuthFilesInfo);
}
@Override
public void updateMerchantInfo(JSONObject device, ClientUpdateInfo clientRegisterInfo) {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
if(PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN){
throw new ForbiddenException("You have no permission");
}
if (client == null) {
throw new NotFoundException("Client not found, please check");
}
if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){
JSONObject record = clientRegisterInfo.appClientInfo();
record.put("client_moniker",client.getString("client_moniker"));
clientManager.updateClientRegisterInfoV2(null,client.getString("client_moniker"),record);
}else {
throw new BadRequestException("已通过审核,暂不能提交和修改");
}
}
@Override
@ -336,7 +381,7 @@ public class RetailAppServiceImp implements RetailAppService {
if (device.getIntValue("client_id") != account.getIntValue("client_id") || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
throw new ForbiddenException("You have no permission");
}
clientManager.updateAppClient(account,device.getIntValue("client_id"), appClientBean);
clientManager.updateAppClient(account, device.getIntValue("client_id"), appClientBean);
}
@ -361,6 +406,23 @@ public class RetailAppServiceImp implements RetailAppService {
return clientWithConfig;
}
@Override
public JSONObject getClientInfoMe(JSONObject device) {
JSONObject result = new JSONObject();
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
if (StringUtils.isEmpty(client.getString("store_photo"))|| StringUtils.isEmpty(client.getString("logo_url"))|| StringUtils.isEmpty(client.getString("company_photo"))) {
result.put("base_info_lack", true);
}
JSONObject file = clientManager.getAuthFiles(null, client.getString("client_moniker"));
for (String s : fileName) {
if (file.getString(s) == null) {
result.put("compliance_info_lack", true);
}
}
result.putAll(file);
return result;
}
@Override
public JSONObject updateRetailConfig(JSONObject device, boolean clientPaySurcharge) {
JSONObject user = userInfo(device);
@ -396,7 +458,7 @@ public class RetailAppServiceImp implements RetailAppService {
user = JSON.parseObject(user.toJSONString());
return user;
} else {
JSONObject clientWithConfig =clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject clientWithConfig = clientManager.getClientInfo(device.getIntValue("client_id"));
clientWithConfig.putAll(clientConfigService.find(device.getIntValue("client_id")));
clientWithConfig = SignInAccountServiceImpl.clientInfoWithNoSecretInfo(clientWithConfig);
clientWithConfig.put("terminal_id", device.getString("client_dev_id"));
@ -421,16 +483,16 @@ public class RetailAppServiceImp implements RetailAppService {
params.put("client_id", client_id);
PageList<JSONObject> logs = clearingDetailMapper.listClientSettlementLog(params,
new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc")));
logs.forEach(log -> log.put("total_charge",log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount"))));
logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount"))));
JSONObject result = PageListUtils.buildPageListResult(logs);
if (appQueryBean.getPage()==1){
if (!logs.isEmpty() && logs.size()>0){
if (appQueryBean.getPage() == 1) {
if (!logs.isEmpty() && logs.size() > 0) {
JSONObject sendMailLog = logSettleMailMapper.findByDate(logs.get(0).getDate("report_date"));
if (sendMailLog == null) {
result.put("padding",true);
result.put("padding", true);
}
if (sendMailLog!=null && sendMailLog.getIntValue("mail_status") != 1) {
result.put("padding",true);
if (sendMailLog != null && sendMailLog.getIntValue("mail_status") != 1) {
result.put("padding", true);
}
}
}
@ -454,7 +516,7 @@ public class RetailAppServiceImp implements RetailAppService {
List<JSONObject> channels = clearingDetailAnalysisMapper.listReportChannels(String.valueOf(clearing_detail_id));
JSONObject channelsObj = new JSONObject();
for (JSONObject channel : channels) {
channel.put("total_charge",channel.getBigDecimal("total_charge").add(channel.getBigDecimal("tax_amount")));
channel.put("total_charge", channel.getBigDecimal("total_charge").add(channel.getBigDecimal("tax_amount")));
channelsObj.put(channel.getString("channel"), channel);
}
List<JSONObject> credit = new ArrayList<>();
@ -1163,7 +1225,7 @@ public class RetailAppServiceImp implements RetailAppService {
}
@Override
public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device,String app_client_ids) {
public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device, String app_client_ids) {
try {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
@ -1176,30 +1238,30 @@ public class RetailAppServiceImp implements RetailAppService {
devId = device.getString("dev_id");
}
Date to = DateUtils.addDays(date, 1);
String [] param_client_ids = null;
if(StringUtils.isEmpty(app_client_ids)) {
String[] param_client_ids = null;
if (StringUtils.isEmpty(app_client_ids)) {
JSONArray client_ids = clientManager.getAllClientIds(device.getIntValue("client_id"));
if (client_ids.size() > 1) {
param_client_ids = new String[client_ids.size()];
client_ids.toArray(param_client_ids);
}
}else {
} else {
param_client_ids = app_client_ids.split(",");
}
List<JSONObject> transactions = transactionMapper.listDailyTransactions(date, to, devId, device.getIntValue("client_id"),param_client_ids);
List<JSONObject> transactions = transactionMapper.listDailyTransactions(date, to, devId, device.getIntValue("client_id"), param_client_ids);
if (transactions.isEmpty()) {
throw new BadRequestException("No Transactions in date " + dateStr + " at " + timezone);
}
TimeZoneUtils.switchTimeZoneToString(transactions, timezone, "HH:mm:ss", Collections.singletonList("transaction_time"));
BigDecimal display_amount = BigDecimal.ZERO;
BigDecimal cny_display_amount = BigDecimal.ZERO;
for (JSONObject transaction:transactions){
if (PlatformEnvironment.getEnv().getForeignCurrency().equals(transaction.getString("currency"))){
if ("Credit".equals(transaction.getString("transaction_type"))){
for (JSONObject transaction : transactions) {
if (PlatformEnvironment.getEnv().getForeignCurrency().equals(transaction.getString("currency"))) {
if ("Credit".equals(transaction.getString("transaction_type"))) {
display_amount = display_amount.add(transaction.getBigDecimal("display_amount"));
}
}else {
if ("Credit".equals(transaction.getString("transaction_type"))){
} else {
if ("Credit".equals(transaction.getString("transaction_type"))) {
cny_display_amount = cny_display_amount.add(transaction.getBigDecimal("display_amount"));
}
}
@ -1207,12 +1269,10 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject res = new JSONObject();
res.put("transactions", transactions);
JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"),param_client_ids);
JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"), param_client_ids);
analysis.put("date", TimeZoneUtils.formatTime(date, "dd/MMM/yyyy", timezone));
analysis.put("display_amount",display_amount);
analysis.put("cny_display_amount",cny_display_amount);
analysis.put("display_amount", display_amount);
analysis.put("cny_display_amount", cny_display_amount);
res.put("analysis", analysis);
return res;
} catch (ParseException e) {
@ -1270,19 +1330,19 @@ public class RetailAppServiceImp implements RetailAppService {
Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType);
String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType);
int update_type = 0;// 0:不更新 1更新 2强制更新
String [] oldVersion = version.split("\\.");
String [] newVersion = newAppVersion.split("\\.");
String[] oldVersion = version.split("\\.");
String[] newVersion = newAppVersion.split("\\.");
JSONObject res = new JSONObject();
res.put("update_content", updateContent);
for (int i = 0; i < newVersion.length; i++) {
if(Integer.valueOf(newVersion[i])>Integer.valueOf(oldVersion[i])){
if (Integer.valueOf(newVersion[i]) > Integer.valueOf(oldVersion[i])) {
update_type = 1;
if (isUpdate) {
update_type = 2;
}
res.put("update_type", update_type);
return res;
}else if(Integer.valueOf(newVersion[i])<Integer.valueOf(oldVersion[i])){
} else if (Integer.valueOf(newVersion[i]) < Integer.valueOf(oldVersion[i])) {
res.put("update_type", update_type);
return res;
}
@ -1570,16 +1630,16 @@ public class RetailAppServiceImp implements RetailAppService {
@Override
public JSONObject getCheckClientInfo(JSONObject device) {
return clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id"),"App");
return clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id"), "App");
}
@Override
public void changeManualSettle(JSONObject device, boolean manual_settle) {
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientManager.changeManualSettle(account,device.getIntValue("client_id"), manual_settle, device.getString("account_id"), 1, "商户"+(manual_settle?"打开":"关闭")+"手动清算");
clientManager.changeManualSettle(account, device.getIntValue("client_id"), manual_settle, device.getString("account_id"), 1,
"商户" + (manual_settle ? "打开" : "关闭") + "手动清算");
}
private static boolean mathchLetterorNum(String str) {
String regex = "[A-Za-z0-9]{8}";
return str.matches(regex);

@ -11,12 +11,15 @@ import au.com.royalpay.payment.manage.bill.bean.QueryBillBean;
import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean;
import au.com.royalpay.payment.manage.bill.core.BillOrderService;
import au.com.royalpay.payment.manage.bill.core.BillService;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.advise.AppClientController;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
@ -35,6 +38,8 @@ 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 org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal;
@ -52,7 +57,7 @@ import static au.com.royalpay.payment.tools.CommonConsts.RETAIL_DEVICE;
/**
* Created by yishuqian on 28/03/2017.
*/
@AppClientController
@RestController
@RequestMapping("/api/v1.0/retail/app")
public class RetailAppController {
@Resource
@ -71,6 +76,11 @@ public class RetailAppController {
private ClientContractService clientContractService;
@Resource
private ManualSettleSupport manualSettleSupport;
@Resource
private AttachmentClient attachmentClient;
@Resource
private ClientManager clientManager;
@RequestMapping(value = "/token", method = RequestMethod.PUT)
public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) {
@ -235,6 +245,22 @@ public class RetailAppController {
return retailAppService.getClientInfo(device);
}
@RequestMapping(value = "/client/apply", method = RequestMethod.PUT)
@ResponseBody
public void updatePartnerInfo(@ModelAttribute(RETAIL_DEVICE) JSONObject device,@RequestBody ClientUpdateInfo info) {
retailAppService.updateMerchantInfo(device,info);
}
@RequestMapping(value = "/client/realtime", method = RequestMethod.GET)
public JSONObject getClientInfoRealtime(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientInfoRealtime(device);
}
@RequestMapping(value = "/client/me", method = RequestMethod.GET)
public JSONObject getClientMyInfoRealtime(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientInfoMe(device);
}
@RequestMapping(value = "/client/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
JSONObject defaultResult = new JSONObject();
@ -258,6 +284,16 @@ public class RetailAppController {
retailAppService.updateClient(device, appClientBean);
}
@RequestMapping(value = "/client/file", method = RequestMethod.GET)
public JSONObject getAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getAuthFiles(device);
}
@RequestMapping(value = "/client/file", method = RequestMethod.PUT)
public void uploadAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody ClientAuthFilesInfo filesInfo) {
retailAppService.uploadAuthFiles(device, filesInfo);
}
@RequestMapping(value = "/daily_transactions/date/{dateStr}", method = RequestMethod.GET)
public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone,@RequestParam(required = false) String app_client_ids,
@RequestParam(defaultValue = "false") boolean thisdevice, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
@ -485,4 +521,11 @@ public class RetailAppController {
result.put("require_remark", client.getBooleanValue("require_remark"));
return result;
}
@RequestMapping(value = "/attachment/files",method = RequestMethod.POST)
public JSONObject uploadImage(@ModelAttribute(RETAIL_DEVICE) JSONObject device,@RequestParam MultipartFile file) throws Exception {
return attachmentClient.uploadFile(file,false);
}
}

@ -62,7 +62,6 @@ public interface ClientMapper {
@AdvanceSelect(addonWhereClause = "is_valid=1 and approve_email_id is not null and approve_email_send=3")
List<JSONObject> listClientsWithEmailNotVerify();
List<JSONObject> listUnAuthPartners(@Param("auth_days") int auth_days);
JSONObject analysisClients(JSONObject params);
@ -81,4 +80,7 @@ public interface ClientMapper {
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")
List<JSONObject> listClientsByBD(@Param("bd_user") String bd_user);
PageList<JSONObject> simpleQuery(JSONObject params, PageBounds pagination);
}

@ -0,0 +1,399 @@
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 java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.Pattern;
/**
* Created by yixian on 2016-06-29.
*/
public class ClientUpdateInfo {
@JSONField(name = "client_moniker")
@Pattern(regexp = "^[a-zA-Z0-9]{4}$", message = "Parameter error(partner code):Only letters or numbers are allowed")
private String clientMoniker;
@JSONField(name = "company_name")
private String companyName;
@JSONField(name = "short_name")
private String shortName;
@JSONField(name = "business_name")
private String businessName;
@JSONField(name = "business_structure")
private String businessStructure;
private String abn;
private String acn;
private String industry;
@JSONField(name = "alipayindustry")
private String alipayIndustry;
@JSONField(name = "company_photo")
private String companyPhoto;
@JSONField(name = "store_photo")
private String storePhoto;
@JSONField(name = "company_website")
private String companyWebsite;
@JSONField(name = "company_phone")
private String companyPhone;
private String description;
private String remark;
private String sector;
@JSONField(name = "logo_id")
private String logoId;
@JSONField(name = "contact_person")
private String contactPerson;
@JSONField(name = "contact_phone")
private String contactPhone;
@JSONField(name = "contact_email")
private String contactEmail;
private String address;
private String suburb;
private String postcode;
private String state;
private String country;
@Pattern(regexp = "^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$", message = "error.payment.valid.invalid_timezone")
private String timezone;
private String jdindustry;
private String royalpayindustry;
private String referrer_id;
private String referrer_name;
private String client_apply_id;
private String business_hours;
private String merchant_introduction;
private String merchant_tag;
private String merchant_video_url;
public JSONObject insertObject() {
JSONObject res = (JSONObject) JSON.toJSON(this);
if (client_apply_id == null) {
res.remove("client_apply_id");
}
return res;
}
public JSONObject updateObject() {
JSONObject obj = insertObject();
obj.remove("client_moniker");
return obj;
}
public JSONObject appClientInfo() {
JSONObject obj = insertObject();
List<String> keys = new ArrayList<>();
obj.keySet().forEach(p -> {
if (StringUtils.isEmpty(obj.getString(p))) {
keys.add(p);
}
});
keys.forEach(p->{
obj.remove(p);
});
obj.remove("client_moniker");
obj.remove("client_id");
obj.remove("merchant_video_url");
obj.remove("merchant_tag");
obj.remove("merchant_introduction");
obj.remove("business_hours");
obj.remove("client_apply_id");
obj.remove("referrer_id");
obj.remove("referrer_name");
obj.remove("jdindustry");
obj.remove("royalpayindustry");
obj.remove("industry");
obj.remove("alipayIndustry");
obj.remove("country");
obj.remove("company_phone");
return obj;
}
public String getClientMoniker() {
if (StringUtils.isEmpty(this.clientMoniker)) {
return null;
} else {
return clientMoniker.toUpperCase();
}
}
public void setClientMoniker(String clientMoniker) {
this.clientMoniker = clientMoniker;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getShortName() {
return shortName;
}
public void setShortName(String shortName) {
this.shortName = shortName;
}
public String getBusinessName() {
return businessName;
}
public void setBusinessName(String businessName) {
this.businessName = businessName;
}
public String getAbn() {
return abn;
}
public void setAbn(String abn) {
this.abn = abn;
}
public String getAcn() {
return acn;
}
public void setAcn(String acn) {
this.acn = acn;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public String getCompanyPhoto() {
return companyPhoto;
}
public void setCompanyPhoto(String companyPhoto) {
this.companyPhoto = companyPhoto;
}
public String getStorePhoto() {
return storePhoto;
}
public void setStorePhoto(String storePhoto) {
this.storePhoto = storePhoto;
}
public String getCompanyWebsite() {
return companyWebsite;
}
public void setCompanyWebsite(String companyWebsite) {
this.companyWebsite = companyWebsite;
}
public String getCompanyPhone() {
return companyPhone;
}
public void setCompanyPhone(String companyPhone) {
this.companyPhone = companyPhone;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getSector() {
return sector;
}
public void setSector(String sector) {
this.sector = sector;
}
public String getLogoId() {
return logoId;
}
public void setLogoId(String logoId) {
this.logoId = logoId;
}
public String getContactPerson() {
return contactPerson;
}
public void setContactPerson(String contactPerson) {
this.contactPerson = contactPerson;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getContactEmail() {
return contactEmail;
}
public void setContactEmail(String contactEmail) {
this.contactEmail = contactEmail;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getSuburb() {
return suburb;
}
public void setSuburb(String suburb) {
this.suburb = suburb;
}
public String getPostcode() {
return postcode;
}
public void setPostcode(String postcode) {
this.postcode = postcode;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getTimezone() {
return timezone;
}
public void setTimezone(String timezone) {
this.timezone = timezone;
}
public String getClient_apply_id() {
return client_apply_id;
}
public void setClient_apply_id(String client_apply_id) {
this.client_apply_id = client_apply_id;
}
public String getBusinessStructure() {
return businessStructure;
}
public void setBusinessStructure(String businessStructure) {
this.businessStructure = businessStructure;
}
public String getReferrer_id() {
return referrer_id;
}
public void setReferrer_id(String referrer_id) {
this.referrer_id = referrer_id;
}
public String getReferrer_name() {
return referrer_name;
}
public void setReferrer_name(String referrer_name) {
this.referrer_name = referrer_name;
}
public String getAlipayIndustry() {
return alipayIndustry;
}
public void setAlipayIndustry(String alipayIndustry) {
this.alipayIndustry = alipayIndustry;
}
public String getJdindustry() {
return jdindustry;
}
public void setJdindustry(String jdindustry) {
this.jdindustry = jdindustry;
}
public String getRoyalpayindustry() {
return royalpayindustry;
}
public void setRoyalpayindustry(String royalpayindustry) {
this.royalpayindustry = royalpayindustry;
}
public String getBusiness_hours() {
return business_hours;
}
public void setBusiness_hours(String business_hours) {
this.business_hours = business_hours;
}
public String getMerchant_introduction() {
return merchant_introduction;
}
public void setMerchant_introduction(String merchant_introduction) {
this.merchant_introduction = merchant_introduction;
}
public String getMerchant_tag() {
return merchant_tag;
}
public void setMerchant_tag(String merchant_tag) {
this.merchant_tag = merchant_tag;
}
public String getMerchant_video_url() {
return merchant_video_url;
}
public void setMerchant_video_url(String merchant_video_url) {
this.merchant_video_url = merchant_video_url;
}
}

@ -54,6 +54,9 @@ public interface ClientManager {
@Transactional
void updateClientRegisterInfo(JSONObject manager, String clientMoniker, ClientRegisterInfo info);
@Transactional
void updateClientRegisterInfoV2(JSONObject manager, String clientMoniker, JSONObject info);
@Transactional
void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo);
@ -298,4 +301,7 @@ public interface ClientManager {
JSONObject getWithConfig(int client_id);
List<JSONObject> getClientsByBD(String bd_user);
JSONObject simpleQuery(JSONObject param, int page,int limit);
}

@ -289,11 +289,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private MpWechatApiProvider mpWechatApiProvider;
@PostConstruct
public void init(){
public void init() {
tags.add("account");
}
@Override
public JSONObject getSysRateConfig() {
String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates");
@ -330,9 +330,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("show_all_permission", true);
int role = manager != null ? manager.getIntValue("role") : 0;
if (manager != null) {
if(ManagerRole.OPERATOR.hasRole(role)){
if (ManagerRole.OPERATOR.hasRole(role)) {
List<JSONObject> log = logClientSubMerchantIdMapper.listLogsByClientId(client.getInteger("client_id"));
client.put("sub_merchant_id_log", log.size()>0?true:false);
client.put("sub_merchant_id_log", log.size() > 0 ? true : false);
}
if (ManagerRole.BD_USER.hasRole(role)) {
int checkBDPermission = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id"));
@ -563,8 +563,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
try {
clientMapper.save(partner);
JSONObject clientConfig = new JSONObject();
clientConfig.put("client_id",partner.getIntValue("client_id"));
clientConfig.put("client_moniker",partner.getString("client_moniker"));
clientConfig.put("client_id", partner.getIntValue("client_id"));
clientConfig.put("client_moniker", partner.getString("client_moniker"));
clientConfigService.save(clientConfig);
} catch (Exception e) {
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
@ -592,8 +592,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
try {
mailGunService.addClientToMailList(partner);
}catch (Exception e){
logger.error("邮件列表添加成员失败",e);
} catch (Exception e) {
logger.error("邮件列表添加成员失败", e);
}
return partner;
}
@ -630,8 +630,46 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
clientMapper.update(updateInfo);
if(client.getString("contact_email").equals(updateInfo.getString("contact_email"))){
mailGunService.updateClientOfMailList(updateInfo,client);
if (client.getString("contact_email").equals(updateInfo.getString("contact_email"))) {
mailGunService.updateClientOfMailList(updateInfo, client);
}
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
public void updateClientRegisterInfoV2(JSONObject manager, String clientMoniker, JSONObject info) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
Assert.notNull(client);
checkOrgPermission(manager, client);
int clientId = client.getIntValue("client_id");
List<JSONObject> clients = clientMapper.listChildClients(clientId);
String logoId = info.getString("logoId");
if (StringUtils.isNotEmpty(logoId)) {
String fileUrl = attachmentClient.getFileUrl(logoId);
info.put("logo_url", fileUrl);
String thumbnail = attachmentClient.getThumbnail(logoId, 600).getString("url");
info.put("logo_thumbnail", thumbnail);
for (JSONObject subClient : clients) {
subClient.put("logo_url", fileUrl);
subClient.put("logo_thumbnail", thumbnail);
}
}
info.put("client_id", clientId);
int originReferrerId = client.getIntValue("referrer_id");
int updateReferrerId = Integer.parseInt(info.getString("referrer_id") == null ? "0" : info.getString("referrer_id"));
if (originReferrerId == 0 && updateReferrerId != 0) {
List<JSONObject> bds = clientBDMapper.listClientBDAvailable(clientId, new Date());
if (bds.size() == 1 && bds.get(0).getIntValue("proportion") == 1) {
JSONObject clientBDInfo = bds.get(0);
clientBDInfo.put("proportion", 0.5);
clientBDMapper.update(clientBDInfo);
}
}
clientMapper.update(info);
if (client.getString("contact_email").equals(info.getString("contact_email"))) {
mailGunService.updateClientOfMailList(info, client);
}
clientInfoCacheSupport.clearClientCache(clientId);
}
@ -651,33 +689,34 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(subMerchantId);
update.put("merchant_id", availableMerchant == null ? null : availableMerchant.getMerchantId());
update.put("sub_merchant_id", subMerchantId);
try{
recordSubMerchantLog(client,subMerchantInfo,manager);
}catch(Exception e){
logger.error("记录log_client_sub_merchant_id失败",e);
try {
recordSubMerchantLog(client, subMerchantInfo, manager);
} catch (Exception e) {
logger.error("记录log_client_sub_merchant_id失败", e);
}
clientMapper.update(update);
List<JSONObject> children = clientMapper.listChildClients(clientId);
for (JSONObject child : children) {
if (Objects.equals(child.getString("sub_merchant_id"), originSubMerchantId)) {
update.put("client_id", child.getIntValue("client_id"));
try{
recordSubMerchantLog(child,subMerchantInfo,manager);
}catch(Exception e){
logger.error("记录log_client_sub_merchant_id失败",e);
try {
recordSubMerchantLog(child, subMerchantInfo, manager);
} catch (Exception e) {
logger.error("记录log_client_sub_merchant_id失败", e);
}
clientMapper.update(update);
}
}
clientInfoCacheSupport.clearClientCache(clientId);
}
private void recordSubMerchantLog(JSONObject client,JSONObject subMerchantInfo,JSONObject manager){
private void recordSubMerchantLog(JSONObject client, JSONObject subMerchantInfo, JSONObject manager) {
JSONObject log = new JSONObject();
log.put("sub_merchant_id_after",subMerchantInfo.getString("sub_merchant_id"));
log.put("operator",manager.getString("display_name"));
log.put("create_time",new Date());
log.put("client_id",client.getIntValue("client_id"));
log.put("sub_merchant_id_before",client.getString("sub_merchant_id"));
log.put("sub_merchant_id_after", subMerchantInfo.getString("sub_merchant_id"));
log.put("operator", manager.getString("display_name"));
log.put("create_time", new Date());
log.put("client_id", client.getIntValue("client_id"));
log.put("sub_merchant_id_before", client.getString("sub_merchant_id"));
logClientSubMerchantIdMapper.save(log);
}
@ -741,7 +780,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
private void initAdminUserAndSendEmail(JSONObject manager, String clientMoniker, JSONObject client) {
if(StringUtils.isEmpty(client.getString("sub_merchant_id"))){
if (StringUtils.isEmpty(client.getString("sub_merchant_id"))) {
throw new BadRequestException("Sub Merchant ID Can't be null ");
}
String username = clientMoniker + client.getString("sub_merchant_id");
@ -962,8 +1001,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
for (JSONObject client : clients) {
try {
String emailId = client.getString("approve_email_id");
JSONObject status = mailSendMapper.find(emailId,client.getString("contact_email"));
if (status!=null) {
JSONObject status = mailSendMapper.find(emailId, client.getString("contact_email"));
if (status != null) {
int statusNo = status.getIntValue("status");
logger.debug("get mail status:" + emailId + "--" + statusNo);
int mailStatus = 3;
@ -1637,14 +1676,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public String getQrCodeBoard(JSONObject client, QRCodeConfig config,JSONObject account,String plantform) {
public String getQrCodeBoard(JSONObject client, QRCodeConfig config, JSONObject account, String plantform) {
// JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
return merchantInfoProvider.getQrCodeBoard(client, config);
// return merchantInfoProvider.getQrCodeBoard(client, config,account,plantform);
// return merchantInfoProvider.getQrCodeBoard(client, config,account,plantform);
}
@Override
public void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous,String plantform) {
public void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous, String plantform) {
JSONObject client = clientDetail(manager, clientMoniker);
try {
JSONObject qrboardConfig = new JSONObject();
@ -1664,7 +1703,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
qrboardConfig.put("brandw", "600");
qrboardConfig.put("brandh", "200");
String type = qrboardConfig.getString("type");
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client,
// config,mongoTemplate,manager,plantform);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous);
} catch (Exception e) {
@ -1673,7 +1713,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous,String plantform) {
public void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous, String plantform) {
JSONObject client = clientDetail(manager, clientMoniker);
JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
try {
@ -1685,7 +1725,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString);
String type = qrboardConfig.getString("type");
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client,
// config,mongoTemplate,manager,plantform);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous);
} catch (Exception e) {
@ -2243,7 +2284,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
file.put("file_id", existFile.getString("file_id"));
clientFilesMapper.update(file);
}
if (!renewal && client.getIntValue("source")!=4) {
if (!renewal && client.getIntValue("source") != 4) {
clientModifySupport.processClientModify(new OpenStatusModify(manager, clientMoniker, 2));
}
@ -2346,7 +2387,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
record.put("refund_pwd", pwdHash);
record.put("refund_pwd_salt", salt);
clientConfigService.update(record);
clientModifySupport.processClientConfigModify(new RefundPWDModify(account,client.getString("client_moniker"),pwd,salt));
clientModifySupport.processClientConfigModify(new RefundPWDModify(account, client.getString("client_moniker"), pwd, salt));
}
@Override
@ -2404,12 +2445,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void setClientCustomerTaxFree(JSONObject account,String clientMoniker, boolean customerTaxFree) {
public void setClientCustomerTaxFree(JSONObject account, String clientMoniker, boolean customerTaxFree) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,clientMoniker,"customer_tax_free",customerTaxFree));
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "customer_tax_free", customerTaxFree));
}
@Override
@ -2438,7 +2479,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
public void disableClient(String clientMoniker, JSONObject manager) {
JSONObject client = clientDetail(manager, clientMoniker);
Assert.notEmpty(client);
clientModifySupport.processClientModify(new DisableModify(manager,clientMoniker,false));
clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, false));
}
@Override
@ -2524,14 +2565,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs);
if (query.getPage()==1){
if (!logs.isEmpty() && logs.size()>0){
if (query.getPage() == 1) {
if (!logs.isEmpty() && logs.size() > 0) {
JSONObject sendMailLog = logSettleMailMapper.findByDate(logs.get(0).getDate("clearing_time"));
if (sendMailLog == null) {
result.put("padding",true);
result.put("padding", true);
}
if (sendMailLog!=null && sendMailLog.getIntValue("mail_status") != 1) {
result.put("padding",true);
if (sendMailLog != null && sendMailLog.getIntValue("mail_status") != 1) {
result.put("padding", true);
}
}
}
@ -2642,7 +2683,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
log.put("open_status_from", open_status_form);
}
log.put("open_status_to", open_status_to);
log.put("operator_id", StringUtils.isNotEmpty(manager.getString("manager_id"))?manager.getString("manager_id"):manager.getString("account_id"));
log.put("operator_id", StringUtils.isNotEmpty(manager.getString("manager_id")) ? manager.getString("manager_id") : manager.getString("account_id"));
log.put("operator", manager.getString("display_name"));
log.put("create_time", new Date());
log.put("remark", remark);
@ -2759,12 +2800,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
@Transactional
public void changeManualSettle(JSONObject account,int client_id, boolean manual_settle, String operator_id, int type, String operation) {
public void changeManualSettle(JSONObject account, 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");
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"manual_settle",manual_settle));
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "manual_settle", manual_settle));
JSONObject actClientLog = new JSONObject();
actClientLog.put("client_id", client_id);
actClientLog.put("operator_id", operator_id);
@ -2848,10 +2889,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} else {
auditModify.setOpen_status(open_status - 1);
}
if(client.getInteger("approve_result")==null || client.getIntValue("approve_result")==4){
if (client.getInteger("approve_result") == null || client.getIntValue("approve_result") == 4) {
auditModify.setApprove_result(5);
}
if(client.getIntValue("source")==4){
if (client.getIntValue("source") == 4) {
auditModify.setApprove_result(5);
}
if (refuse_remark != null && !refuse_remark.isEmpty()) {
@ -3159,7 +3200,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return;
}
if (client.getIntValue("open_status") == 4) {
if (client.getIntValue("source")==4 && !StringUtils.isNotEmpty(bd_user_name)){
if (client.getIntValue("source") == 4 && !StringUtils.isNotEmpty(bd_user_name)) {
bd_user_name = "自助开通商户";
}
List<JSONObject> complianceList = managerMapper.getOnlyCompliance();
@ -3444,10 +3485,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void sendVerifyEmail(JSONObject client,String accountId) {
public void sendVerifyEmail(JSONObject client, String accountId) {
JSONObject clientAccount = clientAccountMapper.findById(accountId);
Assert.notNull(clientAccount);
simpleClientApplyService.sendVerifyEmail(client.getString("contact_email"),client.getIntValue("client_id"),clientAccount.getString("username"));
simpleClientApplyService.sendVerifyEmail(client.getString("contact_email"), client.getIntValue("client_id"), clientAccount.getString("username"));
}
@Override
@ -3461,4 +3502,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
public List<JSONObject> getClientsByBD(String bd_user) {
return clientMapper.listClientsByBD(bd_user);
}
@Override
public JSONObject simpleQuery(JSONObject param, int page, int limit) {
PageList<JSONObject> partners = clientMapper.listPartners(param, new PageBounds(page, limit, Order.formString("create_time.desc")));
return PageListUtils.buildPageListResult(partners);
}
}

@ -310,4 +310,14 @@
WHERE (c.approve_result = 1 OR c.approve_result= 2) AND c.is_valid = 1 AND c.sub_merchant_id IS NOT NULL
AND c.merchant_id IS NOT NULL AND c.sub_merchant_id = #{sub_merchant_id}
</select>
<select id="simpleQuery" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_clients
where is_vaild = 1
<if test="source!=null">
and source = #{source}
</if>
<if test="approve_result!=null">
and approve_result = #{approve_result}
</if>
</select>
</mapper>
Loading…
Cancel
Save