物资类型提取,控制器修改
This commit is contained in:
parent
37ac0556e8
commit
4a3009366d
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.material.home.domain;
|
||||
package com.bonus.common.biz.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
|
@ -9,11 +9,9 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 我的收藏
|
||||
对象 ma_user_collect
|
||||
* 我的收藏 ma_user_collect
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2023-12-02
|
||||
* @author bonus
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
|
|
|
|||
|
|
@ -0,0 +1,157 @@
|
|||
package com.bonus.material.device.controller;
|
||||
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.domain.dto.InfoMotionDto;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.device.service.DevInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备信息Controller
|
||||
*
|
||||
* @author syruan
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dev")
|
||||
@Api(value = "设备信息",tags = "设备管理")
|
||||
public class DevInfoController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private DevInfoService devInfoService;
|
||||
|
||||
/**
|
||||
* 查询设备信息列表
|
||||
*/
|
||||
// @RequiresPermissions("equip:info:list")
|
||||
@ApiOperation(value = "装备列表")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody DevInfoVo devInfo) {
|
||||
startPage();
|
||||
List<DevInfoVo> list = devInfoService.selectDevInfoList(devInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表--包含附件查询
|
||||
*/
|
||||
//@RequiresPermissions("equip:info:list")
|
||||
@ApiOperation(value = "查询商品列表")
|
||||
@PostMapping("/devList")
|
||||
public TableDataInfo devList(@RequestBody DevInfoVo devInfo) {
|
||||
startPage();
|
||||
List<DevInfoVo> list = devInfoService.selectDevInfoLists(devInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "收藏装备列表")
|
||||
@PostMapping("/userCollectList")
|
||||
public TableDataInfo userCollectList(@RequestBody DevInfoVo devInfo) {
|
||||
startPage();
|
||||
List<DevInfoVo> list = devInfoService.selectUserCollectList(devInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
// @RequiresPermissions("equip:info:list")
|
||||
@ApiOperation(value = "装备推荐列表")
|
||||
@GetMapping("/hotList")
|
||||
public TableDataInfo hotList(DevInfoVo devInfo) {
|
||||
startPage();
|
||||
List<DevInfoVo> list = devInfoService.selectDevInfoHotList(devInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备信息列表
|
||||
*/
|
||||
// @RequiresPermissions("equip:info:export")
|
||||
@ApiOperation(value = "导出装备信息")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DevInfoVo devInfo) {
|
||||
List<DevInfoVo> list = devInfoService.selectDevInfoList(devInfo);
|
||||
ExcelUtil<DevInfoVo> util = new ExcelUtil<>(DevInfoVo.class);
|
||||
util.exportExcel(response, list, "设备信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备信息详细信息
|
||||
*/
|
||||
//@RequiresPermissions("equip:info:query")
|
||||
@ApiOperation(value = "装备详情")
|
||||
@GetMapping(value = "/getInfo/{maId}")
|
||||
public AjaxResult getInfo(@PathVariable("maId") Long maId) {
|
||||
return success(devInfoService.selectDevInfoByMaId(maId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*/
|
||||
// @RequiresPermissions("equip:info:edit")
|
||||
@ApiOperation(value = "修改装备信息")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DevInfo devInfo) {
|
||||
return toAjax(devInfoService.updateDevInfo(devInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备信息
|
||||
*/
|
||||
//@RequiresPermissions("equip:info:remove")
|
||||
@ApiOperation(value = "删除装备")
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(@RequestBody Long[] maIds) {
|
||||
return toAjax(devInfoService.deleteDevInfoByMaIds(maIds));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设备信息录入---录入经纬度
|
||||
* @param infoMotionDto 设备信息
|
||||
*/
|
||||
@ApiOperation(value = "装备信息录入--含经纬度")
|
||||
@PostMapping("/insertInfoMotionDto")
|
||||
public AjaxResult insertInfoMotionDto(@RequestBody InfoMotionDto infoMotionDto) {
|
||||
return toAjax(devInfoService.insertInfoMotionDto(infoMotionDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备--UUID生成CODE--字符串
|
||||
* @param devInfo 设备信息
|
||||
*/
|
||||
@ApiOperation(value = "添加设备--字符串传入--UUID生成CODE")
|
||||
@PostMapping("/outType")
|
||||
public void outType(@RequestBody String devInfo){
|
||||
devInfoService.insertOutType(devInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备信息--包含附件上传
|
||||
*/
|
||||
//@RequiresPermissions("equip:info:add")
|
||||
@ApiOperation(value = "新增装备--含附件上传")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DevInfo devInfo) {
|
||||
return toAjax(devInfoService.insertDevInfo(devInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计装备
|
||||
*/
|
||||
@ApiOperation(value = "装备统计")
|
||||
@GetMapping("/sumType")
|
||||
public AjaxResult sumType() {
|
||||
return success(devInfoService.sumType());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
package com.bonus.material.device.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备类型对象 ma_type_info
|
||||
*
|
||||
* @author syruan
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel("设备类型对象")
|
||||
public class TypeInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 类型id */
|
||||
@Excel(name = "类型id")
|
||||
@ApiModelProperty(value = "类型id", required = true)
|
||||
private Long typeId;
|
||||
|
||||
/** 父级id */
|
||||
@Excel(name = "父级id")
|
||||
@ApiModelProperty(value = "父级id", required = true)
|
||||
private Long parentId;
|
||||
|
||||
/** 类型名称 */
|
||||
@Excel(name = "类型名称")
|
||||
@ApiModelProperty(value = "类型名称", required = true)
|
||||
private String typeName;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
@ApiModelProperty(value = "计量单位", required = true)
|
||||
private String unitName;
|
||||
|
||||
/** 层级 */
|
||||
@Excel(name = "层级")
|
||||
@ApiModelProperty(value = "层级", required = true)
|
||||
private String level;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
private String sort;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
@ApiModelProperty(value = "是否删除", required = true)
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
@ApiModelProperty(value = "父部门名称", required = true)
|
||||
private String parentName;
|
||||
|
||||
/** 子部门 */
|
||||
@ApiModelProperty(value = "子部门", required = true)
|
||||
private List<TypeInfo> children = new ArrayList<TypeInfo>();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.material.device.domain.dto;
|
||||
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author syruan
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
|
||||
public class InfoMotionDto extends DevInfo {
|
||||
|
||||
@ApiModelProperty(value = "经度", required = true)
|
||||
private String lon;
|
||||
|
||||
@ApiModelProperty(value = "纬度", required = true)
|
||||
private String lat;
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import com.bonus.common.biz.domain.SysDic;
|
|||
import com.bonus.common.biz.domain.SysFile;
|
||||
import com.bonus.common.biz.domain.UserCollect;
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.domain.dto.InfoMotionDto;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -87,7 +88,7 @@ public interface DevInfoMapper {
|
|||
/**
|
||||
* 添加经纬度信息
|
||||
*/
|
||||
// int insertLon(InforMationDto inforMationDto);
|
||||
int insertLon(InfoMotionDto infoMotionDto);
|
||||
|
||||
List<SysDic> getSysDic();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.bonus.material.device.mapper;
|
|||
|
||||
|
||||
import com.bonus.common.biz.domain.SysFileInfo;
|
||||
import com.bonus.material.device.domain.TypeInfo;
|
||||
import com.bonus.common.biz.domain.TypeInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -20,7 +20,8 @@ public interface SysFileInfoMapper {
|
|||
|
||||
void insertFileInfo(SysFileInfo fileInfo);
|
||||
|
||||
// BmCompanyInfo getBmCompanyInfo(@Param("companyName") String companyName);
|
||||
// TODO: 2020/7/27
|
||||
// BmCompanyInfo getBmCompanyInfo(@Param("companyName") String companyName);
|
||||
|
||||
TypeInfo getTypeInfo(@Param("deviceName") String deviceName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.device.service;
|
|||
|
||||
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.domain.dto.InfoMotionDto;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -19,7 +20,7 @@ public interface DevInfoService {
|
|||
* @param maId 设备信息主键
|
||||
* @return 设备信息
|
||||
*/
|
||||
public DevInfoVo selectDevInfoByMaId(Long maId);
|
||||
DevInfoVo selectDevInfoByMaId(Long maId);
|
||||
|
||||
/**
|
||||
* 查询设备信息列表
|
||||
|
|
@ -27,19 +28,11 @@ public interface DevInfoService {
|
|||
* @param devInfo 设备信息
|
||||
* @return 设备信息集合
|
||||
*/
|
||||
public List<DevInfoVo> selectDevInfoList(DevInfoVo devInfo);
|
||||
List<DevInfoVo> selectDevInfoList(DevInfoVo devInfo);
|
||||
|
||||
List<DevInfoVo> selectUserCollectList(DevInfoVo devInfo);
|
||||
|
||||
public List<DevInfoVo> selectDevInfoHotList(DevInfoVo devInfo);
|
||||
|
||||
/**
|
||||
* 新增设备信息
|
||||
*
|
||||
* @param devInfo 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDevInfo(DevInfo devInfo);
|
||||
List<DevInfoVo> selectDevInfoHotList(DevInfoVo devInfo);
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
|
|
@ -47,7 +40,7 @@ public interface DevInfoService {
|
|||
* @param devInfo 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevInfo(DevInfo devInfo);
|
||||
int updateDevInfo(DevInfo devInfo);
|
||||
|
||||
/**
|
||||
* 批量删除设备信息
|
||||
|
|
@ -55,7 +48,7 @@ public interface DevInfoService {
|
|||
* @param maIds 需要删除的设备信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevInfoByMaIds(Long[] maIds);
|
||||
int deleteDevInfoByMaIds(Long[] maIds);
|
||||
|
||||
/**
|
||||
* 删除设备信息信息
|
||||
|
|
@ -63,19 +56,29 @@ public interface DevInfoService {
|
|||
* @param maId 设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevInfoByMaId(Long maId);
|
||||
int deleteDevInfoByMaId(Long maId);
|
||||
|
||||
/**
|
||||
* 设备信息录入
|
||||
* @param inforMationDto
|
||||
* @return
|
||||
* 设备信息录入--录入经纬度
|
||||
* @param infoMotionDto 设备信息
|
||||
*/
|
||||
int insertInfoMotionDto(InfoMotionDto infoMotionDto);
|
||||
|
||||
int insertInforMationDto(InforMationDto inforMationDto);*/
|
||||
/**
|
||||
* 设备类型--字符串传入--UUID生成CODE
|
||||
*/
|
||||
void insertOutType(String devInfo);
|
||||
|
||||
/**
|
||||
* 新增设备信息--包含附件上传
|
||||
*
|
||||
* @param devInfo 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertDevInfo(DevInfo devInfo);
|
||||
|
||||
public Map<String, Integer> sumType();
|
||||
Map<String, Integer> sumType();
|
||||
|
||||
List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo);
|
||||
|
||||
void insertOutType(String devInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
import com.bonus.common.biz.domain.*;
|
||||
import com.bonus.common.biz.enums.MaStatusEnum;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.bean.BeanUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.domain.TypeInfo;
|
||||
import com.bonus.material.device.domain.dto.InfoMotionDto;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.device.mapper.DevInfoMapper;
|
||||
import com.bonus.material.device.mapper.SysFileInfoMapper;
|
||||
|
|
@ -23,8 +24,6 @@ import javax.annotation.Resource;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设备信息Service业务层处理
|
||||
*
|
||||
|
|
@ -248,18 +247,16 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* 信息录入
|
||||
* @param inforMationDto
|
||||
* @return
|
||||
|
||||
* @param infoMotionDto 设备信息
|
||||
*/
|
||||
@Override
|
||||
public int insertInforMationDto(InforMationDto inforMationDto) {
|
||||
public int insertInfoMotionDto(InfoMotionDto infoMotionDto) {
|
||||
DevInfo devInfo = new DevInfo();
|
||||
BeanUtils.copyProperties(inforMationDto, devInfo);
|
||||
BeanUtils.copyProperties(infoMotionDto, devInfo);
|
||||
devInfoMapper.insertDevInfo(devInfo);
|
||||
return devInfoMapper.insertLon(inforMationDto);
|
||||
}*/
|
||||
return devInfoMapper.insertLon(infoMotionDto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.material.home.mapper;
|
||||
|
||||
|
||||
import com.bonus.material.home.domain.TypeInfo;
|
||||
import com.bonus.common.biz.domain.TypeInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.bonus.material.home.service.impl;
|
|||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import com.bonus.material.home.domain.TypeInfo;
|
||||
import com.bonus.common.biz.domain.TypeInfo;
|
||||
import com.bonus.material.home.mapper.MaTypeInfoMapper;
|
||||
import com.bonus.material.home.service.MaTypeInfoSevice;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.home.mapper.MaTypeInfoMapper">
|
||||
|
||||
<resultMap type="com.bonus.material.home.domain.TypeInfo" id="MaDevInfoResult">
|
||||
<resultMap type="com.bonus.common.biz.domain.TypeInfo" id="MaDevInfoResult">
|
||||
|
||||
<id property="typeId" column="type_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
|
|
@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where del_flag = '0'
|
||||
</sql>
|
||||
|
||||
<select id="getMaTypeInfoList" resultType="com.bonus.material.home.domain.TypeInfo">
|
||||
<select id="getMaTypeInfoList" resultType="com.bonus.common.biz.domain.TypeInfo">
|
||||
select type_id as typeId, parent_id as parentId, type_name as typeName, `level` as level, del_flag as delFlag
|
||||
from ma_type
|
||||
where del_flag = '0'
|
||||
|
|
|
|||
Loading…
Reference in New Issue