master
wangning 7 years ago
parent 206106caac
commit 29d7835400

@ -203,7 +203,7 @@ public class RetailAppController {
JSONObject result = retailAppService.getClientRateExpire(device.getIntValue("client_id")); JSONObject result = retailAppService.getClientRateExpire(device.getIntValue("client_id"));
JSONObject file = appFileService.getOrGenerateSourceAgreement(device.getIntValue("client_id")); JSONObject file = appFileService.getOrGenerateSourceAgreement(device.getIntValue("client_id"));
result.put("file_url", file.getString("file_value")); result.put("file_url", file.getString("file_value"));
result.put("contract_info",sysConfigManager.getSysConfig().getString("contract_info")); result.put("contract_info",sysConfigManager.getSysConfig().getString("sys_contract_info"));
return result; return result;
} }

@ -38,7 +38,6 @@ public class AppFileServiceImpl implements AppFileService {
public JSONObject getOrGenerateSourceAgreement(int client_id) { public JSONObject getOrGenerateSourceAgreement(int client_id) {
JSONObject client = clientManager.getClientInfo(client_id); JSONObject client = clientManager.getClientInfo(client_id);
JSONObject contract = clientsContractMapper.findByClientId(client_id); JSONObject contract = clientsContractMapper.findByClientId(client_id);
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
Date now = new Date(); Date now = new Date();
if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0) { if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0) {
try { try {
@ -46,11 +45,12 @@ public class AppFileServiceImpl implements AppFileService {
} catch (Exception e) { } catch (Exception e) {
logger.info("App generate PDF failed"); logger.info("App generate PDF failed");
} }
files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file"); List<JSONObject> files =clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
saveContract(client_id, now); saveContract(client_id, now);
return files.get(0); return files.get(0);
} else { } else {
JSONObject expireInfo = retailAppService.getClientRateExpire(client_id); JSONObject expireInfo = retailAppService.getClientRateExpire(client_id);
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
JSONObject file = files.get(0); JSONObject file = files.get(0);
if(expireInfo.getBoolean("rate_expire")){ if(expireInfo.getBoolean("rate_expire")){
file.put("last_update_date",now); file.put("last_update_date",now);

Loading…
Cancel
Save