数据大屏弹窗bug修改及消息未读数开发

This commit is contained in:
bonus 2025-02-13 17:12:39 +08:00
parent 37caac54fc
commit 77c688fd5f
5 changed files with 22 additions and 5 deletions

View File

@ -113,7 +113,10 @@ public class LargeScreenController {
Integer repairingDevNum = devInfoMapper.getRepairingDevNum();
orderData.setDevRepairingNum(repairingDevNum);
DevInfo devInfo = devInfoMapper.getDevUsageRatio();
orderData.setDevUsageRatio(MathUtil.calculatePercentage(devInfo.getTotalLeaseDay(), devInfo.getTotalUpDay() + devInfo.getTotalLeaseDay()));
if(devInfo != null){
orderData.setDevUsageRatio(MathUtil.calculatePercentage(devInfo.getTotalLeaseDay(), devInfo.getTotalUpDay() + devInfo.getTotalLeaseDay()));
}
return AjaxResult.success(orderData);
}

View File

@ -18,7 +18,7 @@ import java.util.List;
*/
@RestController
@Api(value = "个人管理", tags = {"个人管理"})
@RequestMapping("/userManage")
@RequestMapping("/")
public class UserController extends BaseController {
@Resource

View File

@ -87,4 +87,7 @@ public class UserDto {
@ApiModelProperty(value = "是否内置用户0内置用户1非内置用户")
private String isBuiltIn;
@ApiModelProperty(value = "消息数")
private String msgNum;
}

View File

@ -448,6 +448,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT distinct(type_id)
FROM ma_lease_details
where type_id is not null
group by type_id
limit 1
</select>
<select id="getTopPopularTypeName" resultType="java.lang.String">
@ -507,4 +509,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY
lease_count DESC
</select>
</mapper>
</mapper>

View File

@ -13,6 +13,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<select id="getUserById" resultType="com.bonus.material.user.entity.UserDto">
select * from sys_user where user_id = #{userId}
SELECT
su.*,
SUM(
IF
( is_read = 0, 1, 0 )) AS msgNum
FROM
sys_user su
LEFT JOIN bm_message bm ON su.user_id = bm.to_user
WHERE
su.user_id =#{userId}
</select>
</mapper>
</mapper>