| package doumeemes.api.ext; | 
|   | 
| import doumeemes.api.BaseController; | 
| import doumeemes.core.annotation.pr.PreventRepeat; | 
| import doumeemes.core.model.ApiResponse; | 
| import doumeemes.core.model.PageWrap; | 
| import doumeemes.core.model.PageData; | 
| import doumeemes.dao.business.model.WTransfer; | 
| import doumeemes.dao.ext.bean.WTransferBean; | 
| import doumeemes.dao.ext.bean.WTransferConfirmBean; | 
| import doumeemes.dao.ext.bean.WTransferRedisCodeBean; | 
| import doumeemes.dao.ext.bean.WTransferRedisBean; | 
| import doumeemes.dao.ext.beanDto.QueryWOutBoundDto; | 
| import doumeemes.dao.ext.beanDto.QueryWTransferDto; | 
| import doumeemes.dao.ext.beanDto.SubmitTransferInDTO; | 
| import doumeemes.dao.ext.beanDto.SubmitTransferOutDTO; | 
| import doumeemes.dao.ext.dto.ScanWTransferExtDTO; | 
| import doumeemes.dao.ext.vo.WOutboundListCountVO; | 
| import doumeemes.dao.ext.vo.WTransferExtListVO; | 
| import doumeemes.dao.ext.vo.WTransferListCountVO; | 
| import doumeemes.service.business.WTransferService; | 
| import doumeemes.service.ext.WTransferExtService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiImplicitParam; | 
| import io.swagger.annotations.ApiImplicitParams; | 
| import io.swagger.annotations.ApiOperation; | 
| import org.apache.shiro.authz.annotation.RequiresPermissions;     | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.validation.annotation.Validated; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| /** | 
|  * 换库单信息接口 | 
|  * @author 江蹄蹄 | 
|  * @date 2022/04/20 10:56 | 
|  */ | 
| @RestController | 
| @RequestMapping("/ext/wTransferExt") | 
| @Api(tags = "换库单信息接口") | 
| public class WTransferExtController extends BaseController { | 
|   | 
|     @Autowired | 
|     private WTransferExtService wTransferExtService; | 
|      | 
|     @Autowired | 
|     private WTransferService wTransferService; | 
|   | 
| //    @PreventRepeat | 
| //    @ApiOperation("新建") | 
| //    @PostMapping("/create") | 
| //    @RequiresPermissions("ext:wtransferext:create") | 
| //    public ApiResponse create(@RequestBody WTransfer wTransfer) { | 
| //        return ApiResponse.success(wTransferService.create(wTransfer)); | 
| //    } | 
| // | 
| //    @ApiOperation("根据ID删除") | 
| //    @GetMapping("/delete/{id}") | 
| //    @RequiresPermissions("ext:wtransferext:delete") | 
| //    public ApiResponse deleteById(@PathVariable Integer id) { | 
| //        wTransferService.deleteById(id); | 
| //        return ApiResponse.success(null); | 
| //    } | 
| // | 
| //    @ApiOperation("批量删除") | 
| //    @GetMapping("/delete/batch") | 
| //    @RequiresPermissions("ext:wtransferext:delete") | 
| //    public ApiResponse deleteByIds(@RequestParam String ids) { | 
| //        String [] idArray = ids.split(","); | 
| //        List<Integer> idList = new ArrayList<>(); | 
| //        for (String id : idArray) { | 
| //            idList.add(Integer.valueOf(id)); | 
| //        } | 
| //        wTransferService.deleteByIdInBatch(idList); | 
| //        return ApiResponse.success(null); | 
| //    } | 
| // | 
| //    @ApiOperation("根据ID修改") | 
| //    @PostMapping("/updateById") | 
| //    @RequiresPermissions("ext:wtransferext:update") | 
| //    public ApiResponse updateById(@RequestBody WTransfer wTransfer) { | 
| //        wTransferService.updateById(wTransfer); | 
| //        return ApiResponse.success(null); | 
| //    } | 
| // | 
| //    @ApiOperation("分页查询") | 
| //    @PostMapping("/page") | 
| //    @RequiresPermissions("ext:wtransferext:query") | 
| //    public ApiResponse<PageData<WTransferExtListVO>> findPage (@RequestBody PageWrap<QueryWTransferExtDTO> pageWrap) { | 
| //        return ApiResponse.success(wTransferExtService.findPage(pageWrap)); | 
| //    } | 
| // | 
| //    @ApiOperation("导出Excel") | 
| //    @PostMapping("/exportExcel") | 
| //    @RequiresPermissions("ext:wtransferext:exportExcel") | 
| //    public void exportExcel (@RequestBody PageWrap<QueryWTransferExtDTO> pageWrap, HttpServletResponse response) { | 
| //        ExcelExporter.build(WTransferExtListVO.class).export(wTransferExtService.findPage(pageWrap).getRecords(), "换库单信息", response); | 
| //    } | 
| // | 
| //    @ApiOperation("根据ID查询") | 
| //    @GetMapping("/{id}") | 
| //    @RequiresPermissions("ext:wtransferext:query") | 
| //    public ApiResponse findById(@PathVariable Integer id) { | 
| //        return ApiResponse.success(wTransferService.findById(id)); | 
| //    } | 
| // | 
|   | 
|   | 
|   | 
|     @PreventRepeat | 
|     @ApiOperation("手动新建转库单 - PC") | 
|     @PostMapping("/create") | 
|     @RequiresPermissions("ext:wtransferext:create") | 
|     public ApiResponse create(@Validated @RequestBody WTransferBean wTransferBean) { | 
|         return wTransferService.saveBean(wTransferBean,getLoginUser()); | 
|     } | 
|   | 
|     @ApiOperation("分页查询 - PC") | 
|     @PostMapping("/page") | 
|     @RequiresPermissions("ext:wtransferext:query") | 
|     public ApiResponse<PageData<WTransferExtListVO>>page(@RequestBody PageWrap<QueryWTransferDto> pageWrap) { | 
|         return ApiResponse.success(wTransferExtService.findListPage(pageWrap)); | 
|     } | 
|   | 
|   | 
|     @ApiOperation("根据ID查询 - PC ") | 
|     @GetMapping("/{id}") | 
|     @RequiresPermissions("ext:wtransferext:query") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "主键" , required = true), | 
|     }) | 
|     public ApiResponse<WTransfer> getBeanById(@PathVariable Integer id) { | 
|         return ApiResponse.success(wTransferService.getBeanById(id)); | 
|     } | 
|   | 
|   | 
|     @ApiOperation("分页查询 - H5") | 
|     @PostMapping("/pageList") | 
|     public ApiResponse<PageData<WTransferExtListVO>>pageList(@RequestBody PageWrap<QueryWTransferDto> pageWrap) { | 
|         return ApiResponse.success(wTransferExtService.findListPage(pageWrap)); | 
|     } | 
|   | 
|   | 
|     @ApiOperation("转库列表统计 - H5") | 
|     @PostMapping("/pageCount") | 
|     @RequiresPermissions("ext:wtransferext:query") | 
|     public ApiResponse<WTransferListCountVO> pageCount (@RequestBody QueryWTransferDto queryWTransferDto) { | 
|         return ApiResponse.success(wTransferExtService.pageCount(queryWTransferDto)); | 
|     } | 
|   | 
|   | 
|     @ApiOperation("单据取消") | 
|     @GetMapping("/cancel") | 
|     @RequiresPermissions("ext:wtransferext:cancel") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "主键" , required = true), | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "detail", value = "取消描述" , required = true), | 
|     }) | 
|     public ApiResponse cancel(@RequestParam Integer id,@RequestParam String detail) { | 
|         return wTransferService.cancel(id,detail,getLoginUser()); | 
|     } | 
|   | 
|     @ApiOperation("备料确认详情页面 - H5 ") | 
|     @GetMapping("/wTransferConfirm") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "转库单主键" , required = true), | 
|     }) | 
|     public ApiResponse<WTransferConfirmBean> wTransferConfirm(@RequestParam Integer id) { | 
|         return wTransferService.wTransferConfirm(id); | 
|     } | 
|   | 
|     @ApiOperation("备料确认 - 接受备料 - H5 ") | 
|     @GetMapping("/acceptWTransfer") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "转库单编码" , required = true), | 
|     }) | 
|     public ApiResponse acceptWTransfer(@RequestParam Integer id) { | 
|         return wTransferService.acceptWTransfer(id,getLoginUser()); | 
|     } | 
|   | 
|   | 
|     @ApiOperation(value = "获取转库单信息", notes = "转库单进行出入库操作 - H5") | 
|     @GetMapping("/wTransferForInOut") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "转库单主键" , required = true), | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "wTransferType", value = "转库单类别 0:转出;1转入" , required = true), | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "optType", value = "操作类别:1 添加 2 移除" , required = false), | 
|             @ApiImplicitParam(paramType = "query", dataType = "String", name = "jsonBean", value = "添加条码类" , required = false) | 
|     }) //, @RequestBody WTransferRedisCodeBean codeBean | 
|     public ApiResponse<WTransferRedisBean> wTransferForInOut(@RequestParam Integer id, @RequestParam Integer wTransferType, Integer optType, String jsonBean) { | 
|         return ApiResponse.success(wTransferService.wTransferForInOut(id,wTransferType,optType,jsonBean)); | 
|     } | 
|   | 
|   | 
|   | 
|     @ApiOperation(value = "提交转库单出入库", notes = "转库单进行出入库提交 - H5") | 
|     @GetMapping("/wTransferForInOutUpload") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "转库单主键" , required = true), | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "wTransferType", value = "转库单类别 0:转出;1转入" , required = true) | 
|     }) | 
|     public ApiResponse wTransferForInOutUpload(@RequestParam Integer id, @RequestParam Integer wTransferType) { | 
|         wTransferService.wTransferForInOutUpload(id,wTransferType,getLoginUser()); | 
|         return ApiResponse.success("操作成功"); | 
|     } | 
|   | 
|     @ApiOperation("转库退回 ") | 
|     @GetMapping("/wTransferReturn") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "转库单主键" , required = true), | 
|     }) | 
|     public ApiResponse wTransferReturn(@RequestParam Integer id) { | 
|         return wTransferService.wTransferReturnForStandard(id,getLoginUser()); | 
|     } | 
|   | 
|   | 
|     @ApiOperation("手工转库 - H5") | 
|     @PostMapping("/scanTransfer") | 
|     public ApiResponse scanTransfer(@RequestBody ScanWTransferExtDTO scanWTransferExtDTO) { | 
|         this.wTransferService.scanTransfer(scanWTransferExtDTO,getLoginUser()); | 
|         return ApiResponse.success("操作成功"); | 
|     } | 
|   | 
|   | 
|     @ApiOperation(value = "测试转库类别", notes = "测试转库类别") | 
|     @GetMapping("/testWarehouse") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(paramType = "query", dataType = "Long", name = "outWarehouseId", value = "出库仓库主键" , required = true), | 
|             @ApiImplicitParam(paramType = "query", dataType = "Long", name = "inWarehouseId", value = "入库仓库主键" , required = true) | 
|     }) | 
|     public ApiResponse<Integer> testWarehouse(@RequestParam Integer outWarehouseId, @RequestParam Integer inWarehouseId) { | 
|         return ApiResponse.success(wTransferService.testWarehouse(outWarehouseId,inWarehouseId)); | 
|     } | 
|   | 
|   | 
|   | 
|     /********************************************************************* 调整业务 开始 *********************************************************************/ | 
|   | 
|     @ApiOperation("转库出库业务 - H5") | 
|     @PostMapping("/transferToOutNew") | 
|     public ApiResponse transferToOutNew(@RequestBody SubmitTransferOutDTO submitTransferOutDTO) { | 
|         this.wTransferService.wTransferForOutUpload(submitTransferOutDTO,getLoginUser()); | 
|         return ApiResponse.success("操作成功"); | 
|     } | 
|   | 
|     @ApiOperation("转库入库业务 - H5") | 
|     @PostMapping("/transferToInNew") | 
|     public ApiResponse transferToInNew(@RequestBody SubmitTransferInDTO submitTransferInDTO) { | 
|         this.wTransferService.wTransferForInUpload(submitTransferInDTO,getLoginUser()); | 
|         return ApiResponse.success("操作成功"); | 
|     } | 
|   | 
|     /********************************************************************* 调整业务 结束 *********************************************************************/ | 
|   | 
| } |