Merge remote-tracking branch 'origin/master'

master
yixian 7 years ago
commit 1d95427e60

@ -495,7 +495,7 @@ public class RetailAppServiceImp implements RetailAppService {
} catch (Exception e) {
logger.error("出错了:" + e.getMessage());
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
throw new ServerErrorException("Send App "+devToken.getString("client_type")+" Failed", e);
throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e);
}
};
sendingAppleMsgPool.execute(task);
@ -640,7 +640,7 @@ public class RetailAppServiceImp implements RetailAppService {
} catch (Exception e) {
logger.error("出错了:" + e.getMessage());
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
throw new ServerErrorException("Send App "+devToken.getString("client_type")+" Failed", e);
throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e);
}
}
});
@ -687,7 +687,7 @@ public class RetailAppServiceImp implements RetailAppService {
} catch (Exception e) {
logger.error("出错了:" + e.getMessage());
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
throw new ServerErrorException("Send App "+devToken.getString("client_type")+" Failed", e);
throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e);
}
}
}
@ -720,23 +720,20 @@ public class RetailAppServiceImp implements RetailAppService {
}
JSONObject managerMsg = new JSONObject();
managerMsg.put("title", LocaleSupport.localeMessage("app.message.title.daily_notice"));
managerMsg.put("body", trade_date + ": 总交易额 "
+ PlatformEnvironment.getEnv().getForeignCurrency() + total_amount + ", 订单数:" + total_orders + ", 付款人数:" + customers);
managerMsg.put("body", trade_date + ": 总交易额 " + PlatformEnvironment.getEnv().getForeignCurrency() + total_amount + ", 订单数:" + total_orders
+ ", 付款人数:" + customers);
managerMsg.put("type", type);
managerMsg.put("data", tradeInfo);
managerMsg.put("msgType", "daily_notice");
AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage();
sender.sendMessage(appMessage, devToken);
log.put("status", 2);
appMessageLogMapper.update(log);
} catch (Exception e) {
logger.error("出错了:" + e.getMessage());
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
throw new ServerErrorException("Send App "+devToken.getString("client_type")+" Failed", e);
throw new ServerErrorException("Send App " + devToken.getString("client_type") + " Failed", e);
}
}
}
@ -845,9 +842,18 @@ public class RetailAppServiceImp implements RetailAppService {
res.put("customer_surcharge_rate", client.getBigDecimal("customer_surcharge_rate"));
}
res.put("max_customer_surcharge_rate", PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate());
channels.add(getChannel(clientId, now, "Wechat"));
channels.add(getChannel(clientId, now, "Alipay"));
channels.add(getChannel(clientId, now, "Bestpay"));
JSONObject wechat = getChannel(clientId, now, "Wechat");
if (wechat.containsKey("channel")) {
channels.add(wechat);
}
JSONObject alipay = getChannel(clientId, now, "Alipay");
if (wechat.containsKey("channel")) {
channels.add(alipay);
}
JSONObject bestpay = getChannel(clientId, now, "Bestpay");
if (wechat.containsKey("channel")) {
channels.add(bestpay);
}
JSONObject jd = getChannel(clientId, now, "jd");
if (jd.containsKey("channel")) {
channels.add(jd);
@ -958,15 +964,15 @@ public class RetailAppServiceImp implements RetailAppService {
Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType);
String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType);
int update_type = 0;// 0:不更新 1更新 2强制更新
String [] versionArr = version.split("\\.");
String [] newVersionArr = newAppVersion.split("\\.");
String[] versionArr = version.split("\\.");
String[] newVersionArr = newAppVersion.split("\\.");
for (int i = 0; i < newVersionArr.length; i++) {
if(Integer.valueOf(newVersionArr[i])>Integer.valueOf(versionArr[i])){
if (Integer.valueOf(newVersionArr[i]) > Integer.valueOf(versionArr[i])) {
update_type = 1;
if (isUpdate) {
update_type = 2;
}
i=newVersionArr.length+1;
i = newVersionArr.length + 1;
}
}
JSONObject res = new JSONObject();
@ -1193,7 +1199,7 @@ public class RetailAppServiceImp implements RetailAppService {
} catch (Exception e) {
logger.error("出错了:" + e.getMessage());
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
throw new ServerErrorException("Send App "+params.getString("client_type")+" Failed", e);
throw new ServerErrorException("Send App " + params.getString("client_type") + " Failed", e);
}
}

@ -72,7 +72,4 @@ public interface ClientMapper {
List<String> listCityClientIds(@Param("city") String city, @Param("date") Date date);
List<String> listClientByCleanDays(@Param("clean_days") int clean_days);
@AutoSql(type = SqlType.SELECT)
int getPartnercode(@Param("codes") String codes);
}

