Merge remote-tracking branch 'origin/develop' into develop

master
yixian 6 years ago
commit 615b9ddda0

@ -160,4 +160,7 @@ public interface RetailAppService {
JSONObject ctripCouponInfo(JSONObject device,String coupon_id); JSONObject ctripCouponInfo(JSONObject device,String coupon_id);
JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean);
void saveCouponAccuessLog(int client_id, String coupon_id);
} }

@ -172,6 +172,10 @@ public class RetailAppServiceImp implements RetailAppService {
private ClearingLogMapper clearingLogMapper; private ClearingLogMapper clearingLogMapper;
@Resource @Resource
private CustomerServiceService customerServiceService; private CustomerServiceService customerServiceService;
@Resource
private CouponAccuessLogMapper couponAccuessLogMapper;
@Resource
private CouponValidateService couponValidateService;
private Map<String, AppMsgSender> senderMap = new HashMap<>(); private Map<String, AppMsgSender> senderMap = new HashMap<>();
private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" }; private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" };
@ -447,8 +451,50 @@ public class RetailAppServiceImp implements RetailAppService {
@Override @Override
public JSONObject ctripCouponInfo(JSONObject device, String coupon_id) { public JSONObject ctripCouponInfo(JSONObject device, String coupon_id) {
return couponVerificationService.ctripCouponInfo(coupon_id,device.getIntValue("client_id")); return couponVerificationService.ctripCouponInfo(coupon_id,device.getIntValue("client_id"), true);
}
@Override
public JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean) {
JSONObject client = clientMapper.findClientByMoniker(client_moniker);
if (client == null) {
throw new BadRequestException("Partner not exists");
}
PageList<JSONObject> cusCouponLogs = couponAccuessLogMapper.getCouponAccuessLog(
client.getIntValue("client_id"), new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("creation_date.desc")));
HashMap<String, JSONObject> couponMap = new HashMap<>();
for(JSONObject cusCouponLog : cusCouponLogs) {
cusCouponLog.put("client_moniker", client_moniker);
if (couponMap.containsKey(cusCouponLog.getString("coupon_id"))) {
cusCouponLog.put("coupon", couponMap.get(cusCouponLog.getString("coupon_id")));
continue;
}
JSONObject coupon = couponValidateService.ctripCouponInfo(cusCouponLog.getString("coupon_id"), cusCouponLog.getIntValue("client_id"), false);
couponMap.put(cusCouponLog.getString("coupon_id"), coupon);
cusCouponLog.put("coupon", coupon);
}
return PageListUtils.buildPageListResult(cusCouponLogs);
}
@Override
public void saveCouponAccuessLog(int client_id, String coupon_id) {
JSONObject client = clientMapper.findClient(client_id);
if (client == null) {
throw new BadRequestException("Partner not exists");
}
JSONObject couponAccuessLog = new JSONObject();
Date date = new Date();
couponAccuessLog.put("client_id", client_id);
couponAccuessLog.put("order_id", "非平台订单");
couponAccuessLog.put("coupon_id", coupon_id);
couponAccuessLog.put("customer_openid", "非平台订单");
couponAccuessLog.put("coupon_deal_amount", 0);
couponAccuessLog.put("currency", "AUD");
couponAccuessLog.put("creation_date", date);
couponAccuessLog.put("last_update_date", date);
couponAccuessLog.put("is_valid", 1);
couponAccuessLogMapper.save(couponAccuessLog);
} }
@Override @Override

@ -564,4 +564,14 @@ public class RetailAppController {
return retailAppService.ctripCouponInfo(device,couponId); return retailAppService.ctripCouponInfo(device,couponId);
} }
@RequestMapping(value = "/cus/coupon_accuess_log/{client_moniker}", method = RequestMethod.GET)
public JSONObject getCouponLogByClientMoniker(@PathVariable String client_moniker, AppQueryBean appQueryBean) {
return retailAppService.getCouponCusCouponLog(client_moniker, appQueryBean);
}
@RequestMapping(value = "/cus/coupon_accuess_log/{coupon_id}", method = RequestMethod.POST)
public void saveCouponAccuessLog(@PathVariable String coupon_id, @RequestParam int client_id) {
retailAppService.saveCouponAccuessLog(client_id, coupon_id);
}
} }

