Commit 4fcdd22cb354f6a4f2e87ddb1bd87f028f768cfa
1 parent
830a2e3e
1、国际化改造:车辆设备管理后端国际化
Showing
3 changed files
with
12 additions
and
3 deletions
src/main/java/com/bsth/service/schedule/impl/CarDeviceServiceImpl.java
| @@ -5,6 +5,7 @@ import com.bsth.entity.Cars; | @@ -5,6 +5,7 @@ import com.bsth.entity.Cars; | ||
| 5 | import com.bsth.service.CarsService; | 5 | import com.bsth.service.CarsService; |
| 6 | import com.bsth.service.schedule.CarDeviceService; | 6 | import com.bsth.service.schedule.CarDeviceService; |
| 7 | import com.bsth.service.schedule.exception.ScheduleException; | 7 | import com.bsth.service.schedule.exception.ScheduleException; |
| 8 | +import com.bsth.util.I18n; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Isolation; | 11 | import org.springframework.transaction.annotation.Isolation; |
| @@ -39,10 +40,10 @@ public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implemen | @@ -39,10 +40,10 @@ public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implemen | ||
| 39 | @Override | 40 | @Override |
| 40 | public void validate_qyrq(CarDevice carDevice) throws ScheduleException { | 41 | public void validate_qyrq(CarDevice carDevice) throws ScheduleException { |
| 41 | if (carDevice.getXl() == null) { | 42 | if (carDevice.getXl() == null) { |
| 42 | - throw new ScheduleException("线路未选择"); | 43 | + throw new ScheduleException(I18n.getInstance().getMessage("carDeviceServiceImpl-line43")); |
| 43 | } | 44 | } |
| 44 | if (carDevice.getCl() == null) { | 45 | if (carDevice.getCl() == null) { |
| 45 | - throw new ScheduleException("车辆未选择"); | 46 | + throw new ScheduleException(I18n.getInstance().getMessage("carDeviceServiceImpl-line46")); |
| 46 | } | 47 | } |
| 47 | Map<String, Object> param = new HashMap<>(); | 48 | Map<String, Object> param = new HashMap<>(); |
| 48 | if (carDevice.getId() != null) { | 49 | if (carDevice.getId() != null) { |
| @@ -53,7 +54,7 @@ public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implemen | @@ -53,7 +54,7 @@ public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implemen | ||
| 53 | param.put("isCancel_eq", false); // 未标记作废删除的 | 54 | param.put("isCancel_eq", false); // 未标记作废删除的 |
| 54 | param.put("qyrq_ge", carDevice.getQyrq()); | 55 | param.put("qyrq_ge", carDevice.getQyrq()); |
| 55 | if (!CollectionUtils.isEmpty(list(param))) { | 56 | if (!CollectionUtils.isEmpty(list(param))) { |
| 56 | - throw new ScheduleException("启用日期必须比历史的启用日期大"); | 57 | + throw new ScheduleException(I18n.getInstance().getMessage("carDeviceServiceImpl-line57")); |
| 57 | } | 58 | } |
| 58 | } | 59 | } |
| 59 | 60 |
src/main/resources/message_en_US.properties
| @@ -4538,6 +4538,10 @@ carsServiceImpl-line118=duplicate vehicle Code | @@ -4538,6 +4538,10 @@ carsServiceImpl-line118=duplicate vehicle Code | ||
| 4538 | carsServiceImpl-line132=duplicate license number | 4538 | carsServiceImpl-line132=duplicate license number |
| 4539 | carsServiceImpl-line147=duplicate terminal number | 4539 | carsServiceImpl-line147=duplicate terminal number |
| 4540 | 4540 | ||
| 4541 | +carDeviceServiceImpl-line43=route not select | ||
| 4542 | +carDeviceServiceImpl-line46=vehicle not select | ||
| 4543 | +carDeviceServiceImpl-line57=activation date must be later than historical activation date | ||
| 4544 | + | ||
| 4541 | employeeServiceImpl-line54=duplicate employee number | 4545 | employeeServiceImpl-line54=duplicate employee number |
| 4542 | 4546 | ||
| 4543 | bController-line192=import file not exist | 4547 | bController-line192=import file not exist |
src/main/resources/message_zh_CN.properties
| @@ -4539,6 +4539,10 @@ carsServiceImpl-line118=车辆编号重复 | @@ -4539,6 +4539,10 @@ carsServiceImpl-line118=车辆编号重复 | ||
| 4539 | carsServiceImpl-line132=车牌号重复 | 4539 | carsServiceImpl-line132=车牌号重复 |
| 4540 | carsServiceImpl-line147=设备编号重复 | 4540 | carsServiceImpl-line147=设备编号重复 |
| 4541 | 4541 | ||
| 4542 | +carDeviceServiceImpl-line43=线路未选择 | ||
| 4543 | +carDeviceServiceImpl-line46=车辆未选择 | ||
| 4544 | +carDeviceServiceImpl-line57=启用日期必须比历史的启用日期大 | ||
| 4545 | + | ||
| 4542 | employeeServiceImpl-line54=相同公司工号重复 | 4546 | employeeServiceImpl-line54=相同公司工号重复 |
| 4543 | 4547 | ||
| 4544 | bController-line192=导入文件不存在! | 4548 | bController-line192=导入文件不存在! |