1、增加单位图标管理
2、修改机构登录 3、订单问题处理 4、完善组态绑定及删除关联
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.xinda.iot.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xinda.common.annotation.Excel;
|
||||
import com.xinda.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 单位图标对象 iot_unit_icon
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-06-04
|
||||
*/
|
||||
@ApiModel(value = "UnitIcon",description = "单位图标 iot_unit_icon")
|
||||
@Data
|
||||
public class UnitIcon extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id唯一标识 */
|
||||
private Long id;
|
||||
|
||||
/** 单位说明 */
|
||||
@Excel(name = "单位说明")
|
||||
@ApiModelProperty("单位说明")
|
||||
private String unitDesc;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
@ApiModelProperty("单位")
|
||||
private String unitName;
|
||||
|
||||
/** 路径 */
|
||||
@Excel(name = "路径")
|
||||
@ApiModelProperty("路径")
|
||||
private String resourceUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.xinda.iot.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.iot.domain.UnitIcon;
|
||||
|
||||
/**
|
||||
* 单位图标Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-06-04
|
||||
*/
|
||||
public interface UnitIconMapper
|
||||
{
|
||||
/**
|
||||
* 查询单位图标
|
||||
*
|
||||
* @param id 单位图标主键
|
||||
* @return 单位图标
|
||||
*/
|
||||
public UnitIcon selectUnitIconById(Long id);
|
||||
|
||||
/**
|
||||
* 查询单位图标列表
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 单位图标集合
|
||||
*/
|
||||
public List<UnitIcon> selectUnitIconList(UnitIcon unitIcon);
|
||||
|
||||
/**
|
||||
* 新增单位图标
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUnitIcon(UnitIcon unitIcon);
|
||||
|
||||
/**
|
||||
* 修改单位图标
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUnitIcon(UnitIcon unitIcon);
|
||||
|
||||
/**
|
||||
* 删除单位图标
|
||||
*
|
||||
* @param id 单位图标主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUnitIconById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除单位图标
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUnitIconByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.xinda.iot.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.iot.domain.UnitIcon;
|
||||
|
||||
/**
|
||||
* 单位图标Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-06-04
|
||||
*/
|
||||
public interface IUnitIconService
|
||||
{
|
||||
/**
|
||||
* 查询单位图标
|
||||
*
|
||||
* @param id 单位图标主键
|
||||
* @return 单位图标
|
||||
*/
|
||||
public UnitIcon selectUnitIconById(Long id);
|
||||
|
||||
/**
|
||||
* 查询单位图标列表
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 单位图标集合
|
||||
*/
|
||||
public List<UnitIcon> selectUnitIconList(UnitIcon unitIcon);
|
||||
|
||||
/**
|
||||
* 新增单位图标
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUnitIcon(UnitIcon unitIcon);
|
||||
|
||||
/**
|
||||
* 修改单位图标
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUnitIcon(UnitIcon unitIcon);
|
||||
|
||||
/**
|
||||
* 批量删除单位图标
|
||||
*
|
||||
* @param ids 需要删除的单位图标主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUnitIconByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除单位图标信息
|
||||
*
|
||||
* @param id 单位图标主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUnitIconById(Long id);
|
||||
}
|
||||
@@ -277,8 +277,10 @@ public class SocialLoginServiceImpl implements ISocialLoginService {
|
||||
throw new ServiceException("该账号已经绑定其他微信,请先解绑后重试!");
|
||||
}
|
||||
// 生成令牌
|
||||
String token = sysLoginService.login(bindLoginBody.getUsername(), bindLoginBody.getPassword(), bindLoginBody.getCode(),
|
||||
String token = sysLoginService.login(bindLoginBody.getDeptId(),bindLoginBody.getUsername(), bindLoginBody.getPassword(), bindLoginBody.getCode(),
|
||||
bindLoginBody.getUuid(), null, language);
|
||||
// String token = sysLoginService.login(bindLoginBody.getUsername(), bindLoginBody.getPassword(), bindLoginBody.getCode(),
|
||||
// bindLoginBody.getUuid(), null, language);
|
||||
LoginUser loginUser = tokenService.getLoginUserByToken(token);
|
||||
//绑定和更新
|
||||
SocialUser updateSocialUser = new SocialUser();
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.xinda.iot.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xinda.iot.mapper.UnitIconMapper;
|
||||
import com.xinda.iot.domain.UnitIcon;
|
||||
import com.xinda.iot.service.IUnitIconService;
|
||||
|
||||
/**
|
||||
* 单位图标Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-06-04
|
||||
*/
|
||||
@Service
|
||||
public class UnitIconServiceImpl implements IUnitIconService
|
||||
{
|
||||
@Autowired
|
||||
private UnitIconMapper unitIconMapper;
|
||||
|
||||
/**
|
||||
* 查询单位图标
|
||||
*
|
||||
* @param id 单位图标主键
|
||||
* @return 单位图标
|
||||
*/
|
||||
@Override
|
||||
public UnitIcon selectUnitIconById(Long id)
|
||||
{
|
||||
return unitIconMapper.selectUnitIconById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位图标列表
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 单位图标
|
||||
*/
|
||||
@Override
|
||||
public List<UnitIcon> selectUnitIconList(UnitIcon unitIcon)
|
||||
{
|
||||
return unitIconMapper.selectUnitIconList(unitIcon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单位图标
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUnitIcon(UnitIcon unitIcon)
|
||||
{
|
||||
unitIcon.setCreateTime(DateUtils.getNowDate());
|
||||
return unitIconMapper.insertUnitIcon(unitIcon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单位图标
|
||||
*
|
||||
* @param unitIcon 单位图标
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUnitIcon(UnitIcon unitIcon)
|
||||
{
|
||||
unitIcon.setUpdateTime(DateUtils.getNowDate());
|
||||
return unitIconMapper.updateUnitIcon(unitIcon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除单位图标
|
||||
*
|
||||
* @param ids 需要删除的单位图标主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUnitIconByIds(Long[] ids)
|
||||
{
|
||||
return unitIconMapper.deleteUnitIconByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单位图标信息
|
||||
*
|
||||
* @param id 单位图标主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUnitIconById(Long id)
|
||||
{
|
||||
return unitIconMapper.deleteUnitIconById(id);
|
||||
}
|
||||
}
|
||||
@@ -101,8 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectNotifyTemplateListByAlertId" resultType="com.xinda.notify.domain.NotifyTemplate">
|
||||
select n.id, n.service_code,n.msg_params,n.status,n.type, n.name, n.channel_id, n.channel_type, n.provider, n.create_by, n.create_time, n.update_by, n.update_time, n.del_flag, n.tenant_id, n.tenant_name, c.name channelName
|
||||
from iot_alert_notify_template a left join notify_template n on a.notify_template_id = n.id
|
||||
select n.id, n.service_code,n.msg_params,n.status, n.name, n.channel_id, n.channel_type, n.provider, n.create_by, n.create_time, n.update_by, n.update_time, n.del_flag, n.tenant_id, n.tenant_name, c.name channelName
|
||||
from iot_alert_notify_template a left join notify_template n on a.notify_template_id = n.id
|
||||
left join notify_channel c on n.channel_id = c.id
|
||||
where a.alert_id = #{alertId}
|
||||
</select>
|
||||
|
||||
@@ -68,37 +68,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where log_id = #{logId}
|
||||
</select>
|
||||
|
||||
<!-- <select id="selectCategoryLogCount" parameterType="com.xinda.iot.domain.Device" resultType="com.xinda.iot.model.DeviceStatistic">-->
|
||||
<!-- SELECT-->
|
||||
<!-- (select count(log_id)-->
|
||||
<!-- from iot_device_log-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="1==1"> and log_type=1</if>-->
|
||||
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- ) as propertyCount,-->
|
||||
<!-- (select count(id)-->
|
||||
<!-- from iot_function_log-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="1==1"> and fun_type=2</if>-->
|
||||
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- ) as functionCount,-->
|
||||
<!-- (select count(log_id)-->
|
||||
<!-- from iot_event_log-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="1==1"> and log_type=3</if>-->
|
||||
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- ) as eventCount,-->
|
||||
<!-- (select count(log_id)-->
|
||||
<!-- from iot_device_log-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="1==1"> and log_type=1 and is_monitor=1</if>-->
|
||||
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- ) as monitorCount-->
|
||||
<!-- limit 1-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectCategoryLogCount" parameterType="com.xinda.iot.domain.Device" resultType="com.xinda.iot.model.DeviceStatistic">
|
||||
SELECT
|
||||
(select count(log_id)
|
||||
from iot_device_log
|
||||
<where>
|
||||
<if test="1==1"> and log_type=1</if>
|
||||
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
|
||||
</where>
|
||||
) as propertyCount,
|
||||
(select count(id)
|
||||
from iot_function_log
|
||||
<where>
|
||||
<if test="1==1"> and fun_type=2</if>
|
||||
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
|
||||
</where>
|
||||
) as functionCount,
|
||||
(select count(log_id)
|
||||
from iot_event_log
|
||||
<where>
|
||||
<if test="1==1"> and log_type=3</if>
|
||||
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
|
||||
</where>
|
||||
) as eventCount,
|
||||
(select count(log_id)
|
||||
from iot_device_log
|
||||
<where>
|
||||
<if test="1==1"> and log_type=1 and is_monitor=1</if>
|
||||
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
|
||||
</where>
|
||||
) as monitorCount
|
||||
limit 1
|
||||
SUM(CASE WHEN type = 'property' THEN cnt ELSE 0 END) AS propertyCount,
|
||||
SUM(CASE WHEN type = 'function' THEN cnt ELSE 0 END) AS functionCount,
|
||||
SUM(CASE WHEN type = 'event' THEN cnt ELSE 0 END) AS eventCount,
|
||||
SUM(CASE WHEN type = 'monitor' THEN cnt ELSE 0 END) AS monitorCount
|
||||
FROM (
|
||||
SELECT 'property' AS type, COUNT(log_id) AS cnt
|
||||
FROM iot_device_log
|
||||
WHERE log_type = 1
|
||||
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 'function' AS type, COUNT(id) AS cnt
|
||||
FROM iot_function_log
|
||||
WHERE fun_type = 2
|
||||
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 'event' AS type, COUNT(log_id) AS cnt
|
||||
FROM iot_event_log
|
||||
WHERE log_type = 3
|
||||
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT 'monitor' AS type, COUNT(log_id) AS cnt
|
||||
FROM iot_device_log
|
||||
WHERE log_type = 1 AND is_monitor = 1
|
||||
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
|
||||
) AS subquery;
|
||||
</select>
|
||||
|
||||
<insert id="insertDeviceLog" parameterType="com.xinda.iot.domain.DeviceLog" useGeneratedKeys="true" keyProperty="logId">
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinda.iot.mapper.UnitIconMapper">
|
||||
|
||||
<resultMap type="UnitIcon" id="UnitIconResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="unitDesc" column="unit_desc" />
|
||||
<result property="unitName" column="unit_name" />
|
||||
<result property="resourceUrl" column="resource_url" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUnitIconVo">
|
||||
select id, unit_desc, unit_name, resource_url, create_by, create_time, update_by, update_time from iot_unit_icon
|
||||
</sql>
|
||||
|
||||
<select id="selectUnitIconList" parameterType="UnitIcon" resultMap="UnitIconResult">
|
||||
<include refid="selectUnitIconVo"/>
|
||||
<where>
|
||||
<if test="unitDesc != null and unitDesc != ''"> and unit_desc like concat('%', #{unitDesc}, '%')</if>
|
||||
<if test="unitName != null and unitName != ''"> and unit_name = #{unitName}</if>
|
||||
<if test="resourceUrl != null and resourceUrl != ''"> and resource_url = #{resourceUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUnitIconById" parameterType="Long" resultMap="UnitIconResult">
|
||||
<include refid="selectUnitIconVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertUnitIcon" parameterType="UnitIcon" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into iot_unit_icon
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="unitDesc != null">unit_desc,</if>
|
||||
<if test="unitName != null">unit_name,</if>
|
||||
<if test="resourceUrl != null">resource_url,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="unitDesc != null">#{unitDesc},</if>
|
||||
<if test="unitName != null">#{unitName},</if>
|
||||
<if test="resourceUrl != null">#{resourceUrl},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUnitIcon" parameterType="UnitIcon">
|
||||
update iot_unit_icon
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="unitDesc != null">unit_desc = #{unitDesc},</if>
|
||||
<if test="unitName != null">unit_name = #{unitName},</if>
|
||||
<if test="resourceUrl != null">resource_url = #{resourceUrl},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUnitIconById" parameterType="Long">
|
||||
delete from iot_unit_icon where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUnitIconByIds" parameterType="String">
|
||||
delete from iot_unit_icon where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user