Browse Source

更换数据库,启动文件还原,修改字段类型不匹配

guoyuanquan@mail.taiji.com.cn 8 months ago
parent
commit
c2b0abe618

+ 37 - 37
cn.com.taiji.myapp/src/main/java/cn/com/taiji/Application.java

@@ -136,42 +136,42 @@ public class Application extends WebMvcConfigurerAdapter implements CommandLineR
 
 	@Override
 	public void run(String... strings) throws Exception {
-//		String basePath = "src/main/resources/diagrams";
-//		1、创建ProcessEngine
-		ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
-//        2、得到RepositoryService实例
-		RepositoryService repositoryService = processEngine.getRepositoryService();
-//        3、使用RepositoryService进行部署
-		Deployment deployment = repositoryService.createDeployment()
-				.addInputStream("dataPreparation.bpmn", this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "dataPreparation.bpmn"))
-				.addInputStream("dataPreparation.png", this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "dataPreparation.png"))
-				.name("dataPreparation")
-				.deploy();
-		deployment = repositoryService.createDeployment()
-				.addInputStream("fwSq.bpmn",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "fwSq.bpmn"))
-				.addInputStream("fwSq.png",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "fwSq.png"))
-				.name("服务申请")
-				.deploy();
-		deployment = repositoryService.createDeployment()
-				.addInputStream("fwZc.bpmn",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "fwZc.bpmn"))
-				.addInputStream("fwZc.png",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "fwZc.png"))
-				.name("服务注册")
-				.deploy();
-		deployment = repositoryService.createDeployment()
-				.addInputStream("infoClassZc.bpmn",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "infoClassZc.bpmn"))
-				.addInputStream("infoClassZc.png",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "infoClassZc.png"))
-				.name("信息类注册")
-				.deploy();
-		deployment = repositoryService.createDeployment()
-				.addInputStream("requireInfo.bpmn",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "requireInfo.bpmn"))
-				.addInputStream("requireInfo.png",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "requireInfo.png"))
-				.name("requireInfo")
-				.deploy();
-		deployment = repositoryService.createDeployment()
-				.addInputStream("shareApply.bpmn",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "shareApply.bpmn"))
-				.addInputStream("shareApply.png",this.getClass().getClassLoader().getResourceAsStream("diagrams" + File.separator + "shareApply.png"))
-				.name("信息类共享")
-				.deploy();
+//		String basePath = "/Users/hujie/Documents/dev/git-repo/taiji/tianjin-cgw/zyml/cn.com.taiji.system/src/main/resources/static/diagrams";
+////		1、创建ProcessEngine
+//		ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+////        2、得到RepositoryService实例
+//		RepositoryService repositoryService = processEngine.getRepositoryService();
+////        3、使用RepositoryService进行部署
+//		Deployment deployment = repositoryService.createDeployment()
+//				.addInputStream("dataPreparation.bpmn", new FileInputStream(new File(basePath + "/dataPreparation.bpmn")))
+//				.addInputStream("dataPreparation.png", new FileInputStream(new File(basePath + "/dataPreparation.png")))
+//				.name("dataPreparation")
+//				.deploy();
+//		deployment = repositoryService.createDeployment()
+//				.addInputStream("fwSq.bpmn", new FileInputStream(new File(basePath + "/fwSq.bpmn")))
+//				.addInputStream("fwSq.png", new FileInputStream(new File(basePath + "/fwSq.png")))
+//				.name("服务申请")
+//				.deploy();
+//		deployment = repositoryService.createDeployment()
+//				.addInputStream("fwZc.bpmn", new FileInputStream(new File(basePath + "/fwZc.bpmn")))
+//				.addInputStream("fwZc.png", new FileInputStream(new File(basePath + "/fwZc.png")))
+//				.name("服务注册")
+//				.deploy();
+//		deployment = repositoryService.createDeployment()
+//				.addInputStream("infoClassZc.bpmn", new FileInputStream(new File(basePath + "/infoClassZc.bpmn")))
+//				.addInputStream("infoClassZc.png", new FileInputStream(new File(basePath + "/infoClassZc.png")))
+//				.name("信息类注册")
+//				.deploy();
+//		deployment = repositoryService.createDeployment()
+//				.addInputStream("requireInfo.bpmn", new FileInputStream(new File(basePath + "/requireInfo.bpmn")))
+//				.addInputStream("requireInfo.png", new FileInputStream(new File(basePath + "/requireInfo.png")))
+//				.name("requireInfo")
+//				.deploy();
+//		deployment = repositoryService.createDeployment()
+//				.addInputStream("shareApply.bpmn", new FileInputStream(new File(basePath + "/shareApply.bpmn")))
+//				.addInputStream("shareApply.png", new FileInputStream(new File(basePath + "/shareApply.png")))
+//				.name("信息类共享")
+//				.deploy();
 	}
 
 	@Bean
@@ -216,7 +216,7 @@ public class Application extends WebMvcConfigurerAdapter implements CommandLineR
 		DruidDataSource druidDataSource = new DruidDataSource();
 		druidDataSource.setDriverClassName(driver);
 		druidDataSource.setUrl(url);
-		druidDataSource.setDbType("postgresql");
+//		druidDataSource.setDbType("");
 		druidDataSource.setUsername(username);
 		druidDataSource.setPassword(password);
 		druidDataSource.setInitialSize(10);

