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 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;
@Resource
private CustomerServiceService customerServiceService;
@Resource
private CouponAccuessLogMapper couponAccuessLogMapper;
@Resource
private CouponValidateService couponValidateService;
private Map<String, AppMsgSender> senderMap = new HashMap<>();
private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" };
@ -447,8 +451,50 @@ public class RetailAppServiceImp implements RetailAppService {
@Override
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

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

@ -18,7 +18,7 @@ public interface CouponValidateService {
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);
}

@ -177,7 +177,7 @@ public class CouponValidateServiceImpl implements CouponValidateService {
}
@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);
if(client==null){
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"));
HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET);
gen.addQueryString("client_moniker",client.getString("client_moniker"));
if (!is_expiry) {
gen.addQueryString("is_expiry", "0");
}
try {
HttpRequestResult reqResult = gen.execute();
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.Message;
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.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.dev.core.*;
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.payment.OrderMapper;
@ -110,6 +107,8 @@ public class TestController implements ApplicationEventPublisherAware {
private AliforexcelService aliforexcelService;
@Resource
private HfClearAmountService hfClearAmountService;
@Resource
private HfUpdateService hfUpdateService;
@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 {
@ -394,7 +393,12 @@ public class TestController implements ApplicationEventPublisherAware {
}
@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);
}
@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 com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
@ -26,4 +28,7 @@ public interface CouponAccuessLogMapper {
@AutoSql(type = SqlType.SELECT)
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> 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.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
@ -94,4 +95,6 @@ public interface ClientMapper {
@AutoSql(type = SqlType.SELECT)
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.PageList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -63,4 +64,7 @@ public interface ManagerMapper {
List<JSONObject> listOpenIdByRole(@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
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.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
@ -416,6 +411,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (audit_logs != null && !audit_logs.isEmpty()) {
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;
}
@ -886,7 +886,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (StringUtils.isEmpty(client.getString("sub_merchant_id"))) {
throw new BadRequestException("Sub Merchant ID Can't be null ");
}
String username = clientMoniker + client.getString("sub_merchant_id");
String username = clientMoniker;
boolean duplicated = true;
String pwd = RandomStringUtils.random(8, true, true);
while (duplicated) {
@ -899,7 +899,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
newAccount(clientMoniker, account, manager, 1);
duplicated = false;
} catch (Exception e) {
username += "1";
username += "0";
}
}
sendInitEmail(client, username, pwd);
@ -959,9 +959,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
ctx.setVariable("client_moniker", client.getString("client_moniker"));
ctx.setVariable("contact_person", client.getString("contact_person"));
ctx.setVariable("credential_code", client.getString("credential_code"));
final String content = thymeleaf.process("mail/new_client_notice", ctx);
// final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm",
// "utf-8", model);
ctx.setVariable("password", "*****");
final String contentBd = thymeleaf.process("mail/new_client_notice", ctx);
final String mailTo = client.getString("contact_email");
if (StringUtils.isEmpty(mailTo)) {
throw new EmailException("Client Contact Email is invalid");
@ -977,8 +980,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public void run() {
try {
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo,
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content);
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo, "", content);
mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","),
"", contentBd);
JSONObject clientUpdate = new JSONObject();
clientUpdate.put("client_id", client.getIntValue("client_id"));
clientUpdate.put("approve_email_send", 3);
@ -1175,6 +1179,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
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));
logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel "
+ 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
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();
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);
}
@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) {
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,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
HttpUtils.handleValidErrors(errors);
@ -546,4 +546,9 @@ public class PartnerManageController {
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>
</where>
</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>

@ -6,23 +6,24 @@
WHERE is_valid=1 and (approve_result = 1 or approve_result = 2)
</select>
<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
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
where approve_result = 2 and (source = 1 or source = 2)
<if test="approve_time != null and interval_begin_day != null">
and TIMESTAMPDIFF(DAY,c.approve_time,#{approve_time})&gt;#{interval_begin_day}
</if>
<if test="approve_time != null and interval_begin_day != null">
and TIMESTAMPDIFF(DAY,c.approve_time,#{approve_time})&gt;#{interval_begin_day}
</if>
<if test="approve_time != null and interval_end_day != null">
and TIMESTAMPDIFF(DAY,c.approve_time,#{approve_time})&lt;#{interval_end_day}
</if>
<if test="open_status != null">
and c.open_status = #{open_status}
</if>
<if test="managerId!=null">
and m.manager_id = #{managerId}
</if>
<if test="open_status != null">
and c.open_status = #{open_status}
</if>
<if test="managerId!=null">
and m.manager_id = #{managerId}
</if>
order by display_name
</select>
<select id="listPartners" resultType="com.alibaba.fastjson.JSONObject">
@ -101,7 +102,8 @@
and c.suburb like #{suburb_pattern}
</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)
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="state!=null">
and c.state=#{state}
@ -137,7 +139,8 @@
<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
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'">
@ -161,7 +164,8 @@
</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>
<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="is_valid">and c.is_valid=1</if>
</where>
@ -222,7 +226,8 @@
</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>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
and c.is_valid=1
</where>
GROUP BY c.contact_email
@ -267,21 +272,25 @@
<select id="listUnAuthPartners" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
client_id,
client_moniker,
approve_time
FROM sys_clients
WHERE is_valid = 1 AND approve_result = 2 AND source = 4 AND datediff(now(), approve_time) <= #{auth_days}
]]>
</select>
<select id="analysisClients" resultType="com.alibaba.fastjson.JSONObject">
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=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=1,1,0)) pass,
sum(if(c.approve_result=1 and c.source=2,1,0)) z_pass,
@ -340,7 +349,7 @@
)
</if>
<if test="source!=null">
and source = #{source}
and source = #{source}
</if>
<if test="approve_result!=null">
and approve_result = #{approve_result}
@ -349,4 +358,8 @@
and contact_email = #{contact_email}
</if>
</select>
<select id="findByhfPayUrlNotNull" resultType="com.alibaba.fastjson.JSONObject">
select client_id,client_moniker FROM sys_clients WHERE hf_pay_url != ''
</select>
</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
</a>
</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">
<!--<i class="fa fa-users"></i> -->Accounts
</a>

