|
|
|
@ -4047,6 +4047,33 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject comListPartnerSelection(JSONObject manager, PartnerQuery query) {
|
|
|
|
|
JSONObject params = query.toJsonParam();
|
|
|
|
|
String tempSubMchId = sysConfigManager.getSysConfig().getString("temp_sub_mch_id");
|
|
|
|
|
String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source");
|
|
|
|
|
tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource;
|
|
|
|
|
if (query.isTempMchId()) {
|
|
|
|
|
params.put("temp_mch_id", tempSubMchId);
|
|
|
|
|
params.put("temp_mch_id_source", tempSubMchSource);
|
|
|
|
|
}
|
|
|
|
|
PageList<JSONObject> partners = clientMapper.comListPartners(params,
|
|
|
|
|
new PageBounds(query.getPage(), query.getLimit(), Order.formString("is_valid.desc,-approve_time.asc,create_time.desc")));
|
|
|
|
|
int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期
|
|
|
|
|
for (JSONObject partner : partners) {
|
|
|
|
|
String subMerchantId = partner.getString("sub_merchant_id");
|
|
|
|
|
if (subMerchantId != null && tempSubMchId != null && tempSubMchId.contains(subMerchantId)
|
|
|
|
|
&& !tempSubMchSource.contains(partner.getString("client_moniker"))) {
|
|
|
|
|
partner.put("temp_sub_merchant", true);
|
|
|
|
|
}
|
|
|
|
|
if (partner.getIntValue("approve_result") == 2) {
|
|
|
|
|
partner.put("expiry_time", DateUtils.addDays(partner.getDate("approve_time"), authDays));
|
|
|
|
|
partner.put("pass_timeout", DateUtils.addDays(partner.getDate("approve_time"), authDays).compareTo(new Date()) < 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return PageListUtils.buildPageListResult(partners);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) {
|
|
|
|
|
TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null);
|
|
|
|
|