板材库去掉价格

This commit is contained in:
lym
2024-07-19 16:00:47 +08:00
parent e7447c4a8c
commit e0253d3011
13 changed files with 65 additions and 22 deletions
@@ -77,4 +77,25 @@ public interface OrderBodyMapper extends BaseMapperX<OrderBodyDO> {
.eq(OrderBodyDO::getDeleted, deleted)
.eq(OrderBodyDO::getOrganId, organId)));
}
// 按照房间名称查询
default List<OrderBodyDO> selectByRoomName(Long orderId, String roomName,
Long organId, Integer deleted){
return selectList(new LambdaUpdateWrapper<OrderBodyDO>()
.eq(OrderBodyDO::getOrderId, orderId)
.eq(OrderBodyDO::getRoomName, roomName)
.eq(OrderBodyDO::getDeleted, deleted)
.eq(OrderBodyDO::getOrganId, organId));
}
// 按照房间id和柜体名称查询
default List<OrderBodyDO> selectByRoomIdAndBodyName(Long orderId, Long roomId,
String bodyName, Long organId, Integer deleted){
return selectList(new LambdaUpdateWrapper<OrderBodyDO>()
.eq(OrderBodyDO::getOrderId, orderId)
.eq(OrderBodyDO::getRoomId, roomId)
.eq(OrderBodyDO::getName, bodyName)
.eq(OrderBodyDO::getDeleted, deleted)
.eq(OrderBodyDO::getOrganId, organId));
}
}
@@ -43,9 +43,33 @@ public interface OrderGroupMapper extends BaseMapperX<OrderGroupDO> {
.eq(OrderGroupDO::getBodyId, id)
.eq(OrderGroupDO::getOrganId, organId));
}
default int deletedById(Long id, Long organId) {
return delete(new LambdaUpdateWrapper<OrderGroupDO>()
.eq(OrderGroupDO::getBodyId, id)
.eq(OrderGroupDO::getOrganId, organId));
}
// 通过柜体id和加工组类型名称查询加工组
default List<OrderGroupDO> selectByRoomIdAndGroupTypeName(Long orderId, Long bodyId,
String groupTypeName, Long organId, Integer deleted) {
return selectList(new LambdaUpdateWrapper<OrderGroupDO>()
.eq(OrderGroupDO::getOrderId, orderId)
.eq(OrderGroupDO::getBodyId, bodyId)
.eq(OrderGroupDO::getGroupTypeName, groupTypeName)
.eq(OrderGroupDO::getOrganId, organId)
.eq(OrderGroupDO::getDeleted, deleted));
}
// 通过柜体id和加工组类型id加工组名称名称查询加工组
default List<OrderGroupDO> selectByRoomIdAndGroupTypeIdAndGroupName(Long orderId, Long bodyId,
Long groupTypeId, String groupName, Long organId, Integer deleted) {
return selectList(new LambdaUpdateWrapper<OrderGroupDO>()
.eq(OrderGroupDO::getOrderId, orderId)
.eq(OrderGroupDO::getBodyId, bodyId)
.eq(OrderGroupDO::getGroupTypeId, groupTypeId)
.eq(OrderGroupDO::getName, groupName)
.eq(OrderGroupDO::getOrganId, organId)
.eq(OrderGroupDO::getDeleted, deleted));
}
}
@@ -300,7 +300,6 @@ public class OrderServiceImpl implements OrderService {
public Integer orderCount() {
// 角色判断
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
System.out.println("loginUser " + loginUser);
// 数据查询
if (loginUser.getIsSupAdmin()){
return orderMapper.selectOrderCount();
@@ -758,7 +757,7 @@ public class OrderServiceImpl implements OrderService {
@Override
@Transactional(rollbackFor = Exception.class)
public void importExcelData(OrderDO orderDO, List<?> list, Integer index) {
if (index == 0){
if (index == null || index == 0){
orderDO.setId((Long) snowFlakeGenerator.nextId(null));
orderMapper.insert(orderDO);
}
@@ -163,9 +163,9 @@ public class ExcelTypeRealize {
excelVO -> excelVO.getSynthesisTypeName() != null ? excelVO.getSynthesisTypeName() : " ",
Collectors.toList()
));
Long groupTypeId = (Long) snowFlakeGenerator.nextId(null);
synthesisCollect.forEach((synthesisTypeName, listSynthesis) -> {
Long groupTypeId = (Long) snowFlakeGenerator.nextId(null);
// 加工组名称为条件进行分组
Map<String, List<OrderPlateImportExcelVO>> combinationNameCollect = listSynthesis.stream()
.collect(Collectors.groupingBy(
@@ -177,7 +177,7 @@ public class ExcelTypeRealize {
final Double[] plateCountByCombination = {0.0};
Long groupId = (Long) snowFlakeGenerator.nextId(null);
OrderGroupDO orderGroupDO = OrderGroupDO.builder().id(groupId).orderId(orderId).organId(organId).bodyId(bodyId)
.groupTypeId(groupTypeId).groupTypeName(synthesisTypeName).name(combinationName != " " ? combinationName : synthesisTypeName).width(0.0).height(0.0)
.groupTypeId(groupTypeId).groupTypeName(synthesisTypeName).name(!Objects.equals(combinationName, " ") ? combinationName : synthesisTypeName).width(0.0).height(0.0)
.depth(0.0).multiNum(0).plateNum(0).unregularNum(0).filename("").remark("").build();
listCombinationName.forEach(combination -> {
@@ -114,9 +114,9 @@ public class PlateController {
// 手动创建导出 demo
List<PlateImportExcelVO> list = Arrays.asList(
PlateImportExcelVO.builder().goodsId("SP1123456").goodsName("xixih").material("颗粒板").width(String.valueOf(1212.3)).height(String.valueOf(12131.6))
.thickness(String.valueOf(0.2)).brand("鹅厂").spec("大厂").remark("测试").price(String.valueOf(33333.2)).color("黑色").texture("").build(),
.thickness(String.valueOf(0.2)).brand("鹅厂").spec("大厂").remark("测试").color("黑色").texture("").build(),
PlateImportExcelVO.builder().goodsId("SP1123457").goodsName("2L").material("yuanma@cf.com").width(String.valueOf(21.6)).height(String.valueOf(12231.6))
.thickness(String.valueOf(5.3)).brand("kkkkkk").spec("大厂").remark("测试").price(String.valueOf(333.555)).color("黑色").texture("").build()
.thickness(String.valueOf(5.3)).brand("kkkkkk").spec("大厂").remark("测试").color("黑色").texture("").build()
);
// 输出
ExcelUtils.write(response, "板材导入模板.xlsx", "板材列表", PlateImportExcelVO.class, list);
@@ -51,9 +51,9 @@ public class PlateImportExcelVO {
@NotEmpty(message = "厚度不能为空")
private String thickness;
@ExcelProperty("价格")
@NotEmpty(message = "价格不能为空")
private String price;
// @ExcelProperty("价格")
// @NotEmpty(message = "价格不能为空")
// private String price;
@ExcelProperty("品牌")
@NotEmpty(message = "品牌不能为空")
@@ -42,8 +42,8 @@ public class PlatePageReqVO extends PageParam {
@Schema(description = "厚度")
private Double thickness;
@Schema(description = "价格", example = "3380")
private Double price;
// @Schema(description = "价格", example = "3380")
// private Double price;
@Schema(description = "品牌")
private String brand;
@@ -33,7 +33,7 @@ public class PlateRespVO {
@Schema(description = "纹理", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("纹理")
private String texture;
private Boolean texture;
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("宽度")
@@ -47,9 +47,9 @@ public class PlateRespVO {
@ExcelProperty("厚度")
private Double thickness;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
@ExcelProperty("价格")
private Double price;
// @Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
// @ExcelProperty("价格")
// private Double price;
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("品牌")
@@ -44,8 +44,8 @@ public class PlateSaveReqVO {
@NotNull(message = "厚度不能为空")
private Double thickness;
@Schema(description = "价格", example = "3380")
private Double price;
// @Schema(description = "价格", example = "3380")
// private Double price;
@Schema(description = "品牌")
private String brand;
@@ -60,7 +60,7 @@ public class PlateDO extends BaseDO {
/**
* 价格
*/
private Double price;
// private Double price;
/**
* 品牌
*/
@@ -33,7 +33,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
.likeIfPresent(PlateDO::getBrand, reqVO.getBrand())
.likeIfPresent(PlateDO::getSpec, reqVO.getSpec())
.likeIfPresent(PlateDO::getRemark, reqVO.getRemark())
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
// .eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
.eqIfPresent(PlateDO::getTexture, reqVO.getTexture())
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime());
@@ -35,7 +35,7 @@ public final class PlateExcelListener<T> extends AnalysisEventListener<PlateImpo
checkData(data.getHeight(),"高度",data);
checkData(data.getWidth(),"宽度",data);
checkData(data.getThickness(),"厚度",data);
checkData(data.getPrice(),"价格",data);
// checkData(data.getPrice(),"价格",data);
checkTexture(data.getTexture(),"纹理",data);
if (data.getResult() != null)
data.setResult(data.getResult().replace("null,", ""));
@@ -20,8 +20,7 @@
create_time,
updater,
update_time,
deleted,
price
deleted
FROM
plate
where organ_id = #{organId} and id = #{id} and deleted = 0