@ -4,6 +4,7 @@ import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent;
import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService; import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService;
import au.com.royalpay.payment.manage.mappers.system.SysCustomerPaymentInfoMapper; import au.com.royalpay.payment.manage.mappers.system.SysCustomerPaymentInfoMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -21,6 +22,8 @@ public class AfterPaymentFinishListener implements ApplicationListener<AfterPaym
private SysCustomerPaymentInfoMapper sysCustomerPaymentInfoMapper; private SysCustomerPaymentInfoMapper sysCustomerPaymentInfoMapper;
@Resource @Resource
private CustomerPaymentInfoService customerPaymentInfoService; private CustomerPaymentInfoService customerPaymentInfoService;
@Resource
private ClientManager clientManager;
@Override @Override
public void onApplicationEvent(AfterPaymentFinishEvent event) { public void onApplicationEvent(AfterPaymentFinishEvent event) {
@ -41,13 +44,13 @@ public class AfterPaymentFinishListener implements ApplicationListener<AfterPaym
sysCustomerPaymentInfoMapper.update(orderInfo); sysCustomerPaymentInfoMapper.update(orderInfo);
}else { }else {
JSONObject lastOrderInfo = new JSONObject(); JSONObject lastOrderInfo = new JSONObject();
lastOrderInfo.put("wechat_openid", extParam.getString("customer_id")); lastOrderInfo.put("wechat_openid", order.getString("customer_id"));
lastOrderInfo.put("idcard_name", extParam.getString("payer_name")); lastOrderInfo.put("idcard_name", extParam.getString("payer_name"));
lastOrderInfo.put("idcard_no", extParam.getString("payer_identity_card")); lastOrderInfo.put("idcard_no", extParam.getString("payer_identity_card"));
lastOrderInfo.put("bankcard", extParam.getString("card_number")); lastOrderInfo.put("bankcard", extParam.getString("card_number"));
lastOrderInfo.put("bank", extParam.getString("bankId")); lastOrderInfo.put("bank", extParam.getString("bankId"));
customerPaymentInfoService.save(lastOrderInfo); customerPaymentInfoService.save(lastOrderInfo);
} }
clientManager.sendHfEmailNotice(order);
} }
} }

@ -18,7 +18,7 @@ public interface CouponValidateService {
JSONObject ctripCheck(int client_id); JSONObject ctripCheck(int client_id);
JSONObject ctripCouponInfo(String coupon_log_id,int client_id); JSONObject ctripCouponInfo(String coupon_log_id,int client_id,boolean is_expiry);
JSONObject ctripCouponLogNotice(String coupon_log_id,String order_id,String open_id,String status); JSONObject ctripCouponLogNotice(String coupon_log_id,String order_id,String open_id,String status);
} }

