Commit 0356a45e authored by 魏艺敏's avatar 魏艺敏

update codes

parents ec2d2de7 e081eea0
.idea/dataSources/
lib/java/bi-report-service/.idea/workspace.xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<<<<<<< HEAD
<component name="BranchesTreeState"> <component name="BranchesTreeState">
<expand> <expand>
<path> <path>
...@@ -21,12 +22,18 @@ ...@@ -21,12 +22,18 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="14933943-93b5-4122-b234-224dacfdf041" name="Default Changelist" comment="update codes"> <list default="true" id="14933943-93b5-4122-b234-224dacfdf041" name="Default Changelist" comment="update codes">
<change beforePath="$PROJECT_DIR$/jobs/daily_recommend_strategy/step1_10.job" beforeDir="false" afterPath="$PROJECT_DIR$/jobs/search_related/step1_2.job" afterDir="false" /> <change beforePath="$PROJECT_DIR$/jobs/daily_recommend_strategy/step1_10.job" beforeDir="false" afterPath="$PROJECT_DIR$/jobs/search_related/step1_2.job" afterDir="false" />
=======
<component name="ChangeListManager">
<list default="true" id="034b59f7-f608-4144-b0af-f6951647bd51" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/lib/shell/hive.sh" beforeDir="false" afterPath="$PROJECT_DIR$/lib/shell/hive.sh" afterDir="false" />
>>>>>>> e081eea020b1ff448855c46de6605710d8705cb6
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<<<<<<< HEAD
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
...@@ -51,12 +58,61 @@ ...@@ -51,12 +58,61 @@
<recent name="$PROJECT_DIR$/jobs/daily_recommend_strategy" /> <recent name="$PROJECT_DIR$/jobs/daily_recommend_strategy" />
<recent name="$PROJECT_DIR$/sqls" /> <recent name="$PROJECT_DIR$/sqls" />
</key> </key>
=======
<component name="CodeStyleSettingsInfer">
<option name="done" value="true" />
</component>
<component name="ComposerSettings">
<execution>
<executable />
</execution>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectCodeStyleSettingsMigration">
<option name="version" value="1" />
</component>
<component name="ProjectId" id="1dfQ0VEii7hX7vb7p4D7taxyaw0" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
</component>
<component name="RunManager">
<configuration default="true" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false">
<setting name="replType" value="NREPL" />
<setting name="execution" value="LEININGEN" />
<setting name="jvmArgs" value="" />
<setting name="parameters" value="" />
<setting name="workingDir" value="" />
<setting name="profiles" value="" />
<setting name="aliases" value="" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
<configuration default="true" type="ClojureREPL" factoryName="Remote" activateToolWindowBeforeRun="false">
<setting name="host" value="" />
<setting name="port" value="0" />
<setting name="replType" value="SOCKET" />
<setting name="configType" value="SPECIFY" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
>>>>>>> e081eea020b1ff448855c46de6605710d8705cb6
</component> </component>
<component name="SvnConfiguration"> <component name="SvnConfiguration">
<configuration /> <configuration />
</component> </component>
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<<<<<<< HEAD
<changelist id="14933943-93b5-4122-b234-224dacfdf041" name="Default Changelist" comment="update codes" /> <changelist id="14933943-93b5-4122-b234-224dacfdf041" name="Default Changelist" comment="update codes" />
<created>1591586650228</created> <created>1591586650228</created>
<option name="number" value="Default" /> <option name="number" value="Default" />
...@@ -195,5 +251,18 @@ ...@@ -195,5 +251,18 @@
<screen x="1440" y="23" width="1920" height="1057" /> <screen x="1440" y="23" width="1920" height="1057" />
</state> </state>
<state x="2050" y="299" key="git4idea.merge.GitPullDialog/1440.23.1920.1057/0.23.1440.798@1440.23.1920.1057" timestamp="1592817974274" /> <state x="2050" y="299" key="git4idea.merge.GitPullDialog/1440.23.1920.1057/0.23.1440.798@1440.23.1920.1057" timestamp="1592817974274" />
=======
<changelist id="034b59f7-f608-4144-b0af-f6951647bd51" name="Default Changelist" comment="" />
<created>1592813444854</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1592813444854</updated>
<workItem from="1592813446154" duration="2153000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
>>>>>>> e081eea020b1ff448855c46de6605710d8705cb6
</component> </component>
</project> </project>
\ No newline at end of file
#!/bin/bash
git checkout yindanlei
git pull origin yindanlei
\ No newline at end of file
#step2.job #step2.job
type=command type=command
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6,step1_7,step1_8,step1_9 dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6,step1_7,step1_8,step1_9
command=curl -X GET http://localhost:8553/api/report/execSql?name=daily_recommend_strategy_insert command=/home/bi/bi-report/shells/daily_recommend_strategy/daily_recommend_strategy.sh
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
...@@ -5,7 +5,7 @@ package com.gmei.data.gateway.server.common; ...@@ -5,7 +5,7 @@ package com.gmei.data.gateway.server.common;
*/ */
public class Constants { public class Constants {
//执行失败 //执行失败
public static Integer FAIL = 1; public static Integer FAIL = 0;
//执行成功 //执行成功
public static Integer SUCCESS = 0; public static Integer SUCCESS = 1;
} }
...@@ -89,10 +89,12 @@ public class ExcelServiceImpl implements ExcelService { ...@@ -89,10 +89,12 @@ public class ExcelServiceImpl implements ExcelService {
XSSFCellStyle cellStyle=wb.createCellStyle(); XSSFCellStyle cellStyle=wb.createCellStyle();
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setAlignment(HorizontalAlignment.CENTER); cellStyle.setAlignment(HorizontalAlignment.CENTER);
//cellStyle.setAlignment(HorizontalAlignment.LEFT);
cellStyle.setBorderBottom(BorderStyle.THIN); cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBorderLeft(BorderStyle.THIN); cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setBorderRight(BorderStyle.THIN); cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setBorderTop(BorderStyle.THIN); cellStyle.setBorderTop(BorderStyle.THIN);
//cellStyle.setWrapText(true);//自动换行
for(int i =0;i<sheetList.size();i++){ for(int i =0;i<sheetList.size();i++){
XSSFSheet sheet = sheetList.get(i); XSSFSheet sheet = sheetList.get(i);
List<String> headers = headersList.get(i); List<String> headers = headersList.get(i);
......
package com.gmei.data.gateway.server.service.impl; package com.gmei.data.gateway.server.service.impl;
import com.gmei.data.gateway.server.common.Constants;
import com.gmei.data.gateway.server.dto.ExcelGenDto; import com.gmei.data.gateway.server.dto.ExcelGenDto;
import com.gmei.data.gateway.server.service.SparksqlService; import com.gmei.data.gateway.server.service.SparksqlService;
import com.gmei.data.gateway.server.utils.DateUtils; import com.gmei.data.gateway.server.utils.DateUtils;
...@@ -69,8 +70,10 @@ public class SparksqlServiceImpl implements SparksqlService { ...@@ -69,8 +70,10 @@ public class SparksqlServiceImpl implements SparksqlService {
Connection conn = null; Connection conn = null;
try{ try{
conn = DriverManager.getConnection(sparkSqlJdbcUrl,"bi",""); conn = DriverManager.getConnection(sparkSqlJdbcUrl,"data","");
Statement statement = conn.createStatement(); Statement statement = conn.createStatement();
statement.executeUpdate("ADD JAR hdfs:///user/hive/share/lib/udf/hive-udf-1.0-SNAPSHOT.jar");
statement.executeUpdate("CREATE TEMPORARY FUNCTION convup AS 'com.gmei.hive.common.udf.UDFConvUpgrade'");
int updateCount = statement.executeUpdate(hql); int updateCount = statement.executeUpdate(hql);
if(updateCount > 0){ if(updateCount > 0){
logger.info("*** Execute By Sparksql success, hql: {}",hql); logger.info("*** Execute By Sparksql success, hql: {}",hql);
...@@ -80,10 +83,10 @@ public class SparksqlServiceImpl implements SparksqlService { ...@@ -80,10 +83,10 @@ public class SparksqlServiceImpl implements SparksqlService {
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
logger.error("*** Execute By Sparksql failed, error message: {}, hql: {}",e.getMessage(),hql); logger.error("*** Execute By Sparksql failed, error message: {}, hql: {}",e.getMessage(),hql);
return 1; return Constants.FAIL;
} }
} }
return 0; return Constants.SUCCESS;
} }
@Override @Override
......
...@@ -19,14 +19,14 @@ public class EmailServiceTest { ...@@ -19,14 +19,14 @@ public class EmailServiceTest {
@Autowired @Autowired
private EmailService emailService; private EmailService emailService;
@Test // @Test
public void testSendAttachmentsMail() { // public void testSendAttachmentsMail() {
emailService.sendAttachmentsMail("zhaojianwei@igengmei.com","jianweizhao@yeah.net","demo"); // emailService.sendAttachmentsMail("zhaojianwei@igengmei.com","jianweizhao@yeah.net","demo");
} // }
//
@Test // @Test
public void testSendFormattedMail() { // public void testSendFormattedMail() {
String htmlContent = "<h1>demo</h1>"; // String htmlContent = "<h1>demo</h1>";
emailService.sendFormatedMail("zhaojianwei@igengmei.com","jianweizhao@yeah.net","demo",htmlContent); // emailService.sendFormatedMail("zhaojianwei@igengmei.com","jianweizhao@yeah.net","demo",htmlContent);
} // }
} }
...@@ -25,26 +25,38 @@ public class ExcelServiceTest { ...@@ -25,26 +25,38 @@ public class ExcelServiceTest {
@Test @Test
public void testGenExcel() { public void testGenExcel() {
List<String> sheetNameList = new ArrayList<String>(); // List<String> sheetNameList = new ArrayList<String>();
sheetNameList.add("sheet01"); // sheetNameList.add("sheet01");
//
List<List<String>> headersList = new ArrayList<List<String>>(); // List<List<String>> headersList = new ArrayList<List<String>>();
List<String> list = new ArrayList<String>(); // List<String> list = new ArrayList<String>();
list.add("aa"); // list.add("日期");
list.add("bb"); // list.add("设备类型");
list.add("cc"); // list.add("活跃类型");
headersList.add(list); // list.add("是否AI渠\r\n道");
// list.add("DAU");
List<List<List>> rowsList = new ArrayList<List<List>>(); // list.add("内容详情\r\n页UV");
List<List> list01 = new ArrayList<List>(); // list.add("内容详情\r\n页PV");
List list02 = new ArrayList(); // list.add("内容UV/\r\nDAU");
list02.add("1"); // list.add("内容PV/\r\n内容UV");
list02.add("2"); // headersList.add(list);
list02.add("3"); //
list01.add(list02); // List<List<List>> rowsList = new ArrayList<List<List>>();
rowsList.add(list01); // List<List> list01 = new ArrayList<List>();
// List list02 = new ArrayList();
ExcelGenDto excelGenDto = new ExcelGenDto(sheetNameList,headersList,rowsList); // list02.add("20200614");
excelService.genExcel(excelGenDto,"报表测试"); // list02.add("android");
// list02.add("新增设备");
// list02.add("AI");
// list02.add("115");
// list02.add("11");
// list02.add("21");
// list02.add("0.0957");
// list02.add("1.9091");
// list01.add(list02);
// rowsList.add(list01);
//
// ExcelGenDto excelGenDto = new ExcelGenDto(sheetNameList,headersList,rowsList);
// excelService.genExcel(excelGenDto,"报表测试");
} }
} }
...@@ -22,26 +22,26 @@ public class SparksqlServiceTest { ...@@ -22,26 +22,26 @@ public class SparksqlServiceTest {
@Autowired @Autowired
private SparksqlService sparksqlService; private SparksqlService sparksqlService;
@Test // @Test
public void testGenExcel() { // public void testGenExcel() {
ExcelGenDto resultDto = sparksqlService.getResultDto("/Users/apple/git-repo/bi-report/sqls/demo"); // ExcelGenDto resultDto = sparksqlService.getResultDto("/Users/apple/git-repo/bi-report/sqls/demo");
List<String> sheetNameList = resultDto.getSheetNameList(); // List<String> sheetNameList = resultDto.getSheetNameList();
for (String sheetName: sheetNameList) { // for (String sheetName: sheetNameList) {
System.out.println("sheetName--"+sheetName); // System.out.println("sheetName--"+sheetName);
} // }
List<List<String>> headersList = resultDto.getHeadersList(); // List<List<String>> headersList = resultDto.getHeadersList();
for (List<String> list: headersList) { // for (List<String> list: headersList) {
for (String header : list) { // for (String header : list) {
System.out.println(header); // System.out.println(header);
} // }
} // }
List<List<List>> rowsList = resultDto.getRowsList(); // List<List<List>> rowsList = resultDto.getRowsList();
for (List<List> list : rowsList) { // for (List<List> list : rowsList) {
for (List rows : list) { // for (List rows : list) {
for (Object row: rows) { // for (Object row: rows) {
System.out.println(row.toString()); // System.out.println(row.toString());
} // }
} // }
} // }
} // }
} }
This diff is collapsed.
#!/bin/bash
cd /home/bi/bi-report/lib/java
mv report-service-server-1.0.0-SNAPSHOT.jar report-service-server-1.0.0-SNAPSHOT.jar.`date +%Y%m%d%H%M%S`
cp /home/bi/bi-report/lib/java/bi-report-service/service-server/target/report-service-server-1.0.0-SNAPSHOT.jar .
\ No newline at end of file
#!/bin/bash #!/bin/bash
nohup java -jar /home/bi/bi-report/lib/java/bi-report-service/service-server/target/report-service-server-1.0.0-SNAPSHOT.jar >> /data/bi-report/logs/bi-report-service.out 2>&1 & cd /home/bi/bi-report/lib/java
nohup java -jar report-service-server-1.0.0-SNAPSHOT.jar >> /data/bi-report/logs/bi-report-service.out 2>&1 &
tail -100f /data/bi-report/logs/bi-report-service.out tail -100f /data/bi-report/logs/bi-report-service.out
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment