From 97fe5104cc31086c2ab151f4f236a38002c372de Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Mon, 13 May 2024 20:48:54 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zhgd/xmgl/async/AsyncHikvision.java | 2 +- .../controller/SystemUserController.java | 45 +--------- .../controller/SystemUserExternalApi.java | 50 +++++++++++ .../basicdata/mapper/SystemUserMapper.java | 8 -- .../basicdata/mapper/xml/CompanyMapper.xml | 86 +++++++++---------- .../basicdata/mapper/xml/SystemUserMapper.xml | 18 ++-- .../basicdata/service/ISystemUserService.java | 3 - .../service/impl/CompanyServiceImpl.java | 1 + .../service/impl/SystemUserServiceImpl.java | 6 +- .../DangerousEngineeringSideStation.java | 21 +++-- .../DangerousEngineeringSideStationMapper.xml | 2 +- ...DangerousEngineeringRecordServiceImpl.java | 2 +- .../HiddenDangerInspectRecordServiceImpl.java | 2 +- .../QualityInspectionRecordController.java | 14 ++- .../xml/QualityInspectionRecordMapper.xml | 11 ++- .../QualityInspectionRecordServiceImpl.java | 30 +++---- .../impl/QualityRectifyRecordServiceImpl.java | 2 +- .../video/mapper/xml/VideoItemMapper.xml | 1 + ...AnalyseHardWareAlarmRecordServiceImpl.java | 43 ++++------ .../service/impl/AiStatisticServiceImpl.java | 9 +- .../service/impl/VideoItemServiceImpl.java | 2 +- .../worker/entity/vo/StatsTrendVo.java | 2 + .../worker/mapper/WorkerInfoMapper.java | 2 - .../worker/mapper/xml/WorkerInfoMapper.xml | 51 ++--------- ...zSecurityQualityInspectionRecordMapper.xml | 52 ++++++----- ...ityQualityInspectionRecordServiceImpl.java | 20 +++-- .../XzVisitorManageRecordController.java | 1 + .../xml/XzTaskProgressContentMapper.xml | 1 + .../XzTaskProgressContentServiceImpl.java | 20 ++++- 29 files changed, 245 insertions(+), 262 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserExternalApi.java diff --git a/src/main/java/com/zhgd/xmgl/async/AsyncHikvision.java b/src/main/java/com/zhgd/xmgl/async/AsyncHikvision.java index d0e555fc5..0d9f2f245 100644 --- a/src/main/java/com/zhgd/xmgl/async/AsyncHikvision.java +++ b/src/main/java/com/zhgd/xmgl/async/AsyncHikvision.java @@ -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 { diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java index f2cbe8c57..6e60ee247 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java @@ -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> getSystemUserBySn(@RequestBody Map 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> getSystemUserList(@RequestBody Map 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> getZjwjUserPage(SystemUser systemUser) { - return systemUserService.getZjwjUserPage(systemUser); - } - - @ApiOperation(value = "中建五局查询人员列表", notes = "中建五局查询人员列表", httpMethod = "GET") - @GetMapping(value = "/zjwj/list") - public Result> 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); diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserExternalApi.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserExternalApi.java new file mode 100644 index 000000000..5cd48bed7 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserExternalApi.java @@ -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> getZjwjUserPage(SystemUser systemUser) { + return systemUserService.getZjwjUserPage(systemUser); + } + + @ApiOperation(value = "中建五局查询人员列表", notes = "中建五局查询人员列表", httpMethod = "GET") + @GetMapping(value = "/zjwj/list") + public Result> 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); + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/SystemUserMapper.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/SystemUserMapper.java index 8a3bd8f79..7e6b96f07 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/SystemUserMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/SystemUserMapper.java @@ -34,14 +34,6 @@ public interface SystemUserMapper extends BaseMapper { Page getSystemUserBySn(@Param("param") Map map, Page page); - /** - * sn,type=3是项目级别账号 - * - * @param map - * @return - */ - List getSystemUsers(@Param("param") Map map); - SystemUser findByUsername(@Param("account") String account); List getComapnySystemUserList(Map map); diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml index 53ae0da63..ce51bdc7e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml @@ -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 and b.is_enable = #{param.useState} @@ -206,108 +206,102 @@ - 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 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 diff --git a/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/DangerousEngineeringRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/DangerousEngineeringRecordServiceImpl.java index 2441aa12e..bdf9318ca 100644 --- a/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/DangerousEngineeringRecordServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/DangerousEngineeringRecordServiceImpl.java @@ -122,7 +122,7 @@ public class DangerousEngineeringRecordServiceImpl extends ServiceImpl systemUsers = systemUserMapper.getSystemUsers(new MapBuilder().put("sn", projectSn).put("type", 3).build()); + List systemUsers = systemUserMapper.getSystemUserBySn(new MapBuilder().put("sn", projectSn).put("type", "projectLevel").build()); for (SystemUser systemUser : systemUsers) { Notice notice = new Notice(); notice.setType("32"); diff --git a/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/HiddenDangerInspectRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/HiddenDangerInspectRecordServiceImpl.java index 80eb74cd8..f562dd144 100644 --- a/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/HiddenDangerInspectRecordServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/dangerous/service/impl/HiddenDangerInspectRecordServiceImpl.java @@ -232,7 +232,7 @@ public class HiddenDangerInspectRecordServiceImpl extends ServiceImpl= 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); } diff --git a/src/main/java/com/zhgd/xmgl/modules/quality/controller/QualityInspectionRecordController.java b/src/main/java/com/zhgd/xmgl/modules/quality/controller/QualityInspectionRecordController.java index a80ea4d58..9e8562d13 100644 --- a/src/main/java/com/zhgd/xmgl/modules/quality/controller/QualityInspectionRecordController.java +++ b/src/main/java/com/zhgd/xmgl/modules/quality/controller/QualityInspectionRecordController.java @@ -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 selectQualityStatisticsNum(@RequestBody Map 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"), diff --git a/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml b/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml index 05b7814c5..f97958ee2 100644 --- a/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml @@ -235,7 +235,7 @@ and status = 2 ORDER BY create_time desc LIMIT 1) > a.change_limit_time - ELSE a.change_limit_time now() END), 0) overTime, + ELSE a.change_limit_time 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 @@ diff --git a/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityInspectionRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityInspectionRecordServiceImpl.java index 3846a08f0..c65c66c36 100644 --- a/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityInspectionRecordServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityInspectionRecordServiceImpl.java @@ -277,7 +277,7 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl systemUsers = systemUserMapper.getSystemUsers(new MapBuilder().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().put("time", time) - .put("level", level).build())); - noticeService.addNotice(notice, false); - } + //List systemUsers = systemUserMapper.getSystemUsers(new MapBuilder().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().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= 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); diff --git a/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java index a69766ea9..74b29f32e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java @@ -104,7 +104,7 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl + order by vi.sort_num - 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} - - diff --git a/src/main/java/com/zhgd/xmgl/modules/xz.security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml b/src/main/java/com/zhgd/xmgl/modules/xz.security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml index f1bfb5bcc..e18edc040 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz.security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/xz.security/mapper/xml/XzSecurityQualityInspectionRecordMapper.xml @@ -130,6 +130,16 @@ + + 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 < now() THEN 1 ELSE 0 END)), 0) + as overTimeRectifiedNum, + IFNULL(SUM((CASE WHEN t.status = 2 and t.change_limit_time < now() THEN 1 ELSE 0 END)), 0) + as overTimeNotRectifiedNum, + + 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 < now() THEN 1 ELSE 0 END)), 0) - overTimeRectifiedNum, - IFNULL(SUM((CASE WHEN t.status = 2 and change_limit_time < now() THEN 1 ELSE 0 END)), 0) - overTimeNotRectifiedNum, + + 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 @@ @@ -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, + + ei.enterprise_name from xz_security_quality_inspection_record t left join enterprise_info ei on ei.id = t.enterprise_id diff --git a/src/main/java/com/zhgd/xmgl/modules/xz.security/service/impl/XzSecurityXzSecurityQualityInspectionRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/xz.security/service/impl/XzSecurityXzSecurityQualityInspectionRecordServiceImpl.java index 0f65fdc2a..0fbe9f4e1 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz.security/service/impl/XzSecurityXzSecurityQualityInspectionRecordServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz.security/service/impl/XzSecurityXzSecurityQualityInspectionRecordServiceImpl.java @@ -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() - .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 systemUsers = systemUserMapper.getSystemUsers(new MapBuilder().put("sn", qualityInspectionRecord.getProjectSn()).put("type", 3).build()); + List systemUsers = systemUserMapper.getSystemUserBySn(new MapBuilder().put("sn", qualityInspectionRecord.getProjectSn()).put("type", "projectLevel").build()); for (SystemUser systemUser : systemUsers) { Notice notice = new Notice(); notice.setType(type); diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzVisitorManageRecordController.java b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzVisitorManageRecordController.java index 99d4bc13f..eb1ad4a21 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzVisitorManageRecordController.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzVisitorManageRecordController.java @@ -75,6 +75,7 @@ public class XzVisitorManageRecordController { @PostMapping(value = "/page") public Result> queryPageList(@ApiIgnore @RequestBody Map map) { QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(XzVisitorManageRecord.class, map); + queryWrapper.orderByDesc("create_time"); Page page = PageUtil.getPage(map); IPage pageList = xzVisitorManageRecordService.page(page, queryWrapper); return Result.success(pageList); diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/mapper/xml/XzTaskProgressContentMapper.xml b/src/main/java/com/zhgd/xmgl/modules/xz/mapper/xml/XzTaskProgressContentMapper.xml index de8a33093..4dbc3947f 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/mapper/xml/XzTaskProgressContentMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/xz/mapper/xml/XzTaskProgressContentMapper.xml @@ -26,6 +26,7 @@ and c.audit_type=2 and c.has_delay_event=1 + and c.delay_event_type != '' group by c.delay_event_type diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzTaskProgressContentServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzTaskProgressContentServiceImpl.java index 77e552697..ec7062ede 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzTaskProgressContentServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzTaskProgressContentServiceImpl.java @@ -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 paramMap) { ArrayList list = baseMapper.statsDelayEventType(paramMap); - return SectorVo.getSectorVoByEnum(list, ParamEnum.DelayEventTypeEnum.values(), false); + List rtList = new ArrayList<>(); + for (SectorOneVo oneVo : list) { + List 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 getQueryWrapper(HashMap paramMap) {