@ -177,7 +177,7 @@ public class CouponValidateServiceImpl implements CouponValidateService {
} }
@Override @Override
public JSONObject ctripCouponInfo(String coupon_id, int client_id) { public JSONObject ctripCouponInfo(String coupon_id, int client_id, boolean is_expiry) {
JSONObject client = clientManager.getClientInfo(client_id); JSONObject client = clientManager.getClientInfo(client_id);
if(client==null){ if(client==null){
throw new NotFoundException("Merchant Not Found"); throw new NotFoundException("Merchant Not Found");
@ -185,6 +185,9 @@ public class CouponValidateServiceImpl implements CouponValidateService {
String uri = signUrl(UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "/coupon/"+coupon_id+"/couponLogInfo")); String uri = signUrl(UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "/coupon/"+coupon_id+"/couponLogInfo"));
HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET);
gen.addQueryString("client_moniker",client.getString("client_moniker")); gen.addQueryString("client_moniker",client.getString("client_moniker"));
if (!is_expiry) {
gen.addQueryString("is_expiry", "0");
}
try { try {
HttpRequestResult reqResult = gen.execute(); HttpRequestResult reqResult = gen.execute();
if (reqResult.isSuccess()) { if (reqResult.isSuccess()) {

@ -0,0 +1,9 @@
package au.com.royalpay.payment.manage.dev.core;
import com.alibaba.fastjson.JSONObject;
public interface HfUpdateService {
String updateStatus();
}

@ -0,0 +1,40 @@
package au.com.royalpay.payment.manage.dev.core.impl;
import au.com.royalpay.payment.manage.dev.core.HfClearAmountService;
import au.com.royalpay.payment.manage.dev.core.HfUpdateService;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonArray;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.List;
@Service
public class HfUpdateImpl implements HfUpdateService {
@Resource
private ClientMapper clientMapper;
@Resource
private MpWechatApiProvider mpWechatApiProvider;
@Override
public String updateStatus() {
List<JSONObject> clientIds = clientMapper.findByhfPayUrlNotNull();
clientIds.forEach(dbResult -> {
String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + dbResult.getString("client_moniker") + "/jump/pc");
MpWechatApi api = mpWechatApiProvider.getNewPaymentApi();
dbResult.put("hf_pay_url", api.registerShortUrl(longUrl));
clientMapper.update(dbResult);
});
return "ok";
}
}

@ -13,10 +13,7 @@ import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.dev.bean.AliExcel; import au.com.royalpay.payment.manage.dev.bean.AliExcel;
import au.com.royalpay.payment.manage.dev.bean.Message; import au.com.royalpay.payment.manage.dev.bean.Message;
import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage; import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage;
import au.com.royalpay.payment.manage.dev.core.AliforexcelService; import au.com.royalpay.payment.manage.dev.core.*;
import au.com.royalpay.payment.manage.dev.core.HfClearAmountService;
import au.com.royalpay.payment.manage.dev.core.NewpartnerService;
import au.com.royalpay.payment.manage.dev.core.WechatMessageService;
import au.com.royalpay.payment.manage.mappers.customers.CustomerEncourageMoneyUseLogMapper; import au.com.royalpay.payment.manage.mappers.customers.CustomerEncourageMoneyUseLogMapper;
import au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper; import au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
@ -110,6 +107,8 @@ public class TestController implements ApplicationEventPublisherAware {
private AliforexcelService aliforexcelService; private AliforexcelService aliforexcelService;
@Resource @Resource
private HfClearAmountService hfClearAmountService; private HfClearAmountService hfClearAmountService;
@Resource
private HfUpdateService hfUpdateService;
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
@ -394,7 +393,12 @@ public class TestController implements ApplicationEventPublisherAware {
} }
@ManagerMapping(value = "/hfClearAmount", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) @ManagerMapping(value = "/hfClearAmount", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
public JSONObject hfClearAmount(@RequestParam String datefrom, @RequestParam String dateto) { public JSONObject hfUpdate(@RequestParam String datefrom, @RequestParam String dateto) {
return hfClearAmountService.hfjsonobject(dateto,datefrom); return hfClearAmountService.hfjsonobject(dateto,datefrom);
} }
@ManagerMapping(value = "/hfUpdate", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
public String hfClearAmount() {
return hfUpdateService.updateStatus();
}
} }

@ -2,6 +2,8 @@ package au.com.royalpay.payment.manage.mappers.log;
import java.util.List; import java.util.List;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -26,4 +28,7 @@ public interface CouponAccuessLogMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
List<JSONObject> findCouponByOrderId(@Param("order_id") String order_id); List<JSONObject> findCouponByOrderId(@Param("order_id") String order_id);
@AutoSql(type = SqlType.SELECT)
PageList<JSONObject> getCouponAccuessLog(@Param("client_id")int client_id, PageBounds pageBounds);
} }

@ -76,4 +76,6 @@ public interface ClientAccountMapper {
List<JSONObject> listNullUnionIdAccounts(); List<JSONObject> listNullUnionIdAccounts();
List<JSONObject> query(JSONObject params); List<JSONObject> query(JSONObject params);
List<JSONObject> partnerAndSubPartnerAccounts(@Param("client_id") int clientId);
} }

@ -4,6 +4,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
@ -94,4 +95,6 @@ public interface ClientMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
JSONObject findByWechatInstitutionMerchantId(@Param("wechat_institution_merchant_id") String wechat_institution_merchant_id); JSONObject findByWechatInstitutionMerchantId(@Param("wechat_institution_merchant_id") String wechat_institution_merchant_id);
List<JSONObject> findByhfPayUrlNotNull();
} }

@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
@ -63,4 +64,7 @@ public interface ManagerMapper {
List<JSONObject> listOpenIdByRole(@Param("mask") int mask); List<JSONObject> listOpenIdByRole(@Param("mask") int mask);
List<JSONObject> listServants(@Param("mask") int mask); List<JSONObject> listServants(@Param("mask") int mask);
@Select("select email from sys_managers where is_valid=1 AND role & 256 > 0 AND email IS NOT NULL")
List<String> listDevManager();
} }

@ -326,4 +326,8 @@ public interface ClientManager {
@Transactional @Transactional
void switchHfLink(JSONObject manager, String clientMoniker,boolean allow); void switchHfLink(JSONObject manager, String clientMoniker,boolean allow);
void sendHfEmailNotice(JSONObject order);
void updateAllPartnerPassword(String clientMoniker, List<String> emails);
} }

