| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | } |
| | | |
| | | |
| | | @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(); |
| | | } |
| | | |