| | |
| | | package com.ruoyi.inspect.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.*; |
| | | import com.ruoyi.basic.dto.IfsInventoryQuantityCheckDto; |
| | | import com.ruoyi.basic.dto.IfsInventoryQuantityDto; |
| | | import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; |
| | | import com.ruoyi.basic.pojo.IfsInventoryQuantity; |
| | | import com.ruoyi.common.annotation.PersonalScope; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.enums.OrderType; |
| | | import com.ruoyi.common.utils.WxCpUtils; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.inspect.dto.InsPlaceOrderDto; |
| | | import com.ruoyi.inspect.dto.OrderSplitDTO; |
| | | import com.ruoyi.inspect.dto.SampleProductDto; |
| | | import com.ruoyi.inspect.pojo.InsOrder; |
| | | import com.ruoyi.inspect.pojo.RawMaterialOrderTemplate; |
| | | import com.ruoyi.inspect.service.InsOrderService; |
| | | import com.ruoyi.inspect.service.RawMaterialOrderService; |
| | | import com.ruoyi.inspect.service.RawMaterialOrderTemplateService; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.common.utils.WxCpUtils; |
| | | import com.ruoyi.inspect.dto.CopperInsOrderDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import java.io.File; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @Author zhuo |
| | |
| | | @PostMapping("/inspectionReport") |
| | | public Result<?> inspectionReport(@RequestBody Map<String, Object> param) { |
| | | List<Long> ids = (List<Long>) param.get("ids"); |
| | | return Result.success(rawMaterialOrderService.inspectionReport(ids)); |
| | | String orderType = Objects.nonNull(param.get("orderType"))?param.get("orderType").toString():""; |
| | | if(!OrderType.validateValue(orderType)){ |
| | | throw new ErrorException("批量报检失败,非法的销售订单分类枚举"); |
| | | } |
| | | return Result.success(rawMaterialOrderService.inspectionReport(ids,orderType)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "撤销报检") |
| | | @PostMapping("/revokeInspectionReport") |
| | | public Result<?> revokeInspectionReport(@RequestBody Map<String, Object> param) { |
| | | Long id = (Long) param.get("id"); |
| | | Long id = Long.parseLong(param.get("id").toString()); |
| | | return Result.success(rawMaterialOrderService.revokeInspectionReport(id)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "报检") |
| | | @PostMapping("/inspectionReportOne") |
| | | public Result<?> inspectionReportOne(@RequestBody IfsInventoryQuantity ifsInventoryQuantity) { |
| | | |
| | | return Result.success(rawMaterialOrderService.inspectionReportOne(ifsInventoryQuantity)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "原材料撤销下单") |
| | | @GetMapping("/repealRawOrder") |
| | | public Result<?> repealRawOrder(@RequestBody Map<String, Object> param){ |
| | | Long ifsInventoryId = (Long) param.get("ifsInventoryId"); |
| | | Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); |
| | | return Result.success(rawMaterialOrderService.repealRawOrder(ifsInventoryId)); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "仓库报检查询") |
| | | @GetMapping("/getWarehouseSubmit") |
| | | public Result getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) throws Exception { |
| | | public Result getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) { |
| | | return Result.success(rawMaterialOrderService.getWarehouseSubmit(page, ifsInventoryQuantity)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "原材料下单放行免检") |
| | | @PostMapping("/rawOrderRelease") |
| | | public Result<?> rawOrderRelease(@RequestBody Map<String, Object> param){ |
| | | Long ifsInventoryId = (Long) param.get("ifsInventoryId"); |
| | | Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); |
| | | String partDetail = (String) param.get("partDetail"); |
| | | return Result.success(rawMaterialOrderService.rawOrderRelease(ifsInventoryId, partDetail)); |
| | | } |
| | |
| | | @PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')") |
| | | @GetMapping("/getIfsByAll") |
| | | public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){ |
| | | ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); |
| | | return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/getIfsByFinish") |
| | | public Result getIfsByFinish(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) throws Exception { |
| | | ifsInventoryQuantityDto.setIsFinish(1); |
| | | ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); |
| | | return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "让步放行") |
| | | @PostMapping("/concessionRelease") |
| | | public Result<?> concessionRelease(@RequestBody Map<String, Object> param){ |
| | | Long ifsInventoryId = (Long) param.get("ifsInventoryId"); |
| | | Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); |
| | | return Result.success(rawMaterialOrderService.concessionRelease(ifsInventoryId)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "提前入库") |
| | | @PostMapping("/advancedGodown") |
| | | public Result<?> advancedGodown(@RequestBody Map<String, Object> param){ |
| | | Long ifsInventoryId = (Long) param.get("ifsInventoryId"); |
| | | Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); |
| | | return Result.success(rawMaterialOrderService.advancedGodown(ifsInventoryId)); |
| | | } |
| | | |
| | |
| | | return Result.success(rawMaterialOrderService.confirmSplitOrder(orderSplitDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 根据ifsId查询下单数量 |
| | | */ |
| | | @ApiOperation(value = "根据ifsId查询下单数量") |
| | | @GetMapping("/getOrderCountByIfsId/{ifsId}") |
| | | public Result getOrderCountByIfsId(@PathVariable("ifsId") Long ifsId){ |
| | | return Result.success(rawMaterialOrderService.getOrderCountByIfsId(ifsId)); |
| | | } |
| | | |
| | | } |