|  |  | 
 |  |  | import com.zt.common.validator.group.UpdateGroup; | 
 |  |  | import com.zt.life.modules.configItemOutbound.dto.ConfigItemOutboundDto; | 
 |  |  | import com.zt.life.modules.configItemOutbound.model.ConfigItemOutbound; | 
 |  |  | import com.zt.life.modules.configItemOutbound.model.OutboundConfigItem; | 
 |  |  | import com.zt.life.modules.configItemOutbound.service.ConfigItemOutboundService; | 
 |  |  | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; | 
 |  |  | import com.zt.life.modules.configItemWarehouse.service.WarehouseConfigItemService; | 
 |  |  | 
 |  |  | /** | 
 |  |  |  * config_item_Change | 
 |  |  |  * | 
 |  |  |  * @author zt generator  | 
 |  |  |  * @author zt generator | 
 |  |  |  * @since 1.0.0 2023-11-27 | 
 |  |  |  */ | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/ConfigItemOutbound/ConfigItemOutbound/") | 
 |  |  | @Api(tags="config_item_Change") | 
 |  |  | @RequestMapping("/configItemOutbound/ConfigItemOutbound/") | 
 |  |  | @Api(tags = "config_item_outbound") | 
 |  |  | public class ConfigItemOutboundController { | 
 |  |  |     @Autowired | 
 |  |  |     private ConfigItemOutboundService configItemOutboundService; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private WarehouseConfigItemService configItemService; | 
 |  |  |  | 
 |  |  |     @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<ConfigItemOutbound> page(@ApiIgnore @QueryParam QueryFilter 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<ConfigItemOutbound> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { | 
 |  |  |         List<ConfigItemOutbound> ConfigItemOutbound = configItemOutboundService.page(queryFilter); | 
 |  |  |         return PageResult.ok(ConfigItemOutbound); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @GetMapping("getDto") | 
 |  |  |     @ApiOperation("信息") | 
 |  |  |     public Result<ConfigItemOutboundDto> getDto(Long projectId, Long changeId) { | 
 |  |  |         ConfigItemOutboundDto data = configItemOutboundService.getDto(projectId, changeId); | 
 |  |  |         if (changeId!=null) { | 
 |  |  |             for (WarehouseConfigItem configItem  : data.getConfigOutboundList()) { | 
 |  |  |                 Long configItemId = configItem.getId(); | 
 |  |  |                 OssDto ossDto = sysOssConfigService.getOssByBusiType(configItemId, "config_item_warehouse"); | 
 |  |  |                 if (ossDto != null) { | 
 |  |  |                     configItem.setFiles(ossDto); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     public Result<ConfigItemOutboundDto> getDto(Long projectId, Long outboundId) { | 
 |  |  |         ConfigItemOutboundDto data = configItemOutboundService.getDto(projectId, outboundId); | 
 |  |  |         return Result.ok(data); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PostMapping | 
 |  |  |     @ApiOperation("新增") | 
 |  |  |     @LogOperation("新增") | 
 |  |  |     public Result insert(@RequestBody ConfigItemOutboundDto configItemDto){ | 
 |  |  |     public Result insert(@RequestBody ConfigItemOutboundDto configItemDto) { | 
 |  |  |         //效验数据 | 
 |  |  |         ValidatorUtils.validateEntity(configItemDto, AddGroup.class, DefaultGroup.class); | 
 |  |  |         Map<String, String> map = new HashMap<>(); | 
 |  |  |         map.put("funCode", "config_item_Outbound"); | 
 |  |  |         map.put("projectId",configItemDto.getProjectId().toString()); | 
 |  |  |         map.put("projectId", configItemDto.getProjectId().toString()); | 
 |  |  |         configItemDto.getConfigItemOutbound().setCode(sysCodeRuleService.getNewCode(map)); | 
 |  |  |         Boolean result = configItemOutboundService.save(configItemDto); | 
 |  |  |         return Result.ok(); | 
 |  |  | 
 |  |  |     @PutMapping | 
 |  |  |     @ApiOperation("修改") | 
 |  |  |     @LogOperation("修改") | 
 |  |  |     public Result update(@RequestBody ConfigItemOutboundDto configItemDto){ | 
 |  |  |     public Result update(@RequestBody ConfigItemOutboundDto configItemDto) { | 
 |  |  |         //效验数据 | 
 |  |  |         ValidatorUtils.validateEntity(configItemDto, UpdateGroup.class, DefaultGroup.class); | 
 |  |  |         Boolean result = configItemOutboundService.save(configItemDto); | 
 |  |  | 
 |  |  |     @DeleteMapping("deleteConfigOutbound") | 
 |  |  |     @ApiOperation("删除") | 
 |  |  |     @LogOperation("删除") | 
 |  |  |     public Result delete(@RequestBody Long[] ids){ | 
 |  |  |     public Result delete(@RequestBody Long[] ids) { | 
 |  |  |         //效验数据 | 
 |  |  |         AssertUtils.isArrayEmpty(ids, "id"); | 
 |  |  |         configItemOutboundService.delete(ids); | 
 |  |  | 
 |  |  |  | 
 |  |  |     @GetMapping("getItemList") | 
 |  |  |     @ApiOperation("获取入库配置项列表") | 
 |  |  |     public PageResult<WarehouseConfigItem> getItemList(Long projectId,String ids) { | 
 |  |  |         String type ="outbound_select_id"; | 
 |  |  |         List<WarehouseConfigItem> resultList = configItemService.warehouseConfigList(projectId,ids,type); | 
 |  |  |     public PageResult<WarehouseConfigItem> getItemList(Long projectId, String ids) { | 
 |  |  |         List<WarehouseConfigItem> resultList = configItemService.warehouseConfigList(projectId, ids); | 
 |  |  |         return PageResult.ok(resultList); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @GetMapping("exportConfigOutbound") | 
 |  |  |     @ApiOperation("打印变更申请单") | 
 |  |  |     @LogOperation("打印变更申请单") | 
 |  |  |     @ApiOperation("打印出库申请单") | 
 |  |  |     @LogOperation("打印出库申请单") | 
 |  |  |     public void exportConfigOutbound(Long id, HttpServletRequest request, HttpServletResponse response) { | 
 |  |  |         configItemOutboundService.exportConfigOutbound(id,request, response); | 
 |  |  |         configItemOutboundService.exportConfigOutbound(id, request, response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @GetMapping("outbound") | 
 |  |  |     @ApiOperation("出库") | 
 |  |  |     @LogOperation("出库") | 
 |  |  |     public void downloadFiles(HttpServletResponse response, HttpServletRequest request, Long id) { | 
 |  |  |         configItemOutboundService.downloadFiles(response, request, id); | 
 |  |  |     } | 
 |  |  | } |