|
|
|
@ -25,6 +25,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.springblade.modules.jinchao.controller; |
|
|
|
package org.springblade.modules.jinchao.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
@ -33,6 +34,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import jakarta.validation.Valid; |
|
|
|
import jakarta.validation.Valid; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.annotation.IsAdmin; |
|
|
|
import org.springblade.core.secure.annotation.IsAdmin; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
@ -40,6 +42,10 @@ import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.modules.jinchao.constant.BaseCol; |
|
|
|
import org.springblade.modules.jinchao.constant.BaseCol; |
|
|
|
|
|
|
|
import org.springblade.modules.jinchao.pojo.entity.OrderEntity; |
|
|
|
|
|
|
|
import org.springblade.modules.jinchao.pojo.entity.OrderProjectProductEntity; |
|
|
|
|
|
|
|
import org.springblade.modules.jinchao.service.IOrderProjectProductService; |
|
|
|
|
|
|
|
import org.springblade.modules.jinchao.service.IOrderService; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -52,6 +58,7 @@ import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
@ -70,6 +77,8 @@ import jakarta.servlet.http.HttpServletResponse; |
|
|
|
public class CatalogController extends BladeController { |
|
|
|
public class CatalogController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
private final ICatalogService catalogService; |
|
|
|
private final ICatalogService catalogService; |
|
|
|
|
|
|
|
private final IOrderProjectProductService orderProjectProductService; |
|
|
|
|
|
|
|
private final IOrderService orderService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* [产品目录] 详情 |
|
|
|
* [产品目录] 详情 |
|
|
|
@ -135,6 +144,26 @@ public class CatalogController extends BladeController { |
|
|
|
if(catalog1 != null && Long.compare(catalog1.getId(),catalog.getId()) != 0){ |
|
|
|
if(catalog1 != null && Long.compare(catalog1.getId(),catalog.getId()) != 0){ |
|
|
|
return R.fail("简称已存在!"); |
|
|
|
return R.fail("简称已存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<OrderEntity> orderList = orderService.list(Wrappers.<OrderEntity>lambdaQuery().in(BaseEntity::getStatus, Arrays.asList(new Integer[]{1,2,3,4}))); |
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(orderList)){ |
|
|
|
|
|
|
|
for(OrderEntity order : orderList){ |
|
|
|
|
|
|
|
List<OrderProjectProductEntity> list1 = orderProjectProductService.list(Wrappers.<OrderProjectProductEntity>lambdaQuery().eq(OrderProjectProductEntity::getCatalogOneId,catalog.getId()).eq(OrderProjectProductEntity::getOrderId,order.getId())); |
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(list1)){ |
|
|
|
|
|
|
|
for(OrderProjectProductEntity orderProjectProduct : list1){ |
|
|
|
|
|
|
|
orderProjectProduct.setCatalogOne(catalog.getName()); |
|
|
|
|
|
|
|
orderProjectProductService.updateById(orderProjectProduct); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<OrderProjectProductEntity> list2 = orderProjectProductService.list(Wrappers.<OrderProjectProductEntity>lambdaQuery().eq(OrderProjectProductEntity::getCatalogTwoId,catalog.getId()).eq(OrderProjectProductEntity::getOrderId,order.getId())); |
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(list2)){ |
|
|
|
|
|
|
|
for(OrderProjectProductEntity orderProjectProduct : list2){ |
|
|
|
|
|
|
|
orderProjectProduct.setCatalogTwo(catalog.getName()); |
|
|
|
|
|
|
|
orderProjectProductService.updateById(orderProjectProduct); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return R.status(catalogService.updateById(catalog)); |
|
|
|
return R.status(catalogService.updateById(catalog)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|