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 8 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.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean; 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.notice.beans.NoticeInfo;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
@ -88,6 +90,8 @@ public interface RetailAppService {
JSONObject getClientInfoRealtime(JSONObject device); JSONObject getClientInfoRealtime(JSONObject device);
JSONObject getClientInfoMe(JSONObject device);
JSONObject updateRetailConfig(JSONObject device, boolean paySurcharge); JSONObject updateRetailConfig(JSONObject device, boolean paySurcharge);
JSONObject setRequireRemarkConfig(JSONObject device, boolean enabled); JSONObject setRequireRemarkConfig(JSONObject device, boolean enabled);
@ -135,4 +139,10 @@ public interface RetailAppService {
void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception; void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception;
Map<String,JSONObject> channelAndDayOfAnalysis(int client_id, String clearingDetailId, String channel, JSONObject device); 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.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; 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.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.ClientSettleDelayConfMapper;
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; 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.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; 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.core.ClientModifySupport;
@ -160,9 +163,14 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource @Resource
private ClientConfigService clientConfigService; private ClientConfigService clientConfigService;
@Resource @Resource
private ClientMapper clientMapper;
@Resource
private ClientModifySupport clientModifySupport; private ClientModifySupport clientModifySupport;
private Map<String, AppMsgSender> senderMap = new HashMap<>(); 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 @Resource
public void setAppMsgSenders(AppMsgSender[] senders) { public void setAppMsgSenders(AppMsgSender[] senders) {
Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender)); Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender));
@ -260,7 +268,8 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("url", url); res.put("url", url);
res.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false)); 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)); res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config));
return res; return res;
} }
@ -328,6 +337,42 @@ public class RetailAppServiceImp implements RetailAppService {
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 @Override
public void updateClient(JSONObject device, AppClientBean appClientBean) { public void updateClient(JSONObject device, AppClientBean appClientBean) {
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");
@ -361,6 +406,23 @@ public class RetailAppServiceImp implements RetailAppService {
return clientWithConfig; 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 @Override
public JSONObject updateRetailConfig(JSONObject device, boolean clientPaySurcharge) { public JSONObject updateRetailConfig(JSONObject device, boolean clientPaySurcharge) {
JSONObject user = userInfo(device); JSONObject user = userInfo(device);
@ -1207,8 +1269,6 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("transactions", transactions); 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("date", TimeZoneUtils.formatTime(date, "dd/MMM/yyyy", timezone));
analysis.put("display_amount", display_amount); analysis.put("display_amount", display_amount);
@ -1576,10 +1636,10 @@ public class RetailAppServiceImp implements RetailAppService {
@Override @Override
public void changeManualSettle(JSONObject device, boolean manual_settle) { public void changeManualSettle(JSONObject device, boolean manual_settle) {
JSONObject account = clientAccountMapper.findById(device.getString("account_id")); 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) { private static boolean mathchLetterorNum(String str) {
String regex = "[A-Za-z0-9]{8}"; String regex = "[A-Za-z0-9]{8}";
return str.matches(regex); 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.bean.QueryBillOrderBean;
import au.com.royalpay.payment.manage.bill.core.BillOrderService; import au.com.royalpay.payment.manage.bill.core.BillOrderService;
import au.com.royalpay.payment.manage.bill.core.BillService; 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.settlement.core.ManualSettleSupport;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService; import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.tools.CommonConsts; 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.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils; 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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; 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 org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal; 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. * Created by yishuqian on 28/03/2017.
*/ */
@AppClientController @RestController
@RequestMapping("/api/v1.0/retail/app") @RequestMapping("/api/v1.0/retail/app")
public class RetailAppController { public class RetailAppController {
@Resource @Resource
@ -71,6 +76,11 @@ public class RetailAppController {
private ClientContractService clientContractService; private ClientContractService clientContractService;
@Resource @Resource
private ManualSettleSupport manualSettleSupport; private ManualSettleSupport manualSettleSupport;
@Resource
private AttachmentClient attachmentClient;
@Resource
private ClientManager clientManager;
@RequestMapping(value = "/token", method = RequestMethod.PUT) @RequestMapping(value = "/token", method = RequestMethod.PUT)
public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) { public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) {
@ -235,6 +245,22 @@ public class RetailAppController {
return retailAppService.getClientInfo(device); 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) @RequestMapping(value = "/client/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
JSONObject defaultResult = new JSONObject(); JSONObject defaultResult = new JSONObject();
@ -258,6 +284,16 @@ public class RetailAppController {
retailAppService.updateClient(device, appClientBean); 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) @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, 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) { @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")); result.put("require_remark", client.getBooleanValue("require_remark"));
return result; 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") @AdvanceSelect(addonWhereClause = "is_valid=1 and approve_email_id is not null and approve_email_send=3")
List<JSONObject> listClientsWithEmailNotVerify(); List<JSONObject> listClientsWithEmailNotVerify();
List<JSONObject> listUnAuthPartners(@Param("auth_days") int auth_days); List<JSONObject> listUnAuthPartners(@Param("auth_days") int auth_days);
JSONObject analysisClients(JSONObject params); JSONObject analysisClients(JSONObject params);
@ -81,4 +80,7 @@ public interface ClientMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1") @AdvanceSelect(addonWhereClause = "is_valid=1")
List<JSONObject> listClientsByBD(@Param("bd_user") String bd_user); 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 @Transactional
void updateClientRegisterInfo(JSONObject manager, String clientMoniker, ClientRegisterInfo info); void updateClientRegisterInfo(JSONObject manager, String clientMoniker, ClientRegisterInfo info);
@Transactional
void updateClientRegisterInfoV2(JSONObject manager, String clientMoniker, JSONObject info);
@Transactional @Transactional
void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo); void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo);
@ -298,4 +301,7 @@ public interface ClientManager {
JSONObject getWithConfig(int client_id); JSONObject getWithConfig(int client_id);
List<JSONObject> getClientsByBD(String bd_user); 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 @Resource
private MpWechatApiProvider mpWechatApiProvider; private MpWechatApiProvider mpWechatApiProvider;
@PostConstruct @PostConstruct
public void init() { public void init() {
tags.add("account"); tags.add("account");
} }
@Override @Override
public JSONObject getSysRateConfig() { public JSONObject getSysRateConfig() {
String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates");
@ -636,6 +636,44 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport.clearClientCache(clientId); 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);
}
@Override @Override
public void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo) { public void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -671,6 +709,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
clientInfoCacheSupport.clearClientCache(clientId); 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(); JSONObject log = new JSONObject();
log.put("sub_merchant_id_after", subMerchantInfo.getString("sub_merchant_id")); log.put("sub_merchant_id_after", subMerchantInfo.getString("sub_merchant_id"));
@ -1664,7 +1703,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
qrboardConfig.put("brandw", "600"); qrboardConfig.put("brandw", "600");
qrboardConfig.put("brandh", "200"); qrboardConfig.put("brandh", "200");
String type = qrboardConfig.getString("type"); 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); QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous); board.drawBoardImage(ous);
} catch (Exception e) { } catch (Exception e) {
@ -1685,7 +1725,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString); JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString);
String type = qrboardConfig.getString("type"); 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); QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous); board.drawBoardImage(ous);
} catch (Exception e) { } catch (Exception e) {
@ -3461,4 +3502,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
public List<JSONObject> getClientsByBD(String bd_user) { public List<JSONObject> getClientsByBD(String bd_user) {
return clientMapper.listClientsByBD(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 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} AND c.merchant_id IS NOT NULL AND c.sub_merchant_id = #{sub_merchant_id}
</select> </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> </mapper>
Loading…
Cancel
Save