master
wangning 7 years ago
parent 128eddeb28
commit 6ab808a45f

@ -255,8 +255,8 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject res = new JSONObject();
res.put("url", url);
res.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false));
// res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config,clientAccountMapper.findById(device.getString("account_id")),"APP"));
res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config));
res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config,clientAccountMapper.findById(device.getString("account_id")),"APP"));
// res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config));
return res;
}

@ -27,4 +27,7 @@ public interface ClientConfigMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject find(@Param("client_id") int client_id);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> getAll();
}

@ -74,4 +74,7 @@ public interface ClientMapper {
List<JSONObject> listSubMerchantId();
List<JSONObject> listBySubMerchantId(@Param("sub_merchant_id") String sub_merchant_id);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> AllClients();
}

@ -1621,8 +1621,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public String getQrCodeBoard(JSONObject client, QRCodeConfig config,JSONObject account,String plantform) {
// JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
return merchantInfoProvider.getQrCodeBoard(client, config);
// return merchantInfoProvider.getQrCodeBoard(client, config,account,plantform);
// return merchantInfoProvider.getQrCodeBoard(client, config);
return merchantInfoProvider.getQrCodeBoard(client, config,account,plantform);
}
@Override
@ -1646,8 +1646,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
qrboardConfig.put("brandw", "600");
qrboardConfig.put("brandh", "200");
String type = qrboardConfig.getString("type");
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous);
} catch (Exception e) {
throw new ServerErrorException("QR board config not set for current organize", e);
@ -1667,8 +1667,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString);
String type = qrboardConfig.getString("type");
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous);
} catch (Exception e) {
throw new ServerErrorException("QR board config not set for current organize", e);

@ -1,6 +1,6 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.schema-name=royalpay_production
spring.datasource.host=192.168.0.49:3306
spring.datasource.host=192.168.99.100:3306
spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root
spring.datasource.password=root

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.apps.core.impls;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.tools.mail.MailGunClient;
@ -9,6 +10,7 @@ import au.com.royalpay.payment.tools.mail.SendMail;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -21,8 +23,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
@ -34,7 +40,7 @@ import cn.yixblog.platform.http.HttpRequestResult;
* Created by wangning on 05/01/2018.
*/
@SpringBootTest
@ActiveProfiles({ "local", "alipay", "wechat", "jd", "bestpay" })
@ActiveProfiles({ "proxy", "alipay", "wechat", "jd", "bestpay" })
@RunWith(SpringRunner.class)
public class CustomerImpressionImplTest {
@Resource
@ -48,7 +54,8 @@ public class CustomerImpressionImplTest {
private OrgMapper orgMapper;
@Resource
private MailGunClient mailGunClient;
@Resource
private ClientConfigMapper clientConfigMapper;
// @Test
// public void redisQueue() {
@ -60,40 +67,39 @@ public class CustomerImpressionImplTest {
// }
// }
// @Test
// public void excel() {
// try {
// XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx")));
// XSSFSheet sheet = workbook.getSheetAt(0);
// Iterator<Row> rowIterator = sheet.rowIterator();
// Row row = null;
// Cell cell = null;
// while (rowIterator.hasNext()) {
// row = rowIterator.next();
// cell = row.getCell(3);
// cell.setCellType(HSSFCell.CELL_TYPE_STRING);
//
// JSONObject client = clientMapper.findClientByMoniker(cell.getStringCellValue().trim());
// if(client==null){
// System.out.println();
// continue;
// }
// JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
// if(org==null){
// continue;
// }
//
// row.createCell(5).setCellValue(org.getString("name"));
// }
//
// OutputStream out = new FileOutputStream("/Users/wangning/Desktop/春节活动报名结果通知(包含BD名称).xlsx");
// workbook.write(out);
// workbook.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// @Test
// public void excel() {
// try {
// XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx")));
// XSSFSheet sheet = workbook.getSheetAt(0);
// Iterator<Row> rowIterator = sheet.rowIterator();
// Row row = null;
// Cell cell = null;
// while (rowIterator.hasNext()) {
// row = rowIterator.next();
// cell = row.getCell(3);
// cell.setCellType(HSSFCell.CELL_TYPE_STRING);
//
// JSONObject client = clientMapper.findClientByMoniker(cell.getStringCellValue().trim());
// if(client==null){
// System.out.println();
// continue;
// }
// JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
// if(org==null){
// continue;
// }
//
// row.createCell(5).setCellValue(org.getString("name"));
// }
//
// OutputStream out = new FileOutputStream("/Users/wangning/Desktop/春节活动报名结果通知(包含BD名称).xlsx");
// workbook.write(out);
// workbook.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
@Test
public void sendSimpleMessage() throws Exception {
@ -126,7 +132,7 @@ public class CustomerImpressionImplTest {
generator.addQueryString("ascending", "yes");
generator.addQueryString("v:my-custom-data", "123456789");
generator.addQueryString("limit", "12");
System.out.println(String.valueOf(DateUtils.addDays(new Date(),1)));
System.out.println(String.valueOf(DateUtils.addDays(new Date(), 1)));
HttpRequestResult res = null;
try {
res = generator.execute();
@ -154,14 +160,16 @@ public class CustomerImpressionImplTest {
@Test
public void sendSimpleMessages() throws Exception {
SendMail sendMail = new SendMail();
sendMail.setFrom("postmaster@mail.royalpay.com.au");
sendMail.setContent("<html><p>Hi kira</p ></html>");
sendMail.setFrom("info@mail.royalpay.com.au");
sendMail.setContent("<html><p>Hi</p ></html>");
List<String> list = new ArrayList<>();
list.add("testTag");
// sendMail.setTags(list);
Set<String> mailCCs = new HashSet<>();
mailCCs.add("asd1159111@163.com");
sendMail.setMailCcs(mailCCs);
Set<String> mailtos = new HashSet<>();
mailtos.add("1029811920@qq.com");
mailtos.add("164851225@qq.com");
mailtos.add("eason.qian@royalpay.com.au");
sendMail.setMailTos(mailtos);
sendMail.setTitle("Final Test");
@ -171,4 +179,43 @@ public class CustomerImpressionImplTest {
System.out.println(result.toJSONString());
}
@Test
public void asd() {
JSONObject client = clientMapper.findClient(9);
JSONObject var = new JSONObject();
var.put("client_moniker", client.getString("client_moniker"));
var.put("short_name", client.getString("short_name"));
JSONObject result = mailGunClient.addListMember(client.getString("contact_email"), "merchants@mail.royalpay.com.au", client.getString("contact_person"),
var);
}
@Test
public void qwe() {
List<JSONObject> clients = clientMapper.AllClients();
List<JSONObject> clientConfigs = clientConfigMapper.getAll();
Map<String, JSONObject> clientConfigMap = new HashMap<>();
Map<String, JSONObject> clientMap = new HashMap<>();
clientConfigs.forEach(p -> {
clientConfigMap.put(p.getString("client_moniker"), p);
});
clients.forEach(p -> {
clientMap.put(p.getString("client_moniker"), p);
});
String split = "--";
String cc = "cc:";
String c = "c";
clientConfigMap.values().forEach(p -> {
String clientMoniker = p.getString("client_moniker");
JSONObject tmpClient = clientMap.get(clientMoniker);
tmpClient.keySet().forEach(o->{
if(StringUtils.isNotEmpty(p.getString(o))){
if(!tmpClient.getString(o).equals(p.getString(o))){
System.out.println(clientMoniker+split+o+split+cc+p.getString(o)+split+c+tmpClient.getString(o));
}
}
});
});
}
}
Loading…
Cancel
Save