基础管理调试

This commit is contained in:
mashuai 2024-09-19 13:57:17 +08:00
parent 5134b35193
commit 33c2058d2c
5 changed files with 28 additions and 11 deletions

View File

@ -52,7 +52,7 @@ public class TbBdDeviceRecordController extends BaseController {
* @param tbBdDeviceVo
* @return
*/
@GetMapping("/DeviceList")
@GetMapping("/getDeviceList")
public TableDataInfo getDeviceList(TbBdDeviceVo tbBdDeviceVo) {
startPage();
List<TbBdDeviceVo> list = tbBdDeviceRecordService.getDeviceList(tbBdDeviceVo);

View File

@ -116,13 +116,20 @@ public class TbBdRecord implements Serializable {
/**
* 审核人
*/
@ApiModelProperty(value="审核人")
@ApiModelProperty(value="审核人id")
private Long auditUser;
/**
* 审核人
*/
@ApiModelProperty(value="审核人姓名")
private String auditUserName;
/**
* 审核时间
*/
@ApiModelProperty(value="审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
/**

View File

@ -1,5 +1,6 @@
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.TbBdDeviceRecord;
@ -16,7 +17,6 @@ import com.bonus.base.domain.TbBdRecord;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.bonus.base.mapper.TbBdRecordMapper;
@ -75,6 +75,9 @@ public class TbBdRecordServiceImpl implements TbBdRecordService{
deviceRecord.setRecordId(record.getId());
deviceRecord.setProId(record.getProId());
if (StringUtils.isNotBlank(deviceRecord.getDevUserPhone())) {
if (!PhoneUtil.isMobile(deviceRecord.getDevUserPhone())) {
return AjaxResult.error(ExceptionEnum.INVALID_PHONE_NUMBER_FORMAT.getCode(), ExceptionEnum.INVALID_PHONE_NUMBER_FORMAT.getMsg());
}
deviceRecord.setDevUserPhone(Sm4Utils.encode(deviceRecord.getDevUserPhone()));
}
//根据设备名称或编码唯一校验
@ -156,6 +159,9 @@ public class TbBdRecordServiceImpl implements TbBdRecordService{
deviceRecord.setRecordId(record.getId());
deviceRecord.setProId(record.getProId());
if (StringUtils.isNotBlank(deviceRecord.getDevUserPhone())) {
if (!PhoneUtil.isMobile(deviceRecord.getDevUserPhone())) {
return AjaxResult.error(ExceptionEnum.INVALID_PHONE_NUMBER_FORMAT.getCode(), ExceptionEnum.INVALID_PHONE_NUMBER_FORMAT.getMsg());
}
deviceRecord.setDevUserPhone(Sm4Utils.encode(deviceRecord.getDevUserPhone()));
}
result += tbBdDeviceRecordMapper.insertSelective(deviceRecord);

View File

@ -21,18 +21,12 @@
<result column="audit_user" jdbcType="BIGINT" property="auditUser" />
<result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, depart_id, depart_name, pro_id, pro_name, rel_user, rel_phone, del_flag, audit_status,
remarks, create_time, create_user, update_time, update_user, audit_user, audit_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from tb_bd_record
where id = #{id,jdbcType=BIGINT}
</select>
<select id="getAll" resultType="com.bonus.base.domain.TbBdRecord">
select
@ -73,6 +67,16 @@
</if>
</select>
<select id="selectByPrimaryKey" resultType="com.bonus.base.domain.TbBdRecord">
select
tbr.id as id, tbr.depart_id as departId, tbr.depart_name as departId, tbr.pro_id as proId, tbr.pro_name, tbr.rel_user, tbr.rel_phone, tbr.del_flag as delFlag, tbr.audit_status as auditStatus,
tbr.remarks as remarks, tbr.create_time as createTime, tbr.create_user as createUser, tbr.update_time as updateTime, tbr.update_user as updateUser, tbr.audit_user as auditUser, tbr.audit_time as auditTime,
su.nick_name as auditUserName
from tb_bd_record tbr
left join sys_user su on tbr.audit_user = su.id
where id = #{id}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
update tb_bd_record

View File

@ -8,7 +8,7 @@
from tb_pro_power tb
where tb.del_flag = '0'
<if test="id != null">
and tb.pro_id = #{proId}
and tb.pro_id = #{id}
</if>
<if test="gtName != null and gtName != ''">
and tb.gt_name like concat('%',#{gtName},'%')