master
wangning 7 years ago
parent 25d6d34a3f
commit 206106caac

@ -14,6 +14,7 @@ import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.advise.AppClientController; import au.com.royalpay.payment.tools.device.advise.AppClientController;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
@ -51,6 +52,8 @@ public class RetailAppController {
private BillService billService; private BillService billService;
@Resource @Resource
private AppFileService appFileService; private AppFileService appFileService;
@Resource
private SysConfigManager sysConfigManager;
@RequestMapping(value = "/token", method = RequestMethod.PUT) @RequestMapping(value = "/token", method = RequestMethod.PUT)
public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) { public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) {
@ -194,9 +197,14 @@ public class RetailAppController {
public JSONObject getClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public JSONObject getClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientInfo(device); return retailAppService.getClientInfo(device);
} }
@RequestMapping(value = "/client/check", method = RequestMethod.GET) @RequestMapping(value = "/client/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientRateExpire(device.getIntValue("client_id")); JSONObject result = retailAppService.getClientRateExpire(device.getIntValue("client_id"));
JSONObject file = appFileService.getOrGenerateSourceAgreement(device.getIntValue("client_id"));
result.put("file_url", file.getString("file_value"));
result.put("contract_info",sysConfigManager.getSysConfig().getString("contract_info"));
return result;
} }
@RequestMapping(value = "/client", method = RequestMethod.PUT) @RequestMapping(value = "/client", method = RequestMethod.PUT)
@ -331,14 +339,6 @@ public class RetailAppController {
return result; return result;
} }
@RequestMapping(value = "/file/agree", method = RequestMethod.PUT)
public JSONObject generateSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
JSONObject file = appFileService.getOrGenerateSourceAgreement(device.getIntValue("client_id"));
JSONObject result = new JSONObject();
result.put("file_value",file.getString("file_value"));
return result;
}
@RequestMapping(value = "/file/agree/confirm", method = RequestMethod.POST) @RequestMapping(value = "/file/agree/confirm", method = RequestMethod.POST)
public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
appFileService.confirmSourceAgreement(device.getIntValue("client_id")); appFileService.confirmSourceAgreement(device.getIntValue("client_id"));

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.apps.core.impls; package au.com.royalpay.payment.manage.apps.core.impls;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.apps.core.AppFileService; import au.com.royalpay.payment.manage.apps.core.AppFileService;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper; import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
@ -29,6 +30,8 @@ public class AppFileServiceImpl implements AppFileService {
private ClientManager clientManager; private ClientManager clientManager;
@Resource @Resource
private ClientsContractMapper clientsContractMapper; private ClientsContractMapper clientsContractMapper;
@Resource
private RetailAppService retailAppService;
@Override @Override
@Transactional @Transactional
@ -47,7 +50,13 @@ public class AppFileServiceImpl implements AppFileService {
saveContract(client_id, now); saveContract(client_id, now);
return files.get(0); return files.get(0);
} else { } else {
return files.get(0); JSONObject expireInfo = retailAppService.getClientRateExpire(client_id);
JSONObject file = files.get(0);
if(expireInfo.getBoolean("rate_expire")){
file.put("last_update_date",now);
}
clientFilesMapper.update(file);
return file;
} }
} }

Loading…
Cancel
Save