@ -154,13 +154,8 @@ import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
@ -416,6 +411,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (audit_logs != null && !audit_logs.isEmpty()) { if (audit_logs != null && !audit_logs.isEmpty()) {
client.put("audit_logs", audit_logs); client.put("audit_logs", audit_logs);
} }
//HF支付链接二维码
if (client.getString("hf_pay_url") != null) {
client.put("hfQrcodeUrl", QRCodeUtils.qrcodeImageCode(client.getString("hf_pay_url"), 200, false));
}
return client; return client;
} }
@ -886,7 +886,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
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 "); throw new BadRequestException("Sub Merchant ID Can't be null ");
} }
String username = clientMoniker + client.getString("sub_merchant_id"); String username = clientMoniker;
boolean duplicated = true; boolean duplicated = true;
String pwd = RandomStringUtils.random(8, true, true); String pwd = RandomStringUtils.random(8, true, true);
while (duplicated) { while (duplicated) {
@ -899,7 +899,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
newAccount(clientMoniker, account, manager, 1); newAccount(clientMoniker, account, manager, 1);
duplicated = false; duplicated = false;
} catch (Exception e) { } catch (Exception e) {
username += "1"; username += "0";
} }
} }
sendInitEmail(client, username, pwd); sendInitEmail(client, username, pwd);
@ -959,9 +959,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
ctx.setVariable("client_moniker", client.getString("client_moniker")); ctx.setVariable("client_moniker", client.getString("client_moniker"));
ctx.setVariable("contact_person", client.getString("contact_person")); ctx.setVariable("contact_person", client.getString("contact_person"));
ctx.setVariable("credential_code", client.getString("credential_code")); ctx.setVariable("credential_code", client.getString("credential_code"));
final String content = thymeleaf.process("mail/new_client_notice", ctx); final String content = thymeleaf.process("mail/new_client_notice", ctx);
// final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", // final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm",
// "utf-8", model); // "utf-8", model);
ctx.setVariable("password", "*****");
final String contentBd = thymeleaf.process("mail/new_client_notice", ctx);
final String mailTo = client.getString("contact_email"); final String mailTo = client.getString("contact_email");
if (StringUtils.isEmpty(mailTo)) { if (StringUtils.isEmpty(mailTo)) {
throw new EmailException("Client Contact Email is invalid"); throw new EmailException("Client Contact Email is invalid");
@ -977,8 +980,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override @Override
public void run() { public void run() {
try { try {
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo, String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo, "", content);
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content); mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","),
"", contentBd);
JSONObject clientUpdate = new JSONObject(); JSONObject clientUpdate = new JSONObject();
clientUpdate.put("client_id", client.getIntValue("client_id")); clientUpdate.put("client_id", client.getIntValue("client_id"));
clientUpdate.put("approve_email_send", 3); clientUpdate.put("approve_email_send", 3);
@ -1175,6 +1179,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) { if (client == null) {
throw new NotFoundException("Client Not Exists"); throw new NotFoundException("Client Not Exists");
} }
if (channel.equals("hf") && !allow && client.getBoolean("enable_hf_email_notice")) {
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_hf_email_notice", allow));
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel "
+ channel + " to " + allow); + channel + " to " + allow);
@ -3754,9 +3761,62 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override
public void sendHfEmailNotice(JSONObject order) {
JSONObject client = clientMapper.findClient(order.getIntValue("client_id"));
JSONObject clientConfig = clientConfigMapper.find(order.getIntValue("client_id"));
if (client == null || clientConfig == null) {
return;
}
if (client.getString("contact_email") == null ||
!clientConfig.getBoolean("enable_hf_email_notice")) {
return;
}
Context ctx = new Context();
ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png"));
ctx.setVariable("name", client.getString("contact_person"));
ctx.setVariable("order_id", order.getString("order_id"));
ctx.setVariable("amount", order.getString("total_amount"));
ctx.setVariable("time", order.getString("create_time"));
final String content = thymeleaf.process( "mail/hf_email_notice", ctx);
final String mailTo = client.getString("contact_email");
if (StringUtils.isEmpty(mailTo)) {
throw new EmailException("Client Contact Email is invalid");
}
new Thread(() -> {
try {
mailService.sendEmail("你刚刚有一笔到账信息", mailTo, "", content);
} catch (Exception ignored) {
logger.error("邮件发送失败", ignored);
}
}).start();
}
@Override
public void updateAllPartnerPassword(String clientMoniker, List<String> emails) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> partners = clientAccountMapper.partnerAndSubPartnerAccounts(client.getIntValue("client_id"));
partners.stream().forEach(partner -> {
String pwd = RandomStringUtils.random(8, true, true);
String salt = PasswordUtils.newSalt();
String pwdHash = PasswordUtils.hashPwd(pwd, salt);
partner.put("salt", salt);
partner.put("password_hash", pwdHash);
partner.put("password_aes", PasswordUtils.encryptAESPwd(pwd));
deviceManager.deviceOffline(partner.getString("account_id"));
clientAccountMapper.update(partner);
signInAccountService.clearAccountCache(partner.getString("account_id"));
partner.put("password", pwd);
});
sendTestMerchantPassword(partners, emails);
}
@Override @Override
public String getShortLink(String clientMoniker) { public String getShortLink(String clientMoniker) {
String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump"); String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump/pc");
MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); MpWechatApi api = mpWechatApiProvider.getNewPaymentApi();
return api.registerShortUrl(longUrl); return api.registerShortUrl(longUrl);
} }
@ -3782,4 +3842,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
private void sendTestMerchantPassword(List<JSONObject> accounts, List<String> emails) {
Context ctx = new Context();
ctx.setVariable("accounts", accounts);
final String content = thymeleaf.process( "mail/test_merchant_password", ctx);
new Thread(() -> {
try {
mailService.sendEmail("测试商户账户已更新", emails.isEmpty() ? "" : StringUtils.join(emails, ","), "", content);
} catch (Exception ignored) {
logger.error("邮件发送失败", ignored);
}
}).start();
}
} }

