add App银行信息接口

master
luoyang 6 years ago
parent cc46f27ee0
commit 691097fd17

@ -0,0 +1,480 @@
package au.com.royalpay.payment.manage.appclient.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class AppMerchantBean {
private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
private String textType;
private String searchText;
private String client_moniker;
private String state;
private String suburb;
private String short_name;
private String sub_merchant_id;
private String org_id;
private String org_ids;
private String bd;
private String business_structure;
private String industry;
private Integer clean_day;
private String bd_city;
private String surcharge_start_rate;
private String surcharge_end_rate;
private String create_start_time;
private String approve_start_time;
private String create_end_time;
private String approve_end_time;
private String transaction_start_time;
private String transaction_end_time;
private boolean approving = false;
private int page = 1;
private int limit = 10;
private boolean onlyMe = false;
private boolean tempMchId = false;
private boolean quickPass = false;
private boolean greenChannel = false;
private boolean greenChannelBdTodo = false;
private boolean pass = false;
private boolean completed_contract = false;
private boolean apply_to_back = false;
private boolean bd_upload_material = false;
private boolean is_valid = false;
private String merchant_id;
private int status;
public String getClient_moniker() {
return StringUtils.isEmpty(client_moniker) ? null : client_moniker;
}
public void setClient_moniker(String client_moniker) {
this.client_moniker = client_moniker;
}
public String getShort_name() {
return short_name;
}
public void setShort_name(String short_name) {
this.short_name = short_name;
}
public String getSub_merchant_id() {
return sub_merchant_id;
}
public void setSub_merchant_id(String sub_merchant_id) {
this.sub_merchant_id = sub_merchant_id;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
public JSONObject toJsonParam() {
JSONObject param = new JSONObject();
if (StringUtils.isNotBlank(client_moniker)) {
param.put("client_moniker", getClient_moniker());
}
if (StringUtils.isNotBlank(short_name)) {
param.put("short_name", short_name);
}
if (StringUtils.isNotBlank(sub_merchant_id)) {
param.put("sub_merchant_id", sub_merchant_id);
}
if (StringUtils.isNotBlank(state)) {
param.put("state", state);
}
if (StringUtils.isNotBlank(suburb)) {
param.put("suburb", suburb);
}
if (StringUtils.isNotBlank(searchText)) {
param.put("search_text", searchText);
if (StringUtils.isNotBlank(textType)) {
param.put("text_type", textType);
} else {
param.put("text_type", "all");
}
}
if (approving) {
param.put("approving", true);
}
if (org_id != null) {
param.put("org_id", org_id);
}
if (org_ids != null) {
param.put("org_ids", org_ids);
}
if (StringUtils.isNotBlank(bd)) {
param.put("bd_user", bd);
}
if (quickPass){
param.put("quickPass",true);
}
if (greenChannel){
param.put("greenChannel",true);
}
if (business_structure!=null && !business_structure.equals("")){
param.put("business_structure",business_structure);
}
if (industry!=null && !industry.equals("")){
param.put("industry",industry);
}
if (bd_city!=null && !bd_city.equals("")){
param.put("bd_city",bd_city);
}
if (clean_day!=null){
param.put("clean_day",clean_day);
}
if (surcharge_start_rate!=null) {
param.put("surcharge_start_rate",surcharge_start_rate);
}
if (surcharge_end_rate!=null){
param.put("surcharge_end_rate",surcharge_end_rate);
}
if (transaction_start_time != null) {
try {
param.put("transaction_start_time", format.parse(transaction_start_time));
} catch (ParseException e) {
throw new ParamInvalidException("transaction_start_time", "error.payment.valid.invalid_date_format");
}
}
if (transaction_end_time != null) {
try {
param.put("transaction_end_time", DateUtils.addDays(format.parse(transaction_end_time), 1));
} catch (ParseException e) {
throw new ParamInvalidException("transaction_end_time", "error.payment.valid.invalid_date_format");
}
}
if (create_start_time != null) {
try {
param.put("create_start_time", format.parse(create_start_time));
} catch (ParseException e) {
throw new ParamInvalidException("create_start_time", "error.payment.valid.invalid_date_format");
}
}
if (create_end_time != null) {
try {
param.put("create_end_time", DateUtils.addDays(format.parse(create_end_time), 1));
} catch (ParseException e) {
throw new ParamInvalidException("create_end_time", "error.payment.valid.invalid_date_format");
}
}
if (approve_start_time != null) {
try {
param.put("approve_start_time", format.parse(approve_start_time));
} catch (ParseException e) {
throw new ParamInvalidException("approve_start_time", "error.payment.valid.invalid_date_format");
}
}
if (approve_end_time != null) {
try {
param.put("approve_end_time", DateUtils.addDays(format.parse(approve_end_time), 1));
} catch (ParseException e) {
throw new ParamInvalidException("approve_end_time", "error.payment.valid.invalid_date_format");
}
}
if (greenChannelBdTodo){
param.put("greenChannelBdTodo",true);
}
if (is_valid){
param.put("is_valid",true);
}
if (pass){
param.put("pass",true);
}
if (completed_contract){
param.put("completed_contract",true);
}
if (apply_to_back){
param.put("apply_to_back",true);
}
if (bd_upload_material){
param.put("bd_upload_material",true);
}
if (merchant_id != null){
param.put("merchant_id",merchant_id);
}
return param;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getTextType() {
return textType;
}
public void setTextType(String textType) {
this.textType = textType;
}
public String getSearchText() {
return searchText;
}
public void setSearchText(String searchText) {
this.searchText = searchText;
}
public String getOrg_id() {
return org_id;
}
public void setOrg_id(String org_id) {
this.org_id = org_id;
}
public void setOnlyMe(boolean onlyMe) {
this.onlyMe = onlyMe;
}
public boolean getOnlyMe() {
return onlyMe;
}
public boolean isTempMchId() {
return tempMchId;
}
public void setTempMchId(boolean tempMchId) {
this.tempMchId = tempMchId;
}
public String getBusiness_structure() {
return business_structure;
}
public void setBusiness_structure(String business_structure) {
this.business_structure = business_structure;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public Integer getClean_day() {
return clean_day;
}
public void setClean_day(Integer clean_day) {
this.clean_day = clean_day;
}
public String getBd_city() {
return bd_city;
}
public void setBd_city(String bd_city) {
this.bd_city = bd_city;
}
public String getCreate_start_time() {
return create_start_time;
}
public void setCreate_start_time(String create_start_time) {
this.create_start_time = create_start_time;
}
public String getApprove_start_time() {
return approve_start_time;
}
public void setApprove_start_time(String approve_start_time) {
this.approve_start_time = approve_start_time;
}
public String getCreate_end_time() {
return create_end_time;
}
public void setCreate_end_time(String create_end_time) {
this.create_end_time = create_end_time;
}
public String getApprove_end_time() {
return approve_end_time;
}
public void setApprove_end_time(String approve_end_time) {
this.approve_end_time = approve_end_time;
}
public String getSurcharge_start_rate() {
return surcharge_start_rate;
}
public void setSurcharge_start_rate(String surcharge_start_rate) {
this.surcharge_start_rate = surcharge_start_rate;
}
public String getTransaction_start_time() {
return transaction_start_time;
}
public void setTransaction_start_time(String transaction_start_time) {
this.transaction_start_time = transaction_start_time;
}
public String getTransaction_end_time() {
return transaction_end_time;
}
public void setTransaction_end_time(String transaction_end_time) {
this.transaction_end_time = transaction_end_time;
}
public String getSurcharge_end_rate() {
return surcharge_end_rate;
}
public void setSurcharge_end_rate(String surcharge_end_rate) {
this.surcharge_end_rate = surcharge_end_rate;
}
public boolean isOnlyMe() {
return onlyMe;
}
public boolean isApproving() {
return approving;
}
public void setApproving(boolean approving) {
this.approving = approving;
}
public boolean isQuickPass() {
return quickPass;
}
public void setQuickPass(boolean quickPass) {
this.quickPass = quickPass;
}
public boolean isGreenChannel() {
return greenChannel;
}
public void setGreenChannel(boolean greenChannel) {
this.greenChannel = greenChannel;
}
public void setGreenChannelAndBDtodo(boolean bDTodo){
this.greenChannelBdTodo = bDTodo;
}
public void setIs_valid(boolean is_valid){
this.is_valid=is_valid;
}
public DateFormat getFormat() {
return format;
}
public boolean isGreenChannelBdTodo() {
return greenChannelBdTodo;
}
public void setGreenChannelBdTodo(boolean greenChannelBdTodo) {
this.greenChannelBdTodo = greenChannelBdTodo;
}
public boolean isPass() {
return pass;
}
public void setPass(boolean pass) {
this.pass = pass;
}
public boolean isCompleted_contract() {
return completed_contract;
}
public void setCompleted_contract(boolean completed_contract) {
this.completed_contract = completed_contract;
}
public boolean isApply_to_back() {
return apply_to_back;
}
public void setApply_to_back(boolean apply_to_back) {
this.apply_to_back = apply_to_back;
}
public boolean isBd_upload_material() {
return bd_upload_material;
}
public void setBd_upload_material(boolean bd_upload_material) {
this.bd_upload_material = bd_upload_material;
}
public boolean isIs_valid() {
return is_valid;
}
public String getOrg_ids() {
return org_ids;
}
public void setOrg_ids(String org_ids) {
this.org_ids = org_ids;
}
public void setBd(String bd) {
this.bd = bd;
}
public String getMerchant_id() {
return merchant_id;
}
public void setMerchant_id(String merchant_id) {
this.merchant_id = merchant_id;
}
public String getSuburb() {
return suburb;
}
public void setSuburb(String suburb) {
this.suburb = suburb;
}
public void setStatus(int status) {
this.status = status;
}
public int getStatus() {
return status;
}
}

@ -1,10 +1,13 @@
package au.com.royalpay.payment.manage.appclient.core;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import java.util.List;
public interface ManageAppService {
@ -25,17 +28,21 @@ public interface ManageAppService {
void updateClientRegisterInfo(JSONObject device, String clientMoniker, ClientRegisterInfo info);
List<JSONObject> listPartners(JSONObject device, PartnerQuery query);
JSONObject listPartners(JSONObject device, AppMerchantBean query);
JSONObject clientDetail(JSONObject device, String clientMoniker);
JSONObject clientBankAccount(JSONObject device, String clientMoniker);
void saveBankAccount(JSONObject device, String clientMoniker, BankAccountInfo bankAccount);
JSONObject getNewVersion(JSONObject device);
JSONObject getCommons(JSONObject device);
List<JSONObject> getOrgPrizeList(JSONObject device);
List<JSONObject> getBdConfigRates(JSONObject device);
List<JSONObject> getOrgPrizeDetail(JSONObject device, Date month);
JSONObject getBdConfigKpi(JSONObject device);

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.appclient.core.impls;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.appclient.core.ManageAppService;
import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
@ -10,6 +11,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ManageDeviceTokenMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
@ -111,11 +113,37 @@ public class ManageAppServiceImp implements ManageAppService {
}
@Override
public List<JSONObject> listPartners(JSONObject device, PartnerQuery query) {
public JSONObject listPartners(JSONObject device, AppMerchantBean query) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
return clientManager.listPartners(manager, query);
switch (query.getStatus()) {
case 0:
query.setIs_valid(true);
break;
case 1:
query.setPass(true);
break;
case 2:
query.setApproving(true);
break;
case 3:
query.setCompleted_contract(true);
break;
case 4:
query.setBd_upload_material(true);
break;
case 5:
query.setApply_to_back(true);
break;
case 6:
query.setGreenChannel(true);
break;
case 7:
query.setQuickPass(true);
break;
}
return clientManager.listClientsByApp(manager, query);
}
@Override
@ -126,6 +154,23 @@ public class ManageAppServiceImp implements ManageAppService {
return clientManager.clientDetail(manager, clientMoniker);
}
@Override
public JSONObject clientBankAccount(JSONObject device, String clientMoniker) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
return clientManager.listClientBankAccounts(manager, clientMoniker);
}
@Override
public void saveBankAccount(JSONObject device, String clientMoniker, BankAccountInfo bankAccount) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
clientManager.saveBankAccount(manager, clientMoniker, bankAccount);
}
@Override
public void updateDevTokenStatus(String devId, int status) {
JSONObject devTokenObj = getDevTokenByDevId(devId);
@ -238,15 +283,15 @@ public class ManageAppServiceImp implements ManageAppService {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
List<JSONObject> getOrgPrizeList = financialPartnerCommissionMapper.getOrgPrizeList(manager.getString("org_id"));
return getOrgPrizeList;
return financialPartnerCommissionMapper.getOrgPrizeList(manager.getString("org_id"));
}
@Override
public List<JSONObject> getBdConfigRates(JSONObject device) {
public List<JSONObject> getOrgPrizeDetail(JSONObject device, Date month) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
return bdPrizeService.getRateConfig();
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
return financialPartnerCommissionMapper.getOrgPrizeDetail(manager.getString("org_id"), month);
}
@Override

@ -1,6 +1,8 @@
package au.com.royalpay.payment.manage.appclient.web;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.appclient.core.ManageAppService;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
@ -8,9 +10,11 @@ import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.device.manageadvise.AppClientController;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.Errors;
@ -19,6 +23,8 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
@ -73,7 +79,7 @@ public class ManageAppController {
}
@RequestMapping(value = "/merchants", method = RequestMethod.GET)
public List<JSONObject> listPartners(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, PartnerQuery query) {
public JSONObject listPartners(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, AppMerchantBean query) {
return manageAppService.listPartners(device, query);
}
@ -82,6 +88,18 @@ public class ManageAppController {
return manageAppService.clientDetail(device, clientMoniker);
}
@RequestMapping(value = "/merchant/{clientMoniker}/bank_account", method = RequestMethod.GET)
public JSONObject getBankAccount(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.clientBankAccount(device, clientMoniker);
}
@RequestMapping(value = "/merchant/{clientMoniker}/bank_account", method = RequestMethod.PUT)
public void saveBankAccount(@PathVariable String clientMoniker, @RequestBody @Valid BankAccountInfo bankAccount, Errors errors,
@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
HttpUtils.handleValidErrors(errors);
manageAppService.saveBankAccount(device, clientMoniker, bankAccount);
}
@RequestMapping(value = "/version", method = RequestMethod.GET)
public JSONObject getAppVersion(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.getNewVersion(device);
@ -97,9 +115,15 @@ public class ManageAppController {
return manageAppService.getOrgPrizeList(device);
}
@RequestMapping(value = "/bd/rates", method = RequestMethod.GET)
public List<JSONObject> getBdConfigRates(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.getBdConfigRates(device);
@RequestMapping(value = "/org_prize/{monthStr}", method = RequestMethod.GET)
public List<JSONObject> getOrgPrizeDetail(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@PathVariable String monthStr) {
Date date;
try {
date = DateUtils.parseDate(monthStr, new String[] { "yyyy-MM" });
} catch (ParseException e) {
throw new BadRequestException("Invalid month format");
}
return manageAppService.getOrgPrizeDetail(device, date);
}
@RequestMapping(value = "/bd/kpi", method = RequestMethod.GET)

@ -8,6 +8,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@ -26,6 +27,8 @@ public interface FinancialPartnerCommissionMapper {
List<JSONObject> getOrgPrizeList(@Param("org_id") String orgId);
List<JSONObject> getOrgPrizeDetail(@Param("org_id") String orgId,@Param("month") Date month);
List<Integer> listAvailableMonths(@Param("year") int year);
List<JSONObject> listWithOrgInfo(@Param("year") int year, @Param("month") int month);

@ -42,6 +42,8 @@ public interface ClientMapper {
PageList<JSONObject> listPartners(JSONObject params, PageBounds pagination);
PageList<JSONObject> listLessInfoPartners(JSONObject params, PageBounds pagination);
PageList<JSONObject> comListPartners(JSONObject params, PageBounds pagination);
List<JSONObject> listClientsIdAndMoniker();

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig;
@ -48,6 +49,8 @@ public interface ClientManager {
JSONObject listClients(JSONObject manager, PartnerQuery query);
JSONObject listClientsByApp(JSONObject manager, AppMerchantBean query);
List<JSONObject> listPartners(JSONObject manager, PartnerQuery query);
@Transactional

@ -19,6 +19,7 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
@ -534,6 +535,69 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return PageListUtils.buildPageListResult(partners);
}
@Override
public JSONObject listClientsByApp(JSONObject manager, AppMerchantBean query) {
JSONObject params = query.toJsonParam();
if (params.getString("org_id") != null) {
if (params.getString("org_ids") == null) {
orgIds(params, Integer.parseInt(params.getString("org_id")));
} else {
params.put("org_id", params.getString("org_ids"));
params.remove("org_ids");
}
}
JSONObject org = null;
if (params.getString("org_id") != null) {
org = orgMapper.findOne(params.getIntValue("org_id"));
if (org.getIntValue("type") == 1) {
params.put("referrer_id", org.getString("org_id"));
params.remove("org_id");
}
}
int orgId = manager.getIntValue("org_id");
if (orgId > 0) {
if (params.getString("org_ids") == null) {
JSONObject org2 = orgMapper.findOne(orgId);
if (org2.getString("parent_org_id") != null) {
params.put("org_id", orgId);
} else {
params.put("org_id", orgId);
orgIds(params, orgId);
}
} else {
params.put("org_id", params.getIntValue("org_ids"));
params.remove("org_ids");
}
}
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id"));
if (bdConfig != null) {
params.put("bd_group", bdConfig.getString("bd_group"));
List<JSONObject> listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group"));
List<String> bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList());
if (params.containsKey("bd_user")) {
if (!bdUserId.contains(params.getString("bd_user"))) {
params.remove("bd_user");
}
}
if (params.containsKey("org_ids")) {
params.remove("org_ids");
}
if (params.containsKey("org_id")) {
params.remove("org_id");
}
}
if (query.getOnlyMe()) {
params.put("bd_user", manager.getString("manager_id"));
}
}
PageList<JSONObject> partners = clientMapper.listLessInfoPartners(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("is_valid.desc,-approve_time.asc,create_time.desc")));
int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期
return PageListUtils.buildPageListResult(partners);
}
private void orgIds(JSONObject params, int orgId) {
JSONObject param = new JSONObject();
param.put("parent_org_id", params.getString("org_id"));

@ -5,8 +5,17 @@
SELECT *
FROM financial_partner_commission
WHERE org_id = #{org_id}
GROUP BY `year`,`month`
ORDER BY `year` DESC,`month` DESC
</select>
<select id="getOrgPrizeDetail" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM financial_partner_commission
WHERE org_id = #{org_id}
AND
`year` = year(month)
AND `month` = month(month)
</select>
<select id="listAvailableMonths" resultType="java.lang.Integer">
SELECT DISTINCT `month`
FROM financial_partner_commission

@ -154,6 +154,85 @@
<if test="is_valid">and c.is_valid=1</if>
</where>
</select>
<select id="listLessInfoPartners" resultType="com.alibaba.fastjson.JSONObject">
SELECT DISTINCT c.client_moniker,c.source,c.approve_result,c.short_name,c.company_phone,c.approve_time,c.create_time,c.open_status,c.address,c.state,c.suburb,c.is_valid,c.postcode,c.country,o.name org_name
FROM sys_clients c
inner join sys_client_config cc on cc.client_id = c.client_id
inner join sys_org o
on o.org_id=c.org_id
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= date(now()) and (d.end_date is null or date(d.end_date)&gt;= date(now())) and
d.is_valid=1
</if>
<where>
<if test="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config fb ON fb.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
<if test="approving">
and ((c.approve_result=4 and c.open_status is null) or (c.approve_result=3 and c.open_status is null) or
c.open_status=1 or c.open_status=2 or c.open_status=4)
</if>
<if test="quickPass">
and c.source=4
</if>
<if test="greenChannel">
and ((c.source=1 or c.source=2) and c.approve_result=2 or c.open_status=10)
</if>
<if test="greenChannelBdTodo">
and ((c.source=1 or c.source=2) and c.approve_result=2 and (c.open_status is null or c.open_status=3))
</if>
<if test="pass">
and c.open_status = 5 AND c.approve_result = 1 AND c.approve_time IS NOT NULL
</if>
<if test="completed_contract">
and c.open_status IS NULL AND c.approve_result IS NULL AND c.source != 4
</if>
<if test="apply_to_back">
AND c.approve_result = 5 AND c.approve_time is NOT NULL
</if>
<if test="bd_upload_material">
AND c.open_status = 3 AND c.approve_result != 5
</if>
<if test="search_text!=null">
<bind name="name_pattern" value="'%'+search_text+'%'"/>
<if test="text_type=='all'">
and (c.client_moniker=#{search_text} or c.short_name like #{name_pattern} or c.company_name like
#{name_pattern} or c.business_name like #{name_pattern} or c.remark like
#{name_pattern} or c.contact_email=#{search_text})
</if>
<if test="text_type=='client_moniker'">
and c.client_moniker=#{search_text}
</if>
<if test="text_type=='client_name'">
and c.short_name like #{name_pattern}
</if>
<if test="text_type=='company_name'">
and c.company_name like #{name_pattern}
</if>
<if test="text_type=='business_name'">
and c.business_name like #{name_pattern}
</if>
<if test="text_type=='contact_email'">
and c.contact_email = #{search_text}
</if>
<if test="text_type=='remark'">
and c.remark like #{name_pattern}
</if>
</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="is_valid">and c.is_valid=0</if>
</where>
</select>
<select id="comListPartners" resultType="com.alibaba.fastjson.JSONObject">
SELECT DISTINCT c.*,o.name org_name
FROM sys_clients c

Loading…
Cancel
Save