master
wangning 7 years ago
parent 498b30c519
commit ad08428964

@ -58,8 +58,6 @@ public interface ClientMapper {
List<JSONObject> listClientsForSettlementWithDetail();
void disableClient(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1 and approve_email_id is not null and approve_email_send=3")
List<JSONObject> listClientsWithEmailNotVerify();

@ -48,6 +48,7 @@ import au.com.royalpay.payment.manage.merchants.entity.impls.BDUserModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.ClearDaysModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.CredentialCodeModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.CustomerSurchargeRateModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.DisableModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.EmailModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.GreenChannelModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.LogoModify;
@ -59,6 +60,7 @@ import au.com.royalpay.payment.manage.merchants.entity.impls.ParentIdModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.PaypadVersionModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.RefundAuditModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.AuditModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.RefundPWDModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.SettleHourModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
import au.com.royalpay.payment.manage.merchants.entity.impls.TimeZoneModify;
@ -375,6 +377,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
List<JSONObject> children = clientMapper.listChildClients(client.getIntValue("client_id"));
client.put("has_children", !children.isEmpty());
}
client.putAll(clientConfigService.find(clientId));
return client;
}
@ -1076,7 +1079,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public void toggleAuditRefund(String clientMoniker, boolean enable, JSONObject account) {
clientModifySupport.processClientModify(new RefundAuditModify(account, clientMoniker, enable));
clientModifySupport.processClientConfigModify(new RefundAuditModify(account, clientMoniker, enable));
}
@Override
@ -2218,6 +2221,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
record.put("refund_pwd", pwdHash);
record.put("refund_pwd_salt", salt);
clientConfigService.update(record);
clientModifySupport.processClientConfigModify(new RefundPWDModify(account,client.getString("client_moniker"),pwd,salt));
}
@Override
@ -2299,9 +2303,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public void disableClient(String clientMoniker, JSONObject manager) {
JSONObject client = clientDetail(manager, clientMoniker);
int clientId = client.getIntValue("client_id");
clientMapper.disableClient(clientId);
clientInfoCacheSupport.clearClientCache(clientId);
Assert.notEmpty(client);
clientModifySupport.processClientModify(new DisableModify(manager,clientMoniker,false));
}
@Override

@ -0,0 +1,30 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class DisableModify extends ClientModify {
private boolean is_valid;
public DisableModify(JSONObject account, String clientMoniker, boolean is_valid) {
super(account, clientMoniker);
this.is_valid = is_valid;
}
@Override
protected String business() {
return is_valid?"开启":"禁用";
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("is_valid", is_valid);
return modify;
}
}

