master
wangning 7 years ago
parent 4c5ffc129f
commit fdbf906996

@ -255,12 +255,14 @@ 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;
}
@Override
public void changeSurchargeEnable(JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) {
merchantInfoProvider.changeSurchargeEnable(device,updateSurchargeDTO);
}

@ -46,6 +46,7 @@ import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.impls.ApproveEmailModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.AuditModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.BDUserModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.ClearDaysModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.CredentialCodeModify;
@ -53,15 +54,12 @@ import au.com.royalpay.payment.manage.merchants.entity.impls.CustomerSurchargeRa
import au.com.royalpay.payment.manage.merchants.entity.impls.DisableModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.EmailModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.GreenChannelModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.LogoModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.MaxOrderAmountModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.MerchantIdModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.OpenStatusModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.OrderExpiryModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.ParentIdModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.PaypadVersionModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.RefundAuditModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.AuditModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.RefundPWDModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.SettleHourModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
@ -548,6 +546,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper.save(partner);
JSONObject clientConfig = new JSONObject();
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");
@ -581,19 +580,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject client = getClientInfoByMoniker(clientMoniker);
Assert.notNull(client);
checkOrgPermission(manager, client);
JSONObject updateInfo = info.updateObject();
int clientId = client.getIntValue("client_id");
LogoModify clientModify = new LogoModify(manager, clientMoniker, null, null);
List<JSONObject> clients = clientMapper.listChildClients(clientId);
if (StringUtils.isNotEmpty(info.getLogoId())) {
String fileUrl = attachmentClient.getFileUrl(info.getLogoId());
clientModify.setLogo_url(fileUrl);
updateInfo.put("logo_url", fileUrl);
String thumbnail = attachmentClient.getThumbnail(info.getLogoId(), 600).getString("url");
clientModify.setLogo_thumbnail(thumbnail);
updateInfo.put("logo_thumbnail", thumbnail);
for (JSONObject subClient : clients) {
subClient.put("logo_url", fileUrl);
subClient.put("logo_thumbnail", thumbnail);
}
}
updateInfo.put("client_id", clientId);
int originReferrerId = client.getIntValue("referrer_id");
int updateReferrerId = Integer.parseInt(info.getReferrer_id() == null ? "0" : info.getReferrer_id());
@ -605,7 +606,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientBDMapper.update(clientBDInfo);
}
}
clientModifySupport.processClientModify(clientModify);
clientMapper.update(updateInfo);
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
@ -1227,7 +1229,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
clientModifySupport.processClientModify(new SettleHourModify(manager, clientMoniker, hour));
clientModifySupport.processClientConfigModify(new SettleHourModify(manager, clientMoniker, hour));
}
@Override

@ -37,6 +37,6 @@ public class ClientModifySupportImpl implements ClientModifySupport {
@Override
public void processClientConfigModify(ClientConfigModify clientConfigModify) {
clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,mongoTemplate);
clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,clientMapper,mongoTemplate);
}
}

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
@ -35,7 +36,7 @@ public abstract class ClientConfigModify {
protected abstract JSONObject getModifyResult();
@Transactional
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientConfigMapper clientConfigMapper, MongoTemplate mongoTemplate) {
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientConfigMapper clientConfigMapper, ClientMapper clientMapper, MongoTemplate mongoTemplate) {
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker);
JSONObject modifyResult = getModifyResult();
try {
@ -46,6 +47,7 @@ public abstract class ClientConfigModify {
int clientId = client.getIntValue("client_id");
modifyResult.put("client_id", clientId);
clientConfigMapper.update(modifyResult);
clientMapper.update(modifyResult);
return clientId;
}

@ -1,48 +0,0 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class LogoModify extends ClientModify {
private String logo_url;
private String logo_thumbnail;
public LogoModify(JSONObject account, String clientMoniker, String logo_url, String logo_thumbnail) {
super(account, clientMoniker);
this.logo_url = logo_url;
this.logo_thumbnail = logo_thumbnail;
}
public String getLogo_url() {
return logo_url;
}
public void setLogo_url(String logo_url) {
this.logo_url = logo_url;
}
public String getLogo_thumbnail() {
return logo_thumbnail;
}
public void setLogo_thumbnail(String logo_thumbnail) {
this.logo_thumbnail = logo_thumbnail;
}
@Override
protected String business() {
return "修改商户Logo信息";
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("logo_url", logo_url);
modify.put("logo_thumbnail", logo_thumbnail);
return modify;
}
}

@ -1,13 +1,13 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class SettleHourModify extends ClientModify {
public class SettleHourModify extends ClientConfigModify {
private int settle_hour;
public SettleHourModify(JSONObject account, String clientMoniker, int settle_hour) {

@ -270,7 +270,7 @@
sum(if(c.approve_result=0,1,0)) not_pass,
sum(if(c.source=4,1,0)) quick_pass
<if test="tempSubMchId">
,sum(if(locate(sub_merchant_id,#{tempSubMchId})>0 and scc.skip_clearing=0,1,0)) temp_submchid
,sum(if(locate(c.sub_merchant_id,#{tempSubMchId})>0 and scc.skip_clearing=0,1,0)) temp_submchid
</if>
FROM sys_clients c
left join sys_client_config scc on scc.client_id = c.client_id

Loading…
Cancel
Save