@ -284,12 +284,12 @@ public class PartnerManageController {
return tradeLogService.listOrderRefunds(orderId, null); return tradeLogService.listOrderRefunds(orderId, null);
} }
@ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR,ManagerRole.DEVELOPER})
public List<JSONObject> partnerAccounts(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public List<JSONObject> partnerAccounts(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listAccounts(manager, clientMoniker); return clientManager.listAccounts(manager, clientMoniker);
} }
@ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER})
public JSONObject addPartnerAccount(@RequestBody @Valid NewAccountBean account, Errors errors, @PathVariable String clientMoniker, public JSONObject addPartnerAccount(@RequestBody @Valid NewAccountBean account, Errors errors, @PathVariable String clientMoniker,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
HttpUtils.handleValidErrors(errors); HttpUtils.handleValidErrors(errors);
@ -546,4 +546,9 @@ public class PartnerManageController {
clientManager.switchHfLink(manager, clientMoniker, pass.getBooleanValue("allow")); clientManager.switchHfLink(manager, clientMoniker, pass.getBooleanValue("allow"));
} }
@ManagerMapping(value = "/{clientMoniker}/hf/email_notice", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow"));
}
} }

@ -0,0 +1,43 @@
package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
@Component
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "false")
public class UpdatePartnerPasswordTask {
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource
private ClientManager clientManager;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Resource
private ManagerMapper managerMapper;
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au," +
"astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
@Scheduled(cron = "0 0 9 28 * ?")
public void resetPartnerPassword() {
synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 120_000, () -> {
final List<String> emails = managerMapper.listDevManager();
List<String> emailList = Arrays.asList(EMAIL.split(","));
emailList.stream().forEach(email -> {
if (!emails.contains(email)) {
emails.add(email);
}
});
clientManager.updateAllPartnerPassword("PINE", emails);
});
}
}

@ -17,4 +17,10 @@
</if> </if>
</where> </where>
</select> </select>
<select id="partnerAndSubPartnerAccounts" resultType="com.alibaba.fastjson.JSONObject">
SELECT sc.client_moniker, sa.*
FROM sys_clients sc
INNER JOIN sys_accounts sa ON sc.client_id = sa.client_id AND sa.is_valid = 1
WHERE sc.client_id = #{client_id} OR sc.parent_client_id = #{client_id} AND sc.is_valid = 1
</select>
</mapper> </mapper>

