| | |
| | | import org.jeecg.modules.eam.service.IInspectionCycleService; |
| | | import org.jeecg.modules.eam.service.IInspectionProjectService; |
| | | |
| | | 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 InspectionCycleMapper inspectionCycleMapper; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IdentityService sysIdentityService; |
| | | |
| | | |
| | | // |
| | | // |
| | | // @Autowired |
| | |
| | | public Result<String> addNew(@RequestBody InspectionCycle inspectionCycle) { |
| | | String cycleUnit = sysBaseApi.queryDictTextByKey("cycle_unit", String.valueOf(inspectionCycle.getCycleUnit())); |
| | | inspectionCycle.setName(String.valueOf(inspectionCycle.getCycle()).concat(cycleUnit)); |
| | | String num = "DJ" + DateUtils.date2Str(DateUtils.yyyyMMdd.get()) + inspectionCycleMapper.getInspectionCycleNum(); |
| | | // String num = "DJ" + DateUtils.date2Str(DateUtils.yyyyMMdd.get()) + inspectionCycleMapper.getInspectionCycleNum(); |
| | | String num = sysIdentityService.getNumByTypeAndLength("InspectionCycle", 4); |
| | | inspectionCycle.setCode(num); |
| | | inspectionCycleService.save(inspectionCycle); |
| | | return Result.OK("添加成功!"); |