master
wangning 7 years ago
parent 3b53be6de3
commit effe1d79f6

@ -1129,10 +1129,11 @@ public class RetailAppServiceImp implements RetailAppService {
int update_type = 0;// 0:不更新 1更新 2强制更新
String [] oldVersion = version.split("\\.");
String [] newVersion = newAppVersion.split("\\.");
JSONObject res = new JSONObject();
res.put("update_content", updateContent);
JSONObject res = null;
for (int i = 0; i < newVersion.length; i++) {
if(Integer.valueOf(newVersion[i])>Integer.valueOf(oldVersion[i])){
res = new JSONObject();
res.put("update_content", updateContent);
update_type = 1;
if (isUpdate) {
update_type = 2;
@ -1141,7 +1142,6 @@ public class RetailAppServiceImp implements RetailAppService {
return res;
}
}
res.put("update_type", update_type);
return res;
}
@ -1424,7 +1424,7 @@ public class RetailAppServiceImp implements RetailAppService {
@Override
public JSONObject getCheckClientInfo(JSONObject device) {
return clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id"));
return clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id"),"App");
}
@Override

@ -223,11 +223,11 @@ public class RetailAppController {
@RequestMapping(value = "/client/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
String version = device.getString("version");
if("2.9.3".equals(version)){
throw new BadRequestException("test");
}
return retailAppService.getCheckClientInfo(device);
JSONObject defaultResult = new JSONObject();
defaultResult.put("rate_expire", false);
defaultResult.put("rate_waring", false);
defaultResult.put("old_contract", false);
return defaultResult;
}
@RequestMapping(value = "/client/checkContract", method = RequestMethod.GET)

@ -283,5 +283,5 @@ public interface ClientManager {
void clearCacheSubMerchantIdApplices(String clientMoniker);
JSONObject getCheckClientInfo(int client_id,String account_id);
JSONObject getCheckClientInfo(int client_id,String account_id, String channel);
}

@ -2141,7 +2141,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
file.put("last_update_by", manager.getString("display_name"));
}
JSONObject contract = clientsContractMapper.findByClientId(client.getIntValue("client_id"));
if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0 || existFile == null || existFile.isEmpty()) {
if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0 ||!contract.getBoolean("has_sign")|| existFile == null || existFile.isEmpty()) {
clientFilesMapper.save(file);
} else {
file.put("file_id", existFile.getString("file_id"));
@ -3239,13 +3239,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject getCheckClientInfo(int client_id, String account_id) {
JSONObject result = clientContractService.getClientContractExpire(client_id);
public JSONObject getCheckClientInfo(int client_id, String account_id, String channel) {
JSONObject result = null;
JSONObject expireInfo = clientContractService.getClientContractExpire(client_id,channel);
JSONObject account = clientAccountMapper.findById(account_id);
if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
result.put("alert", false);
return result;
} else {
if(result.getBoolean("alert")){
if(expireInfo.getBoolean("alert")){
result = new JSONObject();
result.put("content","Dear Valued Merchants,\n" +
"\n" +
"\n" +

@ -526,7 +526,7 @@ public class PartnerManageController {
@PartnerMapping(value = "/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getCheckClientInfo(account.getIntValue("client_id"),account.getString("account_id"));
return clientManager.getCheckClientInfo(account.getIntValue("client_id"),account.getString("account_id"),"PC");
}
@PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST)

@ -13,7 +13,7 @@ public interface ClientContractService {
JSONObject getSourceAgreement(int client_id);
JSONObject getClientContractExpire(int client_id);
JSONObject getClientContractExpire(int client_id, String channel);
void saveContract(int client_id, Date expire_date, String channel);

@ -100,7 +100,7 @@ public class ClientContractServiceImpl implements ClientContractService {
}
@Override
public JSONObject getClientContractExpire(int client_id) {
public JSONObject getClientContractExpire(int client_id,String channel) {
JSONObject client = clientManager.getClientInfo(client_id);
if (client == null) {
throw new NotFoundException("merchant not found please check ID");
@ -117,7 +117,7 @@ public class ClientContractServiceImpl implements ClientContractService {
if (sysconfig.getDate("sys_new_contract_time").compareTo(file.getDate("last_update_date")) > 0) {
JSONObject contract = clientsContractMapper.findByClientId(client_id);
if (contract == null) {
saveContract(client_id, new Date(), null);
saveContract(client_id, new Date(), channel);
}
}
}

Loading…
Cancel
Save