@ -13,7 +13,7 @@ import javax.validation.constraints.Pattern;
public class ClientRegisterInfo {
@JSONField(name = "client_moniker")
@NotEmpty(message = "error.payment.valid.param_missing")
@Pattern(regexp = "^[a-zA-Z0-9]{6}$", message = "Parameter error(partner code):Only letters or numbers are allowed")
@Pattern(regexp = "^[a-zA-Z0-9]{4}$", message = "Parameter error(partner code):Only letters or numbers are allowed")
private String clientMoniker;
@NotEmpty(message = "error.payment.valid.param_missing")
@JSONField(name = "company_name")

@ -264,6 +264,4 @@ public interface ClientManager {
void validRefundPwd(JSONObject account, String pwd);
void setWeekendDelay(int clientId, boolean delay);
String initMerchantCode();
}

@ -2084,16 +2084,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper.update(clientUpdate);
}
@Override
public String initMerchantCode() {
String code = RandomStringUtils.randomAlphanumeric(6).toUpperCase();
if (clientMapper.getPartnercode(code) > 0) {
return initMerchantCode();
}
return code;
}
@Override
public void setClientQRCodePaySurCharge(String clientMoniker, boolean paySurcharge) {
JSONObject client = getClientInfoByMoniker(clientMoniker);

@ -482,8 +482,4 @@ public class PartnerManageController {
public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow"));
}
@RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET)
public String initMerchantCode() {
return clientManager.initMerchantCode();
}
}

@ -1,20 +1,21 @@
package au.com.royalpay.payment.manage.notice.core.impls;
import au.com.royalpay.payment.manage.mappers.notice.NoticePartnerMapper;
import au.com.royalpay.payment.manage.notice.core.NoticePartner;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import au.com.royalpay.payment.manage.mappers.notice.NoticePartnerMapper;
import au.com.royalpay.payment.manage.notice.core.NoticePartner;
import au.com.royalpay.payment.tools.utils.PageListUtils;
/**
* Created by yishuqian on 29/09/2016.
@ -39,6 +40,9 @@ public class NoticePartnerImpl implements NoticePartner {
PageList<JSONObject> partnerNotices =noticePartnerMapper.listNoticesByClientId(params,
new PageBounds(params.getIntValue("page"), params.getIntValue("limit"), Order.formString("status.asc,send_time.desc")));
JSONObject res = PageListUtils.buildPageListResult(partnerNotices);
if(partnerNotices.size()<1){
res.put("data", Collections.EMPTY_LIST);
}
res.put("unReadCounts",counts);
return res;
}

@ -272,7 +272,4 @@
<select id="listClientByCleanDays" resultType="java.lang.String">
SELECT client_id FROM sys_clients WHERE is_valid = 1 and clean_days = #{clean_days}
</select>
<select id="getPartnercode" resultType="int">
SELECT count(1) FROM sys_clients where client_moniker=#{codes};
</select>
</mapper>

@ -40,12 +40,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}).state('partners.new', {
url: '/new',
templateUrl: '/static/payment/partner/templates/add_partner.html',
controller: 'addPartnerCtrl',
resolve: {
merchant_code: ['$http', function ($http) {
return $http.get('/sys/partners/init/merchant_code');
}]
}
controller: 'addPartnerCtrl'
}).state('partners.detail', {
url: '/{clientMoniker}/detail',
templateUrl: '/static/payment/partner/templates/partner_detail.html',
@ -229,9 +224,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
$scope.partner.company_phone_c = 61;
$scope.partner.contact_phone_c = 61;
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data;
});
function remove(arr, val) {
if (angular.isArray(arr)) {
@ -1249,10 +1241,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
controller: 'partnerNewSubPartnerDialogCtrl',
size: 'lg',
resolve: {
merchant_code: ['$http', function ($http) {
return $http.get('/sys/partners/init/merchant_code');
}],
clientMoniker: function () {
return $scope.partner.client_moniker;
}
@ -1546,9 +1534,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
app.controller('partnerNewSubPartnerDialogCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone',
'clientMoniker', 'industryMap', 'businessStructuresMap', 'stateMap', 'countryMap',
function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, clientMoniker, industryMap, businessStructuresMap, stateMap, countryMap) {
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data;
});
if ($scope.partner_application) {
$scope.partner = angular.copy($scope.partner_application);
delete $rootScope.partner_application;

@ -27,7 +27,8 @@
ng-model="partner.client_moniker"
type="text"
name="client_moniker"
id="short-id-input" readonly>
id="short-id-input" required maxlength="4"
ng-pattern="/^[a-zA-Z0-9]+$/">
<p class="small text-info">No further changeable!</p>
<div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty">

@ -20,7 +20,7 @@
<input class="form-control text-uppercase" ng-model="partner.client_moniker"
type="text"
name="client_moniker"
id="short-id-input" readonly>
id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/">
<p class="small text-info">No further changeable!</p>
<div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty">

Loading…
Cancel
Save