Commit a6b6afd6c42bfd3c5f9b7296a3cf3b700c70b537

Authored by 徐烜
1 parent 5ea65027

iss提交2:

排班计划,规则验证中加新的人员停用验证
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
... ... @@ -184,6 +184,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im
184 184 }
185 185  
186 186 @Override
  187 + @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
187 188 public ValidateRuleResult validateRule(Integer xlId, Date from, Date to) {
188 189 KieSession session = validateKBase.newKieSession();
189 190 session.setGlobal("LOG", logger);
... ...
src/main/java/com/bsth/service/schedule/impl/plan/kBase3/validate/rule/ErrorInfoFunction.java
1 1 package com.bsth.service.schedule.impl.plan.kBase3.validate.rule;
2 2  
3 3  
  4 +import com.bsth.entity.Personnel;
4 5 import com.bsth.entity.schedule.EmployeeConfigInfo;
5 6 import com.bsth.entity.schedule.GuideboardInfo;
6 7 import org.apache.commons.lang3.StringUtils;
... ... @@ -116,7 +117,7 @@ public class ErrorInfoFunction implements AccumulateFunction {
116 117 errorInfo.getErrorDescList().add("冗余的路牌id和路牌名字都不能为空,请重新编辑保存!");
117 118 }
118 119  
119   - // 3、人员配置,搭班编码,人员起始索引验证
  120 + // 3、人员配置,搭班编码,人员起始索引验证,配置人员停用验证
120 121 if (StringUtils.isNotEmpty(wrapInput.getEcIds()) &&
121 122 StringUtils.isNotEmpty(wrapInput.getEcDbbms())) { // 冗余的人员配置id和人员搭班编码都不能为空
122 123 String[] ecIds = wrapInput.getEcIds().split(",");
... ... @@ -144,6 +145,40 @@ public class ErrorInfoFunction implements AccumulateFunction {
144 145 break;
145 146 }
146 147 }
  148 +
  149 + // 验证fb_ecInfo1
  150 + String dbbm = fb_ecInfo1.getDbbm();
  151 + Personnel jsy = fb_ecInfo1.getJsy();
  152 + Personnel spy = fb_ecInfo1.getSpy();
  153 + if (jsy != null && jsy.getDestroy() != null && jsy.getDestroy() == 1) {
  154 + errorInfo.getErrorDescList().add(
  155 + String.format("搭班编码=%s,驾驶员=%s,工号=%s,人员经停用!",
  156 + dbbm, jsy.getPersonnelName(), jsy.getJobCodeori()));
  157 + break;
  158 + }
  159 + if (spy != null && spy.getDestroy() != null && spy.getDestroy() == 1) {
  160 + errorInfo.getErrorDescList().add(
  161 + String.format("搭班编码=%s,售票员=%s,工号=%s,人员经停用!",
  162 + dbbm, spy.getPersonnelName(), spy.getJobCodeori()));
  163 + break;
  164 + }
  165 + // 验证fb_ecInfo2
  166 + dbbm = fb_ecInfo2.getDbbm();
  167 + jsy = fb_ecInfo2.getJsy();
  168 + spy = fb_ecInfo2.getSpy();
  169 + if (jsy != null && jsy.getDestroy() != null && jsy.getDestroy() == 1) {
  170 + errorInfo.getErrorDescList().add(
  171 + String.format("搭班编码=%s,驾驶员=%s,工号=%s,人员经停用!",
  172 + dbbm, jsy.getPersonnelName(), jsy.getJobCodeori()));
  173 + break;
  174 + }
  175 + if (spy != null && spy.getDestroy() != null && spy.getDestroy() == 1) {
  176 + errorInfo.getErrorDescList().add(
  177 + String.format("搭班编码=%s,售票员=%s,工号=%s,人员经停用!",
  178 + dbbm, spy.getPersonnelName(), spy.getJobCodeori()));
  179 + break;
  180 + }
  181 +
147 182 }
148 183  
149 184 } else {
... ... @@ -163,6 +198,23 @@ public class ErrorInfoFunction implements AccumulateFunction {
163 198 break;
164 199 }
165 200 }
  201 +
  202 + // 验证ecInfo
  203 + String dbbm = ecInfo.getDbbm();
  204 + Personnel jsy = ecInfo.getJsy();
  205 + Personnel spy = ecInfo.getSpy();
  206 + if (jsy != null && jsy.getDestroy() != null && jsy.getDestroy() == 1) {
  207 + errorInfo.getErrorDescList().add(
  208 + String.format("搭班编码=%s,驾驶员=%s,工号=%s,人员经停用!",
  209 + dbbm, jsy.getPersonnelName(), jsy.getJobCodeori()));
  210 + break;
  211 + }
  212 + if (spy != null && spy.getDestroy() != null && spy.getDestroy() == 1) {
  213 + errorInfo.getErrorDescList().add(
  214 + String.format("搭班编码=%s,售票员=%s,工号=%s,人员经停用!",
  215 + dbbm, spy.getPersonnelName(), spy.getJobCodeori()));
  216 + break;
  217 + }
166 218 }
167 219 }
168 220  
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/list.html
... ... @@ -97,14 +97,14 @@
97 97 <td>
98 98 <span ng-bind="info.jsy.jobCodeori"></span>
99 99 </td>
100   - <td>
101   - <span ng-bind="info.jsy.personnelName"></span>
  100 + <td ng-class="{danger: info.jsy.destroy == 1}">
  101 + <span ng-bind="info.jsy.personnelName + (info.jsy.destroy == 1 ? '(已停用)' : '')"></span>
102 102 </td>
103 103 <td>
104 104 <span ng-bind="info.spy.jobCodeori"></span>
105 105 </td>
106 106 <td>
107   - <span ng-bind="info.spy.personnelName"></span>
  107 + <span ng-bind="info.spy.personnelName + (info.spy.destroy == 1 ? '(已停用)' : '')"></span>
108 108 </td>
109 109 <td>
110 110 <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span>
... ...