master
wangning 7 years ago
parent 8f5e2db5a5
commit 900f31a2c6

@ -1339,36 +1339,8 @@ public class RetailAppServiceImp implements RetailAppService {
@Override
public JSONObject getCheckClientInfo(JSONObject device) {
JSONObject result = clientContractService.getClientContractExpire(device.getIntValue("client_id"));
JSONObject config = sysConfigManager.getSysConfig();
boolean expire = result.getBoolean("rate_expire");
boolean waring = result.getBoolean("rate_waring");
if (PartnerRole.getRole(device.getIntValue("role")) == PartnerRole.CASHIER) {
result.put("is_ordinary", true);
if (!expire && waring) {
String[] key = { result.getString("expire_days") };
result.put("contract_info", editContractOrdinaryWaring(key, config.getString("sys_contract_ordinary_waring")));
}
if (expire) {
result.put("contract_info", config.getString("sys_contract_ordinary_info"));
}
return result;
} else {
result.put("contract_info", config.getString("sys_contract_info"));
result.put("is_ordinary", false);
if (!expire && waring) {
String[] key = { result.getString("expire_days") };
result.put("contract_info", editContractOrdinaryWaring(key, config.getString("sys_contract_waring")));
}
if (expire) {
result.put("contract_info", config.getString("sys_contract_info"));
}
JSONObject file = clientContractService.getOrGenerateSourceAgreement(device.getIntValue("client_id"));
result.put("file_url", file.getString("file_value"));
return result;
}
clientManager.getCheckClientInfo(device.getIntValue("client_id"), device.getString("account_id"));
}
private static boolean mathchLetterorNum(String str) {
String regex = "[A-Za-z0-9]{8}";
return str.matches(regex);

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

@ -3115,9 +3115,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject getCheckClientInfo(JSONObject account) {
JSONObject result = clientContractService.getClientContractExpire(account.getIntValue("client_id"));
public JSONObject getCheckClientInfo(int client_id,String account_id) {
JSONObject result = clientContractService.getClientContractExpire(client_id);
JSONObject config = sysConfigManager.getSysConfig();
JSONObject account = clientAccountMapper.findById(account_id);
boolean expire = result.getBoolean("rate_expire");
boolean waring = result.getBoolean("rate_waring");
if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
@ -3140,7 +3141,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (expire) {
result.put("contract_info", config.getString("sys_contract_info"));
}
JSONObject file = clientContractService.getOrGenerateSourceAgreement(account.getIntValue("client_id"));
JSONObject file = clientContractService.getOrGenerateSourceAgreement(account.getIntValue("client_id"),"pc");
result.put("file_url", file.getString("file_value"));
return result;
}

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

@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
public interface ClientContractService {
JSONObject getOrGenerateSourceAgreement(int client_id);
JSONObject getOrGenerateSourceAgreement(int client_id,String channel);
void confirmSourceAgreement(int client_id,String account_id);

@ -44,7 +44,7 @@ public class ClientContractServiceImpl implements ClientContractService {
@Override
@Transactional
public JSONObject getOrGenerateSourceAgreement(int client_id) {
public JSONObject getOrGenerateSourceAgreement(int client_id,String channel) {
JSONObject client = clientManager.getClientInfo(client_id);
if (client == null) {
throw new NotFoundException("merchant not found");
@ -60,7 +60,7 @@ public class ClientContractServiceImpl implements ClientContractService {
throw new ServerErrorException("System error");
}
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
saveContract(client_id, now);
saveContract(client_id, now,channel);
return files.get(0);
} else {
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
@ -75,11 +75,11 @@ public class ClientContractServiceImpl implements ClientContractService {
}
private void saveContract(int client_id, Date now) {
private void saveContract(int client_id, Date now,String channel) {
JSONObject newContract = new JSONObject();
newContract.put("create_time", now);
newContract.put("expiry_date", DateUtils.addYears(now, 1));
newContract.put("sign_channel", "App");
newContract.put("sign_channel", channel);
newContract.put("client_id", client_id);
newContract.put("has_sign", false);
clientsContractMapper.save(newContract);

Loading…
Cancel
Save