master
wangning 7 years ago
parent a9c50800b0
commit 99df2c0e9f

@ -358,14 +358,32 @@ public class RetailAppServiceImp implements RetailAppService {
@Override
public JSONObject getClientInfoRealtime(JSONObject device) {
return clientMapper.findClient(device.getIntValue("client_id"));
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
JSONObject result = new JSONObject();
result.put("company_phone",client.getString("company_phone"));
result.put("short_name",client.getString("short_name"));
result.put("company_name",client.getString("company_name"));
result.put("business_name",client.getString("business_name"));
result.put("business_structure",client.getString("business_structure"));
result.put("abn",client.getString("abn"));
result.put("acn",client.getString("acn"));
result.put("address",client.getString("address"));
result.put("suburb",client.getString("suburb"));
result.put("postcode",client.getString("postcode"));
result.put("state",client.getString("state"));
result.put("timezone",client.getString("timezone"));
result.put("contact_email",client.getString("contact_email"));
result.put("mail_confirm",client.getString("mail_confirm"));
result.put("contact_person",client.getString("contact_person"));
result.put("logo_url",client.getString("logo_url"));
result.put("store_photo",client.getString("store_photo"));
return result;
}
@Override
public JSONObject getClientInfoMe(JSONObject device) {
JSONObject result = new JSONObject();
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
if (client.getString("store_photo") == null || client.getString("logo_url") == null || client.getString("company_photo") == null) {
if (StringUtils.isEmpty(client.getString("store_photo"))|| StringUtils.isEmpty(client.getString("logo_url"))|| StringUtils.isEmpty(client.getString("company_photo"))) {
result.put("base_info_lack", true);
}
JSONObject file = clientManager.getAuthFiles(null, client.getString("client_moniker"));
@ -374,6 +392,7 @@ public class RetailAppServiceImp implements RetailAppService {
result.put("compliance_info_lack", true);
}
}
result.putAll(file);
return result;
}

@ -19,7 +19,6 @@ import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.device.advise.AppClientController;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
@ -38,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
@ -56,7 +56,7 @@ import static au.com.royalpay.payment.tools.CommonConsts.RETAIL_DEVICE;
/**
* Created by yishuqian on 28/03/2017.
*/
@AppClientController
@RestController
@RequestMapping("/api/v1.0/retail/app")
public class RetailAppController {
@Resource
@ -246,7 +246,7 @@ public class RetailAppController {
@RequestMapping(value = "/client/realtime", method = RequestMethod.GET)
public JSONObject getClientInfoRealtime(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientInfo(device);
return retailAppService.getClientInfoRealtime(device);
}
@RequestMapping(value = "/client/me", method = RequestMethod.GET)

Loading…
Cancel
Save