Commit eb7d970fdc59151a4f14faa5fbcfc2efe13c18a7
1 parent
1b27857c
update
Showing
9 changed files
with
83 additions
and
53 deletions
src/main/java/com/bsth/service/BaseService.java
| @@ -4,6 +4,7 @@ import org.springframework.data.domain.Page; | @@ -4,6 +4,7 @@ import org.springframework.data.domain.Page; | ||
| 4 | import org.springframework.data.domain.Pageable; | 4 | import org.springframework.data.domain.Pageable; |
| 5 | 5 | ||
| 6 | import java.io.Serializable; | 6 | import java.io.Serializable; |
| 7 | +import java.util.Collection; | ||
| 7 | import java.util.Map; | 8 | import java.util.Map; |
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| @@ -70,4 +71,11 @@ public interface BaseService<T, ID extends Serializable> { | @@ -70,4 +71,11 @@ public interface BaseService<T, ID extends Serializable> { | ||
| 70 | * @return {status:状态编码,msg:错误描述},状态编码 @see com.bsth.common.ResponseCode | 71 | * @return {status:状态编码,msg:错误描述},状态编码 @see com.bsth.common.ResponseCode |
| 71 | */ | 72 | */ |
| 72 | Map<String, Object> validateEquale(Map<String, Object> params); | 73 | Map<String, Object> validateEquale(Map<String, Object> params); |
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 批量保存。 | ||
| 77 | + * @param entities 实体列表 | ||
| 78 | + * @return 保存后的entities | ||
| 79 | + */ | ||
| 80 | + <S extends T> Collection<S> bulkSave(Collection<S> entities); | ||
| 73 | } | 81 | } |
src/main/java/com/bsth/service/impl/BaseServiceImpl.java
| @@ -7,18 +7,23 @@ import com.bsth.service.BaseService; | @@ -7,18 +7,23 @@ import com.bsth.service.BaseService; | ||
| 7 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 8 | import org.slf4j.LoggerFactory; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | +import org.springframework.beans.factory.annotation.Value; | ||
| 10 | import org.springframework.dao.DataIntegrityViolationException; | 11 | import org.springframework.dao.DataIntegrityViolationException; |
| 11 | import org.springframework.data.domain.Page; | 12 | import org.springframework.data.domain.Page; |
| 12 | import org.springframework.data.domain.Pageable; | 13 | import org.springframework.data.domain.Pageable; |
| 13 | 14 | ||
| 15 | +import javax.persistence.EntityManager; | ||
| 14 | import java.io.Serializable; | 16 | import java.io.Serializable; |
| 15 | -import java.util.HashMap; | ||
| 16 | -import java.util.Map; | 17 | +import java.util.*; |
| 17 | 18 | ||
| 18 | public class BaseServiceImpl<T, ID extends Serializable> implements BaseService<T, ID>{ | 19 | public class BaseServiceImpl<T, ID extends Serializable> implements BaseService<T, ID>{ |
| 19 | 20 | ||
| 20 | @Autowired | 21 | @Autowired |
| 21 | private BaseRepository<T, ID> baseRepository; | 22 | private BaseRepository<T, ID> baseRepository; |
| 23 | + @Autowired | ||
| 24 | + private EntityManager entityManager; | ||
| 25 | + @Value("${hibernate.jdbc.batch_size}") | ||
| 26 | + private int batchSize; | ||
| 22 | 27 | ||
| 23 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 28 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 24 | 29 | ||
| @@ -50,9 +55,25 @@ public class BaseServiceImpl<T, ID extends Serializable> implements BaseService< | @@ -50,9 +55,25 @@ public class BaseServiceImpl<T, ID extends Serializable> implements BaseService< | ||
| 50 | } | 55 | } |
| 51 | return map; | 56 | return map; |
| 52 | } | 57 | } |
| 53 | - | ||
| 54 | 58 | ||
| 55 | - @Override | 59 | + @Override |
| 60 | + public <S extends T> Collection<S> bulkSave(Collection<S> entities) { | ||
| 61 | + final List<S> savedEntities = new ArrayList<>(entities.size()); | ||
| 62 | + int i = 0; | ||
| 63 | + for (S t : entities) { | ||
| 64 | + entityManager.persist(t); | ||
| 65 | + savedEntities.add(t); | ||
| 66 | + i++; | ||
| 67 | + if (i % batchSize == 0) { | ||
| 68 | + entityManager.flush(); | ||
| 69 | + entityManager.clear(); | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + return savedEntities; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + @Override | ||
| 56 | public Iterable<T> findAll() { | 77 | public Iterable<T> findAll() { |
| 57 | return baseRepository.findAll(); | 78 | return baseRepository.findAll(); |
| 58 | } | 79 | } |
src/main/java/com/bsth/service/schedule/SchedulePlanServiceImpl.java
| @@ -101,7 +101,7 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> | @@ -101,7 +101,7 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> | ||
| 101 | // 人员配置对应的人员 | 101 | // 人员配置对应的人员 |
| 102 | EmployeeConfigInfo employeeConfigInfo = employeeConfigMaps.get(scheduleResult_output.getEmployeeConfigId()); | 102 | EmployeeConfigInfo employeeConfigInfo = employeeConfigMaps.get(scheduleResult_output.getEmployeeConfigId()); |
| 103 | // 排班明细(这个要迭代的) | 103 | // 排班明细(这个要迭代的) |
| 104 | - Collection<TTInfoDetail> ttInfoDetails = gbdTTinfoMaps.get(scheduleResult_output.getGuideboardId()); | 104 | + Collection<TTInfoDetail> ttInfoDetails = gbdTTinfoMaps.get(Long.parseLong(scheduleResult_output.getGuideboardId())); |
| 105 | for (TTInfoDetail ttInfoDetail : ttInfoDetails) { | 105 | for (TTInfoDetail ttInfoDetail : ttInfoDetails) { |
| 106 | SchedulePlanInfo schedulePlanInfo = new SchedulePlanInfo( | 106 | SchedulePlanInfo schedulePlanInfo = new SchedulePlanInfo( |
| 107 | xl, | 107 | xl, |
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleResult_output.java
| @@ -9,13 +9,13 @@ public class ScheduleResult_output { | @@ -9,13 +9,13 @@ public class ScheduleResult_output { | ||
| 9 | /** 具体日期 */ | 9 | /** 具体日期 */ |
| 10 | private DateTime sd; | 10 | private DateTime sd; |
| 11 | /** 用的是哪一组rule */ | 11 | /** 用的是哪一组rule */ |
| 12 | - private Long ruleId; | 12 | + private String ruleId; |
| 13 | /** 路牌id */ | 13 | /** 路牌id */ |
| 14 | - private Long guideboardId; | 14 | + private String guideboardId; |
| 15 | /** 人员配置id */ | 15 | /** 人员配置id */ |
| 16 | - private Long employeeConfigId; | 16 | + private String employeeConfigId; |
| 17 | /** 车辆配置id */ | 17 | /** 车辆配置id */ |
| 18 | - private Long carConfigId; | 18 | + private String carConfigId; |
| 19 | 19 | ||
| 20 | public DateTime getSd() { | 20 | public DateTime getSd() { |
| 21 | return sd; | 21 | return sd; |
| @@ -25,36 +25,35 @@ public class ScheduleResult_output { | @@ -25,36 +25,35 @@ public class ScheduleResult_output { | ||
| 25 | this.sd = sd; | 25 | this.sd = sd; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | - public Long getGuideboardId() { | 28 | + public String getRuleId() { |
| 29 | + return ruleId; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public void setRuleId(String ruleId) { | ||
| 33 | + this.ruleId = ruleId; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public String getGuideboardId() { | ||
| 29 | return guideboardId; | 37 | return guideboardId; |
| 30 | } | 38 | } |
| 31 | 39 | ||
| 32 | - public void setGuideboardId(Long guideboardId) { | 40 | + public void setGuideboardId(String guideboardId) { |
| 33 | this.guideboardId = guideboardId; | 41 | this.guideboardId = guideboardId; |
| 34 | } | 42 | } |
| 35 | 43 | ||
| 36 | - public Long getEmployeeConfigId() { | 44 | + public String getEmployeeConfigId() { |
| 37 | return employeeConfigId; | 45 | return employeeConfigId; |
| 38 | } | 46 | } |
| 39 | 47 | ||
| 40 | - public void setEmployeeConfigId(Long employeeConfigId) { | 48 | + public void setEmployeeConfigId(String employeeConfigId) { |
| 41 | this.employeeConfigId = employeeConfigId; | 49 | this.employeeConfigId = employeeConfigId; |
| 42 | } | 50 | } |
| 43 | 51 | ||
| 44 | - public Long getCarConfigId() { | 52 | + public String getCarConfigId() { |
| 45 | return carConfigId; | 53 | return carConfigId; |
| 46 | } | 54 | } |
| 47 | 55 | ||
| 48 | - public void setCarConfigId(Long carConfigId) { | 56 | + public void setCarConfigId(String carConfigId) { |
| 49 | this.carConfigId = carConfigId; | 57 | this.carConfigId = carConfigId; |
| 50 | } | 58 | } |
| 51 | - | ||
| 52 | - public Long getRuleId() { | ||
| 53 | - return ruleId; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - public void setRuleId(Long ruleId) { | ||
| 57 | - this.ruleId = ruleId; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | } | 59 | } |
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleResults_output.java
| @@ -25,7 +25,7 @@ public class ScheduleResults_output { | @@ -25,7 +25,7 @@ public class ScheduleResults_output { | ||
| 25 | */ | 25 | */ |
| 26 | public String showGuideboardDesc1() { | 26 | public String showGuideboardDesc1() { |
| 27 | StringBuilder stringBuilder = new StringBuilder(); | 27 | StringBuilder stringBuilder = new StringBuilder(); |
| 28 | - Map<Long, List<ScheduleResult_output>> groupRuleIdGuideBoardMap = new HashMap<>(); | 28 | + Map<String, List<ScheduleResult_output>> groupRuleIdGuideBoardMap = new HashMap<>(); |
| 29 | for (ScheduleResult_output s : results) { | 29 | for (ScheduleResult_output s : results) { |
| 30 | if (groupRuleIdGuideBoardMap.get(s.getRuleId()) == null) { | 30 | if (groupRuleIdGuideBoardMap.get(s.getRuleId()) == null) { |
| 31 | groupRuleIdGuideBoardMap.put(s.getRuleId(), new ArrayList<ScheduleResult_output>()); | 31 | groupRuleIdGuideBoardMap.put(s.getRuleId(), new ArrayList<ScheduleResult_output>()); |
| @@ -33,7 +33,7 @@ public class ScheduleResults_output { | @@ -33,7 +33,7 @@ public class ScheduleResults_output { | ||
| 33 | groupRuleIdGuideBoardMap.get(s.getRuleId()).add(s); | 33 | groupRuleIdGuideBoardMap.get(s.getRuleId()).add(s); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | - for (Long ruleId : groupRuleIdGuideBoardMap.keySet()) { | 36 | + for (String ruleId : groupRuleIdGuideBoardMap.keySet()) { |
| 37 | Collections.sort(groupRuleIdGuideBoardMap.get(ruleId), new Comparator<ScheduleResult_output>() { | 37 | Collections.sort(groupRuleIdGuideBoardMap.get(ruleId), new Comparator<ScheduleResult_output>() { |
| 38 | @Override | 38 | @Override |
| 39 | public int compare(ScheduleResult_output o1, ScheduleResult_output o2) { | 39 | public int compare(ScheduleResult_output o1, ScheduleResult_output o2) { |
| @@ -41,8 +41,8 @@ public class ScheduleResults_output { | @@ -41,8 +41,8 @@ public class ScheduleResults_output { | ||
| 41 | } | 41 | } |
| 42 | }); | 42 | }); |
| 43 | 43 | ||
| 44 | - List<Long> gbids = new ArrayList<>(); | ||
| 45 | - List<Long> ecids = new ArrayList<>(); | 44 | + List<String> gbids = new ArrayList<>(); |
| 45 | + List<String> ecids = new ArrayList<>(); | ||
| 46 | for (ScheduleResult_output so : groupRuleIdGuideBoardMap.get(ruleId)) { | 46 | for (ScheduleResult_output so : groupRuleIdGuideBoardMap.get(ruleId)) { |
| 47 | gbids.add(so.getGuideboardId()); | 47 | gbids.add(so.getGuideboardId()); |
| 48 | ecids.add(so.getEmployeeConfigId()); | 48 | ecids.add(so.getEmployeeConfigId()); |
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_input.java
| @@ -12,7 +12,7 @@ import java.util.List; | @@ -12,7 +12,7 @@ import java.util.List; | ||
| 12 | */ | 12 | */ |
| 13 | public class ScheduleRule_input { | 13 | public class ScheduleRule_input { |
| 14 | /** 规则Id */ | 14 | /** 规则Id */ |
| 15 | - private Long ruleId; | 15 | + private String ruleId; |
| 16 | /** 规则启用日期 */ | 16 | /** 规则启用日期 */ |
| 17 | private DateTime qyrq; | 17 | private DateTime qyrq; |
| 18 | 18 | ||
| @@ -27,14 +27,14 @@ public class ScheduleRule_input { | @@ -27,14 +27,14 @@ public class ScheduleRule_input { | ||
| 27 | private int startEIndex; | 27 | private int startEIndex; |
| 28 | 28 | ||
| 29 | /** 车辆配置id */ | 29 | /** 车辆配置id */ |
| 30 | - private Long carConfigId; | 30 | + private String carConfigId; |
| 31 | 31 | ||
| 32 | // TODO:车辆翻班暂时不考虑进去 | 32 | // TODO:车辆翻班暂时不考虑进去 |
| 33 | 33 | ||
| 34 | public ScheduleRule_input() {} | 34 | public ScheduleRule_input() {} |
| 35 | 35 | ||
| 36 | public ScheduleRule_input(ScheduleRule1Flat scheduleRule1Flat) { | 36 | public ScheduleRule_input(ScheduleRule1Flat scheduleRule1Flat) { |
| 37 | - this.ruleId = scheduleRule1Flat.getId(); | 37 | + this.ruleId = String.valueOf(scheduleRule1Flat.getId()); |
| 38 | this.qyrq = new DateTime(scheduleRule1Flat.getQyrq()); | 38 | this.qyrq = new DateTime(scheduleRule1Flat.getQyrq()); |
| 39 | List<String> lpIds = Splitter.on(",").splitToList(scheduleRule1Flat.getLpIds()); | 39 | List<String> lpIds = Splitter.on(",").splitToList(scheduleRule1Flat.getLpIds()); |
| 40 | // for (String lpId : lpIds) { | 40 | // for (String lpId : lpIds) { |
| @@ -50,14 +50,14 @@ public class ScheduleRule_input { | @@ -50,14 +50,14 @@ public class ScheduleRule_input { | ||
| 50 | employeeConfigIds.addAll(ryCids); | 50 | employeeConfigIds.addAll(ryCids); |
| 51 | // 人员初始索引减1 | 51 | // 人员初始索引减1 |
| 52 | this.startEIndex = scheduleRule1Flat.getRyStart() - 1; | 52 | this.startEIndex = scheduleRule1Flat.getRyStart() - 1; |
| 53 | - this.carConfigId = scheduleRule1Flat.getCarConfigInfo().getId(); | 53 | + this.carConfigId = String.valueOf(scheduleRule1Flat.getCarConfigInfo().getId()); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | - public Long getRuleId() { | 56 | + public String getRuleId() { |
| 57 | return ruleId; | 57 | return ruleId; |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | - public void setRuleId(Long ruleId) { | 60 | + public void setRuleId(String ruleId) { |
| 61 | this.ruleId = ruleId; | 61 | this.ruleId = ruleId; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| @@ -101,11 +101,11 @@ public class ScheduleRule_input { | @@ -101,11 +101,11 @@ public class ScheduleRule_input { | ||
| 101 | this.startEIndex = startEIndex; | 101 | this.startEIndex = startEIndex; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | - public Long getCarConfigId() { | 104 | + public String getCarConfigId() { |
| 105 | return carConfigId; | 105 | return carConfigId; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | - public void setCarConfigId(Long carConfigId) { | 108 | + public void setCarConfigId(String carConfigId) { |
| 109 | this.carConfigId = carConfigId; | 109 | this.carConfigId = carConfigId; |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
src/main/resources/application.properties
| @@ -11,3 +11,5 @@ multipart.maxFileSize = -1 | @@ -11,3 +11,5 @@ multipart.maxFileSize = -1 | ||
| 11 | # Total request size for a multipart/form-data | 11 | # Total request size for a multipart/form-data |
| 12 | multipart.maxRequestSize = -1 | 12 | multipart.maxRequestSize = -1 |
| 13 | 13 | ||
| 14 | +# batch insert | ||
| 15 | +hibernate.jdbc.batch_size = 50 | ||
| 14 | \ No newline at end of file | 16 | \ No newline at end of file |
src/main/resources/rules/shiftloop.drl
| @@ -15,7 +15,7 @@ import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; | @@ -15,7 +15,7 @@ import com.bsth.service.schedule.rules.shiftloop.ScheduleResults_output; | ||
| 15 | //------------------------- 第一阶段、计算规则准备数据(天数) ----------------------------// | 15 | //------------------------- 第一阶段、计算规则准备数据(天数) ----------------------------// |
| 16 | 16 | ||
| 17 | declare Calcu_days_result | 17 | declare Calcu_days_result |
| 18 | - ruleId : Long // 规则Id | 18 | + ruleId : String // 规则Id |
| 19 | qyrq_days : Integer // 开始日期离启用日期的天数 | 19 | qyrq_days : Integer // 开始日期离启用日期的天数 |
| 20 | sdays : Integer // 总共需要排班的天数 | 20 | sdays : Integer // 总共需要排班的天数 |
| 21 | calcu_start_date : DateTime // 开始计算日期 | 21 | calcu_start_date : DateTime // 开始计算日期 |
| @@ -104,18 +104,18 @@ end | @@ -104,18 +104,18 @@ end | ||
| 104 | 104 | ||
| 105 | //----------------------- 路牌范围循环计算 ------------------------// | 105 | //----------------------- 路牌范围循环计算 ------------------------// |
| 106 | declare Calcu_guideboard_index_result | 106 | declare Calcu_guideboard_index_result |
| 107 | - ruleId : Long // 规则Id | 107 | + ruleId : String // 规则Id |
| 108 | calcu_index : Integer // 计算之后的起始索引 | 108 | calcu_index : Integer // 计算之后的起始索引 |
| 109 | end | 109 | end |
| 110 | declare Calcu_guideboard_index_param_1 | 110 | declare Calcu_guideboard_index_param_1 |
| 111 | - ruleId : Long // 规则Id | 111 | + ruleId : String // 规则Id |
| 112 | oindex : Integer // 原始起始索引 | 112 | oindex : Integer // 原始起始索引 |
| 113 | range_size : Integer // 范围大小 | 113 | range_size : Integer // 范围大小 |
| 114 | temp : Integer // 原始起始索引距离最后一个索引的大小 | 114 | temp : Integer // 原始起始索引距离最后一个索引的大小 |
| 115 | days_temp : Integer // 开始日期离启用日期的天数 - temp | 115 | days_temp : Integer // 开始日期离启用日期的天数 - temp |
| 116 | end | 116 | end |
| 117 | declare Calcu_guideboard_index_param_2 | 117 | declare Calcu_guideboard_index_param_2 |
| 118 | - ruleId : Long // 规则Id | 118 | + ruleId : String // 规则Id |
| 119 | s_value : Integer // 商 | 119 | s_value : Integer // 商 |
| 120 | y_value : Integer // 余 | 120 | y_value : Integer // 余 |
| 121 | end | 121 | end |
| @@ -217,18 +217,18 @@ end | @@ -217,18 +217,18 @@ end | ||
| 217 | 217 | ||
| 218 | //----------------------- 人员范围循环计算 ------------------------// | 218 | //----------------------- 人员范围循环计算 ------------------------// |
| 219 | declare Calcu_employee_index_result | 219 | declare Calcu_employee_index_result |
| 220 | - ruleId : Long // 规则Id | 220 | + ruleId : String // 规则Id |
| 221 | calcu_index : Integer // 计算之后的起始索引 | 221 | calcu_index : Integer // 计算之后的起始索引 |
| 222 | end | 222 | end |
| 223 | declare Calcu_employee_index_param_1 | 223 | declare Calcu_employee_index_param_1 |
| 224 | - ruleId : Long // 规则Id | 224 | + ruleId : String // 规则Id |
| 225 | oindex : Integer // 原始起始索引 | 225 | oindex : Integer // 原始起始索引 |
| 226 | range_size : Integer // 范围大小 | 226 | range_size : Integer // 范围大小 |
| 227 | temp : Integer // 原始起始索引距离最后一个索引的大小 | 227 | temp : Integer // 原始起始索引距离最后一个索引的大小 |
| 228 | days_temp : Integer // 开始日期离启用日期的天数 - temp | 228 | days_temp : Integer // 开始日期离启用日期的天数 - temp |
| 229 | end | 229 | end |
| 230 | declare Calcu_employee_index_param_2 | 230 | declare Calcu_employee_index_param_2 |
| 231 | - ruleId : Long // 规则Id | 231 | + ruleId : String // 规则Id |
| 232 | s_value : Integer // 商 | 232 | s_value : Integer // 商 |
| 233 | y_value : Integer // 余 | 233 | y_value : Integer // 余 |
| 234 | end | 234 | end |
| @@ -332,7 +332,7 @@ end | @@ -332,7 +332,7 @@ end | ||
| 332 | 332 | ||
| 333 | //----------------------- 路牌范围循环计算 ------------------------// | 333 | //----------------------- 路牌范围循环计算 ------------------------// |
| 334 | declare Calcu_guideboard_range_loop_result | 334 | declare Calcu_guideboard_range_loop_result |
| 335 | - ruleId : Long // 规则Id | 335 | + ruleId : String // 规则Id |
| 336 | firstLoopSize : Integer // 初始的范围循环个数 | 336 | firstLoopSize : Integer // 初始的范围循环个数 |
| 337 | middelLoopCount : Integer // 中间的范围循环次数 | 337 | middelLoopCount : Integer // 中间的范围循环次数 |
| 338 | rangeSize : Integer // 范围大小 | 338 | rangeSize : Integer // 范围大小 |
| @@ -340,7 +340,7 @@ declare Calcu_guideboard_range_loop_result | @@ -340,7 +340,7 @@ declare Calcu_guideboard_range_loop_result | ||
| 340 | end | 340 | end |
| 341 | 341 | ||
| 342 | declare Calcu_guideboard_range_loop_param | 342 | declare Calcu_guideboard_range_loop_param |
| 343 | - ruleId : Long // 规则Id | 343 | + ruleId : String // 规则Id |
| 344 | temp : Integer // 起始索引距离最后一个索引的大小 | 344 | temp : Integer // 起始索引距离最后一个索引的大小 |
| 345 | sdays : Integer // 总共需要排班的天数 | 345 | sdays : Integer // 总共需要排班的天数 |
| 346 | end | 346 | end |
| @@ -409,7 +409,7 @@ end | @@ -409,7 +409,7 @@ end | ||
| 409 | 409 | ||
| 410 | //----------------------- 人员范围循环计算 ------------------------// | 410 | //----------------------- 人员范围循环计算 ------------------------// |
| 411 | declare Calcu_employee_range_loop_result | 411 | declare Calcu_employee_range_loop_result |
| 412 | - ruleId : Long // 规则Id | 412 | + ruleId : String // 规则Id |
| 413 | firstLoopSize : Integer // 初始的范围循环个数 | 413 | firstLoopSize : Integer // 初始的范围循环个数 |
| 414 | middelLoopCount : Integer // 中间的范围循环次数 | 414 | middelLoopCount : Integer // 中间的范围循环次数 |
| 415 | rangeSize : Integer // 范围大小 | 415 | rangeSize : Integer // 范围大小 |
| @@ -417,7 +417,7 @@ declare Calcu_employee_range_loop_result | @@ -417,7 +417,7 @@ declare Calcu_employee_range_loop_result | ||
| 417 | end | 417 | end |
| 418 | 418 | ||
| 419 | declare Calcu_employee_range_loop_param | 419 | declare Calcu_employee_range_loop_param |
| 420 | - ruleId : Long // 规则Id | 420 | + ruleId : String // 规则Id |
| 421 | temp : Integer // 起始索引距离最后一个索引的大小 | 421 | temp : Integer // 起始索引距离最后一个索引的大小 |
| 422 | sdays : Integer // 总共需要排班的天数 | 422 | sdays : Integer // 总共需要排班的天数 |
| 423 | end | 423 | end |
| @@ -489,7 +489,7 @@ end | @@ -489,7 +489,7 @@ end | ||
| 489 | 489 | ||
| 490 | //----------------------- 路牌范围循环计算 ------------------------// | 490 | //----------------------- 路牌范围循环计算 ------------------------// |
| 491 | declare Calcu_loop_guideboard_result | 491 | declare Calcu_loop_guideboard_result |
| 492 | - ruleId : Long // 规则id | 492 | + ruleId : String // 规则id |
| 493 | go_list : List // 路牌循环的列表 | 493 | go_list : List // 路牌循环的列表 |
| 494 | end | 494 | end |
| 495 | 495 | ||
| @@ -553,7 +553,7 @@ end | @@ -553,7 +553,7 @@ end | ||
| 553 | 553 | ||
| 554 | //----------------------- 人员范围循环计算 ------------------------// | 554 | //----------------------- 人员范围循环计算 ------------------------// |
| 555 | declare Calcu_loop_employee_result | 555 | declare Calcu_loop_employee_result |
| 556 | - ruleId : Long // 规则id | 556 | + ruleId : String // 规则id |
| 557 | eo_list : List // 人员循环的列表 | 557 | eo_list : List // 人员循环的列表 |
| 558 | end | 558 | end |
| 559 | 559 |
src/test/java/com/bsth/service/schedule/rules/DroolsRulesTest.java
| @@ -69,14 +69,14 @@ public class DroolsRulesTest { | @@ -69,14 +69,14 @@ public class DroolsRulesTest { | ||
| 69 | scheduleCalcuParam_input.setTtinfoId(1L); | 69 | scheduleCalcuParam_input.setTtinfoId(1L); |
| 70 | 70 | ||
| 71 | ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); | 71 | ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); |
| 72 | - scheduleRule_input1.setRuleId(1L); | 72 | + scheduleRule_input1.setRuleId("1"); |
| 73 | scheduleRule_input1.setQyrq(new DateTime(2016, 7, 22, 0, 0)); | 73 | scheduleRule_input1.setQyrq(new DateTime(2016, 7, 22, 0, 0)); |
| 74 | scheduleRule_input1.getGuideboardIds().addAll(Arrays.asList( | 74 | scheduleRule_input1.getGuideboardIds().addAll(Arrays.asList( |
| 75 | - 9L, 9L , 8L ,8L ,7L ,7L ,6L ,6L, 5L, 5L, 4L, 4L, 3L, 3L, 2L, 2L, 1L, 1L)); | 75 | + "9", "9" , "8" ,"8" ,"7" ,"7" ,"6" ,"6", "5", "5", "4", "4", "3", "3", "2", "2", "1", "1")); |
| 76 | scheduleRule_input1.setStartGbdIndex(3); | 76 | scheduleRule_input1.setStartGbdIndex(3); |
| 77 | - scheduleRule_input1.getEmployeeConfigIds().addAll(Arrays.asList(1L, 2L)); | 77 | + scheduleRule_input1.getEmployeeConfigIds().addAll(Arrays.asList("1", "2")); |
| 78 | scheduleRule_input1.setStartEIndex(1); | 78 | scheduleRule_input1.setStartEIndex(1); |
| 79 | - scheduleRule_input1.setCarConfigId(1L); | 79 | + scheduleRule_input1.setCarConfigId("1"); |
| 80 | 80 | ||
| 81 | // ScheduleRule_input scheduleRule_input2 = new ScheduleRule_input(); | 81 | // ScheduleRule_input scheduleRule_input2 = new ScheduleRule_input(); |
| 82 | // scheduleRule_input2.setRuleId(2L); | 82 | // scheduleRule_input2.setRuleId(2L); |