master
wangning 7 years ago
parent f4345b7096
commit eacb8d89de

@ -164,11 +164,11 @@ public interface ClientManager {
JSONObject getQRCode(JSONObject manager, String clientMoniker, QRCodeConfig config); JSONObject getQRCode(JSONObject manager, String clientMoniker, QRCodeConfig config);
String getQrCodeBoard(JSONObject client, QRCodeConfig config,JSONObject account); String getQrCodeBoard(JSONObject client, QRCodeConfig config,JSONObject account,String plantform);
void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous); void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous,String plantform);
void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous); void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous,String plantform);
void writePoster(JSONObject manager, String clientMoniker, OutputStream ous); void writePoster(JSONObject manager, String clientMoniker, OutputStream ous);

@ -1522,13 +1522,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public String getQrCodeBoard(JSONObject client, QRCodeConfig config,JSONObject account) { public String getQrCodeBoard(JSONObject client, QRCodeConfig config,JSONObject account,String plantform) {
// JSONObject org = orgMapper.findOne(client.getIntValue("org_id")); // JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
return merchantInfoProvider.getQrCodeBoard(client, config,account); return merchantInfoProvider.getQrCodeBoard(client, config,account,plantform);
} }
@Override @Override
public void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous) { public void writeAggregateQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous,String plantform) {
JSONObject client = clientDetail(manager, clientMoniker); JSONObject client = clientDetail(manager, clientMoniker);
try { try {
JSONObject qrboardConfig = new JSONObject(); JSONObject qrboardConfig = new JSONObject();
@ -1548,7 +1548,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
qrboardConfig.put("brandw", "600"); qrboardConfig.put("brandw", "600");
qrboardConfig.put("brandh", "200"); qrboardConfig.put("brandh", "200");
String type = qrboardConfig.getString("type"); String type = qrboardConfig.getString("type");
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager); QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
board.drawBoardImage(ous); board.drawBoardImage(ous);
} catch (Exception e) { } catch (Exception e) {
throw new ServerErrorException("QR board config not set for current organize", e); throw new ServerErrorException("QR board config not set for current organize", e);
@ -1556,7 +1556,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous) { public void writeQrCodeBoard(JSONObject manager, String clientMoniker, QRCodeConfig config, OutputStream ous,String plantform) {
JSONObject client = clientDetail(manager, clientMoniker); JSONObject client = clientDetail(manager, clientMoniker);
JSONObject org = orgMapper.findOne(client.getIntValue("org_id")); JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
try { try {
@ -1568,7 +1568,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString); JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString);
String type = qrboardConfig.getString("type"); String type = qrboardConfig.getString("type");
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager); QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
board.drawBoardImage(ous); board.drawBoardImage(ous);
} catch (Exception e) { } catch (Exception e) {
throw new ServerErrorException("QR board config not set for current organize", e); throw new ServerErrorException("QR board config not set for current organize", e);

@ -92,7 +92,7 @@ public class PartnerManageController {
response.setContentType("application/octet-stream;"); response.setContentType("application/octet-stream;");
response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg");
OutputStream ous = response.getOutputStream(); OutputStream ous = response.getOutputStream();
clientManager.writeQrCodeBoard(manager, clientMoniker, config, ous); clientManager.writeQrCodeBoard(manager, clientMoniker, config, ous,"PC");
} }
@ManagerMapping(value = "/{clientMoniker}/qrcode_board/aggregate", method = RequestMethod.GET) @ManagerMapping(value = "/{clientMoniker}/qrcode_board/aggregate", method = RequestMethod.GET)
@ -101,7 +101,7 @@ public class PartnerManageController {
response.setContentType("application/octet-stream;"); response.setContentType("application/octet-stream;");
response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg");
OutputStream ous = response.getOutputStream(); OutputStream ous = response.getOutputStream();
clientManager.writeAggregateQrCodeBoard(manager, clientMoniker, config, ous); clientManager.writeAggregateQrCodeBoard(manager, clientMoniker, config, ous,"PC");
} }
@ManagerMapping(value = "/{clientMoniker}/poster", method = RequestMethod.GET) @ManagerMapping(value = "/{clientMoniker}/poster", method = RequestMethod.GET)

@ -83,7 +83,7 @@ public class PartnerViewController {
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg");
OutputStream ous = response.getOutputStream(); OutputStream ous = response.getOutputStream();
clientManager.writeQrCodeBoard(null, account.getString("client_moniker"), config, ous); clientManager.writeQrCodeBoard(null, account.getString("client_moniker"), config, ous,"PC");
} }
@PartnerMapping(value = "/qrcode_board/aggregate", method = RequestMethod.GET) @PartnerMapping(value = "/qrcode_board/aggregate", method = RequestMethod.GET)
@ -92,7 +92,7 @@ public class PartnerViewController {
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg");
OutputStream ous = response.getOutputStream(); OutputStream ous = response.getOutputStream();
clientManager.writeAggregateQrCodeBoard(null, account.getString("client_moniker"), config, ous); clientManager.writeAggregateQrCodeBoard(null, account.getString("client_moniker"), config, ous,"pc");
} }
@PartnerMapping(value = "/poster", method = RequestMethod.GET) @PartnerMapping(value = "/poster", method = RequestMethod.GET)

Loading…
Cancel
Save