+ 6 - 1
cn.com.taiji.myapp/src/main/resources/application-local.properties

@@ -59,4 +59,9 @@ ckeditor.access.image.url=http://localhost:8180/
 ckeditor.access.image.url2=http://localhost:8180/public/image/
 # uploadpath  baocunlujing
 save_path=/Users/hujie/Documents/dev/git-repo/taiji/tianjin-cgw/zyml/cn.com.taiji.myapp/target
-breakpoint.upload.dir=/Users/hujie/Documents/dev/git-repo/taiji/tianjin-cgw/zyml/cn.com.taiji.myapp/target
+breakpoint.upload.dir=/Users/hujie/Documents/dev/git-repo/taiji/tianjin-cgw/zyml/cn.com.taiji.myapp/target
+
+# ±¾µØ¿ª·¢»·¾³Í¨¹ýlevel¿ØÖÆ
+#logging.level.org.activiti=trace
+logging.config=classpath:logback.xml
+

+ 30 - 10
cn.com.taiji.myapp/src/main/resources/logback-local.xml

@@ -3,11 +3,11 @@
     <include resource="org/springframework/boot/logging/logback/base.xml" />
     <logger name="cn.com.taiji" level="DEBUG" />
     <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <File>/data/cgwresdir/loginfo/dbdc/info.log</File>
+        <File>/data/project/logs/info.log</File>
         <filter class="cn.com.taiji.websoket.LogFilter">
    		 </filter>
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>/data/cgwresdir/loginfo/dbdc/info-%d{yyyyMMdd}.log.%i
+            <fileNamePattern>/data/project/logs/info-%d{yyyyMMdd}.log.%i
             </fileNamePattern>
             <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                 <maxFileSize>500MB</maxFileSize>
@@ -23,9 +23,9 @@
         <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
             <level>ERROR</level>
         </filter>
-        <File>/data/cgwresdir/loginfo/dbdc/error.log</File>
+        <File>/data/project/logs/error.log</File>
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>/data/cgwresdir/loginfo/dbdc/error-%d{yyyyMMdd}.log.%i
+            <fileNamePattern>/data/project/logs/error-%d{yyyyMMdd}.log.%i
             </fileNamePattern>
             <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                 <maxFileSize>500MB</maxFileSize>
@@ -36,6 +36,25 @@
             <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n</Pattern>
         </layout>
     </appender>
+
+    <appender name="activiti" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>/data/project/logs/activiti.log</File>
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>trace</level>
+        </filter>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>/data/project/logs/activiti-%d{yyyyMMdd}.log.%i
+            </fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>500MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <maxHistory>2</maxHistory>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
+            </Pattern>
+        </layout>
+    </appender>
     <!--异步输出-->
     <appender name="ASYNC_INFO_FILE" class="ch.qos.logback.classic.AsyncAppender">
         <discardingThreshold>0</discardingThreshold>
@@ -48,15 +67,16 @@
         <appender-ref ref="ERROR_FILE"/>
     </appender>
     <!-- hibernate日志输入 -->
-    <logger name="org.hibernate.type.descriptor.sql.BasicBinder"
-        level="ERROR" />
-    <logger name="org.hibernate.type.descriptor.sql.BasicExtractor"
-        level="ERROR" />
+    <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="ERROR" />
+    <logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="ERROR" />
     <logger name="org.hibernate.SQL" level="ERROR" />
     <logger name="org.hibernate.engine.QueryParameters" level="ERROR" />
     <logger name="org.hibernate.engine.query.HQLQueryPlan" level="ERROR" />
-<logger name="org.springframework.jdbc.core" level="debug"/>
-<logger name="org.springframework.jdbc.core.StatementCreatorUtils" level="trace"/>
+    <logger name="org.springframework.jdbc.core" level="debug"/>
+    <logger name="org.springframework.jdbc.core.StatementCreatorUtils" level="trace"/>
+    <logger name="org.activiti" level="trace">
+        <appender-ref ref="activiti"/>
+    </logger>
     <root level="INFO">
         <appender-ref ref="ASYNC_ERROR_FILE" />
         <appender-ref ref="ASYNC_INFO_FILE" />

+ 3 - 3
cn.com.taiji.system/src/main/java/cn/com/taiji/workflow/service/WorkflowService.java

@@ -68,8 +68,8 @@ import cn.com.taiji.zhongxiao.service.TserviceRegInfoService;
 import cn.com.taiji.zhongxiao.service.TshareApplyService;
 @Service
 public class WorkflowService {
-	 private static final Logger log = LoggerFactory
-			    .getLogger(WorkflowService.class);
+	 private static final Logger log = LoggerFactory.getLogger(WorkflowService.class);
+
     @Inject
     private RepositoryService repositoryService;
     @Inject
@@ -1188,7 +1188,7 @@ public class WorkflowService {
 	public String findTjShTimeByPid(String processid) {
 		// TODO Auto-generated method stub
 		List<Map<String,Object>> list=  jdbcTemplate.queryForList("select min(t.taskstart) taskstart from ( " + 
-				"select min(taskstart) taskstart from v_histasklist where proinstid=? " + 
+				"select cast(min(taskstart) as timestamptz) taskstart from v_histasklist where proinstid=? " +
 				"union " + 
 				"select min(create_time_)  taskstart from act_ru_task where PROC_INST_ID_=?) t",new Object[] {processid,processid});
 		if(list!=null&&list.size()>0) {