Commit 2ea9f571e337f4609c3fdb5e83d9eeffbb4ee99f
1 parent
29bbde89
Update
Showing
19 changed files
with
0 additions
and
905 deletions
src/main/java/com/bsth/service/schedule/impl/BServiceImpl.java
| @@ -4,11 +4,9 @@ import com.bsth.entity.search.CustomerSpecs; | @@ -4,11 +4,9 @@ import com.bsth.entity.search.CustomerSpecs; | ||
| 4 | import com.bsth.repository.BaseRepository; | 4 | import com.bsth.repository.BaseRepository; |
| 5 | import com.bsth.service.schedule.BService; | 5 | import com.bsth.service.schedule.BService; |
| 6 | import com.bsth.service.schedule.exception.ScheduleException; | 6 | import com.bsth.service.schedule.exception.ScheduleException; |
| 7 | -import com.bsth.service.schedule.utils.DataToolsService; | ||
| 8 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
| 9 | import org.slf4j.LoggerFactory; | 8 | import org.slf4j.LoggerFactory; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | -import org.springframework.beans.factory.annotation.Qualifier; | ||
| 12 | import org.springframework.beans.factory.annotation.Value; | 10 | import org.springframework.beans.factory.annotation.Value; |
| 13 | import org.springframework.data.domain.Page; | 11 | import org.springframework.data.domain.Page; |
| 14 | import org.springframework.data.domain.Pageable; | 12 | import org.springframework.data.domain.Pageable; |
| @@ -32,10 +30,6 @@ public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> | @@ -32,10 +30,6 @@ public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> | ||
| 32 | @Value("${hibernate.jdbc.batch_size}") | 30 | @Value("${hibernate.jdbc.batch_size}") |
| 33 | private int batchSize; | 31 | private int batchSize; |
| 34 | 32 | ||
| 35 | - @Autowired | ||
| 36 | - @Qualifier(value = "dataToolsServiceImpl") | ||
| 37 | - private DataToolsService dataToolsService; | ||
| 38 | - | ||
| 39 | /** 日志记录器 */ | 33 | /** 日志记录器 */ |
| 40 | protected Logger logger = LoggerFactory.getLogger(this.getClass()); | 34 | protected Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 41 | 35 |
src/test/java/com/bsth/service/schedule/BaseTest.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule; | ||
| 2 | - | ||
| 3 | -import org.junit.runner.RunWith; | ||
| 4 | -import org.springframework.boot.test.SpringApplicationConfiguration; | ||
| 5 | -import org.springframework.test.context.ActiveProfiles; | ||
| 6 | -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 基础测试类。 | ||
| 10 | - */ | ||
| 11 | -@RunWith(SpringJUnit4ClassRunner.class) | ||
| 12 | -@SpringApplicationConfiguration(classes = ScheduleTestApp.class) | ||
| 13 | -@ActiveProfiles("scheduletest") | ||
| 14 | -//@WebIntegrationTest({"server.port=0","management.port=0"}) | ||
| 15 | -public class BaseTest { | ||
| 16 | -} |
src/test/java/com/bsth/service/schedule/ScheduleTestApp.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule; | ||
| 2 | - | ||
| 3 | -import com.bsth.service.schedule.impl.SchedulePlanRuleResultServiceImpl; | ||
| 4 | -import com.bsth.service.schedule.impl.SchedulePlanServiceImpl; | ||
| 5 | -import com.bsth.service.schedule.rules.MyDroolsConfiguration; | ||
| 6 | -import com.bsth.service.schedule.utils.DataToolsServiceImpl; | ||
| 7 | -import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| 8 | -import org.springframework.boot.orm.jpa.EntityScan; | ||
| 9 | -import org.springframework.context.annotation.ComponentScan; | ||
| 10 | -import org.springframework.context.annotation.Configuration; | ||
| 11 | -import org.springframework.context.annotation.FilterType; | ||
| 12 | -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
| 13 | - | ||
| 14 | -/** | ||
| 15 | - * 基础测试类(用于计划调度模块测试测试)。 | ||
| 16 | - * 配置计划调度的模块的用到的entity,repository,service | ||
| 17 | - * | ||
| 18 | - * 注意:测试环境下测试类 TestApp 和springdata的类不在统一级包里,必须指定EnableJpaRepositories | ||
| 19 | - */ | ||
| 20 | -@Configuration | ||
| 21 | -@EntityScan( | ||
| 22 | - basePackages = {"com.bsth.entity"} | ||
| 23 | -) | ||
| 24 | -@ComponentScan( | ||
| 25 | - basePackages = {"com.bsth.repository", "com.bsth.service"}, | ||
| 26 | - useDefaultFilters = false, | ||
| 27 | - includeFilters = { | ||
| 28 | - @ComponentScan.Filter( | ||
| 29 | - type = FilterType.ASSIGNABLE_TYPE, | ||
| 30 | - value = SchedulePlanRuleResultServiceImpl.class | ||
| 31 | - ), | ||
| 32 | - @ComponentScan.Filter( | ||
| 33 | - type = FilterType.ASSIGNABLE_TYPE, | ||
| 34 | - value = SchedulePlanServiceImpl.class | ||
| 35 | - ), | ||
| 36 | - @ComponentScan.Filter( | ||
| 37 | - type = FilterType.ASSIGNABLE_TYPE, | ||
| 38 | - value = MyDroolsConfiguration.class | ||
| 39 | - ), | ||
| 40 | - @ComponentScan.Filter( | ||
| 41 | - type = FilterType.ASSIGNABLE_TYPE, | ||
| 42 | - value = DataToolsServiceImpl.class | ||
| 43 | - ) | ||
| 44 | - } | ||
| 45 | -) | ||
| 46 | -@EnableJpaRepositories( | ||
| 47 | - basePackages = {"com.bsth.repository"} | ||
| 48 | -) | ||
| 49 | -@SpringBootApplication | ||
| 50 | -public class ScheduleTestApp { | ||
| 51 | -} |
src/test/java/com/bsth/service/schedule/rules/RuleTest1.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.rules; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.sys.SysUser; | ||
| 4 | -import com.bsth.repository.sys.SysUserRepository; | ||
| 5 | -import com.bsth.service.schedule.BaseTest; | ||
| 6 | -import com.vividsolutions.jts.util.Assert; | ||
| 7 | -import org.dbunit.database.DatabaseConnection; | ||
| 8 | -import org.dbunit.database.IDatabaseConnection; | ||
| 9 | -import org.dbunit.dataset.IDataSet; | ||
| 10 | -import org.dbunit.dataset.xml.FlatXmlDataSetBuilder; | ||
| 11 | -import org.dbunit.operation.DatabaseOperation; | ||
| 12 | -import org.junit.After; | ||
| 13 | -import org.junit.Before; | ||
| 14 | -import org.slf4j.Logger; | ||
| 15 | -import org.slf4j.LoggerFactory; | ||
| 16 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | -import org.springframework.core.io.ClassPathResource; | ||
| 18 | -import org.springframework.core.io.Resource; | ||
| 19 | - | ||
| 20 | -import javax.sql.DataSource; | ||
| 21 | - | ||
| 22 | -public class RuleTest1 extends BaseTest { | ||
| 23 | - /** 日志记录器 */ | ||
| 24 | - private static final Logger logger = LoggerFactory.getLogger(RuleTest1.class); | ||
| 25 | - | ||
| 26 | - @Autowired | ||
| 27 | - private DataSource dataSource; | ||
| 28 | - | ||
| 29 | - @Autowired | ||
| 30 | - private SysUserRepository sysUserRepository; | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * 初始化数据。 | ||
| 34 | - */ | ||
| 35 | - @Before | ||
| 36 | - public void initData() throws Exception { | ||
| 37 | - logger.info("载入数据......"); | ||
| 38 | - | ||
| 39 | - // 获取数据库连接 | ||
| 40 | - IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection()); | ||
| 41 | - // 获取Dbunit数据源 | ||
| 42 | - Resource res = new ClassPathResource("testdata/d1.xml"); | ||
| 43 | - FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder(); | ||
| 44 | - flatXmlDataSetBuilder.setColumnSensing(false); | ||
| 45 | - flatXmlDataSetBuilder.setCaseSensitiveTableNames(false); | ||
| 46 | - IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream()); | ||
| 47 | - | ||
| 48 | - // 载入数据 | ||
| 49 | - DatabaseOperation.CLEAN_INSERT.execute(iDatabaseConnection, iDataSet); | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - /** | ||
| 53 | - * 清除数据。 | ||
| 54 | - */ | ||
| 55 | - @After | ||
| 56 | - public void destoryData() throws Exception { | ||
| 57 | - logger.info("清除数据......"); | ||
| 58 | - // 获取数据库连接 | ||
| 59 | - IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection()); | ||
| 60 | - // 获取Dbunit数据源 | ||
| 61 | - Resource res = new ClassPathResource("testdata/d1.xml"); | ||
| 62 | - FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder(); | ||
| 63 | - flatXmlDataSetBuilder.setColumnSensing(false); | ||
| 64 | - flatXmlDataSetBuilder.setCaseSensitiveTableNames(false); | ||
| 65 | - IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream()); | ||
| 66 | - | ||
| 67 | - // 清除数据 | ||
| 68 | - DatabaseOperation.DELETE_ALL.execute(iDatabaseConnection, iDataSet); | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - @org.junit.Test | ||
| 72 | - public void t1() { | ||
| 73 | - logger.info("t1()测试......"); | ||
| 74 | - SysUser sysUser = sysUserRepository.findOne(1); | ||
| 75 | - Assert.equals("admin", sysUser.getUserName()); | ||
| 76 | - } | ||
| 77 | -} | ||
| 78 | - | ||
| 79 | -// | ||
| 80 | -// | ||
| 81 | -//package com.bsth.service.schedule.rules; | ||
| 82 | -// | ||
| 83 | -// import com.bsth.Application; | ||
| 84 | -// import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; | ||
| 85 | -// import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; | ||
| 86 | -// import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; | ||
| 87 | -// import com.bsth.service.schedule.rules.ttinfo.TTInfoCalcuParam_input; | ||
| 88 | -// import com.bsth.service.schedule.rules.ttinfo.TTInfoResults_output; | ||
| 89 | -// import com.bsth.service.schedule.rules.ttinfo.TTInfo_input; | ||
| 90 | -// import org.joda.time.DateTime; | ||
| 91 | -// import org.junit.Test; | ||
| 92 | -// import org.junit.runner.RunWith; | ||
| 93 | -// import org.kie.api.KieBase; | ||
| 94 | -// import org.kie.api.runtime.KieSession; | ||
| 95 | -// import org.slf4j.Logger; | ||
| 96 | -// import org.slf4j.LoggerFactory; | ||
| 97 | -// import org.springframework.beans.factory.annotation.Autowired; | ||
| 98 | -// import org.springframework.boot.test.SpringApplicationConfiguration; | ||
| 99 | -// import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
| 100 | -// | ||
| 101 | -// import java.util.Arrays; | ||
| 102 | -// | ||
| 103 | -//@RunWith(SpringJUnit4ClassRunner.class) | ||
| 104 | -//@SpringApplicationConfiguration(classes = {Application.class}) | ||
| 105 | -//public class DroolsRulesTest { | ||
| 106 | -// | ||
| 107 | -// /** 日志记录器 */ | ||
| 108 | -// private final static Logger logger = LoggerFactory.getLogger(DroolsRulesTest.class); | ||
| 109 | -// | ||
| 110 | -// @Autowired | ||
| 111 | -// private KieBase kieBase; | ||
| 112 | -// | ||
| 113 | -//// @Test | ||
| 114 | -//// public void helloWorldDrlTest() throws Exception { | ||
| 115 | -//// // 1、创建session,内部配置的是stateful | ||
| 116 | -//// KieSession session = kieBase.newKieSession(); | ||
| 117 | -//// | ||
| 118 | -//// // 1.1 设置gloable对象,在drl中通过别名使用 | ||
| 119 | -//// List<String> gloableList = new ArrayList<String>(); | ||
| 120 | -//// session.setGlobal("list", gloableList); | ||
| 121 | -//// | ||
| 122 | -//// // 1.2 可以设置一些监听器,再议 | ||
| 123 | -//// | ||
| 124 | -//// // 2、创建fact对象 | ||
| 125 | -//// Message message = new Message(); | ||
| 126 | -//// message.setMessage("Hello World"); | ||
| 127 | -//// message.setStatus(Message.HELLO); | ||
| 128 | -//// session.insert(message); | ||
| 129 | -//// | ||
| 130 | -//// // 3、执行rule | ||
| 131 | -//// session.fireAllRules(); | ||
| 132 | -//// | ||
| 133 | -//// System.out.println(gloableList); | ||
| 134 | -//// | ||
| 135 | -//// // 4、执行完毕销毁,有日志的也要关闭 | ||
| 136 | -//// session.dispose(); | ||
| 137 | -//// } | ||
| 138 | -// | ||
| 139 | -// // @Test | ||
| 140 | -// public void ttinfoDrlTest() throws Exception { | ||
| 141 | -// logger.info("------------ttinfoDrlTest 测试---------------"); | ||
| 142 | -// | ||
| 143 | -// // 1、创建session,内部配置的是stateful | ||
| 144 | -// KieSession session = kieBase.newKieSession(); | ||
| 145 | -// | ||
| 146 | -// // 1.1 设置gloable对象,在drl中通过别人使用 | ||
| 147 | -// session.setGlobal("log", logger); | ||
| 148 | -// TTInfoResults_output ttInfoResults_output = new TTInfoResults_output(); | ||
| 149 | -// session.setGlobal("results", ttInfoResults_output); | ||
| 150 | -// | ||
| 151 | -// // 1.2 可以设置一些监听器,再议 | ||
| 152 | -// | ||
| 153 | -// // 2、创建fact对象 | ||
| 154 | -// TTInfoCalcuParam_input ttInfoCalcuParam_input = new TTInfoCalcuParam_input( | ||
| 155 | -// new DateTime(2016, 8, 1, 0, 0), | ||
| 156 | -// new DateTime(2016, 8, 10, 0, 0), | ||
| 157 | -// "1" | ||
| 158 | -// ); | ||
| 159 | -// | ||
| 160 | -// | ||
| 161 | -// TTInfo_input ttInfo_input1 = new TTInfo_input(); | ||
| 162 | -// ttInfo_input1.setTtInfoId("1"); | ||
| 163 | -// ttInfo_input1.setXlId("1"); | ||
| 164 | -// ttInfo_input1.setWeekdays(Arrays.asList(true, true, true, true, true, false, false)); | ||
| 165 | -// ttInfo_input1.getSpecialDays().add(new DateTime(2016, 8, 1, 0, 0)); | ||
| 166 | -// ttInfo_input1.setUpdateDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 167 | -// ttInfo_input1.setIsEnable(true); | ||
| 168 | -// ttInfo_input1.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 169 | -// | ||
| 170 | -// TTInfo_input ttInfo_input1_2 = new TTInfo_input(); | ||
| 171 | -// ttInfo_input1_2.setTtInfoId("2"); | ||
| 172 | -// ttInfo_input1_2.setXlId("1"); | ||
| 173 | -// ttInfo_input1_2.setWeekdays(Arrays.asList(true, false, false, false, false, true, false)); | ||
| 174 | -// ttInfo_input1_2.getSpecialDays().add(new DateTime(2016, 8, 11, 0, 0)); | ||
| 175 | -// ttInfo_input1_2.setUpdateDate(new DateTime(2015, 2, 1, 0, 0)); | ||
| 176 | -// ttInfo_input1_2.setIsEnable(true); | ||
| 177 | -// ttInfo_input1_2.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 178 | -// | ||
| 179 | -// | ||
| 180 | -// TTInfoCalcuParam_input ttInfoCalcuParam_inpu2 = new TTInfoCalcuParam_input( | ||
| 181 | -// new DateTime(2016, 8, 1, 0, 0), | ||
| 182 | -// new DateTime(2016, 8, 10, 0, 0), | ||
| 183 | -// "2" | ||
| 184 | -// ); | ||
| 185 | -// | ||
| 186 | -// TTInfo_input ttInfo_input2 = new TTInfo_input(); | ||
| 187 | -// ttInfo_input2.setTtInfoId("2"); | ||
| 188 | -// ttInfo_input2.setXlId("2"); | ||
| 189 | -// ttInfo_input2.setWeekdays(Arrays.asList(true, false, false, false, false, true, false)); | ||
| 190 | -// ttInfo_input2.getSpecialDays().add(new DateTime(2016, 8, 11, 0, 0)); | ||
| 191 | -// ttInfo_input2.setUpdateDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 192 | -// ttInfo_input2.setIsEnable(true); | ||
| 193 | -// ttInfo_input2.setQyDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 194 | -// | ||
| 195 | -// session.insert(ttInfoCalcuParam_input); | ||
| 196 | -// session.insert(ttInfo_input1); | ||
| 197 | -// session.insert(ttInfo_input1_2); | ||
| 198 | -// session.insert(ttInfoCalcuParam_inpu2); | ||
| 199 | -// session.insert(ttInfo_input2); | ||
| 200 | -// | ||
| 201 | -// | ||
| 202 | -// | ||
| 203 | -// // 3、执行rule | ||
| 204 | -// session.fireAllRules(); | ||
| 205 | -// | ||
| 206 | -// // 4、执行完毕销毁,有日志的也要关闭 | ||
| 207 | -// session.dispose(); | ||
| 208 | -// | ||
| 209 | -// // 打印global结果 | ||
| 210 | -// logger.info(ttInfoResults_output.showTTInfoDesc1()); | ||
| 211 | -// | ||
| 212 | -// } | ||
| 213 | -// | ||
| 214 | -// @Test | ||
| 215 | -// public void shiftloopDrlTest() throws Exception { | ||
| 216 | -// // 1、创建session,内部配置的是stateful | ||
| 217 | -// KieSession session = kieBase.newKieSession(); | ||
| 218 | -// | ||
| 219 | -// // 1.1 设置gloable对象,在drl中通过别名使用 | ||
| 220 | -// ScheduleResults_output scheduleResults_output = new ScheduleResults_output(); | ||
| 221 | -// session.setGlobal("scheduleResult", scheduleResults_output); | ||
| 222 | -// | ||
| 223 | -// // 1.2 可以设置一些监听器,再议 | ||
| 224 | -// | ||
| 225 | -// // 2、创建fact对象 | ||
| 226 | -// | ||
| 227 | -// ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(); | ||
| 228 | -// scheduleCalcuParam_input.setFromDate(new DateTime(2016, 8, 1, 0, 0)); | ||
| 229 | -// scheduleCalcuParam_input.setToDate(new DateTime(2016, 8, 10, 0, 0)); | ||
| 230 | -// | ||
| 231 | -// ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); | ||
| 232 | -// scheduleRule_input1.setRuleId("1"); | ||
| 233 | -// scheduleRule_input1.setQyrq(new DateTime(2016, 7, 22, 0, 0)); | ||
| 234 | -// scheduleRule_input1.getGuideboardIds().addAll(Arrays.asList( | ||
| 235 | -// "9", "9" , "8" ,"8" ,"7" ,"7" ,"6" ,"6", "5", "5", "4", "4", "3", "3", "2", "2", "1", "1")); | ||
| 236 | -// scheduleRule_input1.setStartGbdIndex(3); | ||
| 237 | -// scheduleRule_input1.getEmployeeConfigIds().addAll(Arrays.asList("1", "2")); | ||
| 238 | -// scheduleRule_input1.setStartEIndex(1); | ||
| 239 | -// scheduleRule_input1.setCarConfigId("1"); | ||
| 240 | -// | ||
| 241 | -//// ScheduleRule_input scheduleRule_input2 = new ScheduleRule_input(); | ||
| 242 | -//// scheduleRule_input2.setRuleId(2L); | ||
| 243 | -//// scheduleRule_input2.setQyrq(new DateTime(2016, 7, 22, 0, 0)); | ||
| 244 | -//// scheduleRule_input2.getGuideboardIds().addAll(Arrays.asList( | ||
| 245 | -//// 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, | ||
| 246 | -//// 11L, 11L, 12L, 12L, 13L, 13L)); | ||
| 247 | -//// scheduleRule_input2.setStartGbdIndex(7); | ||
| 248 | -//// scheduleRule_input2.getEmployeeConfigIds().addAll(Arrays.asList(11L, 12L)); | ||
| 249 | -//// scheduleRule_input2.setStartEIndex(1); | ||
| 250 | -//// scheduleRule_input2.setCarConfigId(2L); | ||
| 251 | -// | ||
| 252 | -// session.insert(scheduleCalcuParam_input); | ||
| 253 | -// session.insert(scheduleRule_input1); | ||
| 254 | -//// session.insert(scheduleRule_input2); | ||
| 255 | -// | ||
| 256 | -// | ||
| 257 | -// // 3、执行rule | ||
| 258 | -// session.fireAllRules(); | ||
| 259 | -// | ||
| 260 | -// // 4、执行完毕销毁,有日志的也要关闭 | ||
| 261 | -// session.dispose(); | ||
| 262 | -// | ||
| 263 | -// System.out.println(scheduleResults_output.showGuideboardDesc1()); | ||
| 264 | -// | ||
| 265 | -// } | ||
| 266 | -//} | ||
| 267 | - |
src/test/java/com/bsth/service/schedule/rules/SchedulePlan1Test.java deleted
100644 → 0
| 1 | -package com.bsth.service.schedule.rules; | ||
| 2 | - | ||
| 3 | -import com.bsth.service.schedule.BaseTest; | ||
| 4 | -import org.dbunit.database.DatabaseConnection; | ||
| 5 | -import org.dbunit.database.IDatabaseConnection; | ||
| 6 | -import org.dbunit.dataset.IDataSet; | ||
| 7 | -import org.dbunit.dataset.xml.FlatXmlDataSetBuilder; | ||
| 8 | -import org.dbunit.operation.DatabaseOperation; | ||
| 9 | -import org.junit.After; | ||
| 10 | -import org.junit.Before; | ||
| 11 | -import org.junit.Test; | ||
| 12 | -import org.slf4j.Logger; | ||
| 13 | -import org.slf4j.LoggerFactory; | ||
| 14 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | -import org.springframework.core.io.ClassPathResource; | ||
| 16 | -import org.springframework.core.io.Resource; | ||
| 17 | - | ||
| 18 | -import javax.sql.DataSource; | ||
| 19 | - | ||
| 20 | -/** | ||
| 21 | - * 排班计划测试(手工排班测试)。 | ||
| 22 | - */ | ||
| 23 | -public class SchedulePlan1Test extends BaseTest { | ||
| 24 | - /** 日志记录器 */ | ||
| 25 | - private static final Logger logger = LoggerFactory.getLogger(SchedulePlan1Test.class); | ||
| 26 | - | ||
| 27 | - @Autowired | ||
| 28 | - private DataSource dataSource; | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 初始化数据。 | ||
| 32 | - */ | ||
| 33 | - @Before | ||
| 34 | - public void initData() throws Exception { | ||
| 35 | - logger.info("载入数据......"); | ||
| 36 | - | ||
| 37 | - // 获取数据库连接 | ||
| 38 | - IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection()); | ||
| 39 | - // 获取Dbunit数据源 | ||
| 40 | - Resource res = new ClassPathResource("testdata/d2.xml"); | ||
| 41 | - FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder(); | ||
| 42 | - flatXmlDataSetBuilder.setColumnSensing(false); | ||
| 43 | - flatXmlDataSetBuilder.setCaseSensitiveTableNames(false); | ||
| 44 | - IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream()); | ||
| 45 | - | ||
| 46 | - // 载入数据 | ||
| 47 | - DatabaseOperation.CLEAN_INSERT.execute(iDatabaseConnection, iDataSet); | ||
| 48 | - } | ||
| 49 | - | ||
| 50 | - /** | ||
| 51 | - * 清除数据。 | ||
| 52 | - */ | ||
| 53 | - @After | ||
| 54 | - public void destoryData() throws Exception { | ||
| 55 | - logger.info("清除数据......"); | ||
| 56 | - // 获取数据库连接 | ||
| 57 | - IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection()); | ||
| 58 | - // 获取Dbunit数据源 | ||
| 59 | - Resource res = new ClassPathResource("testdata/d2.xml"); | ||
| 60 | - FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder(); | ||
| 61 | - flatXmlDataSetBuilder.setColumnSensing(false); | ||
| 62 | - flatXmlDataSetBuilder.setCaseSensitiveTableNames(false); | ||
| 63 | - IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream()); | ||
| 64 | - | ||
| 65 | - // 清除数据 | ||
| 66 | - DatabaseOperation.DELETE_ALL.execute(iDatabaseConnection, iDataSet); | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - | ||
| 70 | - @Test | ||
| 71 | - public void t1() { | ||
| 72 | - | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - | ||
| 76 | - | ||
| 77 | - | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - | ||
| 81 | - | ||
| 82 | - | ||
| 83 | - | ||
| 84 | - | ||
| 85 | - | ||
| 86 | - | ||
| 87 | - | ||
| 88 | - | ||
| 89 | - | ||
| 90 | - | ||
| 91 | - | ||
| 92 | - | ||
| 93 | - | ||
| 94 | -} |
src/test/java/com/bsth/service/schedule/rules/SchedulePlan2Test.java deleted
100644 → 0
src/test/resources/.gitkeep deleted
100644 → 0
src/test/resources/application-scheduletest.properties deleted
100644 → 0
| 1 | -#嵌入式tomcat配置 | ||
| 2 | -#server.port=9088 | ||
| 3 | -#management.port= 9001 | ||
| 4 | -#management.address= 127.0.0.1 | ||
| 5 | - | ||
| 6 | -#JPA配置 | ||
| 7 | -spring.jpa.hibernate.ddl-auto= update | ||
| 8 | -spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 9 | -spring.jpa.database= MYSQL | ||
| 10 | -spring.jpa.show-sql= true | ||
| 11 | - | ||
| 12 | -#数据库连接池配置 | ||
| 13 | -spring.datasource.driver-class-name= com.mysql.jdbc.Driver | ||
| 14 | -spring.datasource.url= jdbc:mysql://127.0.0.1/test_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 15 | -spring.datasource.username= root | ||
| 16 | -spring.datasource.password= | ||
| 17 | - | ||
| 18 | -#spring.datasource.driver-class-name= org.h2.Driver | ||
| 19 | -#spring.datasource.url= jdbc:h2:mem:bookstore;DB_CLOSE_ON_EXIT=FALSE | ||
| 20 | -#spring.datasource.username= sa | ||
| 21 | -#spring.datasource.password= | ||
| 22 | - | ||
| 23 | -spring.datasource.max-active=100 | ||
| 24 | -spring.datasource.max-idle=8 | ||
| 25 | -spring.datasource.min-idle=8 | ||
| 26 | -spring.datasource.initial-size=5 | ||
| 27 | - | ||
| 28 | -spring.datasource.test-on-borrow=true | ||
| 29 | -spring.datasource.test-on-connect=true | ||
| 30 | -spring.datasource.test-on-return=true | ||
| 31 | -spring.datasource.test-while-idle=true | ||
| 32 | -spring.datasource.validation-query=select 1 | ||
| 33 | - |
src/test/resources/datatools/config-scheduletest.properties deleted
100644 → 0
| 1 | -# 配置数据导入导出用到的配置信息 | ||
| 2 | - | ||
| 3 | -# 1、kettle配置文件路径(类路径) | ||
| 4 | -datatools.kettle_properties=/datatools/kettle.properties | ||
| 5 | -# 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) | ||
| 6 | -#数据库ip地址 | ||
| 7 | -datatools.kvars_dbip=127.0.0.1 | ||
| 8 | -#数据库用户名 | ||
| 9 | -datatools.kvars_dbuname=root | ||
| 10 | -#数据库密码 | ||
| 11 | -datatools.kvars_dbpwd= | ||
| 12 | -#数据库库名 | ||
| 13 | -datatools.kvars_dbdname=qp_control | ||
| 14 | - | ||
| 15 | -# 3、上传数据配置信息 | ||
| 16 | -# 上传文件目录配置(根据不同的环境需要修正) | ||
| 17 | -datatools.fileupload_dir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files | ||
| 18 | -# ktr转换文件,中配置的错误输出目录(根据不同的环境需要修正) | ||
| 19 | -datatools.trans_errordir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/erroroutput | ||
| 20 | -# 临时输出文件目录 | ||
| 21 | -datatools.trans_tempdir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/temp | ||
| 22 | -# 模版文件目录 | ||
| 23 | -datatools.trans_templatedir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/template | ||
| 24 | - | ||
| 25 | -##---------------------------- 导入数据ktr ----------------------------## | ||
| 26 | -# 车辆信息导入ktr转换 | ||
| 27 | -datatools.cars_datainputktr=/datatools/ktrs/carsDataInput.ktr | ||
| 28 | -# 人员信息导入 | ||
| 29 | -datatools.employees_datainputktr=/datatools/ktrs/employeesDataInput.ktr | ||
| 30 | -# 路牌信息导入 | ||
| 31 | -datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr | ||
| 32 | -# 时刻表基础信息导入 | ||
| 33 | -datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr | ||
| 34 | -# 时刻表明细信息导入(元数据) | ||
| 35 | -datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailDataInputMetaData.ktr | ||
| 36 | -# 时刻表明细编辑用数据 | ||
| 37 | -datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr | ||
| 38 | -# 时刻表明细信息导入 | ||
| 39 | -datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr | ||
| 40 | -# 时刻表明细信息导入2 | ||
| 41 | -datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr | ||
| 42 | - | ||
| 43 | -# 车辆配置信息导入 | ||
| 44 | -datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr | ||
| 45 | -# 人员配置信息导入 | ||
| 46 | -datatools.employeesconfig_datainputktr=/datatools/ktrs/employeesConfigDataInput.ktr | ||
| 47 | - | ||
| 48 | -# 排版规则信息导入 | ||
| 49 | -datatools.schedulerule_datainputktr=/datatools/ktrs/scheduleRuleDataInput.ktr | ||
| 50 | - | ||
| 51 | -# 4、数据导出配置信息 | ||
| 52 | -# 导出数据文件目录配置(根据不同的环境需要修正) | ||
| 53 | -datatools.fileoutput_dir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files | ||
| 54 | - | ||
| 55 | -##---------------------------- 导出数据ktr -----------------------------## | ||
| 56 | -# 车辆信息导出ktr转换 | ||
| 57 | -datatools.cars_dataoutputktr=/datatools/ktrs/carsDataOutput.ktr | ||
| 58 | -# 人员信息导出ktr转换 | ||
| 59 | -datatools.employees_dataoutputktr=/datatools/ktrs/employeesDataOutput.ktr | ||
| 60 | -# 时刻表导出元数据ktr转换 | ||
| 61 | -datatools.ttinfodetail_metaoutput=/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr | ||
| 62 | -# 时刻表导出数据ktr转换 | ||
| 63 | -datatools.ttinfodetail_output=/datatools/ktrs/ttinfodetailDataOutput.ktr | ||
| 64 | -# 排版规则导出数据ktr转换 | ||
| 65 | -datatools.schedulerule_output=/datatools/ktrs/scheduleRuleDataOutput.ktr | ||
| 66 | - | ||
| 67 | -# 车辆配置信息导出ktr转换 | ||
| 68 | -datatools.carsconfig_dataoutputktr=/datatools/ktrs/carsConfigDataOutput.ktr | ||
| 69 | -# 人员配置信息导出ktr转换 | ||
| 70 | -datatools.employeesconfig_dataoutputktr=/datatools/ktrs/employeesConfigDataOutput.ktr | ||
| 71 | - | ||
| 72 | -# 路牌信息导出 | ||
| 73 | -datatools.guideboards_dataoutputktr=/datatools/ktrs/guideboardDataOutput.ktr | ||
| 74 | - | ||
| 75 | - | ||
| 76 | -# TODO: | ||
| 77 | - | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - | ||
| 81 | - | ||
| 82 | - | ||
| 83 | - | ||
| 84 | - |
src/test/resources/testdata/d1.xml deleted
100644 → 0
src/test/resources/testdata/d2.xml deleted
100644 → 0
| 1 | -<?xml version='1.0' encoding='UTF-8'?> | ||
| 2 | -<dataset> | ||
| 3 | - <!-- 用户(对应实体 SysUser) --> | ||
| 4 | - <bsth_c_sys_user id="1" user_name="admin" name="系统管理员" create_date="2000-01-01" enabled="1" last_login_date="2000-01-01" /> | ||
| 5 | - | ||
| 6 | - <!-- 公司(对应实体 Business) --> | ||
| 7 | - <bsth_c_business id="1" business_name="公交公司" business_code="88" up_code="0" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 8 | - <bsth_c_business id="2" business_name="金高公司" business_code="22" up_code="88" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 9 | - <bsth_c_business id="3" business_name="杨高公司" business_code="05" up_code="88" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 10 | - <bsth_c_business id="4" business_name="上南公司" business_code="55" up_code="88" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 11 | - <bsth_c_business id="5" business_name="南汇公司" business_code="26" up_code="88" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 12 | - | ||
| 13 | - <!-- 线路(对应实体 Line) --> | ||
| 14 | - <bsth_c_line id="1" name="测试线路1" line_code="l1" destroy="0" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 15 | - <!-- 线路标准(对应实体 LineInformation) --> | ||
| 16 | - <bsth_c_line_information id="1" line="1" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 17 | - | ||
| 18 | - <!-- 站点(对应实体 Station) --> | ||
| 19 | - <bsth_c_station id="1" station_name="站1" station_cod="#112233" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 20 | - <bsth_c_station id="2" station_name="站2" station_cod="#223344" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 21 | - <!-- 站点路由(对应实体 StationRoute)--> | ||
| 22 | - <bsth_c_stationroute id="1" line="1" station="1" station_name="上行起点站" station_mark="B" directions="0" destroy="0" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 23 | - <bsth_c_stationroute id="2" line="1" station="2" station_name="上行终点站" station_mark="E" directions="0" destroy="0" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 24 | - <bsth_c_stationroute id="3" line="1" station="2" station_name="下行起点站" station_mark="B" directions="1" destroy="0" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 25 | - <bsth_c_stationroute id="4" line="1" station="1" station_name="下行终点站" station_mark="E" directions="1" destroy="0" create_by="1" create_date="2000-01-01" update_by="1" update_date="2000-01-01" /> | ||
| 26 | - | ||
| 27 | - <!-- 停车场(对应实体) --> | ||
| 28 | - | ||
| 29 | - <!-- TODO --> | ||
| 30 | - | ||
| 31 | -</dataset> | ||
| 32 | \ No newline at end of file | 0 | \ No newline at end of file |
src/test/resources/testdata/new.txt deleted
100644 → 0
| 1 | -1、车辆配置,每辆车都可以配置单独的停车点及相关数据,并提供两种设置模式(早晚,复驶) | ||
| 2 | -2、规则管理,修改规则的界面图形化,更加方便修改 | ||
| 3 | -3、时刻表管理,导入时刻表xls做严格数据判定,时刻表明细修改提供跟方便的图形化修改方式 | ||
| 4 | -4、排班计划管理,提供每次排班的操作信息,时间段,所使用的时刻表,可以查看具体的排班明细(细化到班次) | ||
| 5 | - 生成排班时,提供详细的时刻表统计信息,提供两种排班模式(历史排班优先,规则优先) | ||
| 6 | -5、调度值勤日报,列出每天的基于线路,路牌的排班统计,可以更换车辆,人员 | ||
| 7 | \ No newline at end of file | 0 | \ No newline at end of file |
src/test/resources/testdata/problem.properties deleted
100644 → 0
| 1 | -##1=时刻表明细导入,线路标准里所有的高峰低谷时间需要带入时刻表班次时间里,标准可以点击切换到线路标准界面 | ||
| 2 | -##2=时刻表明细编辑功能,数据工具移到时刻表里,类似工具栏的样子 | ||
| 3 | -3=时刻表导入,可以选一个已经存在的时刻表导入,而不是excel文件 | ||
| 4 | -##4=所有的删除,作废,都要有提示框操作 | ||
| 5 | -##5=排班计划错误提示,如果选的排班日期之前没有排班,提示错误,排班结果有重复与时刻表不符合,显示错误 | ||
| 6 | -##6=调度执行日报,显示最近排班日期,修改操作强化 | ||
| 7 | -7=警告功能,如时刻表选择相同的常规有效日,特殊有效日,车辆,人员配置重复等等 | ||
| 8 | -##8=时刻表明细编辑,颜色覆盖冲突 | ||
| 9 | -##9=下拉框貌似中文不能搜索 | ||
| 10 | -10=时刻表明细编辑,环线,选上下行,上下的站点在下行站点列表里 | ||
| 11 | -##11=人员基础信息导入问题,工号前要加公司代码 | ||
| 12 | -##12=套跑规则嵌入到主排班规则中 | ||
| 13 | -13=导入数据功能,需要加用户名 | ||
| 14 | -14=路牌编号自动生成 | ||
| 15 | -15=时刻表导入的时候表头后面不需要加数字 | ||
| 16 | -##16=时间框中文 | ||
| 17 | -##17=人员工号前公司编码自动加 | ||
| 18 | -19=线路运营概览 | ||
| 19 | -20=排班规则备注 | ||
| 20 | -##21=时刻表,两点间空驶,算空驶 | ||
| 21 | -22=搭班编码自动生成 | ||
| 22 | -##23=时刻表明细修改终点站停驶(停止1个半小时以上) | ||
| 23 | -##24=线路标准里如果里程是0,用标准里程 | ||
| 24 | -##25=规则导出的日期格式修正 | ||
| 25 | -##26=人员录入,工号规则前加 "{公司编码}-" | ||
| 26 | - | ||
| 27 | -##27=调度执勤日报,换人后,工号前的-去掉 | ||
| 28 | -##28=时刻表导出,元数据ktr转换站名匹配有问题 | ||
| 29 | -##29=时刻编辑,超过70个班次,报错,改成150个班次 | ||
| 30 | -##30=时刻表公里数 三位数 | ||
| 31 | - | ||
| 32 | -31=规则修改,路牌范围,人员范围可以拖动 | ||
| 33 | -##32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入 | ||
| 34 | -##33=时刻表明细班次,里添加,是否停驶选项(计算工时使用) |
src/test/resources/testdata/test1.txt deleted
100644 → 0
| 1 | -select * from jwgl_f_t_clxh_workflow_detail a where a.ID_LYSYLB = 36; | ||
| 2 | - | ||
| 3 | -select sum(amount - tl_amount) from jwgl_f_t_clxh_workflow_detail | ||
| 4 | -where | ||
| 5 | -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD') | ||
| 6 | -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD') | ||
| 7 | - | ||
| 8 | -select * from JWGL_D_T_LYSYLB | ||
| 9 | - | ||
| 10 | - | ||
| 11 | -select | ||
| 12 | -statdateid statdate | ||
| 13 | -, ssjc gs | ||
| 14 | -, xl xl | ||
| 15 | -, zbh cl | ||
| 16 | -, b.SYLB1 || '-' || b.SYLB2 as lylb | ||
| 17 | -, (sum(amount) - sum(tl_amount)) ch | ||
| 18 | -from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b | ||
| 19 | -where | ||
| 20 | -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD') | ||
| 21 | -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD') | ||
| 22 | -and a.ID_LYSYLB = b.ID(+) | ||
| 23 | -group by | ||
| 24 | -statdateid | ||
| 25 | -, ssjc | ||
| 26 | -, xl | ||
| 27 | -, zbh | ||
| 28 | -, b.SYLB1 || '-' || b.SYLB2 | ||
| 29 | - | ||
| 30 | --- part1 | ||
| 31 | - | ||
| 32 | -select sum(ch) from | ||
| 33 | -( | ||
| 34 | -select | ||
| 35 | -statdateid statdate | ||
| 36 | -, ssjc gs | ||
| 37 | -, xl xl | ||
| 38 | -, zbh cl | ||
| 39 | -, b.SYLB1 || '-' || b.SYLB2 as lylb | ||
| 40 | -, (sum(amount) - sum(tl_amount)) ch | ||
| 41 | -from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b | ||
| 42 | -where | ||
| 43 | -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD') | ||
| 44 | -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD') | ||
| 45 | -and a.ID_LYSYLB = b.ID(+) | ||
| 46 | -group by | ||
| 47 | -statdateid | ||
| 48 | -, ssjc | ||
| 49 | -, xl | ||
| 50 | -, zbh | ||
| 51 | -, b.SYLB1 || '-' || b.SYLB2 | ||
| 52 | -) | ||
| 53 | -where lylb in ( | ||
| 54 | -'路救-路救', | ||
| 55 | -'小修-小修机工', | ||
| 56 | -'专项-安检', | ||
| 57 | -'专项-节检', | ||
| 58 | -'专项-水箱', | ||
| 59 | -'专项-电瓶', | ||
| 60 | -'小修-小修电工', | ||
| 61 | -'专项-电并', | ||
| 62 | -'小修-小修车身', | ||
| 63 | -'专项-镗固', | ||
| 64 | -'保养-一级保养', | ||
| 65 | -'小修-发动机', | ||
| 66 | -'专项-轮胎', | ||
| 67 | -'分摊-轮胎', | ||
| 68 | -'专项-润滑油', | ||
| 69 | -'总成-差变速', | ||
| 70 | -'总成-大泵', | ||
| 71 | -'总成-小总成', | ||
| 72 | -'总成-发动机', | ||
| 73 | -'保养-二级保养', | ||
| 74 | -'保养-三级保养', | ||
| 75 | -'整修-整修', | ||
| 76 | -'空调-保外', | ||
| 77 | -'空调-保内', | ||
| 78 | -'事故-事故' | ||
| 79 | -) | ||
| 80 | - | ||
| 81 | --- part2 | ||
| 82 | - | ||
| 83 | -select sum(ch) from | ||
| 84 | -( | ||
| 85 | -select | ||
| 86 | -statdateid statdate | ||
| 87 | -, ssjc gs | ||
| 88 | -, xl xl | ||
| 89 | -, zbh cl | ||
| 90 | -, b.SYLB1 || '-' || b.SYLB2 as lylb | ||
| 91 | -, (sum(amount) - sum(tl_amount)) ch | ||
| 92 | -from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b | ||
| 93 | -where | ||
| 94 | -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD') | ||
| 95 | -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD') | ||
| 96 | -and a.ID_LYSYLB = b.ID(+) | ||
| 97 | -group by | ||
| 98 | -statdateid | ||
| 99 | -, ssjc | ||
| 100 | -, xl | ||
| 101 | -, zbh | ||
| 102 | -, b.SYLB1 || '-' || b.SYLB2 | ||
| 103 | -) | ||
| 104 | -where lylb in( | ||
| 105 | -'分摊-镗固', | ||
| 106 | -'专项-机油', | ||
| 107 | -'分摊-机油', | ||
| 108 | -'总成-其它', | ||
| 109 | -'分摊-工具', | ||
| 110 | -'分摊-辅助料', | ||
| 111 | -'分摊-设备', | ||
| 112 | -'车间经费-车间经费' | ||
| 113 | -) | ||
| 114 | - | ||
| 115 | - | ||
| 116 | - | ||
| 117 | - | ||
| 118 | - | ||
| 119 | - | ||
| 120 | - | ||
| 121 | - | ||
| 122 | - | ||
| 123 | - | ||
| 124 | - | ||
| 125 | - | ||
| 126 | - | ||
| 127 | - | ||
| 128 | - | ||
| 129 | - | ||
| 130 | - | ||
| 131 | - | ||
| 132 | - |
src/test/resources/testdata/test2.txt deleted
100644 → 0
| 1 | - | ||
| 2 | -select * from JWGL_FR_T_CH_REPORT_DATA1; | ||
| 3 | - | ||
| 4 | -select * from JWGL_FR_T_CH_REPORT_DATA2; | ||
| 5 | - | ||
| 6 | --- sum part1 | ||
| 7 | - | ||
| 8 | -select | ||
| 9 | -( | ||
| 10 | -sum(lj_lj) + sum(xx_xxjg) + sum(xx_xxdg) + sum(zx_db) + sum(xx_xxcs) + sum(zx_tg) + sum(by_b1) + | ||
| 11 | -sum(nvl(future_bx, 0)) + sum(xx_fdj) + sum(zx_lt) + sum(zx_rhy) + sum(zc_cbx) + sum(zc_db) + sum(zc_xzc) + | ||
| 12 | -sum(zc_fdj) + sum(by_b2) + sum(by_b3) + sum(nvl(future_wx_db, 0)) + sum(nvl(future_wxfy, 0)) + sum(nvl(future_ktwx, 0)) + sum(nvl(future_sx, 0)) + | ||
| 13 | -sum(nvl(future_dp, 0)) + sum(zx_zx) + sum(kt_bw) + sum(sg_sg) | ||
| 14 | -) as part1 | ||
| 15 | -from JWGL_FR_T_CH_REPORT_DATA1 | ||
| 16 | -where | ||
| 17 | -statdate >= to_date('20170301', 'YYYYMMDD') | ||
| 18 | -and statdate <= to_date('20170331', 'YYYYMMDD') | ||
| 19 | - | ||
| 20 | --- sum part2 | ||
| 21 | - | ||
| 22 | -select | ||
| 23 | -( | ||
| 24 | -sum(zx_tg) + sum(jy) + sum(qt) + sum(zcfl) + sum(gj) + sum(sb) + sum(cjjf) | ||
| 25 | -) as part2 | ||
| 26 | -from JWGL_FR_T_CH_REPORT_DATA2 | ||
| 27 | -where statdate = to_date('20170331', 'YYYYMMDD') | ||
| 28 | \ No newline at end of file | 0 | \ No newline at end of file |
src/test/resources/testdata/test3.txt deleted
100644 → 0
| 1 | -select count(*) from bsth_c_s_sp_rule_rst | ||
| 2 | - | ||
| 3 | -show index from bsth_c_s_sp_rule_rst | ||
| 4 | - | ||
| 5 | -select * from bsth_c_s_sp_rule_rst t | ||
| 6 | -where not exists (select 1 from bsth_c_s_sp_rule_rst | ||
| 7 | -where create_date > t.create_date and schedule_date < '2017-04-17' ) | ||
| 8 | -and t.xl_id = 10407 and t.schedule_date < '2017-04-17' | ||
| 9 | - | ||
| 10 | -show index from bsth_c_s_sp_rule_rst | ||
| 11 | - | ||
| 12 | -select * from bsth_c_s_sp_rule_rst | ||
| 13 | -where xl_id = 1 | ||
| 14 | - | ||
| 15 | -select * from bsth_c_s_sp_rule_rst t | ||
| 16 | -where t.xl_id = 10407 and t.schedule_date < '2017-04-17' | ||
| 17 | - | ||
| 18 | - | ||
| 19 | -select count(distinct concat(xl_id ,schedule_date, create_date)) / count(*) from bsth_c_s_sp_rule_rst | ||
| 20 | - | ||
| 21 | -select * from bsth_c_s_sp_rule_rst a | ||
| 22 | -where exists (select 1 from | ||
| 23 | -(select t.rule_id as rid, max(t.schedule_date) as sd from bsth_c_s_sp_rule_rst t | ||
| 24 | -where t.xl_id = 10407 and t.schedule_date < '2017-04-17' | ||
| 25 | -group by t.rule_id) a2 where a.rule_id = rid and a.schedule_date = sd) |
src/test/resources/testdata/test4.txt deleted
100644 → 0
| 1 | -select count(*) from bsth_c_s_ttinfo_detail | ||
| 2 | - | ||
| 3 | -select * from bsth_c_s_ttinfo_detail | ||
| 4 | - | ||
| 5 | -select * from bsth_c_s_ttinfo_detail where zdz_code is null; | ||
| 6 | - | ||
| 7 | -select * from bsth_c_station; | ||
| 8 | - | ||
| 9 | -select * from bsth_c_car_park; | ||
| 10 | - | ||
| 11 | -update bsth_c_s_ttinfo_detail a | ||
| 12 | -set a.qdz_code = (select station_cod from bsth_c_station b where a.qdz = b.id) | ||
| 13 | -where a.bc_type <> 'out' | ||
| 14 | - | ||
| 15 | -update bsth_c_s_ttinfo_detail a | ||
| 16 | -set a.qdz_name = (select station_name from bsth_c_station b where a.qdz = b.id) | ||
| 17 | -where a.bc_type <> 'out' | ||
| 18 | - | ||
| 19 | -update bsth_c_s_ttinfo_detail a | ||
| 20 | -set a.zdz_code = (select station_cod from bsth_c_station b where a.zdz = b.id) | ||
| 21 | -where a.bc_type <> 'in' | ||
| 22 | - | ||
| 23 | -update bsth_c_s_ttinfo_detail a | ||
| 24 | -set a.zdz_name = (select station_name from bsth_c_station b where a.zdz = b.id) | ||
| 25 | -where a.bc_type <> 'in' | ||
| 26 | - | ||
| 27 | -update bsth_c_s_ttinfo_detail a | ||
| 28 | -set a.qdz_code = (select park_code from bsth_c_car_park b where a.tcc = b.id) | ||
| 29 | -where a.bc_type = 'out' | ||
| 30 | - | ||
| 31 | -update bsth_c_s_ttinfo_detail a | ||
| 32 | -set a.qdz_name = (select park_name from bsth_c_car_park b where a.tcc = b.id) | ||
| 33 | -where a.bc_type = 'out' | ||
| 34 | - | ||
| 35 | -update bsth_c_s_ttinfo_detail a | ||
| 36 | -set a.zdz_code = (select park_code from bsth_c_car_park b where a.tcc = b.id) | ||
| 37 | -where a.bc_type = 'in' | ||
| 38 | - | ||
| 39 | -update bsth_c_s_ttinfo_detail a | ||
| 40 | -set a.zdz_name = (select park_name from bsth_c_car_park b where a.tcc = b.id) | ||
| 41 | -where a.bc_type = 'in' | ||
| 42 | - | ||
| 43 | -commit; | ||
| 44 | - | ||
| 45 | - | ||
| 46 | - |
src/test/resources/testdata/test5.txt deleted
100644 → 0
src/test/resources/testdata/test6.txt deleted
100644 → 0
| 1 | -select * from bsth_c_s_sp_rule_rst; | ||
| 2 | - | ||
| 3 | -select * from bsth_c_s_sp_rule_rst | ||
| 4 | -where qyrq is null; | ||
| 5 | - | ||
| 6 | -update bsth_c_s_sp_rule_rst a | ||
| 7 | -set a.qyrq = (select qyrq from bsth_c_s_sr1_flat where id = a.rule_id) | ||
| 8 | -where a.qyrq is null; | ||
| 9 | - | ||
| 10 | -select * from bsth_c_s_sp_rule_rst | ||
| 11 | -where origingidindex is null; | ||
| 12 | - | ||
| 13 | -update bsth_c_s_sp_rule_rst a | ||
| 14 | -set a.origingidindex = (select lp_start from bsth_c_s_sr1_flat where id = a.rule_id) | ||
| 15 | -where a.origingidindex is null; | ||
| 16 | - | ||
| 17 | -970 | ||
| 18 | -789 | ||
| 19 | -604 | ||
| 20 | -985 | ||
| 21 | -北蔡2路 | ||
| 22 | -1048 | ||
| 23 | -1118 | ||
| 24 | -上南二分通勤 | ||
| 25 | - | ||
| 26 | - | ||
| 27 | --Xms128M -Xmx1024M -XX:PermSize=64M -XX:MaxPermSize=128M | ||
| 28 | - | ||
| 29 | -1118 | ||
| 30 | -572康桥 | ||
| 31 | -83 |