@ -59,7 +59,11 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
url: '/hfClearAmount',
templateUrl: '/static/config/devtools/templates/hfClearAmount.html',
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) {
$scope.sendRefund = function () {
@ -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;
});

@ -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>
HF清算金额统计
</a>
<a class="btn btn-app" role="button" ui-sref=".hfupdate">
<i class="fa fa-credit-card-alt"></i>
更新HF短连接
</a>
</div>
</div>
</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 () {
if (!$scope.paymentInfo) {
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 () {
if (!$scope.paymentInfo) {
return;

@ -119,6 +119,13 @@
</span>
</p>
</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>

@ -1,7 +1,7 @@
<div class="row margin-bottom">
<div class="col-sm-12">
<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
</button>
</div>
@ -9,7 +9,7 @@
</div>
<div class="row">
<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">
<table class="table table-striped table-bordered table-hover" ng-if="accounts.length">
<thead>

@ -331,6 +331,19 @@
&nbsp;&nbsp;<span ng-if="paymentInfo.enable_link">{{paymentInfo.hf_pay_url}}</span>
</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>

@ -1,17 +1,16 @@
$("#bank-li").hide();
$("#bankCard-li").hide();
var currentIndex = 0;
$(".main .main-left ul li.tab-item").click(function () {
$("#qrode").hide();
$("#payment-form").show();
var selectedIndex = $(this).index();
$(this).addClass("change-color").siblings().removeClass("change-color");
$(this).children(".s1").addClass("s1-change-color");
$(this).siblings().children(".s1").removeClass("s1-change-color");
if (selectedIndex == 2) {
$("#bank-li").show();
$("#bankCard-li").show();
} else {
$("#bank-li").hide();
$("#bankCard-li").hide();
}
});
@ -23,8 +22,81 @@ $("#modal-close").click(function () {
var select = $("select#bank-select,#product-category-select");
if (select.val() != "")
select.prev().hide();
select.bind("change", function() {
if($(this).val() != "") {
select.bind("change", function () {
if ($(this).val() != "") {
$(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