@ -6,7 +6,8 @@
WHERE is_valid=1 and (approve_result = 1 or approve_result = 2) WHERE is_valid=1 and (approve_result = 1 or approve_result = 2)
</select> </select>
<select id="listGreenChannel" resultType="com.alibaba.fastjson.JSONObject"> <select id="listGreenChannel" resultType="com.alibaba.fastjson.JSONObject">
select m.manager_id manager_id,m.display_name display_name, m.wx_openid wx_openid , c.client_moniker client_moniker select m.manager_id manager_id,m.display_name display_name, m.wx_openid wx_openid , c.client_moniker
client_moniker
from sys_clients c from sys_clients c
left join sys_client_bd cb on cb.client_id = c.client_id left join sys_client_bd cb on cb.client_id = c.client_id
left join sys_managers m on m.manager_id = cb.bd_id left join sys_managers m on m.manager_id = cb.bd_id
@ -101,7 +102,8 @@
and c.suburb like #{suburb_pattern} and c.suburb like #{suburb_pattern}
</if> </if>
<if test="approving"> <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) 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>
<if test="state!=null"> <if test="state!=null">
and c.state=#{state} and c.state=#{state}
@ -137,7 +139,8 @@
<if test="search_text!=null"> <if test="search_text!=null">
<bind name="name_pattern" value="'%'+search_text+'%'"/> <bind name="name_pattern" value="'%'+search_text+'%'"/>
<if test="text_type=='all'"> <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 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}) #{name_pattern} or c.contact_email=#{search_text})
</if> </if>
<if test="text_type=='client_moniker'"> <if test="text_type=='client_moniker'">
@ -161,7 +164,8 @@
</if> </if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</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 <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="referrer_id!=null">and c.referrer_id=#{referrer_id}</if> <if test="referrer_id!=null">and c.referrer_id=#{referrer_id}</if>
<if test="is_valid">and c.is_valid=1</if> <if test="is_valid">and c.is_valid=1</if>
</where> </where>
@ -222,7 +226,8 @@
</if> </if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</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 <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
and c.is_valid=1 and c.is_valid=1
</where> </where>
GROUP BY c.contact_email GROUP BY c.contact_email
@ -267,21 +272,25 @@
<select id="listUnAuthPartners" resultType="com.alibaba.fastjson.JSONObject"> <select id="listUnAuthPartners" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT SELECT
client_id, client_id,
client_moniker, client_moniker,
approve_time approve_time
FROM sys_clients FROM sys_clients
WHERE is_valid = 1 AND approve_result = 2 AND source = 4 AND datediff(now(), approve_time) <= #{auth_days} WHERE is_valid = 1 AND approve_result = 2 AND source = 4 AND datediff(now(), approve_time) <= #{auth_days}
]]> ]]>
</select> </select>
<select id="analysisClients" resultType="com.alibaba.fastjson.JSONObject"> <select id="analysisClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT
sum(if(((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),1,0)) wp, sum(if(((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),1,0)) wp,
sum(if(c.approve_result is null and c.source= 4,1,0)) a_unagree, sum(if(c.approve_result is null and c.source= 4,1,0)) a_unagree,
sum(if(((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) and c.source = 4,1,0)) a_wp, sum(if(((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) and c.source = 4,1,0)) a_wp,
sum(if(c.approve_result=2 and c.source = 4,1,0)) wa, sum(if(c.approve_result=2 and c.source = 4,1,0)) wa,
sum(if(c.approve_result=1,1,0)) pass, sum(if(c.approve_result=1,1,0)) pass,
sum(if(c.approve_result=1 and c.source=2,1,0)) z_pass, sum(if(c.approve_result=1 and c.source=2,1,0)) z_pass,
@ -349,4 +358,8 @@
and contact_email = #{contact_email} and contact_email = #{contact_email}
</if> </if>
</select> </select>
<select id="findByhfPayUrlNotNull" resultType="com.alibaba.fastjson.JSONObject">
select client_id,client_moniker FROM sys_clients WHERE hf_pay_url != ''
</select>
</mapper> </mapper>

@ -0,0 +1,31 @@
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body>
<div style="width: 91%;border: 1px #F2F2F2 solid;margin: 0 auto; ">
<div style="height: 3%;background-color: #F2F2F2;"></div>
<div style="text-align: center;margin-top: 2.5%;">
<img th:src="${img_url}"/>
</div>
<div style="width: 80.3%;margin: 0 auto;">
<p>您好,<span th:text="${name}"></span></p>
<p>您有一笔收款信息如下:</p>
<div style="border: 1px #EAEAEA solid;margin-bottom: 5.5%;font-size: 12px;">
<p style="margin-left: 3%;">RoyalPay到账提醒</p>
<ul>
<li style="margin-bottom: 6px;">订单编号:<span style="color: #EE6723;" th:text="${order_id}"></span></li>
<li style="margin-bottom: 6px;">收款金额:<span style="color: #EE6723;" th:text="${amount}"></span></li>
<li style="margin-bottom: 6px;">到账时间:<span style="color: #EE6723;" th:text="${time}"></span></li>
</ul>
</div>
<span>此致</span><br />
<span>RoyalPay</span>
</div>
<div style="height: 3%;background-color: #F2F2F2;margin-top: 6.5%;"></div>
</div>
</body>
</html>

@ -0,0 +1,49 @@
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<style type="text/css">
table.gridtable {
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border-width: 1px;
border-color: #666666;
border-collapse: collapse;
}
table.gridtable th {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #dedede;
}
table.gridtable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #ffffff;
}
</style>
<table class="gridtable">
<thead>
<tr>
<th>序号</th>
<th>商户</th>
<th>角色</th>
<th>用户名</th>
<th>密码</th>
</tr>
</thead>
<tbody>
<tr th:each="account : ${accounts}">
<td th:text="${accountStat.index} + 1"></td>
<td th:text="${account.client_moniker}"></td>
<td th:if="${account.role} == 1">admin</td>
<td th:if="${account.role} == 2">Manager</td>
<td th:if="${account.role} == 3">Cashier</td>
<td th:text="${account.username}"></td>
<td th:text="${account.password}"></td>
</tr>
</tbody>
</table>
</html>

@ -994,7 +994,7 @@ margin-bottom: 10%;"/>
<!--<i class="fa fa-file-image-o"></i> -->Marketing Materials <!--<i class="fa fa-file-image-o"></i> -->Marketing Materials
</a> </a>
</li> </li>
<li ng-if="[1]|withRole"> <li ng-if="(currentUser.client.client_id!=9 && currentUser.client.parent_client_id!=9)&&([1]|withRole)">
<a ui-sref="accounts"> <a ui-sref="accounts">
<!--<i class="fa fa-users"></i> -->Accounts <!--<i class="fa fa-users"></i> -->Accounts
</a> </a>

@ -59,6 +59,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
url: '/hfClearAmount', url: '/hfClearAmount',
templateUrl: '/static/config/devtools/templates/hfClearAmount.html', templateUrl: '/static/config/devtools/templates/hfClearAmount.html',
controller: 'hfClearAmountCtrl' controller: 'hfClearAmountCtrl'
}).state('devtools.hfupdate', {
url: '/hfupdate',
templateUrl: '/static/config/devtools/templates/hfupdate.html',
controller: 'hfupdateCtrl'
}) })
}]); }]);
app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
@ -363,6 +367,23 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('hfupdateCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) {
$scope.selecttotal = true;
$scope.select = function () {
$scope.totalhide = true;
$scope.selecttotal = false;
$http.get('/dev/hfUpdate').then(function (resp) {
alert(resp.data);
$scope.totalhide = false;
$scope.selecttotal = true;
}, function (resp) {
alert(resp.data.message);
})
}
}]);
return app; return app;
}); });

