|
@@ -12,6 +12,7 @@ import com.management.platform.util.HttpRespMsg;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@@ -160,6 +161,10 @@ public class SalesOrderController {
|
|
|
List<String> splitList = Arrays.asList(idSplit);
|
|
|
List<Integer> idList = splitList.stream().map(s -> Integer.valueOf(s)).collect(Collectors.toList());
|
|
|
List<SalesOrder> orderList = salesOrderService.list(new LambdaQueryWrapper<SalesOrder>().in(SalesOrder::getId, idList));
|
|
|
+ if(orderProductDetailService.count(new LambdaQueryWrapper<OrderProductDetail>().in(OrderProductDetail::getOrderId,idList))>0){
|
|
|
+ msg.setError("存在关联产品的订单,删除失败");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
orderList.forEach(o->{
|
|
|
o.setIsDelete(1);
|
|
|
});
|
|
@@ -187,6 +192,26 @@ public class SalesOrderController {
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description:批量删除产品数据
|
|
|
+ * @Param: [ids]
|
|
|
+ * @return: com.management.platform.util.HttpRespMsg
|
|
|
+ * @Author: yurk
|
|
|
+ * @Date: 2024/5/21
|
|
|
+ */
|
|
|
+ @RequestMapping("/batchDeleteOrder")
|
|
|
+ public HttpRespMsg batchDeleteProduct(String ids){
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
+ if(!StringUtils.isEmpty(ids)){
|
|
|
+ String[] idsSplit = ids.split(",");
|
|
|
+ List<String> splitList = Arrays.asList(idsSplit);
|
|
|
+ List<Integer> idList = splitList.stream().map(i -> Integer.valueOf(i)).collect(Collectors.toList());
|
|
|
+ idList.add(-1);
|
|
|
+ salesOrderService.removeByIds(idList);
|
|
|
+ }
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 恢复订单(假删除 isDelete标记 1-->0)
|