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

master
hellolujian 6 years ago
commit c7db75ebff

@ -775,33 +775,6 @@ public class RetailAppServiceImp implements RetailAppService {
TimeZoneUtils.switchTimeZone(orders, query.getTimezone(), "create_time", "transaction_time", "confirm_time");
ArrayList<String> date_contains = new ArrayList<>();
for (JSONObject order : orders) {
String customer_id = order.getString("customer_id");
if (StringUtils.isEmpty(customer_id)) {
continue;
}
switch (order.getString("channel")) {
case "Alipay":
JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id);
if (alipayUser != null) {
order.put("nickname", alipayUser.getString("nickname"));
order.put("headimg", alipayUser.getString("headimg"));
}
break;
case "Wechat":
JSONObject weUser = new JSONObject();
if (customer_id.startsWith("olH")) {
weUser = customerMapper.findCustomerGlobalpayByOpenId(customer_id);
} else {
weUser = customerMapper.findCustomerByOpenId(customer_id);
}
if (weUser != null && !weUser.isEmpty()) {
order.put("nickname", weUser.getString("nickname"));
order.put("headimg", weUser.getString("headimg"));
}
break;
default:
break;
}
Calendar calendar = (Calendar) order.get("transaction_time");
String trade_date = DateFormatUtils.format(calendar, "yyyy-MM-dd", calendar.getTimeZone());
String trade_time = DateFormatUtils.format(calendar, "HH:mm:ss", calendar.getTimeZone());
@ -831,6 +804,33 @@ public class RetailAppServiceImp implements RetailAppService {
order.put("date_total", analysis);
date_contains.add(trade_date);
}
String customer_id = order.getString("customer_id");
if (StringUtils.isEmpty(customer_id)) {
continue;
}
switch (order.getString("channel")) {
case "Alipay":
JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id);
if (alipayUser != null) {
order.put("nickname", alipayUser.getString("nickname"));
order.put("headimg", alipayUser.getString("headimg"));
}
break;
case "Wechat":
JSONObject weUser = new JSONObject();
if (customer_id.startsWith("olH")) {
weUser = customerMapper.findCustomerGlobalpayByOpenId(customer_id);
} else {
weUser = customerMapper.findCustomerByOpenId(customer_id);
}
if (weUser != null && !weUser.isEmpty()) {
order.put("nickname", weUser.getString("nickname"));
order.put("headimg", weUser.getString("headimg"));
}
break;
default:
break;
}
}
return PageListUtils.buildPageListResult(orders);
}

@ -1,30 +1,28 @@
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.ClientConfigMapper;
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;
import javax.annotation.Resource;
@Service
public class HfUpdateImpl implements HfUpdateService {
@Resource
private ClientMapper clientMapper;
@Resource
private MpWechatApiProvider mpWechatApiProvider;
@Resource
private ClientConfigMapper clientConfigMapper;
@Override
public String updateStatus() {
@ -32,8 +30,14 @@ public class HfUpdateImpl implements HfUpdateService {
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));
String url = api.registerShortUrl(longUrl);
dbResult.put("hf_pay_url", url);
JSONObject config = new JSONObject();
config.put("client_id",dbResult.getString("client_id"));
config.put("hf_pay_url", url);
clientConfigMapper.update(config);
clientMapper.update(dbResult);
});
return "ok";
}

@ -414,7 +414,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
//HF支付链接二维码
if (client.getString("hf_pay_url") != null) {
client.put("hfQrcodeUrl", QRCodeUtils.qrcodeImageCode(client.getString("hf_pay_url"), 200, false));
String hfQrcodeUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + client.getString("client_moniker") + "/jump/app");
client.put("hfQrcodeUrl", QRCodeUtils.qrcodeImageCode(hfQrcodeUrl, 200, false));
}
return client;
}

@ -103,7 +103,7 @@
<label class="control-label col-sm-2">HF Pay Link</label>
<div class="col-sm-10">
<p class="form-control-static">{{partner.hf_pay_url}}
<span id="intro">
<!-- <span id="intro">
<a href=""><i id="carousel_id" class="glyphicon glyphicon-info-sign" ng-mouseover="toFirst();toShow()"></i></a>
<div class="pos" ng-show="show">
<i class="tocancle glyphicon glyphicon-remove" ng-click="toHide()"></i>
@ -116,7 +116,7 @@
</uib-slide>
</uib-carousel>
</div>
</span>
</span>-->
</p>
</div>
<div class="form-group" >

Loading…
Cancel
Save