@ -0,0 +1,15 @@
<section class="content-header">
<h1>更新HF短链接</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-cog"></i> Basic Config
</li>
<li><a ui-sref="^">Dev Tools</a></li>
<li class="active">hfupdate</li>
</ol>
</section>
<section class="content">
<div class="box">
<button class="btn btn-primary" ng-click="select()">Update</button> <label ng-hide="selecttotal" style="padding-left: 30px">请稍后</label>
</div>
</section>

@ -79,6 +79,10 @@
<i class="fa fa-credit-card-alt"></i> <i class="fa fa-credit-card-alt"></i>
HF清算金额统计 HF清算金额统计
</a> </a>
<a class="btn btn-app" role="button" ui-sref=".hfupdate">
<i class="fa fa-credit-card-alt"></i>
更新HF短连接
</a>
</div> </div>
</div> </div>
</section> </section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -1373,7 +1373,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}) })
}) })
}; };
$scope.init = {jsapi: false, gateway: false, offline: false, refund: false,common_sub_merchant_id:false, channel: {},gateway_alipay_online:false,hf_Link:false}; $scope.init = {jsapi: false, gateway: false, offline: false, refund: false,common_sub_merchant_id:false, channel: {},gateway_alipay_online:false,hf_Link:false,enable_hf_email_notice:false};
$scope.switchCommonSubMerchantId = function () { $scope.switchCommonSubMerchantId = function () {
if (!$scope.paymentInfo) { if (!$scope.paymentInfo) {
return; return;
@ -1478,6 +1478,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}) })
}; };
$scope.toggleHfEmailNotice = function () {
if (!$scope.paymentInfo) {
return;
}
if (!$scope.init.enable_hf_email_notice) {
$scope.init.enable_hf_email_notice = true;
return;
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/hf/email_notice', {allow: $scope.paymentInfo.enable_hf_email_notice}).then(function () {
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({
title: 'Failed to change enable_hf_email_notice permission status',
content: resp.data.message,
type: 'error'
});
})
};
$scope.toggleJsApi = function () { $scope.toggleJsApi = function () {
if (!$scope.paymentInfo) { if (!$scope.paymentInfo) {
return; return;

@ -119,6 +119,13 @@
</span> </span>
</p> </p>
</div> </div>
<div class="form-group" >
<label class="col-sm-2 control-label">HF Pay QR Code</label>
<img ng-src="{{partner.hfQrcodeUrl}}" class="img-responsive">
<div>
&nbsp;&nbsp;<span style="padding-left: 18.5%;font-size:9px;">仅支持微信客户端扫描</span>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -1,7 +1,7 @@
<div class="row margin-bottom"> <div class="row margin-bottom">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="btn-group"> <div class="btn-group">
<button class="btn btn-success" type="button" ng-click="addAccount()" ng-if="'111'|withRole"> <button class="btn btn-success" type="button" ng-click="addAccount()" ng-if="'100000011'|withRole">
<i class="fa fa-plus"></i> Add Account <i class="fa fa-plus"></i> Add Account
</button> </button>
</div> </div>
@ -9,7 +9,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<p ng-if="!accounts.length">There is no accounts for this partner, <a role="button" ng-click="addAccount()" ng-if="'111'|withRole">Create One</a></p> <p ng-if="!accounts.length">There is no accounts for this partner, <a role="button" ng-click="addAccount()" ng-if="'100000011'|withRole">Create One</a></p>
<div class="col-sm-12 table-responsive"> <div class="col-sm-12 table-responsive">
<table class="table table-striped table-bordered table-hover" ng-if="accounts.length"> <table class="table table-striped table-bordered table-hover" ng-if="accounts.length">
<thead> <thead>

@ -331,6 +331,19 @@
&nbsp;&nbsp;<span ng-if="paymentInfo.enable_link">{{paymentInfo.hf_pay_url}}</span> &nbsp;&nbsp;<span ng-if="paymentInfo.enable_link">{{paymentInfo.hf_pay_url}}</span>
</div> </div>
</div> </div>
<div class="form-group" ng-if="paymentInfo.enable_link">
<label class="col-sm-2 control-label">HF Pay QR Code</label>
<img ng-src="{{paymentInfo.hfQrcodeUrl}}" class="img-responsive">
<div>
&nbsp;&nbsp;<span style="padding-left: 18.5%;font-size:9px;" ng-if="paymentInfo.enable_link">仅支持微信客户端扫描</span>
</div>
</div>
<div class="form-group" ng-if="paymentInfo.enable_hf">
<label class="col-sm-2 control-label">HF Pay Email Notice</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_hf_email_notice" bs-switch switch-change="toggleHfEmailNotice()">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -1,17 +1,16 @@
$("#bank-li").hide(); $("#bank-li").hide();
$("#bankCard-li").hide();
var currentIndex = 0; var currentIndex = 0;
$(".main .main-left ul li.tab-item").click(function () { $(".main .main-left ul li.tab-item").click(function () {
$("#qrode").hide();
$("#payment-form").show();
var selectedIndex = $(this).index(); var selectedIndex = $(this).index();
$(this).addClass("change-color").siblings().removeClass("change-color"); $(this).addClass("change-color").siblings().removeClass("change-color");
$(this).children(".s1").addClass("s1-change-color"); $(this).children(".s1").addClass("s1-change-color");
$(this).siblings().children(".s1").removeClass("s1-change-color"); $(this).siblings().children(".s1").removeClass("s1-change-color");
if (selectedIndex == 2) { if (selectedIndex == 2) {
$("#bank-li").show(); $("#bank-li").show();
$("#bankCard-li").show();
} else { } else {
$("#bank-li").hide(); $("#bank-li").hide();
$("#bankCard-li").hide();
} }
}); });
@ -27,4 +26,77 @@ select.bind("change", function() {
if ($(this).val() != "") { if ($(this).val() != "") {
$(this).prev().hide(); $(this).prev().hide();
} }
}) });
var bankList = [
{label:'招商银行',value:'CMB'},
{label:'中国工商银行',value:'ICBC'},
{label:'中国农业银行',value:'ABC'},
{label:'中国建设银行',value:'CCB'},
{label:'中国银行',value:'BOC'},
{label:'浦发银行',value:'SPDB'},
{label:'中国交通银行',value:'BCOM'},
{label:'中国民生银行',value:'CMBC'},
{label:'广东发展银行',value:'GDB'},
{label:'中信银行',value:'CITIC'},
{label:'华夏银行',value:'HXB'},
{label:'上海农村商业银行',value:'SRCB'},
{label:'中国邮政储蓄银行',value:'PSBC'},
{label:'北京银行',value:'BOB'},
{label:'渤海银行',value:'CBHB'},
{label:'北京农商银行',value:'BJRCB'},
{label:'南京银行',value:'NJCB'},
{label:'中国光大银行',value:'CEB'},
{label:'浙商银行',value:'CZB'},
{label:'兴业银行',value:'CIB'},
{label:'杭州银行',value:'HZB'},
{label:'平安银行',value:'PAB'},
{label:'上海银行',value:'SHB'},
];
var productList = [
{label:'护肤品',value:'100003'},
{label:'洗发护发',value:'100004'},
{label:'身体护理',value:'100005'},
{label:'口腔护理',value:'100006'},
{label:'包包',value:'100007'},
{label:'女装',value:'100008'},
{label:'男装',value:'100009'},
{label:'童装',value:'100010'},
{label:'内衣',value:'100011'},
{label:'睡衣',value:'100012'},
{label:'袜品',value:'100013'},
{label:'配饰',value:'100014'},
{label:'香水',value:'100015'},
{label:'彩妆',value:'100016'},
{label:'奶粉',value:'100017'},
{label:'母婴营养保健',value:'100018'},
{label:'婴儿辅食',value:'100019'},
{label:'尿裤纸巾',value:'100020'},
{label:'男鞋',value:'100021'},
{label:'女鞋',value:'100022'},
{label:'运动鞋',value:'100023'},
{label:'户外鞋',value:'100024'},
{label:'运动服',value:'100025'},
{label:'休闲服装',value:'100026'},
{label:'家纺/床品',value:'100027'},
{label:'生活日用',value:'100028'},
{label:'厨房电器',value:'100029'},
{label:'家装软饰',value:'100030'},
{label:'生活电器',value:'100031'},
{label:'手机',value:'100032'},
{label:'手机配件',value:'100033'},
{label:'数码相机',value:'100034'},
{label:'单反相机',value:'100035'},
{label:'摄像机',value:'100036'},
{label:'镜头',value:'100037'},
{label:'耳机/耳麦',value:'100038'},
{label:'音箱/音响',value:'100039'},
{label:'数码配件',value:'100040'},
{label:'智能手环',value:'100041'},
{label:'影音娱乐',value:'100042'},
{label:'笔记本',value:'100043'},
{label:'进口食品',value:'100044'},
{label:'休闲食品',value:'100045'},
{label:'营养品',value:'100046'},
{label:'地方特产',value:'100047'}
];

Loading…
Cancel
Save