From 375407a3fc58e736a1968e5dc458192c3c5ef810 Mon Sep 17 00:00:00 2001 From: "zhuangpeng.li" <908349383@qq.com> Date: Thu, 18 Dec 2025 14:52:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=A4=9A=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E5=A4=9A=E6=95=B0=E6=8D=AE=E6=BA=90=E4=BA=8B=E5=8A=A1=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceJobServiceImpl.java | 30 +- .../service/GenTableServiceImpl.java | 46 +- .../resources/vm/java/serviceImpl.java.vm | 26 +- .../service/cache/impl/DeviceCacheImpl.java | 6 - .../iot/service/impl/DeviceServiceImpl.java | 16 +- .../main/resources/vm/java/controller.java.vm | 115 ---- .../src/main/resources/vm/java/domain.java.vm | 105 ---- .../src/main/resources/vm/java/mapper.java.vm | 91 --- .../main/resources/vm/java/service.java.vm | 61 -- .../resources/vm/java/serviceImpl.java.vm | 169 ------ .../main/resources/vm/java/sub-domain.java.vm | 76 --- .../src/main/resources/vm/js/api.js.vm | 44 -- .../src/main/resources/vm/sql/sql.vm | 22 - .../main/resources/vm/vue/index-tree.vue.vm | 476 --------------- .../src/main/resources/vm/vue/index.vue.vm | 567 ------------------ .../src/main/resources/vm/xml/mapper.xml.vm | 135 ----- 16 files changed, 57 insertions(+), 1928 deletions(-) delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/controller.java.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/domain.java.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/mapper.java.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/service.java.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/serviceImpl.java.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/sub-domain.java.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/js/api.js.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/sql/sql.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index-tree.vue.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index.vue.vm delete mode 100644 springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/xml/mapper.xml.vm diff --git a/springboot/fastbee-open-api/src/main/java/com/fastbee/data/service/impl/DeviceJobServiceImpl.java b/springboot/fastbee-open-api/src/main/java/com/fastbee/data/service/impl/DeviceJobServiceImpl.java index d055cc5f..4f855eaf 100644 --- a/springboot/fastbee-open-api/src/main/java/com/fastbee/data/service/impl/DeviceJobServiceImpl.java +++ b/springboot/fastbee-open-api/src/main/java/com/fastbee/data/service/impl/DeviceJobServiceImpl.java @@ -5,8 +5,6 @@ import com.fastbee.common.exception.job.TaskException; import com.fastbee.iot.domain.DeviceJob; import com.fastbee.iot.mapper.DeviceJobMapper; import com.fastbee.iot.service.IDeviceJobService; -import com.fastbee.iot.service.IDeviceService; -import com.fastbee.iot.service.cache.IDeviceCache; import com.fastbee.data.quartz.CronUtils; import com.fastbee.data.quartz.ScheduleUtils; import com.fastbee.quartz.domain.SysJob; @@ -17,17 +15,15 @@ import org.quartz.JobKey; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; -import javax.annotation.Resource; import java.util.List; /** * 定时任务调度信息 服务层 - * + * * @author kerwincui */ @Service @@ -68,7 +64,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 获取quartz调度器的计划任务列表 - * + * * @param job 调度信息 * @return */ @@ -80,7 +76,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 通过调度任务ID查询调度信息 - * + * * @param jobId 调度任务ID * @return 调度任务对象信息 */ @@ -92,7 +88,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 暂停任务 - * + * * @param job 调度信息 */ @Override @@ -112,7 +108,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 恢复任务 - * + * * @param job 调度信息 */ @Override @@ -132,7 +128,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 删除任务后,所对应的trigger也将被删除 - * + * * @param job 调度信息 */ @Override @@ -151,7 +147,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 批量删除调度信息 - * + * * @param jobIds 需要删除的任务ID * @return 结果 */ @@ -228,7 +224,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 任务调度状态修改 - * + * * @param job 调度信息 */ @Override @@ -250,7 +246,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 立即运行任务 - * + * * @param job 调度信息 */ @Override @@ -268,7 +264,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 新增任务 - * + * * @param deviceJob 调度信息 调度信息 */ @Override @@ -285,7 +281,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 更新任务的时间表达式 - * + * * @param deviceJob 调度信息 */ @Override @@ -303,7 +299,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 更新任务 - * + * * @param deviceJob 任务对象 * @param jobGroup 任务组名 */ @@ -322,7 +318,7 @@ public class DeviceJobServiceImpl implements IDeviceJobService /** * 校验cron表达式是否有效 - * + * * @param cronExpression 表达式 * @return 结果 */ diff --git a/springboot/fastbee-plugs/fastbee-generator/src/main/java/com/fastbee/generator/service/GenTableServiceImpl.java b/springboot/fastbee-plugs/fastbee-generator/src/main/java/com/fastbee/generator/service/GenTableServiceImpl.java index 8f8f735c..56d70c03 100644 --- a/springboot/fastbee-plugs/fastbee-generator/src/main/java/com/fastbee/generator/service/GenTableServiceImpl.java +++ b/springboot/fastbee-plugs/fastbee-generator/src/main/java/com/fastbee/generator/service/GenTableServiceImpl.java @@ -52,7 +52,7 @@ import javax.annotation.Resource; /** * 业务 服务层实现 - * + * * @author ruoyi */ @Service @@ -73,7 +73,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询业务信息 - * + * * @param id 业务ID * @return 业务信息 */ @@ -87,7 +87,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询业务列表 - * + * * @param genTable 业务信息 * @return 业务集合 */ @@ -99,7 +99,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询据库列表 - * + * * @param genTable 业务信息 * @return 数据库表集合 */ @@ -162,7 +162,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询据库列表 - * + * * @param tableNames 表名称组 * @return 数据库表集合 */ @@ -197,7 +197,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询所有表信息 - * + * * @return 表信息集合 */ @Override @@ -208,12 +208,12 @@ public class GenTableServiceImpl implements IGenTableService /** * 修改业务 - * + * * @param genTable 业务信息 * @return 结果 */ @Override - @Transactional + @DSTransactional public void updateGenTable(GenTable genTable) { String options = JSON.toJSONString(genTable.getParams()); @@ -230,12 +230,12 @@ public class GenTableServiceImpl implements IGenTableService /** * 删除业务对象 - * + * * @param tableIds 需要删除的数据ID * @return 结果 */ @Override - @Transactional + @DSTransactional public void deleteGenTableByIds(Long[] tableIds) { genTableMapper.deleteGenTableByIds(tableIds); @@ -244,7 +244,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 导入表结构 - * + * * @param tableList 导入表列表 */ @Override @@ -303,7 +303,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 预览代码 - * + * * @param tableId 表编号 * @return 预览数据列表 */ @@ -342,7 +342,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 生成代码(下载方式) - * + * * @param tableName 表名称 * @return 数据 */ @@ -358,7 +358,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 生成代码(自定义路径) - * + * * @param tableName 表名称 */ @Override @@ -400,11 +400,11 @@ public class GenTableServiceImpl implements IGenTableService /** * 同步数据库 - * + * * @param tableName 表名称 */ @Override - @Transactional + @DSTransactional public void synchDb(String tableName) { GenTable table = genTableMapper.selectGenTableByName(tableName); @@ -455,7 +455,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 批量生成代码(下载方式) - * + * * @param tableNames 表数组 * @return 数据 */ @@ -514,7 +514,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 修改保存参数校验 - * + * * @param genTable 业务信息 */ @Override @@ -552,7 +552,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 设置主键列信息 - * + * * @param table 业务表信息 */ public void setPkColumn(GenTable table) @@ -588,7 +588,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 设置主子表信息 - * + * * @param table 业务表信息 */ public void setSubTable(GenTable table) @@ -602,7 +602,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 设置代码生成其他选项值 - * + * * @param genTable 设置后的生成对象 */ public void setTableFromOptions(GenTable genTable) @@ -626,7 +626,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 获取代码生成地址 - * + * * @param table 业务表信息 * @param template 模板文件路径 * @return 生成地址 @@ -640,4 +640,4 @@ public class GenTableServiceImpl implements IGenTableService } return genPath + File.separator + VelocityUtils.getFileName(template, table); } -} \ No newline at end of file +} diff --git a/springboot/fastbee-plugs/fastbee-generator/src/main/resources/vm/java/serviceImpl.java.vm b/springboot/fastbee-plugs/fastbee-generator/src/main/resources/vm/java/serviceImpl.java.vm index 1bcdadba..8fe10267 100644 --- a/springboot/fastbee-plugs/fastbee-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ b/springboot/fastbee-plugs/fastbee-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -21,19 +21,19 @@ import ${packageName}.service.I${ClassName}Service; /** * ${functionName}Service业务层处理 - * + * * @author ${author} * @date ${datetime} */ @Service -public class ${ClassName}ServiceImpl implements I${ClassName}Service +public class ${ClassName}ServiceImpl implements I${ClassName}Service { @Autowired private ${ClassName}Mapper ${className}Mapper; /** * 查询${functionName} - * + * * @param ${pkColumn.javaField} ${functionName}主键 * @return ${functionName} */ @@ -45,7 +45,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service /** * 查询${functionName}列表 - * + * * @param ${className} ${functionName} * @return ${functionName} */ @@ -57,12 +57,12 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service /** * 新增${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ #if($table.sub) - @Transactional + @DSTransactional #end @Override public int insert${ClassName}(${ClassName} ${className}) @@ -83,12 +83,12 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service /** * 修改${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ #if($table.sub) - @Transactional + @DSTransactional #end @Override public int update${ClassName}(${ClassName} ${className}) @@ -107,12 +107,12 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service /** * 批量删除${functionName} - * + * * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 * @return 结果 */ #if($table.sub) - @Transactional + @DSTransactional #end @Override public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) @@ -125,12 +125,12 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service /** * 删除${functionName}信息 - * + * * @param ${pkColumn.javaField} ${functionName}主键 * @return 结果 */ #if($table.sub) - @Transactional + @DSTransactional #end @Override public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) @@ -144,7 +144,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service /** * 新增${subTable.functionName}信息 - * + * * @param ${className} ${functionName}对象 */ public void insert${subClassName}(${ClassName} ${className}) diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/cache/impl/DeviceCacheImpl.java b/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/cache/impl/DeviceCacheImpl.java index 3ea06ece..cf9e1e14 100644 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/cache/impl/DeviceCacheImpl.java +++ b/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/cache/impl/DeviceCacheImpl.java @@ -4,23 +4,17 @@ import com.fastbee.common.core.mq.DeviceStatusBo; import com.fastbee.common.core.redis.RedisCache; import com.fastbee.common.core.redis.RedisKeyBuilder; import com.fastbee.common.enums.DeviceStatus; -import com.fastbee.common.exception.ServiceException; import com.fastbee.common.utils.DateUtils; import com.fastbee.iot.domain.Device; import com.fastbee.iot.service.IDeviceService; import com.fastbee.iot.service.cache.IDeviceCache; -import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.TimeUnit; /** * @author bill diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/DeviceServiceImpl.java b/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/DeviceServiceImpl.java index b62f4e3a..38e301b9 100644 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/DeviceServiceImpl.java +++ b/springboot/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/DeviceServiceImpl.java @@ -3,6 +3,7 @@ package com.fastbee.iot.service.impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.fastbee.common.constant.Constants; import com.fastbee.common.constant.ProductAuthConstant; import com.fastbee.common.core.domain.AjaxResult; @@ -46,7 +47,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; @@ -216,7 +216,7 @@ public class DeviceServiceImpl implements IDeviceService { @Override - @Transactional(rollbackFor = Exception.class) + @DSTransactional public List reportDeviceThingsModelValue(ThingsModelValuesInput input, int type, boolean isShadow) { String key = RedisKeyBuilder.buildTSLVCacheKey(input.getProductId(), input.getDeviceNumber()); Map maps = new HashMap(); @@ -670,7 +670,7 @@ public class DeviceServiceImpl implements IDeviceService { * @return 结果 */ @Override - @Transactional(rollbackFor = Exception.class) + @DSTransactional public Device insertDevice(Device device) { // 设备编号唯一检查 Device existDevice = deviceMapper.selectDeviceBySerialNumber(device.getSerialNumber()); @@ -736,7 +736,7 @@ public class DeviceServiceImpl implements IDeviceService { * @return 结果 */ @Override - @Transactional(rollbackFor = Exception.class) + @DSTransactional public AjaxResult deviceRelateUser(DeviceRelateUserInput deviceRelateUserInput) { // 查询用户信息 SysUser sysUser = userService.selectUserById(deviceRelateUserInput.getUserId()); @@ -784,7 +784,7 @@ public class DeviceServiceImpl implements IDeviceService { * @return 结果 */ @Override - @Transactional(rollbackFor = Exception.class) + @DSTransactional public int insertDeviceAuto(String serialNumber, Long userId, Long productId) { // 设备编号唯一检查 int count = deviceMapper.selectDeviceCountBySerialNumber(serialNumber); @@ -952,7 +952,7 @@ public class DeviceServiceImpl implements IDeviceService { * @return 结果 */ @Override - @Transactional(rollbackFor = Exception.class) + @DSTransactional public int updateDeviceStatusAndLocation(Device device, String ipAddress) { // 设置自动定位和状态 if (ipAddress != "") { @@ -1028,7 +1028,7 @@ public class DeviceServiceImpl implements IDeviceService { * @return 结果 */ @Override - @Transactional(rollbackFor = Exception.class) + @DSTransactional public int reportDevice(Device device, Device deviceEntity) { // 未采用设备定位则清空定位,定位方式(1=ip自动定位,2=设备定位,3=自定义) if (deviceEntity.getLocationWay() != 2) { @@ -1087,7 +1087,7 @@ public class DeviceServiceImpl implements IDeviceService { * @return 结果 */ @Override - @Transactional(rollbackFor = Exception.class) + @DSTransactional public int deleteDeviceByDeviceId(Long deviceId) throws SchedulerException { SysUser user = getLoginUser().getUser(); // 是否为普通用户,普通用户如果不是设备所有者,只能删除设备用户和用户自己的设备关联分组信息 diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/controller.java.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/controller.java.vm deleted file mode 100644 index 07fb5879..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/controller.java.vm +++ /dev/null @@ -1,115 +0,0 @@ -package ${packageName}.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.fastbee.common.annotation.Log; -import com.fastbee.common.core.controller.BaseController; -import com.fastbee.common.core.domain.AjaxResult; -import com.fastbee.common.enums.BusinessType; -import ${packageName}.domain.${ClassName}; -import ${packageName}.service.I${ClassName}Service; -import com.fastbee.common.utils.poi.ExcelUtil; -#if($table.crud || $table.sub) -import com.fastbee.common.core.page.TableDataInfo; -#elseif($table.tree) -#end - -/** - * ${functionName}Controller - * - * @author ${author} - * @date ${datetime} - */ -@RestController -@RequestMapping("/${moduleName}/${businessName}") -public class ${ClassName}Controller extends BaseController -{ - @Autowired - private I${ClassName}Service ${className}Service; - - /** - * 查询${functionName}列表 - */ - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") - @GetMapping("/list") -#if($table.crud || $table.sub) - public TableDataInfo list(${ClassName} ${className}) - { - startPage(); - List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); - return getDataTable(list); - } -#elseif($table.tree) - public AjaxResult list(${ClassName} ${className}) - { - List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); - return AjaxResult.success(list); - } -#end - - /** - * 导出${functionName}列表 - */ - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") - @Log(title = "${functionName}", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, ${ClassName} ${className}) - { - List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); - ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); - util.exportExcel(response, list, "${functionName}数据"); - } - - /** - * 获取${functionName}详细信息 - */ - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") - @GetMapping(value = "/{${pkColumn.javaField}}") - public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) - { - return AjaxResult.success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); - } - - /** - * 新增${functionName} - */ - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") - @Log(title = "${functionName}", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody ${ClassName} ${className}) - { - return toAjax(${className}Service.insert${ClassName}(${className})); - } - - /** - * 修改${functionName} - */ - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") - @Log(title = "${functionName}", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody ${ClassName} ${className}) - { - return toAjax(${className}Service.update${ClassName}(${className})); - } - - /** - * 删除${functionName} - */ - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") - @Log(title = "${functionName}", businessType = BusinessType.DELETE) - @DeleteMapping("/{${pkColumn.javaField}s}") - public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) - { - return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s)); - } -} diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/domain.java.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/domain.java.vm deleted file mode 100644 index 517abcc9..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/domain.java.vm +++ /dev/null @@ -1,105 +0,0 @@ -package ${packageName}.domain; - -#foreach ($import in $importList) -import ${import}; -#end -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.fastbee.common.annotation.Excel; -#if($table.crud || $table.sub) -import com.fastbee.common.core.domain.BaseEntity; -#elseif($table.tree) -import com.fastbee.common.core.domain.TreeEntity; -#end - -/** - * ${functionName}对象 ${tableName} - * - * @author ${author} - * @date ${datetime} - */ -#if($table.crud || $table.sub) -#set($Entity="BaseEntity") -#elseif($table.tree) -#set($Entity="TreeEntity") -#end -public class ${ClassName} extends ${Entity} -{ - private static final long serialVersionUID = 1L; - -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField)) - /** $column.columnComment */ -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) -#set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else -#set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.javaType == 'Date') - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") -#else - @Excel(name = "${comment}") -#end -#end - private $column.javaType $column.javaField; - -#end -#end -#if($table.sub) - /** $table.subTable.functionName信息 */ - private List<${subClassName}> ${subclassName}List; - -#end -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField)) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - public void set${AttrName}($column.javaType $column.javaField) - { - this.$column.javaField = $column.javaField; - } - - public $column.javaType get${AttrName}() - { - return $column.javaField; - } -#end -#end - -#if($table.sub) - public List<${subClassName}> get${subClassName}List() - { - return ${subclassName}List; - } - - public void set${subClassName}List(List<${subClassName}> ${subclassName}List) - { - this.${subclassName}List = ${subclassName}List; - } - -#end - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) -#foreach ($column in $columns) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - .append("${column.javaField}", get${AttrName}()) -#end -#if($table.sub) - .append("${subclassName}List", get${subClassName}List()) -#end - .toString(); - } -} diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/mapper.java.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/mapper.java.vm deleted file mode 100644 index 7e7d7c26..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/mapper.java.vm +++ /dev/null @@ -1,91 +0,0 @@ -package ${packageName}.mapper; - -import java.util.List; -import ${packageName}.domain.${ClassName}; -#if($table.sub) -import ${packageName}.domain.${subClassName}; -#end - -/** - * ${functionName}Mapper接口 - * - * @author ${author} - * @date ${datetime} - */ -public interface ${ClassName}Mapper -{ - /** - * 查询${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return ${functionName} - */ - public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); - - /** - * 查询${functionName}列表 - * - * @param ${className} ${functionName} - * @return ${functionName}集合 - */ - public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); - - /** - * 新增${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ - public int insert${ClassName}(${ClassName} ${className}); - - /** - * 修改${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ - public int update${ClassName}(${ClassName} ${className}); - - /** - * 删除${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return 结果 - */ - public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); - - /** - * 批量删除${functionName} - * - * @param ${pkColumn.javaField}s 需要删除的数据主键集合 - * @return 结果 - */ - public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); -#if($table.sub) - - /** - * 批量删除${subTable.functionName} - * - * @param ${pkColumn.javaField}s 需要删除的数据主键集合 - * @return 结果 - */ - public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); - - /** - * 批量新增${subTable.functionName} - * - * @param ${subclassName}List ${subTable.functionName}列表 - * @return 结果 - */ - public int batch${subClassName}(List<${subClassName}> ${subclassName}List); - - - /** - * 通过${functionName}主键删除${subTable.functionName}信息 - * - * @param ${pkColumn.javaField} ${functionName}ID - * @return 结果 - */ - public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); -#end -} diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/service.java.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/service.java.vm deleted file mode 100644 index 264882b2..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/service.java.vm +++ /dev/null @@ -1,61 +0,0 @@ -package ${packageName}.service; - -import java.util.List; -import ${packageName}.domain.${ClassName}; - -/** - * ${functionName}Service接口 - * - * @author ${author} - * @date ${datetime} - */ -public interface I${ClassName}Service -{ - /** - * 查询${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return ${functionName} - */ - public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); - - /** - * 查询${functionName}列表 - * - * @param ${className} ${functionName} - * @return ${functionName}集合 - */ - public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); - - /** - * 新增${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ - public int insert${ClassName}(${ClassName} ${className}); - - /** - * 修改${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ - public int update${ClassName}(${ClassName} ${className}); - - /** - * 批量删除${functionName} - * - * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 - * @return 结果 - */ - public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); - - /** - * 删除${functionName}信息 - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return 结果 - */ - public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); -} diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/serviceImpl.java.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/serviceImpl.java.vm deleted file mode 100644 index 1bcdadba..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/serviceImpl.java.vm +++ /dev/null @@ -1,169 +0,0 @@ -package ${packageName}.service.impl; - -import java.util.List; -#foreach ($column in $columns) -#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') -import com.fastbee.common.utils.DateUtils; -#break -#end -#end -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -#if($table.sub) -import java.util.ArrayList; -import com.fastbee.common.utils.StringUtils; -import org.springframework.transaction.annotation.Transactional; -import ${packageName}.domain.${subClassName}; -#end -import ${packageName}.mapper.${ClassName}Mapper; -import ${packageName}.domain.${ClassName}; -import ${packageName}.service.I${ClassName}Service; - -/** - * ${functionName}Service业务层处理 - * - * @author ${author} - * @date ${datetime} - */ -@Service -public class ${ClassName}ServiceImpl implements I${ClassName}Service -{ - @Autowired - private ${ClassName}Mapper ${className}Mapper; - - /** - * 查询${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return ${functionName} - */ - @Override - public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) - { - return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); - } - - /** - * 查询${functionName}列表 - * - * @param ${className} ${functionName} - * @return ${functionName} - */ - @Override - public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) - { - return ${className}Mapper.select${ClassName}List(${className}); - } - - /** - * 新增${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int insert${ClassName}(${ClassName} ${className}) - { -#foreach ($column in $columns) -#if($column.javaField == 'createTime') - ${className}.setCreateTime(DateUtils.getNowDate()); -#end -#end -#if($table.sub) - int rows = ${className}Mapper.insert${ClassName}(${className}); - insert${subClassName}(${className}); - return rows; -#else - return ${className}Mapper.insert${ClassName}(${className}); -#end - } - - /** - * 修改${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int update${ClassName}(${ClassName} ${className}) - { -#foreach ($column in $columns) -#if($column.javaField == 'updateTime') - ${className}.setUpdateTime(DateUtils.getNowDate()); -#end -#end -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); - insert${subClassName}(${className}); -#end - return ${className}Mapper.update${ClassName}(${className}); - } - - /** - * 批量删除${functionName} - * - * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) - { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s); -#end - return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s); - } - - /** - * 删除${functionName}信息 - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) - { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); -#end - return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); - } -#if($table.sub) - - /** - * 新增${subTable.functionName}信息 - * - * @param ${className} ${functionName}对象 - */ - public void insert${subClassName}(${ClassName} ${className}) - { - List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); - ${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}(); - if (StringUtils.isNotNull(${subclassName}List)) - { - List<${subClassName}> list = new ArrayList<${subClassName}>(); - for (${subClassName} ${subclassName} : ${subclassName}List) - { - ${subclassName}.set${subTableFkClassName}(${pkColumn.javaField}); - list.add(${subclassName}); - } - if (list.size() > 0) - { - ${className}Mapper.batch${subClassName}(list); - } - } - } -#end -} diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/sub-domain.java.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/sub-domain.java.vm deleted file mode 100644 index 5fe04c47..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/java/sub-domain.java.vm +++ /dev/null @@ -1,76 +0,0 @@ -package ${packageName}.domain; - -#foreach ($import in $subImportList) -import ${import}; -#end -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.fastbee.common.annotation.Excel; -import com.fastbee.common.core.domain.BaseEntity; - -/** - * ${subTable.functionName}对象 ${subTableName} - * - * @author ${author} - * @date ${datetime} - */ -public class ${subClassName} extends BaseEntity -{ - private static final long serialVersionUID = 1L; - -#foreach ($column in $subTable.columns) -#if(!$table.isSuperColumn($column.javaField)) - /** $column.columnComment */ -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) -#set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else -#set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.javaType == 'Date') - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") -#else - @Excel(name = "${comment}") -#end -#end - private $column.javaType $column.javaField; - -#end -#end -#foreach ($column in $subTable.columns) -#if(!$table.isSuperColumn($column.javaField)) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - public void set${AttrName}($column.javaType $column.javaField) - { - this.$column.javaField = $column.javaField; - } - - public $column.javaType get${AttrName}() - { - return $column.javaField; - } -#end -#end - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) -#foreach ($column in $subTable.columns) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - .append("${column.javaField}", get${AttrName}()) -#end - .toString(); - } -} diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/js/api.js.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/js/api.js.vm deleted file mode 100644 index 9295524a..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/js/api.js.vm +++ /dev/null @@ -1,44 +0,0 @@ -import request from '@/utils/request' - -// 查询${functionName}列表 -export function list${BusinessName}(query) { - return request({ - url: '/${moduleName}/${businessName}/list', - method: 'get', - params: query - }) -} - -// 查询${functionName}详细 -export function get${BusinessName}(${pkColumn.javaField}) { - return request({ - url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, - method: 'get' - }) -} - -// 新增${functionName} -export function add${BusinessName}(data) { - return request({ - url: '/${moduleName}/${businessName}', - method: 'post', - data: data - }) -} - -// 修改${functionName} -export function update${BusinessName}(data) { - return request({ - url: '/${moduleName}/${businessName}', - method: 'put', - data: data - }) -} - -// 删除${functionName} -export function del${BusinessName}(${pkColumn.javaField}) { - return request({ - url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, - method: 'delete' - }) -} diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/sql/sql.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/sql/sql.vm deleted file mode 100644 index 05755835..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/sql/sql.vm +++ /dev/null @@ -1,22 +0,0 @@ --- 菜单 SQL -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); - --- 按钮父菜单ID -SELECT @parentId := LAST_INSERT_ID(); - --- 按钮 SQL -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate(), '', null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); \ No newline at end of file diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index-tree.vue.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index-tree.vue.vm deleted file mode 100644 index d862133d..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index-tree.vue.vm +++ /dev/null @@ -1,476 +0,0 @@ - - - diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index.vue.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index.vue.vm deleted file mode 100644 index 940e016a..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/vue/index.vue.vm +++ /dev/null @@ -1,567 +0,0 @@ - - - diff --git a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/xml/mapper.xml.vm b/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/xml/mapper.xml.vm deleted file mode 100644 index 0ceb3d85..00000000 --- a/springboot/fastbee-service/fastbee-iot-service/src/main/resources/vm/xml/mapper.xml.vm +++ /dev/null @@ -1,135 +0,0 @@ - - - - - -#foreach ($column in $columns) - -#end - -#if($table.sub) - - - - - - -#foreach ($column in $subTable.columns) - -#end - -#end - - - select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName} - - - - - - - - insert into ${tableName} - -#foreach($column in $columns) -#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) - $column.columnName, -#end -#end - - -#foreach($column in $columns) -#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) - #{$column.javaField}, -#end -#end - - - - - update ${tableName} - -#foreach($column in $columns) -#if($column.columnName != $pkColumn.columnName) - $column.columnName = #{$column.javaField}, -#end -#end - - where ${pkColumn.columnName} = #{${pkColumn.javaField}} - - - - delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}} - - - - delete from ${tableName} where ${pkColumn.columnName} in - - #{${pkColumn.javaField}} - - -#if($table.sub) - - - delete from ${subTableName} where ${subTableFkName} in - - #{${subTableFkclassName}} - - - - - delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}} - - - - insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values - - (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end) - - -#end - \ No newline at end of file