| | |
| | | import org.jeecg.modules.eam.entity.InspectionCycle; |
| | | import org.jeecg.modules.eam.entity.MaintenanceCycle; |
| | | import org.jeecg.modules.eam.service.IMaintenanceCycleService; |
| | | import org.jeecg.modules.eam.service.IdentityService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IdentityService sysIdentityService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | public Result<String> addNew(@RequestBody MaintenanceCycle maintenanceCycle) { |
| | | String cycleUnit = sysBaseApi.queryDictTextByKey("maintenance_cycle_unit", String.valueOf(maintenanceCycle.getCycleUnit())); |
| | | maintenanceCycle.setName(String.valueOf(maintenanceCycle.getCycle()).concat(cycleUnit)); |
| | | String num = sysIdentityService.getNumByTypeAndLength("MaintenanceCycle", 4); |
| | | maintenanceCycle.setCode(num); |
| | | maintenanceCycleService.save(maintenanceCycle); |
| | | return Result.OK("添加成功!"); |
| | | } |