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

master
yixian 5 years ago
commit 55b72227cb

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.0.28</version>
<version>1.0.31</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -13,6 +13,8 @@ public interface AliforexcelService {
JSONObject registerAlipayOnlineMerchant();
JSONObject registerRangeAlipayOnlineMerchant(int start,int end);
JSONObject registerAlipayMerchant();
JSONObject registerInsertAlipayMerchant(String partners);

@ -109,7 +109,7 @@ public class AliforexcelServiceImpl implements AliforexcelService {
List<String> registerSuccessMerchant = new ArrayList<>();
List<JSONObject> registerFailMerchant = new ArrayList<>();
List<JSONObject> lessInfoMerchant = new ArrayList<>();
List<Integer> useAlipayOnlineMerchant = clientMapper.listUseAlipayMerchant();
List<Integer> useAlipayOnlineMerchant = clientMapper.listUseAlipayMerchant(0,10000);
for (int clientId : useAlipayOnlineMerchant) {
JSONObject client = clientMapper.findClient(clientId);
if (client == null) {
@ -163,6 +163,73 @@ public class AliforexcelServiceImpl implements AliforexcelService {
return result;
}
@Override
public JSONObject registerRangeAlipayOnlineMerchant(int start, int end) {
JSONObject result = new JSONObject();
List<String> needRegisterMerchant = new ArrayList<>();
List<String> registerSuccessMerchant = new ArrayList<>();
List<JSONObject> registerFailMerchant = new ArrayList<>();
List<JSONObject> lessInfoMerchant = new ArrayList<>();
List<Integer> useAlipayOnlineMerchant = clientMapper.listUseAlipayMerchant(start,end);
for (int clientId : useAlipayOnlineMerchant) {
JSONObject client = clientMapper.findClient(clientId);
if (client == null) {
continue;
}
try {
needRegisterMerchant.add(client.getString("client_moniker"));
if (StringUtils.isBlank(client.getString("company_website"))) {
client.put("company_website", client.getString("ali_sub_merchant_id")+".royalpay.com.au");
}
if (StringUtils.isBlank(client.getString("alipayindustry"))) {
client.put("alipayindustry", "5311");
}
if (StringUtils.isBlank(client.getString("business_structure"))) {
client.put("business_structure", "da");
}
checkPartnerInfo(client,"online");
} catch (InvalidParameterException e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
exception.put("bd_name", client.getString("bd_user_name"));
lessInfoMerchant.add(exception);
continue;
}
try {
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant();
Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", resultElement.elementText("error"));
registerFailMerchant.add(exception);
continue;
}
Element responseElement = resultElement.element("response").element("alipay");
if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", resultElement.elementText("error"));
registerFailMerchant.add(exception);
continue;
}
registerSuccessMerchant.add(client.getString("client_moniker"));
} catch (Exception e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
registerFailMerchant.add(exception);
}
}
result.put("need_register_merchant", needRegisterMerchant);
result.put("success_register_merchant", registerSuccessMerchant);
result.put("fail_register_merchant", registerFailMerchant);
result.put("less_info_merchant", lessInfoMerchant);
logger.info("-------AlipayOnline Gms end----fail_register_merchant"+registerFailMerchant.toString());
return result;
}
@Override
public JSONObject registerAlipayMerchant() {
JSONObject result = new JSONObject();

@ -93,7 +93,7 @@ public class CloseOrderWarningSender implements ApplicationListener<OrderCloseEv
}
}
warningList.put(moniker, new Date());
List<JSONObject> developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask());
List<JSONObject> developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask() | ManagerRole.RISK_MANAGER.getMask());
if (!StringUtils.isEmpty(client.getString("bd_user"))) {
String[] bds = client.getString("bd_user").split(",");
if (bds.length > 0) {
@ -133,6 +133,9 @@ public class CloseOrderWarningSender implements ApplicationListener<OrderCloseEv
if (developer.getString("manager_id").equals("141")) {
continue;
}
if (StringUtils.isBlank(developer.getString("wx_openid"))) {
continue;
}
try {
String title = client.getString("short_name") + "(" + moniker + ")";
String content = "最近" + recentOrders.size() + "笔订单中有" + closed.size() + "笔关闭,占比" + percentage + "%;\r\n" + "最早一笔:"
@ -144,7 +147,8 @@ public class CloseOrderWarningSender implements ApplicationListener<OrderCloseEv
"所属BD:" + client.getString("bd_user_name"));
api.sendTemplateMessage(msg);
}
} catch (Exception ignore) {
} catch (Exception e) {
logger.info("sendTemplateMessage--发送告警模板消息发生错误" + developer.getString("wx_openid") + "--" + e);
}
}
}

