修改租户限制场站创建数量,增加新的数据库sql

This commit is contained in:
yuyang 2022-03-29 09:15:44 +08:00
parent 3abcf2fd0b
commit 3e9fe759a2
3 changed files with 66 additions and 2 deletions

View File

@ -1297,3 +1297,66 @@ ALTER TABLE `xhpc_customers`
ADD COLUMN `commission_type` INT(4) NULL COMMENT '0总金额提成 1服务费提成 2电量抽成' AFTER `tenant_id`; ADD COLUMN `commission_type` INT(4) NULL COMMENT '0总金额提成 1服务费提成 2电量抽成' AFTER `tenant_id`;
--------------------------v2.0-----------------------
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `sys_oper_log` MODIFY COLUMN `method` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '方法名称' AFTER `business_type`;
ALTER TABLE `t_iccard_device` ADD COLUMN `corpName` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '运营商名称' AFTER `serialNumber`;
ALTER TABLE `t_iccard_info` DROP INDEX `userIndex`;
ALTER TABLE `xhpc_activity_cash` ADD COLUMN `activity_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '活动名称' AFTER `activity_id`;
ALTER TABLE `xhpc_activity_cash` ADD COLUMN `receive_count` int(4) NULL DEFAULT NULL COMMENT '领取次数' AFTER `end_time`;
ALTER TABLE `xhpc_activity_cash` ADD COLUMN `cus_user_list` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'B端用户ID列表-1表示全部' AFTER `com_user_list`;
ALTER TABLE `xhpc_activity_cash` DROP COLUMN `b_user_list`;
ALTER TABLE `xhpc_activity_discount` ADD COLUMN `activity_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '活动名称' AFTER `activity_id`;
ALTER TABLE `xhpc_activity_discount` ADD COLUMN `template_id` int(11) NULL DEFAULT NULL COMMENT '模板ID' AFTER `activity_name`;
ALTER TABLE `xhpc_activity_discount` ADD COLUMN `cus_user_list` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'B端用户列表(以逗号分隔,-1表示全部用户)' AFTER `com_user_list`;
ALTER TABLE `xhpc_activity_discount` ADD COLUMN `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间' AFTER `tenant_id`;
ALTER TABLE `xhpc_activity_discount` ADD COLUMN `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间' AFTER `start_time`;
ALTER TABLE `xhpc_activity_discount` MODIFY COLUMN `status` smallint(2) NULL DEFAULT NULL COMMENT '状态0-编辑1-提交待审核2-审核失败3-审核通过4-已失效)' AFTER `end_time`;
ALTER TABLE `xhpc_activity_discount` DROP COLUMN `b_user_list`;
ALTER TABLE `xhpc_activity_internet` ADD COLUMN `service_price` decimal(10,2) NULL DEFAULT NULL COMMENT '默认服务费' AFTER `compute_formula`;
ALTER TABLE `xhpc_activity_internet` MODIFY COLUMN `compute_formula` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '默认计算公式' AFTER `compute_type`;
ALTER TABLE `xhpc_activity_template` ADD COLUMN `activity_template_id` int(11) NOT NULL COMMENT '模板ID' FIRST ;
ALTER TABLE `xhpc_activity_template` ADD COLUMN `background_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '活动背景图' AFTER `mini_display`;
ALTER TABLE `xhpc_activity_template` MODIFY COLUMN `activity_temlpate_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '模板ID' FIRST ;
ALTER TABLE `xhpc_activity_template` DROP COLUMN `activity_temlpate_id`;
ALTER TABLE `xhpc_activity_template` DROP COLUMN `backgroud_url`;
ALTER TABLE `xhpc_charge_order` MODIFY COLUMN `charging_degree` decimal(10,4) NULL DEFAULT NULL COMMENT '充电度数' AFTER `charging_time`;
CREATE INDEX `Index 2` ON `xhpc_device_message`(`charge_order_no`) USING BTREE ;
CREATE INDEX `Index 3` ON `xhpc_device_message`(`serial_number`) USING BTREE ;
CREATE INDEX `Index 4` ON `xhpc_device_message`(`create_time`) USING BTREE ;
ALTER TABLE `xhpc_history_order` MODIFY COLUMN `total_power` double(10,4) NULL DEFAULT NULL COMMENT '电量' AFTER `stop_reason_evcs`;
ALTER TABLE `xhpc_invoice` MODIFY COLUMN `status` int(2) NULL DEFAULT NULL COMMENT '开票状态0表示未开票1表示已经开票2表示不开票' AFTER `create_time`;
CREATE INDEX `Index 2` ON `xhpc_message`(`charge_order_no`) USING BTREE ;
ALTER TABLE `xhpc_statistics_station` MODIFY COLUMN `charging_degree` decimal(10,4) NULL DEFAULT NULL COMMENT '电量' AFTER `statistics_station_id`;
ALTER TABLE `xhpc_statistics_time_interval` MODIFY COLUMN `charging_degree` decimal(10,4) NULL DEFAULT NULL COMMENT '电量' AFTER `status`;
ALTER TABLE `xhpc_terminal` MODIFY COLUMN `tenant_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `search_value`;
ALTER TABLE `xhpc_work_order_push_message` MODIFY COLUMN `target` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接收方邮箱、手机号、openID等' AFTER `order_push_id`;
ALTER TABLE `xhpc_activity_template` ADD PRIMARY KEY (`activity_template_id`);
ALTER TABLE `xhpc_activity_template` MODIFY COLUMN `activity_template_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '模板ID' FIRST ;
SET FOREIGN_KEY_CHECKS=1;

View File

@ -325,9 +325,9 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
}else{ }else{
Map<String, Object> map = (Map<String, Object>)r1.getData(); Map<String, Object> map = (Map<String, Object>)r1.getData();
if(map !=null){ if(map !=null){
if(!map.get("getStationQuote").equals("-1")){ if(!map.get("stationQuote").equals("-1")){
int count = xhpcChargingStationMapper.getCountXhpcChargingStation(loginUser.getTenantId()); int count = xhpcChargingStationMapper.getCountXhpcChargingStation(loginUser.getTenantId());
if(Integer.parseInt(map.get("getStationQuote").toString())<count){ if(Integer.parseInt(map.get("stationQuote").toString())<count){
return AjaxResult.error(1001, "场站已达到限额,如要在创建场站请联系管理员"); return AjaxResult.error(1001, "场站已达到限额,如要在创建场站请联系管理员");
} }
} }

View File

@ -36,6 +36,7 @@
from xhpc_rate_time from xhpc_rate_time
where charging_station_id=#{stationId} where charging_station_id=#{stationId}
group by rate_model_id group by rate_model_id
order by create_time desc
</select> </select>