wangning 7 years ago
parent ddee63590f
commit f7f5a925dc

@ -47,4 +47,7 @@ public interface OrgMapper {
PageList<JSONObject> listOrgWithPages(JSONObject paraams, PageBounds order);
List<JSONObject> listOrgAndChild(@Param("org_id") int org_id);
JSONObject test(@Param("client_id") int client_id);
}

@ -1,6 +1,6 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.schema-name=royalpay_production
spring.datasource.host=192.168.99.103:3306
spring.datasource.host=192.168.0.49: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

@ -18,11 +18,11 @@ spring.datasource.max-idle=150
spring.datasource.max-wait=3000
spring.datasource.filters=stat,wall,log4j
spring.redis.host=127.0.0.1
spring.redis.host=192.168.99.100
spring.redis.port=6379
spring.redis.database=1
spring.data.mongodb.host=10.30.0.8
spring.data.mongodb.host=192.168.99.100
spring.data.mongodb.port=27017
spring.data.mongodb.database=admin
spring.data.mongodb.username=mongouser
@ -99,3 +99,5 @@ app.foreign-currency=AUD
app.ofei.md5-key=Khjx6wejblaJzmG0JBWFlPFKAUxhFIXQ
app.ofei.pwd=aomi@8888
app.ofei.sp-code=A1407200
mail.mailgun.api_key=api:key-96fa3b5866ace125b8ec5a9d27e19353

@ -70,4 +70,17 @@
</where>
</select>
<select id="test" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select sum(clearing_amount) sum,count(DISTINCT(order_id)) counts
from pmt_transactions
where channel !='Settlement' and
transaction_type = 'Credit' and
transaction_time>'2018-01-01' and
transaction_time<'2018-05-01' and
client_id = #{client_id} and system_generate = 0
]]>
</select>
</mapper>

@ -57,14 +57,14 @@ public class CustomerImpressionImplTest {
@Test
public void excel() {
try {
XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx")));
XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/11.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 = row.getCell(0);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
JSONObject client = clientMapper.findClientByMoniker(cell.getStringCellValue().trim());
@ -72,15 +72,16 @@ public class CustomerImpressionImplTest {
System.out.println();
continue;
}
JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
JSONObject org = orgMapper.test(client.getIntValue("client_id"));
if(org==null){
continue;
}
row.createCell(5).setCellValue(org.getString("name"));
row.createCell(10).setCellValue(org.getString("sum"));
row.createCell(11).setCellValue(org.getString("counts"));
}
OutputStream out = new FileOutputStream("/Users/wangning/Desktop/春节活动报名结果通知(包含BD名称).xlsx");
OutputStream out = new FileOutputStream("/Users/wangning/Desktop/22.xlsx");
workbook.write(out);
workbook.close();
} catch (IOException e) {

Loading…
Cancel
Save