@ -1,12 +1,13 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class RefundAuditModify extends ClientModify {
public class RefundAuditModify extends ClientConfigModify {
private boolean enable;
public RefundAuditModify(JSONObject account, String clientMoniker, boolean enable) {

@ -0,0 +1,33 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class RefundPWDModify extends ClientConfigModify {
private String refund_pwd;
private String refund_pwd_salt;
public RefundPWDModify(JSONObject account, String clientMoniker, String refund_pwd, String refund_pwd_salt) {
super(account, clientMoniker);
this.refund_pwd = refund_pwd;
this.refund_pwd_salt = refund_pwd_salt;
}
@Override
protected String business() {
return "修改退款密码为:"+refund_pwd;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put("refund_pwd", refund_pwd);
modify.put("refund_pwd_salt", refund_pwd_salt);
return modify;
}
}

@ -10,20 +10,13 @@ import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal;
import javax.annotation.Resource;
import java.math.BigDecimal;
/**
* Created by yixian on 2016-07-04.
@ -68,17 +61,17 @@ public class RefundController {
return refundService.notifyRefundReview();
}
@RequestMapping(value = "/auditions", method = RequestMethod.GET)
@WechatMapping(value = "/auditions", method = RequestMethod.GET)
public ModelAndView auditionListPage(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) {
ModelAndView view = new ModelAndView("refund_audit_list");
view.addAllObjects(refundService.auditionsFromOpenId("o32MzuO4s8c7iFOVxnxejkbhMoEc"));
view.addAllObjects(refundService.auditionsFromOpenId(user.getString("openid")));
return view;
}
@RequestMapping(value = "/auditions/{auditionId}", method = RequestMethod.GET)
@WechatMapping(value = "/auditions/{auditionId}", method = RequestMethod.GET)
public ModelAndView auditionPage(@PathVariable String auditionId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) {
ModelAndView view = new ModelAndView("refund_audit");
view.addAllObjects(refundService.auditionInfo("25", "asd"));
view.addAllObjects(refundService.auditionInfo(auditionId, user.getString("openid")));
return view;
}

@ -209,8 +209,9 @@
c.client_id client_id,
max(t.transaction_time) transation_time,
c.client_moniker client_moniker
FROM pmt_transactions t INNER JOIN sys_clients c
ON t.client_id = c.client_id AND c.enable_refund_auth = 0
FROM pmt_transactions t
INNER JOIN sys_clients c ON t.client_id = c.client_id
INNER JOIN sys_client_config cc on cc.client_id = c.client_id AND cc.enable_refund_auth = 0
GROUP BY c.client_id) a
WHERE a.amount &lt; 0
</select>
@ -237,7 +238,7 @@
c.client_moniker,
c.parent_client_id,
c.org_id,
c.clean_days,
cc.clean_days,
t.transaction_id,
t.transaction_type,
t.transaction_time,
@ -252,6 +253,7 @@
o.total_amount
FROM pmt_transactions t
INNER JOIN sys_clients c ON c.client_id = t.client_id
inner join sys_client_config cc on cc.client_id = c.client_id
LEFT JOIN pmt_orders o ON o.order_id = t.order_id
WHERE t.clearing_order IS NULL AND t.clearing_status = 0 AND t.channel != 'Settlement' AND
t.client_id = #{client_id} AND
@ -415,7 +417,7 @@
t.transaction_currency currency,
t.order_id
FROM pmt_transactions t
INNER JOIN sys_clients c ON t.client_id = c.client_id AND c.skip_clearing = 0
INNER JOIN sys_client_config c ON t.client_id = c.client_id AND c.skip_clearing = 0
LEFT JOIN sys_client_rates r ON r.client_id = t.client_id
AND date(r.expiry_time) >= DATE(t.transaction_time)
AND date(r.active_time) <= DATE(t.transaction_time)
@ -434,7 +436,7 @@
(SELECT round(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) *
(100 - ifnull(min(r.rate_value), 1.6))) / 100 clearing_amount
FROM pmt_transactions t
INNER JOIN sys_clients c ON t.client_id = c.client_id AND c.skip_clearing = 0
INNER JOIN sys_client_config c ON t.client_id = c.client_id AND c.skip_clearing = 0
LEFT JOIN sys_client_rates r ON r.client_id = t.client_id
AND date(r.expiry_time) >= DATE(t.transaction_time)
AND date(r.active_time) <= DATE(t.transaction_time)
@ -460,7 +462,8 @@
FROM pmt_transactions t
INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order
INNER JOIN log_clearing c ON c.clearing_id = d.clearing_id AND c.clearing_id = #{clear_id}
INNER JOIN sys_clients cl ON cl.client_id = t.client_id AND cl.is_valid = 1
INNER JOIN sys_clients cl ON cl.client_id = t.client_id
inner join sys_client_config cc on cc.clear_id = cl.client_id and cc.is_valid = 1
WHERE t.transaction_type = 'Credit' OR t.refund_id IS NOT NULL
ORDER BY t.order_id ASC
</select>
@ -575,6 +578,7 @@
ifnull(so.rate_value, 1) rate_value
FROM pmt_transactions t
INNER JOIN sys_clients c ON c.client_id = t.client_id
inner join sys_client_config cc on cc.client_id = c.client_id
INNER JOIN sys_org so
ON c.referrer_id = so.org_id AND so.is_valid = 1 AND so.type = 1 AND so.commission = 1
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement'

@ -1,13 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.ClientMapper">
<update id="disableClient">
UPDATE sys_clients
SET is_valid = 0
WHERE client_id = #{client_id}
</update>
<select id="listValidClient" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_id,c.client_moniker,c.parent_client_id FROM sys_clients c
SELECT client_id,client_moniker,parent_client_id FROM sys_clients
WHERE is_valid=1 and (approve_result = 1 or approve_result = 2)
</select>
<select id="listGreenChannel" resultType="com.alibaba.fastjson.JSONObject">
@ -33,7 +28,6 @@
<select id="listPartners" resultType="com.alibaba.fastjson.JSONObject">
SELECT DISTINCT c.*,o.name org_name
FROM sys_clients c
inner join sys_client_config on scc.client_id = c.client_id
inner join sys_org o
on o.org_id=c.org_id
<if test="bd_user!=null">
@ -166,7 +160,6 @@
</select>
<select id="listPartnerSelection" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.*,o.name org_name FROM sys_clients c
inner join sys_client_config scc on scc.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
@ -220,14 +213,15 @@
c.client_id,
c.client_moniker,
c.short_name,
c.clean_days,
c.weekend_delay,
cc.clean_days,
cc.weekend_delay,
b.bsb_no,
b.account_no,
b.account_name
FROM sys_clients c
INNER JOIN sys_bank_accounts b ON b.client_id = c.client_id
WHERE c.skip_clearing = 0 AND (c.approve_result = 1 or (c.approve_result=2 and (c.source=1 or c.source=2))) AND c.is_valid = 1
inner join sys_client_config cc on cc.client_id = c.client_id
WHERE cc.skip_clearing = 0 AND (c.approve_result = 1 or (c.approve_result=2 and (c.source=1 or c.source=2))) AND cc.is_valid = 1
ORDER BY client_moniker ASC
</select>
<select id="listClientsForSettlementWithDetail" resultType="com.alibaba.fastjson.JSONObject">
@ -238,7 +232,8 @@
b.account_name
FROM sys_clients c
INNER JOIN sys_bank_accounts b ON b.client_id = c.client_id
WHERE c.skip_clearing = 0 AND (c.approve_result = 1 or (c.approve_result=2 and (c.source=1 or c.source=2))) AND c.is_valid = 1
inner join sys_client_config cc on cc.client_id = c.client_id
WHERE cc.skip_clearing = 0 AND (c.approve_result = 1 or (c.approve_result=2 and (c.source=1 or c.source=2))) AND cc.is_valid = 1
ORDER BY client_moniker ASC
</select>
@ -257,22 +252,22 @@
<select id="analysisClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT
sum(if(((scc.approve_result=4 and scc.open_status is null) or (scc.approve_result=3 and scc.open_status is null) or scc.open_status=1 or scc.open_status=2 or scc.open_status=4),1,0)) wp,
sum(if(scc.approve_result is null and scc.source= 4,1,0)) a_unagree,
sum(if(((scc.approve_result=4 and scc.open_status is null) or (scc.approve_result=3 and scc.open_status is null) or scc.open_status=1 or scc.open_status=2 or scc.open_status=4) and scc.source = 4,1,0)) a_wp,
sum(if(scc.approve_result=2 and scc.source = 4,1,0)) wa,
sum(if(scc.approve_result=1,1,0)) pass,
sum(if(scc.approve_result=1 and scc.source=2,1,0)) z_pass,
sum(if(scc.approve_result=1 and scc.source = 4,1,0)) a_pass,
sum(if(scc.approve_result=0,1,0)) not_pass,
sum(if(scc.source=4,1,0)) quick_pass
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=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,
sum(if(c.approve_result=1 and c.source = 4,1,0)) a_pass,
sum(if(c.approve_result=0,1,0)) not_pass,
sum(if(c.source=4,1,0)) quick_pass
<if test="tempSubMchId">
,sum(if(locate(sub_merchant_id,#{tempSubMchId})>0 and skip_clearing=0,1,0)) temp_submchid
,sum(if(locate(sub_merchant_id,#{tempSubMchId})>0 and scc.skip_clearing=0,1,0)) temp_submchid
</if>
FROM sys_clients c
left join sys_client_config scc on scc.client_id = c.client_id
where is_valid = 1
where c.is_valid = 1
</select>
<select id="listCityClientIds" resultType="java.lang.String">
SELECT DISTINCT cb.client_id
@ -282,6 +277,8 @@
AND (cb.end_date IS NULL OR cb.end_date &gt;= #{date})
</select>
<select id="listClientByCleanDays" resultType="java.lang.String">
SELECT client_id FROM sys_clients WHERE is_valid = 1 and clean_days = #{clean_days}
SELECT client_id FROM sys_clients c
inner join sys_client_config cc
WHERE c.is_valid = 1 and cc.clean_days = #{clean_days}
</select>
</mapper>
Loading…
Cancel
Save