接口联调
This commit is contained in:
parent
0b7fc42131
commit
67fa4ac6ef
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-modules</artifactId>
|
||||
<version>24.8.0</version>
|
||||
<version>24.9.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -40,7 +41,7 @@ public class TbDeviceController extends BaseController {
|
|||
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult queryByPage(TbDevice tbDevice) {
|
||||
public AjaxResult queryByPage(@Valid TbDevice tbDevice) {
|
||||
startPage();
|
||||
List<TbDevice> list = tbDeviceService.getAll(tbDevice);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
|
|
@ -54,7 +55,7 @@ public class TbDeviceController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbDevice tbDevice) {
|
||||
public AjaxResult add(@Valid @RequestBody TbDevice tbDevice) {
|
||||
return tbDeviceService.insertSelective(tbDevice);
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ public class TbDeviceController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbDevice tbDevice) {
|
||||
public AjaxResult edit(@Valid @RequestBody TbDevice tbDevice) {
|
||||
return tbDeviceService.updateByPrimaryKeySelective(tbDevice);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static com.bonus.base.config.Constants.TEAM_LEADER;
|
||||
|
|
@ -43,7 +44,7 @@ public class TbPeopleController extends BaseController {
|
|||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult queryByPage(TbPeople tbPeople) {
|
||||
public AjaxResult queryByPage(@Valid TbPeople tbPeople) {
|
||||
if (tbPeople.getIsAll() != null) {
|
||||
return AjaxResult.success(tbPeopleService.queryByPage(tbPeople));
|
||||
}
|
||||
|
|
@ -70,7 +71,7 @@ public class TbPeopleController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbPeople tbPeople) {
|
||||
public AjaxResult add(@Valid @RequestBody TbPeople tbPeople) {
|
||||
return tbPeopleService.insert(tbPeople);
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +82,7 @@ public class TbPeopleController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbPeople tbPeople) {
|
||||
public AjaxResult edit(@Valid @RequestBody TbPeople tbPeople) {
|
||||
return tbPeopleService.update(tbPeople);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -36,7 +37,7 @@ public class TbProDepartController extends BaseController {
|
|||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult queryByPage(TbProDepart tbProDepart) {
|
||||
public AjaxResult queryByPage(@Valid TbProDepart tbProDepart) {
|
||||
if (tbProDepart.getIsAll() != null && tbProDepart.getIsAll() == 0) {
|
||||
return AjaxResult.success(tbProDepartService.queryByPage(tbProDepart));
|
||||
}
|
||||
|
|
@ -83,7 +84,7 @@ public class TbProDepartController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbProDepart tbProDepart) {
|
||||
public AjaxResult add(@Valid @RequestBody TbProDepart tbProDepart) {
|
||||
return tbProDepartService.insert(tbProDepart);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +95,7 @@ public class TbProDepartController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbProDepart tbProDepart) {
|
||||
public AjaxResult edit(@Valid @RequestBody TbProDepart tbProDepart) {
|
||||
return tbProDepartService.update(tbProDepart);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +38,7 @@ public class TbProPowerController extends BaseController {
|
|||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo queryByPage(TbProPower tbProPower) {
|
||||
public TableDataInfo queryByPage(@Valid TbProPower tbProPower) {
|
||||
startPage();
|
||||
List<TbProPower> list = tbProPowerService.queryByPage(tbProPower);
|
||||
return getDataTable(list);
|
||||
|
|
@ -61,7 +62,7 @@ public class TbProPowerController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbProPower tbProPower) {
|
||||
public AjaxResult add(@Valid @RequestBody TbProPower tbProPower) {
|
||||
return tbProPowerService.insert(tbProPower);
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +73,7 @@ public class TbProPowerController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbProPower tbProPower) {
|
||||
public AjaxResult edit(@Valid @RequestBody TbProPower tbProPower) {
|
||||
return tbProPowerService.update(tbProPower);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -35,7 +36,7 @@ public class TbProjectController extends BaseController {
|
|||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult queryByPage(TbProject tbProject) {
|
||||
public AjaxResult queryByPage(@Valid TbProject tbProject) {
|
||||
if (tbProject.getIsAll() != null && tbProject.getIsAll() == 0) {
|
||||
return AjaxResult.success(tbProjectService.queryByPage(tbProject));
|
||||
}
|
||||
|
|
@ -62,7 +63,7 @@ public class TbProjectController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbProject tbProject) {
|
||||
public AjaxResult add(@Valid @RequestBody TbProject tbProject) {
|
||||
return tbProjectService.insert(tbProject);
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ public class TbProjectController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbProject tbProject) {
|
||||
public AjaxResult edit(@Valid @RequestBody TbProject tbProject) {
|
||||
return tbProjectService.update(tbProject);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -36,7 +37,7 @@ public class TbTeamController extends BaseController {
|
|||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo queryByPage(TbTeam tbTeam) {
|
||||
public TableDataInfo queryByPage(@Valid TbTeam tbTeam) {
|
||||
startPage();
|
||||
List<TbTeam> list = tbTeamService.queryByPage(tbTeam);
|
||||
return getDataTable(list);
|
||||
|
|
@ -60,7 +61,7 @@ public class TbTeamController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbTeam tbTeam) {
|
||||
public AjaxResult add(@Valid @RequestBody TbTeam tbTeam) {
|
||||
return tbTeamService.insert(tbTeam);
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +72,7 @@ public class TbTeamController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbTeam tbTeam) {
|
||||
public AjaxResult edit(@Valid @RequestBody TbTeam tbTeam) {
|
||||
return tbTeamService.update(tbTeam);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class TbWarnConfigController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult queryByPage(TbWarnConfig tbWarnConfig) {
|
||||
public AjaxResult queryByPage(@Valid TbWarnConfig tbWarnConfig) {
|
||||
if (tbWarnConfig.getIsAll() != null && tbWarnConfig.getIsAll() == 0) {
|
||||
return AjaxResult.success(tbWarnConfigService.getAll(tbWarnConfig));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ public class TbDevice implements Serializable {
|
|||
@ApiModelProperty(value="设备类型(码表)")
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@ApiModelProperty(value="设备类型")
|
||||
private String devTypeCode;
|
||||
|
||||
/**
|
||||
* 设备类型(码表)
|
||||
*/
|
||||
|
|
@ -41,6 +47,7 @@ public class TbDevice implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value="设备编码(唯一)")
|
||||
@Excel(name = "设备编码")
|
||||
@Size(max = 50,message = "设备编码最大长度要小于 50")
|
||||
private String devCode;
|
||||
|
||||
/**
|
||||
|
|
@ -48,6 +55,7 @@ public class TbDevice implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value="设备名称")
|
||||
@Excel(name = "设备名称")
|
||||
@Size(max = 50,message = "设备名称最大长度要小于 50")
|
||||
private String devName;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.base.domain;
|
|||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -33,6 +34,7 @@ public class TbPeople implements Serializable {
|
|||
* 人员名称
|
||||
*/
|
||||
@Excel(name = "姓名")
|
||||
@Size(max = 50,message = "姓名最大长度要小于 50")
|
||||
private String relName;
|
||||
|
||||
/**
|
||||
|
|
@ -61,12 +63,14 @@ public class TbPeople implements Serializable {
|
|||
* 身份证号码
|
||||
*/
|
||||
@Excel(name = "身份证号码")
|
||||
@Size(max = 18,message = "身份证号码最大长度要小于 18")
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 联系方式(sm4加密存储)
|
||||
*/
|
||||
@Excel(name = "电话")
|
||||
@Size(max = 11,message = "电话最大长度要小于 11")
|
||||
private String relPhone;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.base.domain;
|
|||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -29,6 +30,7 @@ public class TbProDepart implements Serializable {
|
|||
* 项目部名称
|
||||
*/
|
||||
@Excel(name = "项目部名称")
|
||||
@Size(max = 50,message = "项目部名称最大长度要小于 50")
|
||||
private String departName;
|
||||
|
||||
/**
|
||||
|
|
@ -62,16 +64,19 @@ public class TbProDepart implements Serializable {
|
|||
* 负责人
|
||||
*/
|
||||
@Excel(name = "负责人")
|
||||
@Size(max = 50,message = "负责人名称最大长度要小于 50")
|
||||
private String headUser;
|
||||
/**
|
||||
* 负责人联系电话(sm4)加密(查询展示脱敏)
|
||||
*/
|
||||
@Excel(name = "电话")
|
||||
@Size(max = 50,message = "电话最大长度要小于 50")
|
||||
private String headUserPhone;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
@Size(max = 50,message = "备注最大长度要小于 50")
|
||||
private String remarks;
|
||||
/**
|
||||
* 创建时间
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.base.domain;
|
|||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -22,6 +23,7 @@ public class TbProPower implements Serializable {
|
|||
* 工程杆塔名称
|
||||
*/
|
||||
@Excel(name = "杆塔名称")
|
||||
@Size(max = 50,message = "杆塔名称最大长度要小于 50")
|
||||
private String gtName;
|
||||
/**
|
||||
* 工程id
|
||||
|
|
@ -32,12 +34,14 @@ public class TbProPower implements Serializable {
|
|||
* 经度
|
||||
*/
|
||||
@Excel(name = "杆塔经度")
|
||||
@Size(max = 50,message = "杆塔经度最大长度要小于 50")
|
||||
private String lon;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Excel(name = "杆塔纬度")
|
||||
@Size(max = 50,message = "杆塔纬度最大长度要小于 50")
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.base.domain;
|
|||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -29,6 +30,7 @@ public class TbProject implements Serializable {
|
|||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称")
|
||||
@Size(max = 50,message = "工程名称最大长度要小于 50")
|
||||
private String proName;
|
||||
/**
|
||||
* 所属项目部
|
||||
|
|
@ -64,11 +66,13 @@ public class TbProject implements Serializable {
|
|||
* 经度
|
||||
*/
|
||||
@Excel(name = "经度")
|
||||
@Size(max = 50,message = "经度最大长度要小于 50")
|
||||
private String lon;
|
||||
/**
|
||||
* 维度
|
||||
*/
|
||||
@Excel(name = "纬度")
|
||||
@Size(max = 50,message = "纬度最大长度要小于 50")
|
||||
private String lat;
|
||||
/**
|
||||
* 删除状态(0 正常 1删除)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
|
@ -36,6 +37,7 @@ public class TbTeam implements Serializable {
|
|||
* 班组名称
|
||||
*/
|
||||
@Excel(name = "班组名称")
|
||||
@Size(max = 50,message = "班组名称最大长度要小于 50")
|
||||
private String teamName;
|
||||
/**
|
||||
* 班组长id
|
||||
|
|
@ -60,6 +62,7 @@ public class TbTeam implements Serializable {
|
|||
* 班组长名称2
|
||||
*/
|
||||
@Excel(name = "班组长")
|
||||
@Size(max = 50,message = "班组长最大长度要小于 50")
|
||||
private String relName;
|
||||
|
||||
/**
|
||||
|
|
@ -111,6 +114,7 @@ public class TbTeam implements Serializable {
|
|||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@Size(max = 50,message = "关键字最大长度要小于 50")
|
||||
private String keyWord;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -75,5 +75,5 @@ public interface TbDeviceMapper {
|
|||
DeviceTypeEnum towerWaterMonitor,
|
||||
DeviceTypeEnum leadStrainMonitor);
|
||||
|
||||
List<DeviceWarnRecordVo> getDeviceModelDetailsPage(@Param("deviceTypeCode") Integer deviceTypeCode);
|
||||
List<DeviceWarnRecordVo> getDeviceModelDetailsPage(TbDevice tbDevice);
|
||||
}
|
||||
|
|
@ -297,7 +297,7 @@ public class TbPeopleServiceImpl implements TbPeopleService {
|
|||
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
if (!Constants.XLS.equalsIgnoreCase(fileExtension) && !Constants.XLSX.equalsIgnoreCase(fileExtension)) {
|
||||
// 文件后缀名不符合要求
|
||||
return AjaxResult.error("文件后缀名不符合要求,必须为xls或xlsx结尾");
|
||||
return AjaxResult.error("导入失败:文件后缀名不符合要求,必须为xls或xlsx结尾");
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
|
@ -308,18 +308,18 @@ public class TbPeopleServiceImpl implements TbPeopleService {
|
|||
int totalRows = sheet.getPhysicalNumberOfRows();
|
||||
// 检查是否有行数
|
||||
if (totalRows <= 1) {
|
||||
throw new IllegalArgumentException("Excel文件中没有数据,请检查后重新导入");
|
||||
throw new IllegalArgumentException("导入失败:Excel文件中没有数据,请检查后重新导入");
|
||||
}
|
||||
// 读取第一行表头
|
||||
Row headerRow = sheet.getRow(0);
|
||||
if (headerRow == null) {
|
||||
throw new IllegalArgumentException("文件中没有表头");
|
||||
throw new IllegalArgumentException("导入失败:文件中没有表头");
|
||||
}
|
||||
// 获取表头的列数
|
||||
int totalCells = headerRow.getPhysicalNumberOfCells();
|
||||
// 预期的表头列数为5列,可以根据实际需求修改这个条件
|
||||
if (totalCells != 5) {
|
||||
throw new IllegalArgumentException("表头列数与预期不符,请检查导入模板");
|
||||
throw new IllegalArgumentException("导入失败:表头列数与预期不符,请检查导入模板");
|
||||
}
|
||||
// 读取表头内容并验证每一列
|
||||
extracted(headerRow, totalCells);
|
||||
|
|
|
|||
|
|
@ -140,14 +140,18 @@ public class TbProPowerServiceImpl implements TbProPowerService {
|
|||
*/
|
||||
@Override
|
||||
public AjaxResult importTbProPower(MultipartFile file, Long id) {
|
||||
if (file.getSize() > 10 * 1024 * 1024) {
|
||||
return AjaxResult.error("文件过大,请上传10M以内的文件");
|
||||
}
|
||||
String fileName = file.getOriginalFilename();
|
||||
if (fileName != null) {
|
||||
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
if (!Constants.XLS.equalsIgnoreCase(fileExtension) && !Constants.XLSX.equalsIgnoreCase(fileExtension)) {
|
||||
// 文件后缀名不符合要求
|
||||
return AjaxResult.error("文件后缀名不符合要求,必须为xls或xlsx结尾");
|
||||
return AjaxResult.error("导入失败:文件后缀名不符合要求,必须为xls或xlsx结尾");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
InputStream inputStream = file.getInputStream();
|
||||
Workbook workbook = new XSSFWorkbook(inputStream);
|
||||
|
|
@ -158,19 +162,19 @@ public class TbProPowerServiceImpl implements TbProPowerService {
|
|||
|
||||
// 检查是否有行数
|
||||
if (totalRows <= 1) {
|
||||
throw new IllegalArgumentException("Excel文件中没有数据,请检查后重新导入");
|
||||
throw new IllegalArgumentException("导入失败:Excel文件中没有数据,请检查后重新导入");
|
||||
}
|
||||
// 读取第一行表头
|
||||
Row headerRow = sheet.getRow(0);
|
||||
|
||||
if (headerRow == null) {
|
||||
throw new IllegalArgumentException("文件中没有表头");
|
||||
throw new IllegalArgumentException("导入失败:文件中没有表头");
|
||||
}
|
||||
// 获取表头的列数
|
||||
int totalCells = headerRow.getPhysicalNumberOfCells();
|
||||
// 假设预期的表头列数为3列,可以根据实际需求修改这个条件
|
||||
if (totalCells != 3) {
|
||||
throw new IllegalArgumentException("表头列数与预期不符,请检查导入模板");
|
||||
throw new IllegalArgumentException("导入失败:表头列数与预期不符,请检查导入模板");
|
||||
}
|
||||
// 读取表头内容并验证每一列,看是否符合模版要求
|
||||
for (int cellNum = 0; cellNum < totalCells; cellNum++) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
package com.bonus.base.service.impl;
|
||||
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.base.config.ExceptionEnum;
|
||||
import com.bonus.base.domain.TbUserPost;
|
||||
import com.bonus.base.mapper.TbUserPostMapper;
|
||||
import com.bonus.base.service.TbUserPostService;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -30,7 +34,15 @@ public class TbUserPostServiceImpl implements TbUserPostService {
|
|||
*/
|
||||
@Override
|
||||
public List<TbUserPost> queryByPage(TbUserPost tbUserPost) {
|
||||
return tbUserPostDao.queryByPage(tbUserPost);
|
||||
List<TbUserPost> list = tbUserPostDao.queryByPage(tbUserPost);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (TbUserPost userPost : list) {
|
||||
if (StringUtils.isNotBlank(userPost.getRelPhone())) {
|
||||
userPost.setRelPhone(Sm4Utils.decode(userPost.getRelPhone()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +53,13 @@ public class TbUserPostServiceImpl implements TbUserPostService {
|
|||
*/
|
||||
@Override
|
||||
public AjaxResult insert(TbUserPost tbUserPost) {
|
||||
//校验手机号
|
||||
if (StringUtils.isNotBlank(tbUserPost.getRelPhone())) {
|
||||
if (!PhoneUtil.isMobile(tbUserPost.getRelPhone())) {
|
||||
return AjaxResult.error(ExceptionEnum.INVALID_PHONE_NUMBER_FORMAT.getCode(), ExceptionEnum.INVALID_PHONE_NUMBER_FORMAT.getMsg());
|
||||
}
|
||||
tbUserPost.setRelPhone(Sm4Utils.encode(tbUserPost.getRelPhone()));
|
||||
}
|
||||
int result = tbUserPostDao.insert(tbUserPost);
|
||||
if (result > 0) {
|
||||
return AjaxResult.success(ExceptionEnum.SUCCESS.getMsg(), result);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bonus.base.vo;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
|
||||
/**
|
||||
* 边带设备管理返回vo
|
||||
|
|
@ -24,6 +26,7 @@ public class TbBdDeviceVo {
|
|||
* 项目部名称
|
||||
*/
|
||||
@ApiModelProperty(value="项目部名称")
|
||||
@Size(max = 50,message = "项目部名称最大长度要小于 50")
|
||||
private String departName;
|
||||
|
||||
/**
|
||||
|
|
@ -36,6 +39,7 @@ public class TbBdDeviceVo {
|
|||
* 工程名称
|
||||
*/
|
||||
@ApiModelProperty(value="工程名称")
|
||||
@Size(max = 50,message = "工程名称最大长度要小于 50")
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
|
|
@ -48,12 +52,14 @@ public class TbBdDeviceVo {
|
|||
* 设备名称
|
||||
*/
|
||||
@ApiModelProperty(value="设备名称")
|
||||
@Size(max = 50,message = "边带名称最大长度要小于 50")
|
||||
private String devName;
|
||||
|
||||
/**
|
||||
* 设备编码-唯一校验
|
||||
*/
|
||||
@ApiModelProperty(value="设备编码-唯一校验")
|
||||
@Size(max = 50,message = "边带编码最大长度要小于 50")
|
||||
private String devCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.screen.controller;
|
||||
|
||||
import com.bonus.base.domain.TbDevice;
|
||||
import com.bonus.base.service.TbUserPostService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -71,9 +72,9 @@ public class ProjectViewController extends BaseController {
|
|||
}
|
||||
|
||||
@GetMapping("/getDeviceModelDetailsPage")
|
||||
public TableDataInfo getDeviceModelDetailsPage(Integer deviceTypeCode) {
|
||||
public TableDataInfo getDeviceModelDetailsPage(TbDevice tbDevice) {
|
||||
startPage();
|
||||
List<DeviceWarnRecordVo> list = projectViewService.getDeviceModelDetailsPage(deviceTypeCode);
|
||||
List<DeviceWarnRecordVo> list = projectViewService.getDeviceModelDetailsPage(tbDevice);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.screen.service.impl;
|
|||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.base.config.DeviceTypeEnum;
|
||||
import com.bonus.base.config.ProjectTypeEnum;
|
||||
import com.bonus.base.domain.TbDevice;
|
||||
import com.bonus.base.domain.TbProPower;
|
||||
import com.bonus.base.mapper.TbDeviceMapper;
|
||||
import com.bonus.base.mapper.TbProDepartMapper;
|
||||
|
|
@ -119,8 +120,8 @@ public class ProjectViewServiceImpl {
|
|||
}
|
||||
|
||||
|
||||
public List<DeviceWarnRecordVo> getDeviceModelDetailsPage(Integer code) {
|
||||
return tbDeviceMapper.getDeviceModelDetailsPage(code);
|
||||
public List<DeviceWarnRecordVo> getDeviceModelDetailsPage(TbDevice tbDevice) {
|
||||
return tbDeviceMapper.getDeviceModelDetailsPage(tbDevice);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,4 +57,10 @@ public class DeviceWarnRecordVo implements Serializable {
|
|||
@ApiModelProperty(value = "告警类型")
|
||||
private String warnType;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/bonus-ai" />
|
||||
<property name="log.path" value="logs/bonus-base" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
|
|
|||
|
|
@ -314,7 +314,8 @@
|
|||
SELECT
|
||||
td.dev_name as devName,
|
||||
td.dev_code AS devCode,
|
||||
td.dev_type AS devTypeName,
|
||||
td.dev_type AS devType,
|
||||
sda.dict_label AS devTypeName,
|
||||
CASE WHEN td.dev_status = 0 THEN '离线'
|
||||
WHEN td.dev_status = 1 THEN '在线'
|
||||
ELSE '未知状态' END devStatusName,
|
||||
|
|
@ -323,10 +324,17 @@
|
|||
tbdr.dev_user AS devUserName
|
||||
FROM tb_device td
|
||||
LEFT JOIN tb_bd_device_record tbdr ON tbdr.id = td.bd_id
|
||||
LEFT JOIN sys_dict_data sda ON td.dev_type = sda.dict_code
|
||||
LEFT JOIN tb_project tp ON tbdr.pro_id = tp.id
|
||||
WHERE td.del_flag = 0
|
||||
<if test="devTypeCode != null">
|
||||
and td.dev_type = #{devTypeCode}
|
||||
</if>
|
||||
<if test="devName != null and devName != ''">
|
||||
and td.dev_name like concat('%',#{devName},'%')
|
||||
</if>
|
||||
<if test="devCode != null and devCode != ''">
|
||||
and td.dev_code like concat('%',#{devCode},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
id as id, post_name as postName, rel_name as relName, rel_phone as relPhone, create_time as createTime, pro_id as proId
|
||||
from tb_user_post
|
||||
<where>
|
||||
<if test="proId != null and proId != ''">
|
||||
and pro_id = #{proId}
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
<if test="proName != null and proName != ''">
|
||||
and tp.pro_name like concat('%',#{proName},'%')
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE(tddr.create_time) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
GROUP BY tddr.id
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue