| | |
| | | import doumeemes.core.model.PageWrap; |
| | | import doumeemes.core.utils.Constants; |
| | | import doumeemes.dao.business.model.Category; |
| | | import doumeemes.dao.business.model.CategoryUnion; |
| | | import doumeemes.dao.ext.dto.QueryCategoryExtDTO; |
| | | import doumeemes.dao.ext.vo.CategoryExtListVO; |
| | | import doumeemes.service.business.CategoryService; |
| | | import doumeemes.service.business.CategoryUnionService; |
| | | import doumeemes.service.ext.CategoryExtService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @Autowired |
| | | private CategoryService categoryService; |
| | | |
| | | @Autowired |
| | | private CategoryUnionService categoryUnionService; |
| | | |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | |
| | | category.setCreateTime(new Date()); |
| | | category.setCreateUser(getLoginUser().getId()); |
| | | category.setRootDepartId(getLoginUser().getRootDepartment().getId()); |
| | | int r = categoryService.create(category); |
| | | int r = categoryService.create(category); |
| | | CategoryUnion categoryUnion = new CategoryUnion(); |
| | | categoryUnion.setDeleted(Constants.ZERO); |
| | | categoryUnion.setCreateUser(getLoginUser().getId()); |
| | | categoryUnion.setCreateTime(new Date()); |
| | | categoryUnion.setUpdateUser(getLoginUser().getId()); |
| | | categoryUnion.setUpdateTime(new Date()); |
| | | categoryUnion.setRemark(""); |
| | | categoryUnion.setRootDepartId(getLoginUser().getRootDepartment().getId()); |
| | | categoryUnion.setCateBigId(category.getId()); |
| | | categoryUnionService.create(categoryUnion); |
| | | categoryExtService.loadCom(getLoginUser().getCompany()); |
| | | return ApiResponse.success(r ); |
| | | } |
| | |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("ext:categoryext:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | Category category = categoryService.findById(Integer.valueOf(id)); |
| | | category.setDeleted(Constants.ONE); |
| | | categoryService.updateById(category); |
| | | |
| | | categoryService.deleteCategory(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |