add:
1. add price list
This commit is contained in:
10
doc/sql/menu/pricelist.menu.sql
Normal file
10
doc/sql/menu/pricelist.menu.sql
Normal 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);
|
||||||
@@ -23,23 +23,22 @@ CREATE TABLE `kiosk_category`
|
|||||||
DROP TABLE IF EXISTS `kiosk_price_list`;
|
DROP TABLE IF EXISTS `kiosk_price_list`;
|
||||||
CREATE TABLE `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',
|
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
|
||||||
`category_id` bigint NOT NULL COMMENT 'cid',
|
`category_id` bigint NOT NULL COMMENT 'cid',
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品名称',
|
`shape` int NOT NULL DEFAULT 0 COMMENT '形状',
|
||||||
`category_type` int NOT NULL DEFAULT 1 COMMENT '产品类型 1:单张 2:组合 3:配件',
|
`material` int NOT NULL DEFAULT 0 COMMENT '材质',
|
||||||
`shape` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '形状',
|
`size` int NOT NULL DEFAULT 0 COMMENT '尺寸',
|
||||||
`material` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '材质',
|
`currency` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '货币',
|
||||||
`size` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '尺寸',
|
`price` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '单价',
|
||||||
`price` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '单价',
|
`dept_id` bigint NULL DEFAULT NULL COMMENT '目标部门',
|
||||||
`dept_id` bigint NULL DEFAULT NULL COMMENT '目标部门',
|
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
||||||
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
||||||
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
|
||||||
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
|
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
||||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
`status` int NULL DEFAULT 1 COMMENT '状态',
|
||||||
`status` int NULL DEFAULT 1 COMMENT '状态',
|
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
|
||||||
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
|
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
CHARACTER SET = utf8mb4
|
CHARACTER SET = utf8mb4
|
||||||
@@ -48,17 +47,17 @@ CREATE TABLE `kiosk_price_list`
|
|||||||
DROP TABLE IF EXISTS `kiosk_stickers`;
|
DROP TABLE IF EXISTS `kiosk_stickers`;
|
||||||
CREATE TABLE `kiosk_stickers`
|
CREATE TABLE `kiosk_stickers`
|
||||||
(
|
(
|
||||||
`id` bigint NOT NULL COMMENT '主键',
|
`id` bigint NOT NULL COMMENT '主键',
|
||||||
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
|
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
|
||||||
`link` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '贴纸地址',
|
`link` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '贴纸地址',
|
||||||
`name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '贴纸名称',
|
`name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '贴纸名称',
|
||||||
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
||||||
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
||||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
|
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
|
||||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
||||||
`status` int NULL DEFAULT 1 COMMENT '状态',
|
`status` int NULL DEFAULT 1 COMMENT '状态',
|
||||||
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
|
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
CHARACTER SET = utf8mb4
|
CHARACTER SET = utf8mb4
|
||||||
@@ -92,7 +91,7 @@ CREATE TABLE `kiosk_order`
|
|||||||
`id` bigint NOT NULL COMMENT '主键',
|
`id` bigint NOT NULL COMMENT '主键',
|
||||||
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
|
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
|
||||||
`serial_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单编号',
|
`serial_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单编号',
|
||||||
`user_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户电话',
|
`user_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户电话',
|
||||||
`user_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户邮箱',
|
`user_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户邮箱',
|
||||||
`total_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '总金额',
|
`total_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '总金额',
|
||||||
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
||||||
|
|||||||
@@ -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)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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 );
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -120,7 +120,7 @@ public class KioskServiceImpl implements IKioskApiService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PhotoAttachmentApiVO> photoList() {
|
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 -> {
|
return list.stream().map(photo -> {
|
||||||
PhotoAttachmentApiVO vo = new PhotoAttachmentApiVO();
|
PhotoAttachmentApiVO vo = new PhotoAttachmentApiVO();
|
||||||
vo.setLink(photo.getLink());
|
vo.setLink(photo.getLink());
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class OrderDetailPhotoAttachmentRServiceImpl extends BaseServiceImpl<Orde
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OrderDetailPhotoAttachmentREntity> selectOrderDetailPhotoAttachmentRByOrderDetailId(Long orderDetailId) {
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,13 +120,13 @@ public class PhotoAttachmentServiceImpl extends BaseServiceImpl<PhotoAttachmentM
|
|||||||
OrderDetailVO.Photo vo = new OrderDetailVO.Photo();
|
OrderDetailVO.Photo vo = new OrderDetailVO.Photo();
|
||||||
PhotoAttachmentEntity photo = getById(p.getPhotoId());
|
PhotoAttachmentEntity photo = getById(p.getPhotoId());
|
||||||
vo.setPhoto(photo.getLink());
|
vo.setPhoto(photo.getLink());
|
||||||
if(p.getSnapshot() != null) {
|
if (p.getSnapshot() != null) {
|
||||||
PhotoAttachmentEntity snapshot = getById(p.getSnapshot());
|
PhotoAttachmentEntity snapshot = getById(p.getSnapshot());
|
||||||
vo.setSnapshot(snapshot.getLink());
|
vo.setSnapshot(snapshot.getLink());
|
||||||
}
|
}
|
||||||
List<String> stickersUrls = stickersAttachmentRService.selectStickersUrlByPhotoId(p.getPhotoId());
|
List<String> stickersUrls = stickersAttachmentRService.selectStickersUrlByPhotoId(p.getPhotoId());
|
||||||
vo.setStickers(stickersUrls);
|
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 -> {
|
vo.setTexts(tars.stream().map(t -> {
|
||||||
OrderDetailVO.Text text = new OrderDetailVO.Text();
|
OrderDetailVO.Text text = new OrderDetailVO.Text();
|
||||||
text.setFont(t.getFontName());
|
text.setFont(t.getFontName());
|
||||||
|
|||||||
@@ -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() );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user