master
wangning 7 years ago
parent 8127076865
commit 1731d9e973

@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean;
import au.com.royalpay.payment.manage.notice.beans.NoticeInfo;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal;
@ -110,4 +111,6 @@ public interface RetailAppService {
JSONObject getAdDetail(JSONObject device, String article_id);
JSONObject getCheckClientInfo(JSONObject device);
}

@ -16,9 +16,7 @@ import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientSettleDelayConfMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
import au.com.royalpay.payment.manage.mappers.system.CustomerRelationAlipayMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
@ -30,6 +28,7 @@ import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.signin.core.impls.SignInAccountServiceImpl;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.cms.RoyalPayCMSSupport;
import au.com.royalpay.payment.tools.device.DeviceSupport;
@ -37,9 +36,9 @@ import au.com.royalpay.payment.tools.device.message.AppMessage;
import au.com.royalpay.payment.tools.device.message.AppMsgSender;
import au.com.royalpay.payment.tools.device.support.DeviceRegister;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
@ -64,7 +63,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.DateFormat;
@ -138,9 +136,9 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource
private ClientDeviceTokenMapper clientDeviceTokenMapper;
@Resource
private ClientRateMapper clientRateMapper;
private ClientContractService clientContractService;
@Resource
private ClientsContractMapper clientsContractMapper;
private SysConfigManager sysConfigManager;
private Map<String, AppMsgSender> senderMap = new HashMap<>();
@ -1338,6 +1336,20 @@ public class RetailAppServiceImp implements RetailAppService {
return res;
}
@Override
public JSONObject getCheckClientInfo(JSONObject device) {
JSONObject result = clientContractService.getClientContractExpire(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
if(PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER){
result.put("is_ordinary",true);
return result;
}
JSONObject file = clientContractService.getOrGenerateSourceAgreement(device.getIntValue("client_id"));
result.put("file_url", file.getString("file_value"));
result.put("contract_info",sysConfigManager.getSysConfig().getString("sys_contract_info"));
return result;
}
private static boolean mathchLetterorNum(String str) {
String regex = "[A-Za-z0-9]{8}";
return str.matches(regex);

@ -4,7 +4,6 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.manage.bill.bean.NewBillBean;
import au.com.royalpay.payment.manage.bill.bean.QueryBillBean;
import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean;
@ -12,6 +11,7 @@ import au.com.royalpay.payment.manage.bill.core.BillOrderService;
import au.com.royalpay.payment.manage.bill.core.BillService;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.advise.AppClientController;
import au.com.royalpay.payment.tools.env.SysConfigManager;
@ -200,11 +200,7 @@ public class RetailAppController {
@RequestMapping(value = "/client/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
JSONObject result = clientContractService.getClientContractExpire(device.getIntValue("client_id"));
JSONObject file = clientContractService.getOrGenerateSourceAgreement(device.getIntValue("client_id"));
result.put("file_url", file.getString("file_value"));
result.put("contract_info",sysConfigManager.getSysConfig().getString("sys_contract_info"));
return result;
return retailAppService.getCheckClientInfo(device);
}
@RequestMapping(value = "/client", method = RequestMethod.PUT)

@ -283,4 +283,6 @@ public interface ClientManager {
List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager);
void clearCacheSubMerchantIdApplices(String clientMoniker);
JSONObject getCheckClientInfo(JSONObject account);
}

@ -42,6 +42,7 @@ import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
@ -208,6 +209,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private ClientsContractMapper clientsContractMapper;
@Resource
private ClientContractService clientContractService;
private static final String SOURCE_AGREE_FILE = "source_agree_file";
private static final String CLIENT_BANK_FILE = "client_bank_file";
@ -1890,6 +1893,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
List<JSONObject> clientRate = clientRateMapper.minExpiryTime(client.getIntValue("client_id"),null);
if(CollectionUtils.isEmpty(clientRate)){
throw new BadRequestException("The Partner's Rate is not config!");
}
clientRate.forEach((p)->{
String rate_name = p.getString("rate_name");
if("Wechat".equals(rate_name)){
@ -3106,4 +3112,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
public void clearCacheSubMerchantIdApplices(String clientMoniker) {
}
@Override
public JSONObject getCheckClientInfo(JSONObject account) {
JSONObject result = clientContractService.getClientContractExpire(account.getIntValue("client_id"));
if(PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER){
result.put("is_ordinary",true);
boolean expire = result.getBoolean("rate_expire");
boolean waring = result.getBoolean("rate_waring");
if(!expire && waring){
}
return result;
}
JSONObject file = clientContractService.getOrGenerateSourceAgreement(account.getIntValue("client_id"));
result.put("file_url", file.getString("file_value"));
result.put("contract_info",sysConfigManager.getSysConfig().getString("sys_contract_info"));
return result;
}
}

@ -20,6 +20,7 @@ import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
@ -526,11 +527,7 @@ public class PartnerManageController {
@PartnerMapping(value = "/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
JSONObject result = clientContractService.getClientContractExpire(account.getIntValue("client_id"));
JSONObject file = clientContractService.getOrGenerateSourceAgreement(account.getIntValue("client_id"));
result.put("file_url", file.getString("file_value"));
result.put("contract_info",sysConfigManager.getSysConfig().getString("sys_contract_info"));
return result;
return clientManager.getCheckClientInfo(account);
}
@PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST)

@ -5,6 +5,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
@ -35,6 +36,8 @@ public class ClientContractServiceImpl implements ClientContractService {
private ClientsContractMapper clientsContractMapper;
@Resource
private ClientRateMapper clientRateMapper;
@Resource
private SysConfigManager sysConfigManager;
@Override
@Transactional
@ -149,12 +152,12 @@ public class ClientContractServiceImpl implements ClientContractService {
if (contract != null && contract.getDate("expiry_date").compareTo(now) > 0 && contract.getBoolean("has_sign")) {
return result;
}
int waringDays = sysConfigManager.getSysConfig().getIntValue("rate_warning_days");
rateInfo.forEach((p) -> {
if (now.compareTo(p.getDate("expiry_time")) > -1) {
result.put("rate_expire", true);
}
if (DateUtils.addDays(now, 10).compareTo(p.getDate("expiry_time")) > -1) {
if (DateUtils.addDays(now, waringDays).compareTo(p.getDate("expiry_time")) > -1) {
result.put("rate_waring", true);
}
});

Loading…
Cancel
Save