bug修改

This commit is contained in:
guoshengxiong 2024-05-13 20:48:54 +08:00
parent 994bfa12ef
commit 97fe5104cc
29 changed files with 245 additions and 262 deletions

View File

@ -168,7 +168,7 @@ public class AsyncHikvision {
String type = "24";
String msg = null;
if (HttpUtils.isTimeOut(e)) {
msg = "同步失败,车牌号:" + carInfo.getCarNumber() + "。失败原因:" + "。失败原因:平台连接isc网络异常";
msg = "同步失败,车牌号:" + carInfo.getCarNumber() + "。失败原因:平台连接isc网络异常";
} else if (e instanceof OpenPromptException) {
msg = "同步失败,车牌号:" + carInfo.getCarNumber() + "。失败原因:" + e.getMessage();
} else {

View File

@ -142,6 +142,7 @@ public class SystemUserController {
@ApiOperation(value = "根据企业或项目SN查找账号列表", notes = "根据企业或项目SN查找账号列表", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "sn", required = true, value = "企业或项目SN", paramType = "body"),
@ApiImplicitParam(name = "queryType", required = true, value = "default:默认企业或项目SN查找账号列表projectLevel查询项目级别账号projectLevelAndChildren查询项目级别和项目子账号", paramType = "body"),
})
@PostMapping(value = "/getSystemUserBySn")
public Result<List<SystemUser>> getSystemUserBySn(@RequestBody Map<String, Object> map) {
@ -166,7 +167,7 @@ public class SystemUserController {
@ApiImplicitParam(name = "workerId", required = false, value = "劳务人员id", paramType = "body"),
@ApiImplicitParam(name = "enterpriseId", required = false, value = "企业id多个分割", paramType = "body"),
@ApiImplicitParam(name = "enterpriseTypeId", required = false, value = "企业类型id", paramType = "body"),
@ApiImplicitParam(name = "xzProjectOrgId", required = false, value = "星纵-项目组织机构id", paramType = "body"),
@ApiImplicitParam(name = "xzProjectOrgId", required = false, value = "项目组织机构id", paramType = "body"),
@ApiImplicitParam(name = "qualityRegionId", required = false, value = "区域id", paramType = "body"),
})
@PostMapping(value = "/getProjectChilderSystemUserList")
@ -174,16 +175,6 @@ public class SystemUserController {
return Result.success(systemUserService.getProjectChilderSystemUserList(map));
}
@ApiOperation(value = "查找账号列表根据sn", notes = "查找账号列表根据sn", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "sn", required = true, value = "sn", paramType = "body"),
})
@PostMapping(value = "/getSystemUserList")
public Result<List<SystemUser>> getSystemUserList(@RequestBody Map<String, Object> map) {
return Result.success(systemUserService.getSystemUserList(map));
}
@ApiOperation(value = "发送安全帽平台账号信息", notes = "发送安全帽平台账号信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", required = true, value = "用户ID", paramType = "body"),
@ -204,36 +195,6 @@ public class SystemUserController {
return Result.ok();
}
@ApiOperation(value = "中建五局查询人员分页列表", notes = "中建五局查询人员分页列表", httpMethod = "GET")
@GetMapping(value = "/zjwj/page")
public Result<IPage<SystemUser>> getZjwjUserPage(SystemUser systemUser) {
return systemUserService.getZjwjUserPage(systemUser);
}
@ApiOperation(value = "中建五局查询人员列表", notes = "中建五局查询人员列表", httpMethod = "GET")
@GetMapping(value = "/zjwj/list")
public Result<List<SystemUser>> getZjwjUserList(SystemUser systemUser) {
return systemUserService.getZjwjUserList(systemUser);
}
@ApiOperation(value = "中建五局新增人员", notes = "中建五局新增人员", httpMethod = "POST")
@PostMapping(value = "/zjwj/add")
public Result addZjwjUser(@RequestBody SystemUser systemUser) {
return systemUserService.addZjwjUser(systemUser);
}
@ApiOperation(value = "中建五局修改人员", notes = "中建五局修改人员", httpMethod = "POST")
@PostMapping(value = "/zjwj/update")
public Result updateZjwjUser(@RequestBody SystemUser systemUser) {
return systemUserService.updateZjwjUser(systemUser);
}
@ApiOperation(value = "中建五局删除人员", notes = "中建五局删除人员", httpMethod = "POST")
@PostMapping(value = "/zjwj/delete")
public Result deleteZjwjUser(@RequestBody SystemUser systemUser) {
return systemUserService.deleteZjwjUser(systemUser);
}
@ApiOperation(value = "星纵修改密码", notes = "星纵修改密码", httpMethod = "POST")
@PostMapping(value = "/xz/updatePw")
public Result xzUpdatePw(@RequestBody SystemUser systemUser) {
@ -261,7 +222,7 @@ public class SystemUserController {
}
@ApiOperation(value = "星纵验证账号", notes = "星纵验证账号", httpMethod = "POST")
@ApiOperation(value = "验证账号", notes = "验证账号", httpMethod = "POST")
@PostMapping(value = "/xz/checkAccount")
public Result checkAccount(@RequestBody SystemUser systemUser) {
systemUserService.checkAccount(systemUser);

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.modules.basicdata.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/xmgl/systemUser")
@Slf4j
public class SystemUserExternalApi {
@Autowired
private ISystemUserService systemUserService;
@ApiOperation(value = "中建五局查询人员分页列表", notes = "中建五局查询人员分页列表", httpMethod = "GET")
@GetMapping(value = "/zjwj/page")
public Result<IPage<SystemUser>> getZjwjUserPage(SystemUser systemUser) {
return systemUserService.getZjwjUserPage(systemUser);
}
@ApiOperation(value = "中建五局查询人员列表", notes = "中建五局查询人员列表", httpMethod = "GET")
@GetMapping(value = "/zjwj/list")
public Result<List<SystemUser>> getZjwjUserList(SystemUser systemUser) {
return systemUserService.getZjwjUserList(systemUser);
}
@ApiOperation(value = "中建五局新增人员", notes = "中建五局新增人员", httpMethod = "POST")
@PostMapping(value = "/zjwj/add")
public Result addZjwjUser(@RequestBody SystemUser systemUser) {
return systemUserService.addZjwjUser(systemUser);
}
@ApiOperation(value = "中建五局修改人员", notes = "中建五局修改人员", httpMethod = "POST")
@PostMapping(value = "/zjwj/update")
public Result updateZjwjUser(@RequestBody SystemUser systemUser) {
return systemUserService.updateZjwjUser(systemUser);
}
@ApiOperation(value = "中建五局删除人员", notes = "中建五局删除人员", httpMethod = "POST")
@PostMapping(value = "/zjwj/delete")
public Result deleteZjwjUser(@RequestBody SystemUser systemUser) {
return systemUserService.deleteZjwjUser(systemUser);
}
}

View File

@ -34,14 +34,6 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
Page<SystemUser> getSystemUserBySn(@Param("param") Map<String, Object> map, Page<SystemUser> page);
/**
* sntype=3是项目级别账号
*
* @param map
* @return
*/
List<SystemUser> getSystemUsers(@Param("param") Map<String, Object> map);
SystemUser findByUsername(@Param("account") String account);
List<SystemUser> getComapnySystemUserList(Map<String, Object> map);

View File

@ -29,7 +29,7 @@
FROM project a
INNER JOIN company b ON a.company_sn = b.company_sn
GROUP BY b.headquarters_sn) c ON a.headquarters_sn = c.headquarters_sn
LEFT JOIN system_user su ON su.sn=a.headquarters_sn AND su.account_type=2
LEFT JOIN system_user su ON su.sn = a.headquarters_sn AND su.account_type = 2
WHERE a.company_type = 1
<if test="param.useState == '0'.toString() or param.useState == '1'.toString()">
and b.is_enable = #{param.useState}
@ -206,108 +206,102 @@
</select>
<select id="getSystemUserList" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser">
SELECT
su.*
FROM
system_user su
SELECT su.*
FROM system_user su
WHERE
FIND_IN_SET(
su.sn,
(
SELECT
CONCAT_WS(
SELECT CONCAT_WS(
',',
group_concat( DISTINCT a.project_sn ),
group_concat( DISTINCT cp.company_sn ),
group_concat( DISTINCT b.company_sn ),
group_concat( DISTINCT f.company_sn ),
group_concat( DISTINCT f.headquarters_sn ))
FROM
project a
group_concat(DISTINCT a.project_sn),
group_concat(DISTINCT cp.company_sn),
group_concat(DISTINCT b.company_sn),
group_concat(DISTINCT f.company_sn),
group_concat(DISTINCT f.headquarters_sn))
FROM project a
INNER JOIN company cp ON a.company_sn = cp.company_sn
INNER JOIN company b ON cp.parent_id = b.company_id
LEFT JOIN company f ON b.parent_id = f.company_id
<where>
<if test="companyType == '1'.toString()">
and f.headquarters_sn=#{sn}
and f.headquarters_sn = #{sn}
</if>
<if test="companyType == '2'.toString()">
and f.company_sn=#{sn}
and f.company_sn = #{sn}
</if>
<if test="companyType == '3'.toString()">
and b.company_sn=#{sn}
and b.company_sn = #{sn}
</if>
<if test="companyType == '4'.toString()">
and a.project_sn=#{sn}
and a.project_sn = #{sn}
</if>
<if test="companyType == '5'.toString()">
and cp.company_sn=#{sn}
and cp.company_sn = #{sn}
</if>
</where>
)
)
))
</select>
<select id="getHeadquarterCompany" resultType="com.zhgd.xmgl.modules.basicdata.entity.Company">
SELECT
distinct f.*
FROM
project a
SELECT distinct f.*
FROM project a
INNER JOIN company cp ON a.company_sn = cp.company_sn
INNER JOIN company b ON cp.parent_id = b.company_id
LEFT JOIN company f ON b.parent_id = f.company_id
<!--1总部2区域3城市4一个项目5项目部-->
<where>
<if test="companyType == '1'.toString()">
and f.headquarters_sn=#{sn}
and f.headquarters_sn = #{sn}
</if>
<if test="companyType == '2'.toString()">
and f.company_sn=#{sn}
and f.company_sn = #{sn}
</if>
<if test="companyType == '3'.toString()">
and b.company_sn=#{sn}
and b.company_sn = #{sn}
</if>
<if test="companyType == '4'.toString()">
and a.project_sn=#{sn}
and a.project_sn = #{sn}
</if>
<if test="companyType == '5'.toString()">
and cp.company_sn=#{sn}
and cp.company_sn = #{sn}
</if>
</where>
</select>
<select id="getCompanyInfosByProjectSn" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT
a.project_name project_name,
SELECT a.project_name project_name,
a.project_sn project_sn,
cp.company_sn company_sn4,
b.company_sn company_sn3,
f.company_sn company_sn2
FROM
project a
FROM project a
INNER JOIN company cp ON a.company_sn = cp.company_sn
INNER JOIN company b ON cp.parent_id = b.company_id
LEFT JOIN company f ON b.parent_id = f.company_id
<where>
and a.project_sn=#{projectSn}
and a.project_sn = #{projectSn}
</where>
</select>
<select id="getCompanyByUserId" resultType="com.zhgd.xmgl.modules.basicdata.entity.Company">
select * from company where company_sn = (select sn from system_user where user_id = #{userId})
select *
from company
where company_sn = (select sn from system_user where user_id = #{userId})
</select>
<select id="getParentCompanySn" resultType="com.zhgd.xmgl.modules.basicdata.entity.Company">
select * from company c join company p on c.company_id=p.parent_id
where p.company_sn=#{sn}
select *
from company c
join company p on c.company_id = p.parent_id
where p.company_sn = #{sn}
</select>
<select id="getCompanyForProjectByProjectSn" resultType="com.zhgd.xmgl.modules.basicdata.entity.Company">
select c.* from company c
join project p on p.company_sn=c.company_sn
where p.project_sn=#{projectSn}
select c.*
from company c
join project p on p.company_sn = c.company_sn
where p.project_sn = #{projectSn}
</select>
<select id="getNotRegistryHeadCompanys" resultType="com.zhgd.xmgl.modules.basicdata.entity.Company">
@ -329,13 +323,15 @@
</select>
<select id="getMyHeadquarterCompanyList" resultType="com.zhgd.xmgl.modules.basicdata.entity.Company">
select distinct c.* from company c
select distinct c.*
from company c
join xz_system_user_to_company_project xsutcp on xsutcp.headquarters_sn = c.company_sn
where xsutcp.user_id = #{userId}
</select>
<select id="getMyHeadquarterCompanyListForProject" resultType="com.zhgd.xmgl.modules.basicdata.entity.Company">
select distinct c.* from company c
select distinct c.*
from company c
join company c1 on c.company_sn = c1.headquarters_sn
join project p on c1.company_sn = p.company_sn
join system_user su on su.sn = p.project_sn

View File

@ -2,31 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper">
<select id="getSystemUserBySn" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" parameterType="map">
SELECT a.*, jb.job_name
from system_user a
LEFT JOIN organization_job jb ON a.job_id = jb.id
WHERE a.sn = #{param.sn}
and a.account_type in (1, 2, 3, 4, 5, 7)
</select>
<select id="getSystemUsers" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" parameterType="map">
SELECT a.*, jb.job_name
from system_user a
LEFT JOIN organization_job jb ON a.job_id = jb.id
WHERE 1=1
<if test="param.type == '1'.toString()">
<if test="param.queryType == 'default'.toString()">
and a.sn = #{param.sn}
and a.account_type in (1, 2, 3, 4, 5, 7)
</if>
<if test="param.accountType != null and param.accountType != ''">
and a.account_type = #{param.accountType}
</if>
<if test="param.type == '3'.toString()">
<if test="param.queryType == 'projectLevel'.toString()">
and ((a.account_type = 5 and a.sn = #{param.sn}) or ( a.account_type = 10 and a.user_id in (select distinct
t.user_id from
xz_system_user_to_company_project t where a.user_id = t.user_id and t.type = 2 and t.sn = #{param.sn})))
</if>
<if test="param.queryType == 'projectLevelAndChildren'.toString()">
and ((a.account_type in (5,6) and a.sn = #{param.sn}) or ( a.account_type = 10 and a.user_id in (select
distinct
t.user_id from
xz_system_user_to_company_project t where a.user_id = t.user_id and t.type = 2 and t.sn = #{param.sn})))
</if>
</select>
<select id="getProjectChilderSystemUserList" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser"
parameterType="map">
SELECT a.worker_id as id, a.*, c.role_name, d.worker_name, b.role_id,po.dept_name

View File

@ -55,7 +55,6 @@ public interface ISystemUserService extends IService<SystemUser> {
void sendSafetyHatProjectData(Map<String, Object> map);
Result sjLogin(JwtPayloadUserInfo jwtPayloadUserInfo);
Result loginByToken(LoginInfoByTokenDto dto);
@ -94,8 +93,6 @@ public interface ISystemUserService extends IService<SystemUser> {
Page<SystemUser> getSystemUserBySnPage(Map<String, Object> map);
List<SystemUser> getSystemUsers(Map<String, Object> map);
Map<String, Object> deviceLogin(Map<String, Object> map);
/**

View File

@ -198,6 +198,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
map.put("companyType", "4");
List<EntityMap> list = companyMapper.getChildCompanyList(map);
List<EntityMap> projectList = projectMapper.getProjectListBySn(map);
map.put("queryType", "default");
List<SystemUser> sysList1 = systemUserMapper.getSystemUserBySn(map);
List<SystemUser> sysList2 = systemUserMapper.getChildComapnySystemUserList(map);
List<SystemUser> sysList3 = systemUserMapper.getChildComapnyProjectSystemUserList(map);

View File

@ -729,6 +729,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
@Override
public List<SystemUser> getSystemUsersBySn(Map<String, Object> map) {
map.putIfAbsent("queryType", "default");
return systemUserMapper.getSystemUserBySn(map);
}
@ -1427,11 +1428,6 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
return systemUserMapper.getSystemUserBySn(map, page);
}
@Override
public List<SystemUser> getSystemUsers(Map<String, Object> map) {
return systemUserMapper.getSystemUsers(map);
}
@Override
public Map<String, Object> deviceLogin(Map<String, Object> map) {
Integer type = MapUtils.getInteger(map, "type");

View File

@ -63,14 +63,17 @@ public class DangerousEngineeringSideStation implements Serializable {
@Excel(name = "创建人员ID", width = 15)
@ApiModelProperty(value = "创建人员ID")
private java.lang.Long createUser;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 15)
@ApiModelProperty(value = "创建时间")
private java.lang.String createTime;
private java.lang.Long createUser;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 15)
@ApiModelProperty(value = "创建时间")
private java.lang.String createTime;
@TableField(exist = false)
private String createUserName;
@TableField(exist = false)
private String createUserName;
@TableField(exist = false)
@ApiModelProperty(value = "危大工程名称")
private java.lang.String engineeringName;
}

View File

@ -3,7 +3,7 @@
<mapper namespace="com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringSideStationMapper">
<select id="selectSideStationList"
resultType="com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringSideStation">
SELECT a.*,b.real_name as create_user_name
SELECT a.*,b.real_name as create_user_name,der.engineering_name
from dangerous_engineering_side_station a LEFT JOIN system_user b ON a.create_user=b.user_id
left join dangerous_engineering_record der on der.id=a.dangerous_engineering_id
where 1=1

View File

@ -122,7 +122,7 @@ public class DangerousEngineeringRecordServiceImpl extends ServiceImpl<Dangerous
@Override
public void noticeBigScreen(String projectSn, String time, Boolean isSuperDanger, String format) {
List<SystemUser> systemUsers = systemUserMapper.getSystemUsers(new MapBuilder<String, Object>().put("sn", projectSn).put("type", 3).build());
List<SystemUser> systemUsers = systemUserMapper.getSystemUserBySn(new MapBuilder<String, Object>().put("sn", projectSn).put("type", "projectLevel").build());
for (SystemUser systemUser : systemUsers) {
Notice notice = new Notice();
notice.setType("32");

View File

@ -232,7 +232,7 @@ public class HiddenDangerInspectRecordServiceImpl extends ServiceImpl<HiddenDang
vo.setDeductScore(item.getDeductScore());
vo.setType(1);
vo.setCreateDate(new Date());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
vo.setDeductReason(StrUtil.format("您在{}发现安全隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "安全检査", vo.getTypeName() == null ? "" : vo.getTypeName(), item.getDeductScore()));
xzDeductScoreRecordMapper.insert(vo);
}

View File

@ -343,7 +343,19 @@ public class QualityInspectionRecordController {
return Result.success(qualityInspectionRecordService.statsByChangeId(paramMap));
}
@ApiOperation(value = "安全问题统计数量列表", notes = "安全问题统计数量列表", httpMethod = "POST")
@ApiOperation(value = "质量问题统计数量", notes = "质量问题统计数量", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "inspectEndTime", value = "检查结束时间", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/selectQualityStatisticsNum")
public Result<XzSecurityQualityInspectionRecordTotalVo> selectQualityStatisticsNum(@RequestBody Map<String, Object> map) {
return Result.success(qualityInspectionRecordService.selectQualityStatisticsNum(map));
}
@ApiOperation(value = "质量问题统计数量列表", notes = "质量问题统计数量列表", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "body", required = false, dataType = "String"),

View File

@ -235,7 +235,7 @@
and status = 2
ORDER BY create_time desc
LIMIT 1) > a.change_limit_time
ELSE a.change_limit_time <![CDATA[<]]> now() END), 0) overTime,
ELSE a.change_limit_time <![CDATA[<]]> now() END), 0) overTime
from quality_inspection_record a
LEFT JOIN enterprise_info b ON a.enterprise_sn = b.enterprise_sn
LEFT JOIN danger_type_record c ON a.danger_type_id = c.id
@ -553,16 +553,15 @@
</select>
<select id="countQualityInspectionRecordRegion" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
select qr.region_name x, ifnull(sum(if(t.id is not null, 1, 0)), 0) y
from quality_region qr
join quality_inspection_record t on qr.id = t.region_id
select t.region_name x, count(*) y
from quality_inspection_record t
where 1 = 1
and qr.project_sn = #{param.projectSn}
and t.project_sn = #{param.projectSn}
and t.status != 6
and t.record_type = 1
<include refid="whereCondition">
</include>
group by t.region_id
group by t.region_name
order by y desc
</select>

View File

@ -277,7 +277,7 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
noticeBigScreen(qualityInspectionRecord, qualityInspectionRecord.getInspectTime(), StrUtil.format("{}检查到一条{}的{}质量隐患问题,请注意监督整改!",
qualityInspectionRecord.getRegionName(), enterpriseInfo.getEnterpriseName(), StrUtil.subAfter(qualityInspectionRecord.getDangerItemContent(), "/", true)));
} else if (qualityInspectionRecord.getRecordType() == 2) {
noticeBigScreen(qualityInspectionRecord, qualityInspectionRecord.getInspectTime(), StrUtil.format("{}已排查了{}的质量隐患问题,今日排查暂无安全隐患!",
noticeBigScreen(qualityInspectionRecord, qualityInspectionRecord.getInspectTime(), StrUtil.format("{}已排查了{}的质量隐患问题,今日排查暂无安全隐患!",
qualityInspectionRecord.getRegionName(), StrUtil.subAfter(qualityInspectionRecord.getDangerItemContent(), "/", true)));
}
sanjiangDataCall.sendAddQualityInspectionRecord(qualityInspectionRecord);
@ -293,19 +293,19 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
*/
@Override
public void noticeBigScreen(QualityInspectionRecord qualityInspectionRecord, String time, String format) {
List<SystemUser> systemUsers = systemUserMapper.getSystemUsers(new MapBuilder<String, Object>().put("sn", qualityInspectionRecord.getProjectSn()).put("type", 3).build());
for (SystemUser systemUser : systemUsers) {
Notice notice = new Notice();
notice.setType("31");
notice.setMsg(format);
notice.setAccountId(systemUser.getUserId());
notice.setTitle("大屏通知");
notice.setSendTime(DateUtil.now());
Integer level = qualityInspectionRecord.getLevel();
notice.setPayload(JSON.toJSONString(new MapBuilder<String, Object>().put("time", time)
.put("level", level).build()));
noticeService.addNotice(notice, false);
}
//List<SystemUser> systemUsers = systemUserMapper.getSystemUsers(new MapBuilder<String, Object>().put("sn", qualityInspectionRecord.getProjectSn()).put("type", 3).build());
//for (SystemUser systemUser : systemUsers) {
// Notice notice = new Notice();
// notice.setType("31");
// notice.setMsg(format);
// notice.setAccountId(systemUser.getUserId());
// notice.setTitle("大屏通知");
// notice.setSendTime(DateUtil.now());
// Integer level = qualityInspectionRecord.getLevel();
// notice.setPayload(JSON.toJSONString(new MapBuilder<String, Object>().put("time", time)
// .put("level", level).build()));
// noticeService.addNotice(notice, false);
//}
}
private void deductScoreIf(QualityInspectionRecord hiddenDangerInspectRecord) {
@ -348,7 +348,7 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
vo.setDeductScore(item.getDeductScore());
vo.setType(3);
vo.setCreateDate(new Date());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
vo.setDeductReason(StrUtil.format("您在{}发现质量隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "质量检査", vo.getTypeName() == null ? "" : vo.getTypeName(), item.getDeductScore()));
vo.setTypeTableId(hiddenDangerInspectRecord.getId());
xzDeductScoreRecordMapper.insert(vo);

View File

@ -104,7 +104,7 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
qualityInspectionRecord.setStatus(4);
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getVerifyManId(), "您有一条质量检查的整改结果需要核验,请及时查看。", "质量管理整改结果核验通知", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
qualityInspectionRecordService.noticeBigScreen(tempQualityInspectionRecord, qualityRectifyRecord.getRectifyTime(), StrUtil.format("{}复查了{}的一条{}质量隐患问题,请注意监督核!",
qualityInspectionRecordService.noticeBigScreen(tempQualityInspectionRecord, qualityRectifyRecord.getRectifyTime(), StrUtil.format("{}复查了{}的一条{}质量隐患问题,请注意监督",
enterpriseInfo.getEnterpriseName(), tempQualityInspectionRecord.getRegionName(), StrUtil.subAfter(tempQualityInspectionRecord.getDangerItemContent(), "/", true)));
} else {
qualityInspectionRecord.setStatus(2);

View File

@ -31,6 +31,7 @@
#{item}
</foreach>
</if>
order by vi.sort_num
</select>
<select id="selectAllDevCount" resultType="java.util.Map">
SELECT t2.project_sn projectSn,

View File

@ -54,6 +54,7 @@ import com.zhgd.xmgl.util.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -118,18 +119,7 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
String projectSn = MapUtils.getString(map, "projectSn");
Page<AiAnalyseHardWareAlarmRecord> page = new Page<>(pageNo, pageSize);
List<AiAnalyseHardWareAlarmRecord> aiAnalyseHardWareAlarmRecords = aiAnalyseHardWareAlarmRecordMapper.queryAiAnalyseHardWareAlarmPageListTwo(page, map);
List<DictionaryItem> dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, projectSn);
try {
Map<String, DictionaryItem> typeMap = dictList.stream().collect(Collectors.toMap(DictionaryItem::getData, Function.identity(), (dictionaryItem, dictionaryItem2) -> dictionaryItem));
for (AiAnalyseHardWareAlarmRecord record : aiAnalyseHardWareAlarmRecords) {
DictionaryItem item = typeMap.get(record.getAlarmType() + "");
if (item != null) {
record.setAlarmTypeName(item.getName());
}
}
} catch (Exception e) {
log.error("error", e);
}
List<DictionaryItem> dictList = setAlarmTypeName(projectSn, aiAnalyseHardWareAlarmRecords);
//设置应该扣的分数
List<Long> dicIdList = dictList.stream().map(DictionaryItem::getId).distinct().collect(Collectors.toList());
@ -144,6 +134,20 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
return page.setRecords(aiAnalyseHardWareAlarmRecords);
}
private List<DictionaryItem> setAlarmTypeName(String projectSn, List<AiAnalyseHardWareAlarmRecord> aiAnalyseHardWareAlarmRecords) {
List<DictionaryItem> dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, projectSn);
Map<String, DictionaryItem> typeMap = dictList.stream().collect(Collectors.toMap(DictionaryItem::getData, Function.identity(), (dictionaryItem, dictionaryItem2) -> dictionaryItem));
for (AiAnalyseHardWareAlarmRecord record : aiAnalyseHardWareAlarmRecords) {
DictionaryItem item = typeMap.get(record.getAlarmType() + "");
if (item != null) {
record.setAlarmTypeName(item.getName());
} else {
record.setAlarmTypeName("其他类型");
}
}
return dictList;
}
@Override
public void saveAiAnalyseHardWareAlarmRecord(JSONObject body) {
log.info("调用AiAnalyseHardWareAlarmRecordServiceImpl#saveAiAnalyseHardWareAlarmRecord方法参数为{}", body);
@ -275,18 +279,7 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
String projectSn = MapUtils.getString(map, "projectSn");
map.put("sizeNum", sizeNum);
List<AiAnalyseHardWareAlarmRecord> aiAnalyseHardWareAlarmRecords = aiAnalyseHardWareAlarmRecordMapper.selectAiAnalyseHardWareAlarmList(map);
List<DictionaryItem> dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, projectSn);
try {
Map<String, DictionaryItem> typeMap = dictList.stream().collect(Collectors.toMap(DictionaryItem::getData, Function.identity(), (dictionaryItem, dictionaryItem2) -> dictionaryItem));
for (AiAnalyseHardWareAlarmRecord record : aiAnalyseHardWareAlarmRecords) {
DictionaryItem item = typeMap.get(record.getAlarmType() + "");
if (item != null) {
record.setAlarmTypeName(item.getName());
}
}
} catch (Exception e) {
log.error("error", e);
}
setAlarmTypeName(projectSn, aiAnalyseHardWareAlarmRecords);
return aiAnalyseHardWareAlarmRecords;
}
@ -598,7 +591,7 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
for (String noticeUserId : noticeUserIds) {
noticeService.addUserNotice(Long.valueOf(noticeUserId), "您有一条AI预警数据需要处置请及时查看。", "AI预警通知", "8");
}
List<SystemUser> users = systemUserService.getSystemUsers(new MapBuilder<String, Object>().put("type", 3).put("sn", record.getProjectSn()).build());
List<SystemUser> users = systemUserService.getSystemUsersBySn(new MapBuilder<String, Object>().put("type", "projectLevel").put("sn", record.getProjectSn()).build());
for (SystemUser systemUser : users) {
noticeService.addUserNotice(systemUser.getUserId(), "有一条AI预警数据已处置推送", "AI预警通知", "8");
}

View File

@ -113,16 +113,17 @@ public class AiStatisticServiceImpl implements IAiStatisticService {
Map<String, List<DictionaryItem>> dictMap = new HashMap<>();
for (AiAnalyseHardWareAlarmRecordVo record : rsList) {
String projectSn = record.getProjectSn();
List<DictionaryItem> dictionaryItems = dictMap.get(projectSn);
List<DictionaryItem> dictList = new ArrayList<>();
if (dictionaryItems == null) {
List<DictionaryItem> dictList = dictMap.get(projectSn);
if (dictList == null) {
dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, projectSn);
dictMap.put(projectSn, dictList);
dictMap.putIfAbsent(projectSn, dictList);
}
Map<String, DictionaryItem> typeMap = dictList.stream().collect(Collectors.toMap(DictionaryItem::getData, Function.identity(), (dictionaryItem, dictionaryItem2) -> dictionaryItem));
DictionaryItem item = typeMap.get(record.getAlarmType() + "");
if (item != null) {
record.setAlarmTypeName(item.getName());
} else {
record.setAlarmTypeName("其他类型");
}
}
AiAnalyseHardWareAlarmTypeCountVO vo = new AiAnalyseHardWareAlarmTypeCountVO();

View File

@ -205,7 +205,7 @@ public class VideoItemServiceImpl extends ServiceImpl<VideoItemMapper, VideoItem
}
map.put("videoId", projectVideoConfig.getId());
list = videoItemMapper.selectVideoItemListByVideoId(map);
// TODO 此处用户直接在智慧工地云平台添加设备,设备需要手动在萤石云添加好完成
// 此处用户直接在智慧工地云平台添加设备,设备需要手动在萤石云添加好完成
// list = getVideoOtherData(projectVideoConfig, list);
}
return list;

View File

@ -7,6 +7,8 @@ import lombok.Data;
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class StatsTrendVo {
@ApiModelProperty("企业名称")
private String enterpriseName;
@ApiModelProperty("人数")
private Integer workerNum;
@ApiModelProperty("高风险数量")

View File

@ -239,8 +239,6 @@ public interface WorkerInfoMapper extends BaseMapper<WorkerInfo> {
void updateScore(HashMap<String, Object> map);
List<StatsTrendVo> stats(@Param("param") Map<String, Object> map);
StatsTrendVo statsSafeScore(@Param("param") Map<String, Object> map);
List<TrendOneVo> statsEnterprise(@Param("param") Map<String, Object> map);

View File

@ -2442,49 +2442,14 @@
count(distinct wa.person_sn,if(pass_type=2,1,null)) exitTodayNum
from worker_info wi
join worker_attendance wa on wa.person_sn=wi.person_sn
where wa.project_sn=#{projectSn} and wa.create_time>=current_date
where wa.project_sn=#{projectSn} and wa.create_time>=current_date and t.inService_type = 1
</select>
<update id="updateScore">
update worker_info set safe_score = safe_score - #{deductScore} where id = #{id}
update worker_info set safe_score = IF(safe_score-#{deductScore}>=0,safe_score - #{deductScore},0) where id =
#{id}
</update>
<select id="stats" resultType="com.zhgd.xmgl.modules.worker.entity.vo.StatsTrendVo">
select
<choose>
<when test="param.groupby == 'safeScore'.toString()">
CASE WHEN t.safe_score &lt; 80 THEN '高风险' When t.safe_score >= 80 and t.safe_score &lt; 90 then '中风险'
ELSE '低风险' END as name,
count(*) as count,
</when>
<when test="param.groupby == 'enterprise'.toString()">
ei.enterprise_name as name,
avg(t.safe_score) as count,
</when>
<when test="param.groupby == 'enterprise_safeScore'.toString()">
</when>
<otherwise>
</otherwise>
</choose>
1
from worker_info t
left join enterprise_info ei on ei.id=t.enterprise_id
where t.project_sn=#{param.projectSn}
<choose>
<when test="param.groupby == 'safeScore'.toString()">
group by name
</when>
<when test="param.groupby == 'enterprise'.toString()">
group by t.enterprise_id
</when>
<when test="param.groupby == 'enterprise_safeScore'.toString()">
group by t.enterprise_id
</when>
<otherwise>
</otherwise>
</choose>
</select>
<select id="statsSafeScore" resultType="com.zhgd.xmgl.modules.worker.entity.vo.StatsTrendVo">
select
ifnull(round(sum(if(t.safe_score &lt; 80,1,0)),2),0) as highRiskNum,
@ -2492,7 +2457,7 @@
ifnull(round(sum(if(t.safe_score >= 90,1,0)),2),0) as lowRiskNum,
count(*) as workerNum
from worker_info t
where t.project_sn=#{param.projectSn}
where t.project_sn=#{param.projectSn} and t.inService_type = 1
</select>
<select id="statsEnterprise" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
@ -2501,22 +2466,20 @@
ifnull(round(avg(t.safe_score),2),0) as y
from worker_info t
join enterprise_info ei on ei.id=t.enterprise_id
where t.project_sn=#{param.projectSn}
where t.project_sn=#{param.projectSn} and t.inService_type = 1
group by t.enterprise_id
</select>
<select id="statsEnterpriseRisk" resultType="com.zhgd.xmgl.modules.worker.entity.vo.StatsTrendVo">
select
ei.enterprise_name as name,
CASE WHEN t.safe_score &lt; 80 THEN '高风险' When t.safe_score >= 80 and t.safe_score &lt; 90 then '中风险' ELSE '低风险'
END as name,
ei.enterprise_name,
ifnull(round(sum(if(t.safe_score &lt; 80,1,0)),2),0) as highRiskNum,
ifnull(round(sum(if(t.safe_score >= 80 and t.safe_score &lt; 90,1,0)),2),0) as mediumRiskNum,
ifnull(round(sum(if(t.safe_score >= 90,1,0)),2),0) as lowRiskNum,
count(*) as workerNum
from worker_info t
join enterprise_info ei on ei.id=t.enterprise_id
where t.project_sn=#{param.projectSn}
where t.project_sn=#{param.projectSn} and t.inService_type = 1
group by t.enterprise_id
</select>
</mapper>

View File

@ -130,6 +130,16 @@
</if>
</sql>
<sql id="selectShow">
IFNULL(SUM((CASE WHEN t.status != 2 and t.change_limit_time > now() or t.status = 5 THEN 1 ELSE 0 END)),
0) as rectifiedNumTimely,
IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) as rectifiedNum,
IFNULL(SUM((CASE WHEN t.status in (3, 4) and t.change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
as overTimeRectifiedNum,
IFNULL(SUM((CASE WHEN t.status = 2 and t.change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
as overTimeNotRectifiedNum,
</sql>
<sql id="selectTotal">
select tp.*,
round(IFNULL(TRUNCATE(IFNULL(closeNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100,
@ -581,13 +591,8 @@
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNumTimely, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2)
rectifiedNumRatioTimely
from (SELECT count(*) totalNum,
IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum,
IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0)
rectifiedNumTimely,
IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
overTimeRectifiedNum,
IFNULL(SUM((CASE WHEN t.status = 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
overTimeNotRectifiedNum,
<include refid="selectShow">
</include>
su.real_name as workerName
from xz_security_quality_inspection_record t
left join system_user su on su.user_id = t.change_id
@ -613,30 +618,22 @@
<select id="statsByInspectManVo" resultType="com.zhgd.xmgl.modules.xz.security.entity.vo.StatsByInspectManVo">
select t.*,
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100,
2) rectifiedNumRatio,
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNumTimely, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2)
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100,2) as rectifiedNumRatio,
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNumTimely, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2) as
rectifiedNumRatioTimely
from (SELECT count(*) totalNum,
count(*) createDangerNum,
IFNULL(SUM((CASE WHEN hdir.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum,
IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0)
rectifiedNumTimely,
<include refid="selectShow">
</include>
su.real_name as workerName
from xz_security_quality_inspection_record hdir
left join system_user su on su.user_id = hdir.inspect_man_id
from xz_security_quality_inspection_record t
left join system_user su on su.user_id = t.inspect_man_id
WHERE record_type = 1
and hdir.status != 6
and t.status != 6
and project_sn = #{param.projectSn}
<if test="param.inspectTime_begin != null and param.inspectTime_begin != ''">
and hdir.inspect_time <![CDATA[>=]]> #{param.inspectTime_begin}
</if>
<if test="param.inspectTime_end != null and param.inspectTime_end != ''">
and hdir.inspect_time <![CDATA[<=]]> if(LENGTH(#{param.inspectTime_end}) = 10,
CONCAT(DATE_FORMAT(#{param.inspectTime_end}, '%Y-%m-%d'), ' 23:59:59'),
#{param.inspectTime_end})
</if>
group by hdir.inspect_man_id
<include refid="whereCondition">
</include>
group by t.inspect_man_id
order by rectifiedNum desc) t
</select>
@ -647,9 +644,8 @@
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNumTimely, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2)
rectifiedNumRatioTimely
from (SELECT count(*) as totalNum,
IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) as rectifiedNum,
IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0) as
rectifiedNumTimely,
<include refid="selectShow">
</include>
ei.enterprise_name
from xz_security_quality_inspection_record t
left join enterprise_info ei on ei.id = t.enterprise_id

View File

@ -26,7 +26,9 @@ import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringRecord;
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringRecordMapper;
import com.zhgd.xmgl.modules.quality.entity.DangerItemRecord;
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
import com.zhgd.xmgl.modules.quality.mapper.DangerItemRecordMapper;
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareAlarmRecord;
import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareAlarmRecordMapper;
@ -95,6 +97,8 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
@Autowired
WorkerInfoAuditRecordMapper workerInfoAuditRecordMapper;
@Autowired
XzSecurityDangerItemRecordMapper dangerItemRecordMapper;
@Autowired
private QualityRegionMapper qualityRegionMapper;
@Autowired
private EnterpriseInfoMapper enterpriseInfoMapper;
@ -104,10 +108,8 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
private XzSecurityQualityRectifyRecordMapper xzSecurityQualityRectifyRecordMapper;
@Autowired
private INoticeService noticeService;
@Autowired
private IXzSecurityInspectTaskRecordService xzSecurityInspectTaskRecordService;
@Autowired
private IXzSecurityInspectTaskItemRecordService xzSecurityInspectTaskItemRecordService;
@ -309,8 +311,10 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
enterpriseInfo.getEnterpriseName(), d.getEngineeringName(), record.getRegionName(), record.getDangerItemContent()));
}
} else if (record.getRecordType() == 2) {
XzSecurityDangerItemRecord dangerItemRecord = dangerItemRecordMapper.selectById(record.getDangerItemId());
record.setLevel(dangerItemRecord.getLevel());
if (record.getEngineeringId() == null) {
noticeBigScreen("31", record, record.getInspectTime(), StrUtil.format("{}已排查了{}的安全隐患问题,今日排查暂无次安全隐患!",
noticeBigScreen("31", record, record.getInspectTime(), StrUtil.format("{}已排查了{}的安全隐患问题,今日排查暂无安全隐患!",
record.getRegionName(), StrUtil.subAfter(record.getDangerItemContent(), "/", true)));
} else {
DangerousEngineeringRecord d = dangerousEngineeringRecordMapper.selectById(record.getEngineeringId());
@ -361,7 +365,7 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
vo.setDeductScore(item.getDeductScore());
vo.setType(1);
vo.setCreateDate(new Date());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
vo.setDeductReason(StrUtil.format("您在{}发现安全隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "安全检査", vo.getTypeName() == null ? "" : vo.getTypeName(), item.getDeductScore()));
vo.setTypeTableId(hiddenDangerInspectRecord.getId());
xzDeductScoreRecordMapper.insert(vo);
@ -645,7 +649,9 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
);
vo.setSecurityQualityInspectionRecordNum(rc);
Integer ac = aiAnalyseHardWareAlarmRecordMapper.selectCount(new LambdaQueryWrapper<AiAnalyseHardWareAlarmRecord>()
.eq(AiAnalyseHardWareAlarmRecord::getProjectSn, projectSn));
.eq(AiAnalyseHardWareAlarmRecord::getProjectSn, projectSn)
.eq(AiAnalyseHardWareAlarmRecord::getIsPushed, 1)
);
vo.setAiAnalyseHardWareAlarmRecordNum(ac);
return vo;
}
@ -704,7 +710,7 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
BigDecimal avg = bigDecimal6.divide(bigDecimal7, 2, BigDecimal.ROUND_HALF_UP);
BigDecimal result4 = new BigDecimal(1);
if (avg.compareTo(new BigDecimal(7)) < 0) {
result4 = avg.divide(new BigDecimal(7), 2, BigDecimal.ROUND_HALF_UP);
result4 = avg.divide(new BigDecimal(7), 2, BigDecimal.ROUND_HALF_UP);
}
result4 = result4.multiply(new BigDecimal(0.2)).setScale(2, RoundingMode.HALF_UP);
@ -741,7 +747,7 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
@Override
public void noticeBigScreen(String type, XzSecurityQualityInspectionRecord qualityInspectionRecord, String time, String format) {
List<SystemUser> systemUsers = systemUserMapper.getSystemUsers(new MapBuilder<String, Object>().put("sn", qualityInspectionRecord.getProjectSn()).put("type", 3).build());
List<SystemUser> systemUsers = systemUserMapper.getSystemUserBySn(new MapBuilder<String, Object>().put("sn", qualityInspectionRecord.getProjectSn()).put("type", "projectLevel").build());
for (SystemUser systemUser : systemUsers) {
Notice notice = new Notice();
notice.setType(type);

View File

@ -75,6 +75,7 @@ public class XzVisitorManageRecordController {
@PostMapping(value = "/page")
public Result<IPage<XzVisitorManageRecord>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<XzVisitorManageRecord> queryWrapper = QueryGenerator.initPageQueryWrapper(XzVisitorManageRecord.class, map);
queryWrapper.orderByDesc("create_time");
Page<XzVisitorManageRecord> page = PageUtil.getPage(map);
IPage<XzVisitorManageRecord> pageList = xzVisitorManageRecordService.page(page, queryWrapper);
return Result.success(pageList);

View File

@ -26,6 +26,7 @@
</if>
and c.audit_type=2
and c.has_delay_event=1
and c.delay_event_type != ''
group by c.delay_event_type
</select>
</mapper>

View File

@ -3,7 +3,6 @@ package com.zhgd.xmgl.modules.xz.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -30,6 +29,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: 任务进度甘特图-内容
@ -106,7 +106,23 @@ public class XzTaskProgressContentServiceImpl extends ServiceImpl<XzTaskProgress
@Override
public SectorVo statsDelayEventType(Map<String, Object> paramMap) {
ArrayList<SectorOneVo> list = baseMapper.statsDelayEventType(paramMap);
return SectorVo.getSectorVoByEnum(list, ParamEnum.DelayEventTypeEnum.values(), false);
List<SectorOneVo> rtList = new ArrayList<>();
for (SectorOneVo oneVo : list) {
List<String> split = StrUtil.split(oneVo.getEnumType(), ",");
for (String one : split) {
SectorOneVo vo = new SectorOneVo();
vo.setCount(oneVo.getCount());
vo.setEnumType(one);
rtList.add(vo);
}
}
//去重求和
List result = new ArrayList<>(rtList.stream()
.collect(Collectors.toMap(SectorOneVo::getEnumType, a -> a, (o1, o2) -> {
o1.setCount(String.valueOf(Integer.parseInt(o1.getCount()) + Integer.parseInt(o2.getCount())));
return o1;
})).values());
return SectorVo.getSectorVoByEnum(result, ParamEnum.DelayEventTypeEnum.values(), false);
}
private QueryWrapper<XzTaskProgressContent> getQueryWrapper(HashMap<String, Object> paramMap) {