@RequestMapping(value = "/save", method = RequestMethod.POST) @ResponseBody public long save(@RequestBody ConsumptionReportAmmoViewModel viewModelEntity) { ConsumptionAmmo modelEntity = ModelMapper.map(viewModelEntity, ConsumptionAmmo.class); iConsumptionReportAmmoService.save(modelEntity); return modelEntity.getId(); }
@RequestMapping(value = "/load/{Id}", method = RequestMethod.GET) @ResponseBody public ConsumptionReportAmmoViewModel load(@PathVariable long Id) { return (ConsumptionReportAmmoViewModel) ModelMapper.map( iConsumptionReportAmmoService.loadByEntityId(Id), ConsumptionReportAmmoViewModel.class); }
@RequestMapping(value = "/save", method = RequestMethod.POST) @ResponseBody public Long save(@RequestBody EnumerationViewModel viewModelEntity) { Enumeration modelEntity = ModelMapper.map(viewModelEntity, Enumeration.class); modelEntity.setUpdatedDate(new Date()); modelEntity.setCreatedDate(new Date()); return enumerationService.saveAndCloneEnumerationDetail(modelEntity); }
@RequestMapping(value = "/save", method = RequestMethod.POST) @ResponseBody public long save(@RequestBody AllocateTrainingViewModel viewModelEntity) { AllocateTraining modelEntity = ModelMapper.map(viewModelEntity, AllocateTraining.class); allocateTrainingService.save(modelEntity); iFileProviderService.confirmFileProvider(modelEntity.getFileCode()); return modelEntity.getId(); }
@RequestMapping(value = "/list/grid/{consumptionId}", method = RequestMethod.GET) @ResponseBody public QueryResult<ConsumptionReportAmmoViewModel> getAllGridByConsumptionId( @PathVariable Long consumptionId, String where, String order, int pageNumber, int pageSize) { return ModelMapper.mapQueryResult( iConsumptionReportAmmoService.getAllGridByConsumptionId( consumptionId, new SearchOption(where, order, pageNumber, pageSize)), ConsumptionReportAmmoViewModel.class); }
@RequestMapping(value = "/list/searchEnumeration", method = RequestMethod.GET) @ResponseBody public QueryResult<EnumerationViewModel> searchEnumeration( long instructionId, int storeHouseId, String enumerateDate, String enumerateNumber, String countedDate, String where, String order, int pageNumber, int pageSize) { SearchOption s = new SearchOption(where, order, pageNumber, pageSize); QueryResult<Enumeration> q = enumerationService.searchEnumeration( instructionId, storeHouseId, enumerateDate, enumerateNumber, countedDate, s); return ModelMapper.mapQueryResult(q, EnumerationViewModel.class); }
@RequestMapping(value = "/list/searchAllocateTraining", method = RequestMethod.GET) @ResponseBody public QueryResult<AllocateTrainingViewModel> searchAllocation( int norm, String allocateNumber, int allocateTrainingSubject, String allocateDate, int publisherId, int functorId, String order, int pageNumber, int pageSize) { QueryResult<AllocateTraining> modelResult = allocateTrainingService.searchAllocation( norm, allocateNumber, allocateTrainingSubject, allocateDate, publisherId, functorId, new SearchOption("", order, pageNumber, pageSize)); return ModelMapper.mapQueryResult(modelResult, AllocateTrainingViewModel.class); }
@RequestMapping(value = "/load/{id}", method = RequestMethod.GET) @ResponseBody public EnumerationViewModel load(@PathVariable Long id) { return ModelMapper.map(enumerationService.loadByEntityId(id), EnumerationViewModel.class); }
@RequestMapping(value = "/load/{id}", method = RequestMethod.GET) @ResponseBody public AllocateTrainingViewModel load(@PathVariable long id) { return ModelMapper.map( allocateTrainingService.loadByEntityId(id), AllocateTrainingViewModel.class); }