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

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

@ -283,5 +283,5 @@ public interface ClientManager {
void clearCacheSubMerchantIdApplices(String clientMoniker); 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")); file.put("last_update_by", manager.getString("display_name"));
} }
JSONObject contract = clientsContractMapper.findByClientId(client.getIntValue("client_id")); 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); clientFilesMapper.save(file);
} else { } else {
file.put("file_id", existFile.getString("file_id")); file.put("file_id", existFile.getString("file_id"));
@ -3239,13 +3239,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public JSONObject getCheckClientInfo(int client_id, String account_id) { public JSONObject getCheckClientInfo(int client_id, String account_id, String channel) {
JSONObject result = clientContractService.getClientContractExpire(client_id); JSONObject result = null;
JSONObject expireInfo = clientContractService.getClientContractExpire(client_id,channel);
JSONObject account = clientAccountMapper.findById(account_id); JSONObject account = clientAccountMapper.findById(account_id);
if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
result.put("alert", false); return result;
} else { } else {
if(result.getBoolean("alert")){ if(expireInfo.getBoolean("alert")){
result = new JSONObject();
result.put("content","Dear Valued Merchants,\n" + result.put("content","Dear Valued Merchants,\n" +
"\n" + "\n" +
"\n" + "\n" +

@ -526,7 +526,7 @@ public class PartnerManageController {
@PartnerMapping(value = "/check", method = RequestMethod.GET) @PartnerMapping(value = "/check", method = RequestMethod.GET)
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { 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) @PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST)

@ -13,7 +13,7 @@ public interface ClientContractService {
JSONObject getSourceAgreement(int client_id); 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); void saveContract(int client_id, Date expire_date, String channel);

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

Loading…
Cancel
Save