初始化提交

This commit is contained in:
haozq 2025-04-14 09:35:40 +08:00
parent 8874fb18ca
commit 58ee50c389
15 changed files with 261 additions and 30 deletions

View File

@ -21,7 +21,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
public class BonusBaseApplication {
public static void main(String[] args) {
SpringApplication.run(BonusBaseApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 2024博诺思智慧工地平台启动成功 ლ(´ڡ`ლ)゙ \n" +
System.err.println("(♥◠‿◠)ノ゙ 2024博诺思智慧工地平台启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +

View File

@ -0,0 +1,11 @@
package com.bonus.base.basic.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "感知设备管理")
@RestController
@RequestMapping("/collect/dev/")
public class CollectDeviceController {
}

View File

@ -1,11 +1,22 @@
package com.bonus.base.basic.controller;
import com.bonus.base.basic.domain.ConstInfoVo;
import com.bonus.base.basic.domain.DeviceVo;
import com.bonus.base.basic.service.ConstInfoService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.RequiresPermissions;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author 黑子
*/
@ -14,9 +25,20 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/constInfo")
public class ConstInfoController extends BaseController {
private ConstInfoService service;
/**
* 查询作业现场列表
*/
@ApiOperation(value = "查询施工现场信息")
@RequiresPermissions("tb:const:list")
@GetMapping("/getPageList")
@SysLog(title = "施工现场管理", businessType = OperaType.QUERY, logType = 1,module = "设备管理->施工现场管理信息")
public TableDataInfo getPageList(ConstInfoVo deviceVo) {
startPage();
List<ConstInfoVo> list = service.getPageList(deviceVo);
return getDataTable(list);
}
}

View File

@ -21,9 +21,9 @@ import java.util.List;
/**
* @author 黑子
*/
@Api(tags = "工程项目管理接口")
@Api(tags = "感知设备管理")
@RestController
@RequestMapping("/bm_project")
@RequestMapping("/D")
public class DeviceController extends BaseController {
@Autowired
@ -34,7 +34,7 @@ public class DeviceController extends BaseController {
*/
@ApiOperation(value = "查询感知设备信息列表")
@RequiresPermissions("tb:device:list")
@GetMapping("/list")
@GetMapping("/getPageList")
@SysLog(title = "设备管理", businessType = OperaType.INSERT, logType = 1,module = "设备管理->查询感知设备信息列表")
public TableDataInfo getPageList(DeviceVo deviceVo) {
startPage();
@ -49,7 +49,7 @@ public class DeviceController extends BaseController {
*/
@ApiOperation(value = "查询感知设备属性信息")
@RequiresPermissions("tb:device:attr")
@GetMapping("/list")
@GetMapping("/getAttrPageList")
@SysLog(title = "设备管理", businessType = OperaType.INSERT, logType = 1,module = "设备管理->查询设备属性")
public TableDataInfo getAttrPageList(DeviceAttrVo vo) {
startPage();
@ -60,16 +60,18 @@ public class DeviceController extends BaseController {
@PreventRepeatSubmit
@RequiresPermissions("tb:device:add")
@SysLog(title = "设备管理", businessType = OperaType.INSERT, logType = 1,module = "设备管理->新增感知设备")
@PostMapping
@PostMapping("addDevice")
public AjaxResult addDevice(@RequestBody DeviceVo deviceVo) {
return service.addDevice(deviceVo);
}
@ApiOperation(value = "新增设备管理")
@PreventRepeatSubmit
@RequiresPermissions("tb:attr:add")
@SysLog(title = "设备管理", businessType = OperaType.INSERT, logType = 1,module = "设备管理->新增设备属性")
@PostMapping
@PostMapping("addDeviceAttr")
public AjaxResult addDeviceAttr(@RequestBody DeviceAttrVo vo) {
return service.addDeviceAttr(vo);
}

View File

@ -46,7 +46,7 @@ public class DeviceTypeController extends BaseController {
@PreventRepeatSubmit
@RequiresPermissions("tb:type:add")
@SysLog(title = "设备类型管理", businessType = OperaType.INSERT, logType = 1,module = "设备类型管理->新增设备类型")
@PostMapping
@PostMapping("insertData")
public AjaxResult insertData(@RequestBody DeviceTypeVo vo) {
return service.insertData(vo);
}
@ -57,7 +57,7 @@ public class DeviceTypeController extends BaseController {
@PreventRepeatSubmit
@RequiresPermissions("tb:type:update")
@SysLog(title = "设备类型管理", businessType = OperaType.UPDATE, logType = 1,module = "设备类型管理->修改设备类型")
@PostMapping
@PostMapping("updateData")
public AjaxResult updateData(@RequestBody DeviceTypeVo vo) {
return service.updateData(vo);
}
@ -66,14 +66,26 @@ public class DeviceTypeController extends BaseController {
@ApiOperation(value = "删除设备类型")
@PreventRepeatSubmit
@RequiresPermissions("tb:type:del")
@SysLog(title = "设备类型管理", businessType = OperaType.UPDATE, logType = 1,module = "设备类型管理->删除设备类型")
@PostMapping
@SysLog(title = "设备类型管理", businessType = OperaType.UPDATE,module = "设备类型管理->删除设备类型")
@PostMapping("deleteData")
public AjaxResult deleteData(@RequestBody DeviceTypeVo vo) {
return service.deleteData(vo);
}
@ApiOperation(value = "删除设备类型")
@PreventRepeatSubmit
@SysLog(title = "设备类型管理", businessType = OperaType.UPDATE,module = "设备类型管理->查询设备类型")
@PostMapping("queryDetail")
public AjaxResult queryDetail(@RequestBody DeviceTypeVo vo) {
return service.queryDetail(vo);
}
@ApiOperation(value = "查询下拉选")
@PreventRepeatSubmit
@PostMapping("querySelected")
public AjaxResult querySelected() {
return service.querySelected();
}
}

View File

@ -0,0 +1,60 @@
package com.bonus.base.basic.domain;
import lombok.Data;
/**
* 施工 信息维护 实体类
* @author 黑子
*/
@Data
public class ConstInfoVo {
private String id;
/**
* 施工信息名称
*/
private String name;
/**
* 类型编码
*/
private String typeCode;
/**
* 类型id
*/
private String typeId;
/**
* 类型名称
*/
private String typeName;
/**
* 创建时间
*/
private String createTime;
/**
* 更新时间
*/
private String updateTime;
/**
* 是否启用
*/
private String isActive;
/**
* 备注
*/
private String remark;
/**
* 背景图地址
*/
private String backImage;
/**
* 配置信息
*/
private String configData;
}

View File

@ -11,10 +11,24 @@ public class DeviceTypeVo {
private String id;
private String typeCode;
/**
* 类型名称
*/
private String typeName;
/**
* 备注
*/
private String remark;
/**
* 创建时间
*/
private String createTime;
/**
* 修改时间
*/
private String updateTime;
private String keyWord;
}

View File

@ -1,19 +1,20 @@
package com.bonus.base.basic.mapper;
import com.bonus.base.basic.domain.ConstInfoVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author 黑子
*/
@Mapper
public interface ConstInfoMapper {
/**
* 施工分页查询集合
* @param deviceVo
* @return
*/
List<ConstInfoVo> getPageList(ConstInfoVo deviceVo);
}

View File

@ -48,4 +48,17 @@ public interface DeviceTypeMapper {
* @return
*/
int deleteData(DeviceTypeVo vo);
/**
* 查询设备类型
* @param vo
* @return
*/
DeviceTypeVo queryDetail(DeviceTypeVo vo);
/**
* 设备类型下拉选查询
* @return
*/
List<DeviceTypeVo> querySelected();
}

View File

@ -1,7 +1,17 @@
package com.bonus.base.basic.service;
import com.bonus.base.basic.domain.ConstInfoVo;
import java.util.List;
/**
* @author 黑子
*/
public interface ConstInfoService {
/**
* 查询 施工现场信息激活
* @param deviceVo
* @return
*/
List<ConstInfoVo> getPageList(ConstInfoVo deviceVo);
}

View File

@ -38,4 +38,17 @@ public interface DeviceTypeService {
* @return
*/
AjaxResult deleteData(DeviceTypeVo vo);
/**
* 查询设备类型
* @param vo
* @return
*/
AjaxResult queryDetail(DeviceTypeVo vo);
/**
* 查询设备类型下拉选
* @return
*/
AjaxResult querySelected();
}

View File

@ -1,10 +1,16 @@
package com.bonus.base.basic.service.impl;
import com.bonus.base.basic.domain.ConstInfoVo;
import com.bonus.base.basic.mapper.ConstInfoMapper;
import com.bonus.base.basic.service.ConstInfoService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* @author 黑子
*/
@ -12,7 +18,21 @@ import org.springframework.stereotype.Service;
@Slf4j
public class ConstInfoServiceImpl implements ConstInfoService {
@Autowired
private ConstInfoMapper mapper;
@Override
public List<ConstInfoVo> getPageList(ConstInfoVo deviceVo) {
try{
return mapper.getPageList(deviceVo);
}catch (Exception e){
log.error(e.toString(),e);
}
return new ArrayList<>();
}
public static void main(String[] args) {
log.info("");
}
}

View File

@ -104,5 +104,38 @@ public class DeviceTypeServiceImpl implements DeviceTypeService {
}
/**
* 查询设备类型
* @param vo
* @return
*/
@Override
public AjaxResult queryDetail(DeviceTypeVo vo) {
try{
DeviceTypeVo data=mapper.queryDetail(vo);
return AjaxResult.success(data);
}catch (Exception e){
log.error(e.toString(),e);
}
return AjaxResult.error("查询失败");
}
/**
*
* @return
*/
@Override
public AjaxResult querySelected() {
try{
List<DeviceTypeVo> list=mapper.querySelected();
return AjaxResult.success(list);
}catch (Exception e){
log.error(e.toString(),e);
}
return AjaxResult.success("查询异常",new ArrayList<>());
}
}

View File

@ -4,4 +4,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.base.basic.mapper.ConstInfoMapper">
<select id="getPageList" resultType="com.bonus.base.basic.domain.ConstInfoVo">
select tci.id, tci.name, tci.type_id typeId ,tdt.type_code typeCode ,tdt.type_name typeName, tci.create_time createTime ,tci.update_time updateTime , tci.is_active isActive ,
tci.remark, tci.background_image backImage , tci.config_data configData
from tb_const_info tci
left join tb_dev_type tdt on tdt.id=tci.type_id
where tci.del_flag=0
</select>
</mapper>

View File

@ -20,14 +20,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id=#{id}
</update>
<select id="getPageList" resultType="com.bonus.base.basic.domain.DeviceTypeVo">
select id,type_name typeName,type_code typeCode,remark
select id,type_name typeName,type_code typeCode,remark,create_time createTime,update_time updateTime
from tb_dev_type
where del_flag=0
<if test="typeCode!=null and typeCode!=''">
and type_code like concat('%',#{typeCode},'%')
<if test="keyWord!=null and keyWord!=''">
and (type_code like concat('%',#{keyWord},'%') or
type_name like concat('%',#{keyWord},'%') or
id like concat('%',#{keyWord},'%')
)
</if>
<if test="typeName!=null and typeName!=''">
and type_name like concat('%',#{typeName},'%')
</if>
</select>
<select id="getDataInfo" resultType="java.lang.Integer">
@ -35,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from tb_dev_type
<where>
<if test="param.id!=null and param.id!=''">
and id!={param.id}
and id!=#{param.id}
</if>
<if test='type=="1"'>
and type_name=#{param.typeName}
@ -58,4 +61,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where del_flag=0 AND type_id=#{id}
)b
</select>
<select id="queryDetail" resultType="com.bonus.base.basic.domain.DeviceTypeVo">
select id,type_name typeName,type_code typeCode,remark,create_time createTime,update_time updateTime
from tb_dev_type
where id=#{id}
</select>
<select id="querySelected" resultType="com.bonus.base.basic.domain.DeviceTypeVo">
select id,type_name typeName,type_code typeCode
from tb_dev_type
where del_flag=0
</select>
</mapper>