1. add price list
This commit is contained in:
2025-10-13 18:22:57 +08:00
parent 5b909080e9
commit 4cd341e0a9
14 changed files with 666 additions and 33 deletions

View File

@@ -0,0 +1,10 @@
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('1977594758657921025', '1123598815738675201', 'priceList', '自助终端价格表', 'menu', '/kiosk/priceList', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('1977594758657921026', '1977594758657921025', 'priceList_add', '新增', 'add', '/kiosk/priceList/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('1977594758657921027', '1977594758657921025', 'priceList_edit', '修改', 'edit', '/kiosk/priceList/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('1977594758657921028', '1977594758657921025', 'priceList_delete', '删除', 'delete', '/api/kiosk/priceList/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('1977594758657921029', '1977594758657921025', 'priceList_view', '查看', 'view', '/kiosk/priceList/view', 'file-text', 4, 2, 2, 1, NULL, 0);

View File

@@ -23,14 +23,13 @@ CREATE TABLE `kiosk_category`
DROP TABLE IF EXISTS `kiosk_price_list`;
CREATE TABLE `kiosk_price_list`
(
`id` bigint NOT NULL COMMENT '主键',
`id` bigint AUTO_INCREMENT NOT NULL COMMENT '主键',
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`category_id` bigint NOT NULL COMMENT 'cid',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`category_type` int NOT NULL DEFAULT 1 COMMENT '产品类型 1:单张 2:组合 3:配件',
`shape` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '形状',
`material` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '材质',
`size` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '尺寸',
`shape` int NOT NULL DEFAULT 0 COMMENT '形状',
`material` int NOT NULL DEFAULT 0 COMMENT '材质',
`size` int NOT NULL DEFAULT 0 COMMENT '尺寸',
`currency` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '货币',
`price` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '单价',
`dept_id` bigint NULL DEFAULT NULL COMMENT '目标部门',
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',

View File

@@ -0,0 +1,151 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.kiosk.pojo.entity.PriceListEntity;
import org.springblade.modules.kiosk.pojo.vo.PriceListVO;
import org.springblade.modules.kiosk.wrapper.PriceListWrapper;
import org.springblade.modules.kiosk.service.IPriceListService;
import org.springblade.core.boot.ctrl.BladeController;
import java.util.Map;
/**
* 自助终端价格表 控制器
*
* @author Ray
* @since 2025-10-13
*/
@RestController
@AllArgsConstructor
@RequestMapping("kiosk/price-list")
@Tag(name = "自助终端价格表", description = "自助终端价格表接口")
public class PriceListController extends BladeController {
private final IPriceListService priceListService;
/**
* 自助终端价格表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入priceList")
public R<PriceListVO> detail(PriceListEntity priceList) {
PriceListEntity detail = priceListService.getOne(Condition.getQueryWrapper(priceList));
return R.data(PriceListWrapper.build().entityVO(detail));
}
/**
* 自助终端价格表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入priceList")
public R<IPage<PriceListVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> priceList, Query query) {
IPage<PriceListEntity> pages = priceListService.page(Condition.getPage(query), Condition.getQueryWrapper(priceList, PriceListEntity.class));
return R.data(PriceListWrapper.build().pageVO(pages));
}
/**
* 自助终端价格表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入priceList")
public R<IPage<PriceListVO>> page(PriceListVO priceList, Query query) {
IPage<PriceListVO> pages = priceListService.selectPriceListPage(Condition.getPage(query), priceList);
return R.data(pages);
}
/**
* 自助终端价格表 新增
*/
@PreAuth("hasAnyRole('administrator', 'admin', 'manager')")
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入priceList")
public R save(@Valid @RequestBody PriceListEntity priceList) {
return R.status(priceListService.save(priceList));
}
/**
* 自助终端价格表 修改
*/
@PreAuth("hasAnyRole('administrator', 'admin', 'manager')")
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入priceList")
public R update(@Valid @RequestBody PriceListEntity priceList) {
return R.status(priceListService.updateById(priceList));
}
/**
* 自助终端价格表 新增或修改
*/
@PreAuth("hasAnyRole('administrator', 'admin', 'manager')")
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入priceList")
public R submit(@Valid @RequestBody PriceListEntity priceList) {
return R.status(priceListService.saveOrUpdate(priceList));
}
/**
* 自助终端价格表 删除
*/
@PreAuth("hasAnyRole('administrator', 'admin', 'manager')")
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(priceListService.deleteLogic(Func.toLongList(ids)));
}
/**
* 自助终端价格表 初始化
*/
@PreAuth("hasAnyRole('administrator', 'admin', 'manager')")
@PostMapping("/init-price")
@ApiOperationSupport(order = 8)
@Operation(summary = "初始化", description = "传入id")
public R initPrice(@Parameter(description = "deptId", required = true) @RequestParam String id) {
return R.status(priceListService.initPrice(Func.toLong(id)));
}
}

View File

@@ -0,0 +1,53 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.mapper;
import org.springblade.modules.kiosk.pojo.entity.PriceListEntity;
import org.springblade.modules.kiosk.pojo.vo.PriceListVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* 自助终端价格表 Mapper 接口
*
* @author Ray
* @since 2025-10-13
*/
public interface PriceListMapper extends BaseMapper<PriceListEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param priceList 查询参数
* @return List<PriceListVO>
*/
List<PriceListVO> selectPriceListPage(IPage page, PriceListVO priceList);
boolean initByCrossJoin(String tenantId, Long targetDept, Long deptId, Long userId );
}

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.kiosk.mapper.PriceListMapper">
<!-- 通用查询映射结果 -->
<resultMap id="priceListResultMap" type="org.springblade.modules.kiosk.pojo.entity.PriceListEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="category_id" property="categoryId"/>
<result column="name" property="name"/>
<result column="category_type" property="categoryType"/>
<result column="shape" property="shape"/>
<result column="material" property="material"/>
<result column="size" property="size"/>
<result column="currency" property="currency"/>
<result column="price" property="price"/>
<result column="dept_id" property="deptId"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<select id="selectPriceListPage" resultMap="priceListResultMap">
select * from kiosk_price_list where is_deleted = 0 and dept_id = #{priceList.deptId}
</select>
<insert id="initByCrossJoin">
INSERT INTO kiosk_price_list (category_id, shape, material, size, dept_id, tenant_id, create_user, create_dept, create_time,update_user, update_time)
SELECT c.id AS category_id,
CAST(sh.dict_key AS SIGNED) AS shape,
CAST(m.dict_key AS SIGNED) AS material,
CAST(s.dict_key AS SIGNED) AS size,
#{targetDept} AS dept_id,
#{tenantId} AS tenant_id,
#{userId},
#{deptId},
NOW(),
#{userId},
NOW()
FROM kiosk_category c
CROSS JOIN blade_dict_biz sh
ON sh.code = 'shape_type' AND sh.tenant_id = #{tenantId} and sh.parent_id != 0
CROSS JOIN blade_dict_biz m
ON m.code = 'material_type' AND m.tenant_id = #{tenantId} and m.parent_id != 0
CROSS JOIN blade_dict_biz s ON s.code = 'size_type' AND s.tenant_id = #{tenantId} and s.parent_id != 0
WHERE c.is_deleted = 0
AND c.tenant_id = #{tenantId};
</insert>
</mapper>

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.pojo.dto;
import org.springblade.modules.kiosk.pojo.entity.PriceListEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 自助终端价格表 数据传输对象实体类
*
* @author Ray
* @since 2025-10-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class PriceListDTO extends PriceListEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,95 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 自助终端价格表 实体类
*
* @author Ray
* @since 2025-10-13
*/
@Data
@TableName("kiosk_price_list")
@Schema(description = "PriceList对象")
@EqualsAndHashCode(callSuper = true)
public class PriceListEntity extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@TableId(
value = "id",
type = IdType.AUTO
)
private Long id;
/**
* cid
*/
@Schema(description = "cid")
private Long categoryId;
/**
* 形状
*/
@Schema(description = "形状")
private Integer shape;
/**
* 材质
*/
@Schema(description = "材质")
private Integer material;
/**
* 尺寸
*/
@Schema(description = "尺寸")
private Integer size;
/**
* 单价
*/
@Schema(description = "单价")
private String currency;
/**
* 单价
*/
@Schema(description = "单价")
private BigDecimal price;
/**
* 目标部门
*/
@Schema(description = "目标部门")
private Long deptId;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.pojo.vo;
import org.springblade.modules.kiosk.pojo.entity.PriceListEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 自助终端价格表 视图实体类
*
* @author Ray
* @since 2025-10-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class PriceListVO extends PriceListEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.service;
import org.springblade.modules.kiosk.pojo.entity.PriceListEntity;
import org.springblade.modules.kiosk.pojo.vo.PriceListVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
/**
* 自助终端价格表 服务类
*
* @author Ray
* @since 2025-10-13
*/
public interface IPriceListService extends BaseService<PriceListEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param priceList 查询参数
* @return IPage<PriceListVO>
*/
IPage<PriceListVO> selectPriceListPage(IPage<PriceListVO> page, PriceListVO priceList);
boolean initPrice(Long deptId);
}

View File

@@ -120,7 +120,7 @@ public class KioskServiceImpl implements IKioskApiService {
@Override
public List<PhotoAttachmentApiVO> photoList() {
List<PhotoAttachmentEntity> list = photoAttachmentService.list(Wrappers.<PhotoAttachmentEntity>query().lambda().eq(PhotoAttachmentEntity::getCreateUser, AuthUtil.getUserId()).eq(PhotoAttachmentEntity::getStatus, 1));
List<PhotoAttachmentEntity> list = photoAttachmentService.list(Wrappers.<PhotoAttachmentEntity>lambdaQuery().eq(PhotoAttachmentEntity::getIsDeleted, 0).eq(PhotoAttachmentEntity::getCreateUser, AuthUtil.getUserId()).eq(PhotoAttachmentEntity::getStatus, 1));
return list.stream().map(photo -> {
PhotoAttachmentApiVO vo = new PhotoAttachmentApiVO();
vo.setLink(photo.getLink());

View File

@@ -52,7 +52,7 @@ public class OrderDetailPhotoAttachmentRServiceImpl extends BaseServiceImpl<Orde
@Override
public List<OrderDetailPhotoAttachmentREntity> selectOrderDetailPhotoAttachmentRByOrderDetailId(Long orderDetailId) {
return list(Wrappers.<OrderDetailPhotoAttachmentREntity>lambdaQuery().eq(OrderDetailPhotoAttachmentREntity::getDetailId, orderDetailId));
return list(Wrappers.<OrderDetailPhotoAttachmentREntity>lambdaQuery().eq(OrderDetailPhotoAttachmentREntity::getIsDeleted, 0).eq(OrderDetailPhotoAttachmentREntity::getDetailId, orderDetailId));
}
}

View File

@@ -126,7 +126,7 @@ public class PhotoAttachmentServiceImpl extends BaseServiceImpl<PhotoAttachmentM
}
List<String> stickersUrls = stickersAttachmentRService.selectStickersUrlByPhotoId(p.getPhotoId());
vo.setStickers(stickersUrls);
List<TextAttachmentREntity> tars = textAttachmentRService.list(Wrappers.<TextAttachmentREntity>lambdaQuery().eq(TextAttachmentREntity::getPhotoId, p.getPhotoId()));
List<TextAttachmentREntity> tars = textAttachmentRService.list(Wrappers.<TextAttachmentREntity>lambdaQuery().eq(TextAttachmentREntity::getIsDeleted, 0).eq(TextAttachmentREntity::getPhotoId, p.getPhotoId()));
vo.setTexts(tars.stream().map(t -> {
OrderDetailVO.Text text = new OrderDetailVO.Text();
text.setFont(t.getFontName());

View File

@@ -0,0 +1,71 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.service.impl;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.kiosk.pojo.entity.PriceListEntity;
import org.springblade.modules.kiosk.pojo.vo.PriceListVO;
import org.springblade.modules.kiosk.mapper.PriceListMapper;
import org.springblade.modules.kiosk.service.IPriceListService;
import org.springblade.modules.system.pojo.entity.Dept;
import org.springblade.modules.system.service.IDeptService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.Objects;
/**
* 自助终端价格表 服务实现类
*
* @author Ray
* @since 2025-10-13
*/
@Slf4j
@Service
@AllArgsConstructor
public class PriceListServiceImpl extends BaseServiceImpl<PriceListMapper, PriceListEntity> implements IPriceListService {
private final IDeptService deptService;
@Override
public IPage<PriceListVO> selectPriceListPage(IPage<PriceListVO> page, PriceListVO priceList) {
return page.setRecords(baseMapper.selectPriceListPage(page, priceList));
}
@Override
public boolean initPrice(Long deptId) {
Dept dept = deptService.getById(deptId);
if (dept == null || !Objects.equals(dept.getTenantId(), AuthUtil.getTenantId())) {
throw new ServiceException("Invalid parameters");
}
return baseMapper.initByCrossJoin(AuthUtil.getTenantId(), deptId, Long.valueOf(AuthUtil.getDeptId()), AuthUtil.getUserId() );
}
}

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.kiosk.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.kiosk.pojo.entity.PriceListEntity;
import org.springblade.modules.kiosk.pojo.vo.PriceListVO;
import java.util.Objects;
/**
* 自助终端价格表 包装类,返回视图层所需的字段
*
* @author Ray
* @since 2025-10-13
*/
public class PriceListWrapper extends BaseEntityWrapper<PriceListEntity, PriceListVO> {
public static PriceListWrapper build() {
return new PriceListWrapper();
}
@Override
public PriceListVO entityVO(PriceListEntity priceList) {
PriceListVO priceListVO = Objects.requireNonNull(BeanUtil.copyProperties(priceList, PriceListVO.class));
//User createUser = UserCache.getUser(priceList.getCreateUser());
//User updateUser = UserCache.getUser(priceList.getUpdateUser());
//priceListVO.setCreateUserName(createUser.getName());
//priceListVO.setUpdateUserName(updateUser.getName());
return priceListVO;
}
}