| | |
| | | /** |
| | | * config_item_warehouse |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-11-27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/configItemWarehouse/ConfigItemWarehouse/") |
| | | @Api(tags="config_item_warehouse") |
| | | @Api(tags = "config_item_warehouse") |
| | | public class ConfigItemWarehouseController { |
| | | @Autowired |
| | | private ConfigItemWarehouseService configItemWarehouseService; |
| | |
| | | |
| | | @Autowired |
| | | private SysOssConfigService sysOssConfigService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "code", value = "配置项入库编号", dataType = Constant.QT.STRING, format = "a.code^LK"), |
| | | @ApiImplicitParam(name = "projectCode", value = "项目编号", dataType = Constant.QT.STRING, format = "p.code^EQ"), |
| | | @ApiImplicitParam(name = "softwareName", value = "项目名称", dataType = Constant.QT.STRING, format = "p.software_name^EQ"), |
| | | @ApiImplicitParam(name = "libraryType", value = "库类型", dataType = Constant.QT.STRING, format = "a.library_type^EQ") }) |
| | | public PageResult<ConfigItemWarehouse> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | List<ConfigItemWarehouse> configItemWarehouse=configItemWarehouseService.page(queryFilter); |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "code", value = "配置项入库编号", dataType = Constant.QT.STRING, format = "a.code^LK"), |
| | | @ApiImplicitParam(name = "projectCode", value = "项目编号", dataType = Constant.QT.STRING, format = "p.code^EQ"), |
| | | @ApiImplicitParam(name = "softwareName", value = "项目名称", dataType = Constant.QT.STRING, format = "p.software_name^EQ"), |
| | | @ApiImplicitParam(name = "libraryType", value = "库类型", dataType = Constant.QT.STRING, format = "a.library_type^EQ")}) |
| | | public PageResult<ConfigItemWarehouse> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { |
| | | List<ConfigItemWarehouse> configItemWarehouse = configItemWarehouseService.page(queryFilter); |
| | | return PageResult.ok(configItemWarehouse); |
| | | } |
| | | |
| | | @GetMapping("getDto") |
| | | @ApiOperation("信息") |
| | | public Result<ConfigItemWarehouseDto> getDto(Long projectId, Long warehouseId) { |
| | | ConfigItemWarehouseDto data =configItemWarehouseService.getDto(projectId, warehouseId); |
| | | if (warehouseId!=null) { |
| | | for (WarehouseConfigItem configItem : data.getConfigItemList()) { |
| | | public Result<ConfigItemWarehouseDto> getDto(Long projectId, Long warehouseId, String libraryType) { |
| | | ConfigItemWarehouseDto data = configItemWarehouseService.getDto(projectId, warehouseId, libraryType); |
| | | if (warehouseId != null) { |
| | | for (WarehouseConfigItem configItem : data.getConfigItemList()) { |
| | | Long configItemId = configItem.getId(); |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(configItemId, "config_item_warehouse"); |
| | | if (ossDto != null) { |
| | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ConfigItemWarehouseDto configItemDto){ |
| | | public Result insert(@RequestBody ConfigItemWarehouseDto configItemDto) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(configItemDto, AddGroup.class, DefaultGroup.class); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("funCode", "config_item_warehouse"); |
| | | map.put("projectId",configItemDto.getProjectId().toString()); |
| | | map.put("projectId", configItemDto.getProjectId().toString()); |
| | | configItemDto.getConfigItemWarehouse().setCode(sysCodeRuleService.getNewCode(map)); |
| | | Boolean result = configItemWarehouseService.save(configItemDto); |
| | | return Result.ok(); |
| | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody ConfigItemWarehouseDto configItemDto){ |
| | | public Result update(@RequestBody ConfigItemWarehouseDto configItemDto) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(configItemDto, UpdateGroup.class, DefaultGroup.class); |
| | | Boolean result = configItemWarehouseService.save(configItemDto); |
| | |
| | | @DeleteMapping("deleteConfigItem") |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | public Result delete(@RequestBody Long[] ids) { |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | configItemWarehouseService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("exportWarehouseOrder") |
| | | @ApiOperation("打印入库申请单") |
| | | @LogOperation("打印入库申请单") |
| | | public void exportWarehouseOrder(Long id,HttpServletRequest request, HttpServletResponse response) { |
| | | configItemWarehouseService.exportWarehouseOrder(id,request, response); |
| | | public void exportWarehouseOrder(Long id, HttpServletRequest request, HttpServletResponse response,String libraryType) { |
| | | configItemWarehouseService.exportWarehouseOrder(id, request, response,libraryType); |
| | | } |
| | | |
| | | } |