zouyu
12 小时以前 2cf06285f64311722cbf79fd5635b16718635e5e
inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderController.java
@@ -33,6 +33,7 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@RestController
@AllArgsConstructor
@@ -91,6 +92,12 @@
        return Result.success(insOrderService.getInsOrder(orderId));
    }
    @ApiOperation(value = "查询检验下单内容详情列表")
    @PostMapping("/getInsOrderList")
    public Result<?> getInsOrderList(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
        return Result.success(insOrderService.getInsOrderList(insPlaceOrderDto.getSelectOrderIds()));
    }
    @ApiOperation(value = "审核检验单进行状态修改")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class),
@@ -132,44 +139,31 @@
    }
    @ApiOperation(value = "撤销")
    @ApiOperation(value = "撤销未审核订单")
    @PostMapping("/updateStatus")
    public Result<?> updateStatus(@RequestBody Map<String, Object> param) {
        Integer id = (Integer) param.get("id");
        insOrderService.updateStatus(id);
    public Result<?> updateStatus(@RequestBody ProductOrderRevokeDTO revokeDTO) {
        insOrderService.updateStatus(revokeDTO.getId());
        return Result.success();
    }
    //待检的撤销的查询待检项目
    @GetMapping("/selectNoProducts")
    public Result<?> selectNoProducts(Page page, InsProduct insProduct, Integer orderId, String ids) {
        return Result.success(insProductService.selectNoProducts(page, insProduct, orderId, ids));
    public Result<?> selectNoProducts(Page page, ProductOrderRevokeDTO revokeDTO) {
        return Result.success(insProductService.selectNoProducts(page, revokeDTO.getOrderId(), revokeDTO.getRevocationInsProductIds()));
    }
    @ApiOperation(value = "待检的撤销")
    @PostMapping("/updateInspected")
    public Result<?> updateInspected(@RequestBody Map<String, Object> param) {
        Integer orderId = (Integer) param.get("orderId");
        String ids = (String) param.get("ids");
        Integer typeSource = (Integer) param.get("typeSource");
        Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString());
        if (Objects.nonNull(typeSource) && typeSource == 1) {
            ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>()
                    .set(IfsInventoryQuantity::getState, 0)
                    .eq(IfsInventoryQuantity::getId, ifsInventoryId));
            insOrderService.update(null, new LambdaUpdateWrapper<InsOrder>().set(InsOrder::getState, -1).eq(InsOrder::getId, orderId)); // 撤销
        }
        insProductService.updateInspected(orderId, ids);
    public Result<?> updateInspected(@RequestBody ProductOrderRevokeDTO revokeDTO) {
        insProductService.updateInspected(revokeDTO.getOrderId(), revokeDTO.getIds().stream().map(String::valueOf).collect(Collectors.joining(",")));
        return Result.success();
    }
    @ApiOperation(value = "审核待检撤销")
    @PostMapping("/checkUpdate")
    public Result<?> checkUpdate(@RequestBody Map<String, Object> param) {
        Integer orderId = (Integer) param.get("orderId");
        Integer state = (Integer) param.get("state");
        insProductService.checkUpdate(orderId, state);
    public Result<?> checkUpdate(@RequestBody ProductOrderRevokeDTO revokeDTO) {
        insProductService.checkUpdate(revokeDTO.getOrderId(), revokeDTO.getState());
        return Result.success();
    }