@ -108,12 +108,15 @@ public class PaymentAmountCheatMonitor implements CheatMonitor {
}
warningList.put(subMerchantId, new Date());
List<JSONObject> developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask());
List<JSONObject> developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask() | ManagerRole.RISK_MANAGER.getMask());
MpWechatApi api = mpWechatApiProvider.getNewPaymentApi();
for (JSONObject developer : developers) {
if(developer.getString("manager_id").equals("141")){
continue;
}
if (StringUtils.isBlank(developer.getString("wx_openid"))) {
continue;
}
try {
String wxOpenid = developer.getString("wx_openid");
if (wxOpenid != null) {
@ -124,7 +127,8 @@ public class PaymentAmountCheatMonitor implements CheatMonitor {
TemplateMessage msg = WarningSenderHelper.buildWarningMessage(wxOpenid, templateId, title, content, client.getString("bd_user_name"));
api.sendTemplateMessage(msg);
}
} catch (Exception ignore) {
} catch (Exception e) {
logger.info("sendTemplateMessage--发送告警模板消息发生错误" + developer.getString("wx_openid") + "--" + e);
}
}
}

@ -459,6 +459,11 @@ public class TestController implements ApplicationEventPublisherAware {
return aliforexcelService.registerAlipayOnlineMerchant();
}
@ManagerMapping(value = "/register/alipayOnlineGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public JSONObject registerRangeAlipayOnlineMerchant(@RequestParam int start,@RequestParam int end) {
return aliforexcelService.registerRangeAlipayOnlineMerchant(start,end);
}
@ManagerMapping(value = "/register/alipayGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST)
public JSONObject registerAlipayMerchant() {
return aliforexcelService.registerAlipayMerchant();

@ -137,6 +137,6 @@ public interface ClientMapper {
JSONObject findCountByBd(@Param("bd_group") String bd_group, @Param("today") Date today, @Param("yesterday") Date yesterday, @Param("month") Date month);
List<Integer> listUseAlipayMerchant();
List<Integer> listUseAlipayMerchant(@Param("start") int start, @Param("end") int end);
}

@ -1,6 +1,6 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.schema-name=royalpay_production
spring.datasource.host=192.168.0.18:3306
spring.datasource.schema-name=royalpay_local
spring.datasource.host=192.168.0.50:3306
spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root
spring.datasource.password=root

@ -143,3 +143,4 @@ app.hanyin-secure.sftp-host=180.168.61.93
app.hanyin-secure.sftp-port=28480
app.hanyin-secure.sftp-username=royalpay
app.hanyin-secure.sftp-pwd=royalpay

@ -739,5 +739,6 @@
<select id="listUseAlipayMerchant" resultType="int">
select client_id from sys_clients where gateway_alipay_online=1 and is_valid=1
and client_id >=#{start} and client_id &lt;#{end}
</select>
</mapper>

@ -45,7 +45,7 @@
<h1>
<span ng-bind="partner.company_name"></span>
<i ng-if="partner.parent_client_id" class="fa fa-sitemap" title="Sub Partner"></i>
<a class="text-primary" ng-if="'00001'|withRole" title="Mock Login"
<a class="text-primary" ng-if="'00011'|withRole" title="Mock Login"
ng-href="/global/userstatus/current_manager/clients/{{partner.client_moniker}}/auth" target="_blank"><i
class="fa fa-share"></i></a><span ng-if="partner.is_valid==0"
ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span>

@ -43,7 +43,7 @@
<th>Phone</th>
<th>Email</th>
<!-- <th>Approve Status</th>-->
<th style="max-width: 20%">Company Name</th>
<th>Channel</th>
<th>Status</th>
<th>Handle Status</th>
<th>Create Time</th>
@ -56,7 +56,20 @@
<td ng-bind="apply.contact_person"></td>
<td ng-bind="apply.contact_phone"></td>
<td ng-bind="apply.contact_email"></td>
<td ng-bind="apply.company_name |cut:true:15:' ....'"></td>
<td>
<!--修改商户来源-->
<span ng-if="apply.channel==10001">谷歌|Google</span>
<span ng-if="apply.channel==10002">领英|LinkedIn</span>
<span ng-if="apply.channel==10003">微信|Wechat</span>
<span ng-if="apply.channel==10004">传单手册|Flyer Manual</span>
<span ng-if="apply.channel==10005">其他媒体|Other Media</span>
<span ng-if="apply.channel==2">线下使用体验|Offline Experience</span>
<span ng-if="apply.channel==3">朋友介绍|Friend Introduction</span>
<span ng-if="apply.channel==4">商户推荐|Merchant Recommendation</span>
<span ng-if="apply.channel==5">销售推荐|Sales Recommendation</span>
</td>
</td>
<td>
<if ng-if="apply.agree">已申请 <span ng-if="apply.client_moniker">({{apply.client_moniker}})</span></if>
<if ng-if="!apply.agree">申请失败
@ -114,4 +127,4 @@
</div>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save