|
|
|
@ -23,6 +23,7 @@ import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.desk.basic.constant.BAModuleConst; |
|
|
|
import org.springblade.desk.basic.constant.BAModuleConst; |
|
|
|
@ -40,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Objects; |
|
|
|
@ -63,7 +65,7 @@ public class PlatingAssortmentController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private IPlatingAssortmentService service; |
|
|
|
private IPlatingAssortmentService service; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private IUserClient userClient; |
|
|
|
private IUserClient userClient; |
|
|
|
|
|
|
|
|
|
|
|
@ -95,7 +97,7 @@ public class PlatingAssortmentController extends BladeController { |
|
|
|
platingAssortment = platingAssortment.entrySet().stream() |
|
|
|
platingAssortment = platingAssortment.entrySet().stream() |
|
|
|
.filter(entry -> Objects.nonNull(entry.getValue())) |
|
|
|
.filter(entry -> Objects.nonNull(entry.getValue())) |
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); |
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); |
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<PlatingAssortment> qw = Condition.getQueryWrapper(platingAssortment, PlatingAssortment.class); |
|
|
|
QueryWrapper<PlatingAssortment> qw = Condition.getQueryWrapper(platingAssortment, PlatingAssortment.class); |
|
|
|
// 添加未删除的条件
|
|
|
|
// 添加未删除的条件
|
|
|
|
qw.eq("IS_DELETED", CommonConstant.DELETE_FALSE); |
|
|
|
qw.eq("IS_DELETED", CommonConstant.DELETE_FALSE); |
|
|
|
@ -118,7 +120,7 @@ public class PlatingAssortmentController extends BladeController { |
|
|
|
public R<IPage<PlatingAssortmentVO>> page(PlatingAssortmentVO platingAssortment, Query query) { |
|
|
|
public R<IPage<PlatingAssortmentVO>> page(PlatingAssortmentVO platingAssortment, Query query) { |
|
|
|
// 处理排序字段转换
|
|
|
|
// 处理排序字段转换
|
|
|
|
QueryUtils.convertSortField(query); |
|
|
|
QueryUtils.convertSortField(query); |
|
|
|
|
|
|
|
|
|
|
|
IPage<PlatingAssortmentVO> pagesVO = service.selectPlatingAssortmentPage( |
|
|
|
IPage<PlatingAssortmentVO> pagesVO = service.selectPlatingAssortmentPage( |
|
|
|
Condition.getPage(query), platingAssortment |
|
|
|
Condition.getPage(query), platingAssortment |
|
|
|
); |
|
|
|
); |
|
|
|
@ -149,7 +151,7 @@ public class PlatingAssortmentController extends BladeController { |
|
|
|
qw.eq(PlatingAssortment::getStatus, 1); // 只返回启用的
|
|
|
|
qw.eq(PlatingAssortment::getStatus, 1); // 只返回启用的
|
|
|
|
qw.eq(PlatingAssortment::getIsDeleted, CommonConstant.DELETE_FALSE); |
|
|
|
qw.eq(PlatingAssortment::getIsDeleted, CommonConstant.DELETE_FALSE); |
|
|
|
qw.orderByAsc(PlatingAssortment::getSort, PlatingAssortment::getId); |
|
|
|
qw.orderByAsc(PlatingAssortment::getSort, PlatingAssortment::getId); |
|
|
|
|
|
|
|
|
|
|
|
List<PlatingAssortment> list = service.list(qw); |
|
|
|
List<PlatingAssortment> list = service.list(qw); |
|
|
|
List<PlatingAssortmentVO> listVO = PlatingAssortmentWrapper.build().listVO(list); |
|
|
|
List<PlatingAssortmentVO> listVO = PlatingAssortmentWrapper.build().listVO(list); |
|
|
|
return R.data(listVO); |
|
|
|
return R.data(listVO); |
|
|
|
@ -249,13 +251,38 @@ public class PlatingAssortmentController extends BladeController { |
|
|
|
@Operation(summary = "导出Excel", description = "传入PlatingAssortment") |
|
|
|
@Operation(summary = "导出Excel", description = "传入PlatingAssortment") |
|
|
|
public void exportExcel(@Parameter(hidden = true) @RequestParam Map<String, Object> platingAssortment, |
|
|
|
public void exportExcel(@Parameter(hidden = true) @RequestParam Map<String, Object> platingAssortment, |
|
|
|
BladeUser bladeUser, HttpServletResponse response) { |
|
|
|
BladeUser bladeUser, HttpServletResponse response) { |
|
|
|
|
|
|
|
// 过滤空值
|
|
|
|
|
|
|
|
platingAssortment = platingAssortment.entrySet().stream() |
|
|
|
|
|
|
|
.filter(entry -> Objects.nonNull(entry.getValue())) |
|
|
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); |
|
|
|
|
|
|
|
String descs = null; |
|
|
|
|
|
|
|
if(platingAssortment.get("descs") != null){ |
|
|
|
|
|
|
|
descs = (String) platingAssortment.get("descs"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String ascs = null; |
|
|
|
|
|
|
|
if(platingAssortment.get("ascs") != null){ |
|
|
|
|
|
|
|
ascs = (String) platingAssortment.get("ascs"); |
|
|
|
|
|
|
|
} |
|
|
|
QueryWrapper<PlatingAssortment> qw = Condition.getQueryWrapper(platingAssortment, PlatingAssortment.class); |
|
|
|
QueryWrapper<PlatingAssortment> qw = Condition.getQueryWrapper(platingAssortment, PlatingAssortment.class); |
|
|
|
// 添加未删除的条件
|
|
|
|
// 添加未删除的条件
|
|
|
|
qw.eq("IS_DELETED", CommonConstant.DELETE_FALSE); |
|
|
|
qw.eq("IS_DELETED", CommonConstant.DELETE_FALSE); |
|
|
|
|
|
|
|
if(descs != null) { |
|
|
|
List<PlatingAssortmentExcel> list = service.exportPlatingAssortment(qw); |
|
|
|
qw.orderByDesc(descs); |
|
|
|
ExcelUtil.export(response, "[镀种分类]数据" + DateUtil.time(), |
|
|
|
} |
|
|
|
"[镀种分类]数据表", list, PlatingAssortmentExcel.class); |
|
|
|
if(ascs != null){ |
|
|
|
|
|
|
|
qw.orderByAsc(ascs); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
qw.orderByAsc("NAME"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PlatingAssortment> list = service.list(qw); |
|
|
|
|
|
|
|
List<PlatingAssortmentExcel> excels = new ArrayList<>(); |
|
|
|
|
|
|
|
for(PlatingAssortment entity : list){ |
|
|
|
|
|
|
|
PlatingAssortmentExcel excel = new PlatingAssortmentExcel(); |
|
|
|
|
|
|
|
BeanUtil.copyProperties(entity, excel); |
|
|
|
|
|
|
|
excels.add(excel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ExcelUtil.export(response, "镀种分类" + DateUtil.time(), |
|
|
|
|
|
|
|
"镀种分类", excels, PlatingAssortmentExcel.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|