Compare commits
5 Commits
cb2e24c02d
...
3be9130520
| Author | SHA1 | Date |
|---|---|---|
|
|
3be9130520 | |
|
|
d452d31d8d | |
|
|
73da9e4153 | |
|
|
a5620c3a27 | |
|
|
b64c1048a0 |
|
|
@ -6,6 +6,7 @@ import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.Response;
|
import com.alibaba.cola.dto.Response;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
import com.zcloud.key.project.api.project.KeyProjectServiceI;
|
import com.zcloud.key.project.api.project.KeyProjectServiceI;
|
||||||
|
import com.zcloud.key.project.domain.enums.CreateSourceEnum;
|
||||||
import com.zcloud.key.project.domain.enums.KeyProjectApplyStatusEnum;
|
import com.zcloud.key.project.domain.enums.KeyProjectApplyStatusEnum;
|
||||||
import com.zcloud.key.project.dto.clientobject.project.*;
|
import com.zcloud.key.project.dto.clientobject.project.*;
|
||||||
import com.zcloud.key.project.dto.project.*;
|
import com.zcloud.key.project.dto.project.*;
|
||||||
|
|
@ -34,6 +35,9 @@ public class KeyProjectController {
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public SingleResponse<KeyProjectCO> add(@Validated @RequestBody KeyProjectAddCmd cmd) {
|
public SingleResponse<KeyProjectCO> add(@Validated @RequestBody KeyProjectAddCmd cmd) {
|
||||||
cmd.setApplyStatus(KeyProjectApplyStatusEnum.NOT_STARTED.getCode());
|
cmd.setApplyStatus(KeyProjectApplyStatusEnum.NOT_STARTED.getCode());
|
||||||
|
if (cmd.getCreateSource() == null) {
|
||||||
|
cmd.setCreateSource(CreateSourceEnum.MANUAL.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
return keyProjectService.add(cmd);
|
return keyProjectService.add(cmd);
|
||||||
}
|
}
|
||||||
|
|
@ -41,6 +45,9 @@ public class KeyProjectController {
|
||||||
@PostMapping("/saveStorage")
|
@PostMapping("/saveStorage")
|
||||||
public SingleResponse<KeyProjectCO> saveStorage(@RequestBody KeyProjectAddCmd cmd) {
|
public SingleResponse<KeyProjectCO> saveStorage(@RequestBody KeyProjectAddCmd cmd) {
|
||||||
cmd.setApplyStatus(KeyProjectApplyStatusEnum.TEMPORARY_SAVE.getCode());
|
cmd.setApplyStatus(KeyProjectApplyStatusEnum.TEMPORARY_SAVE.getCode());
|
||||||
|
if (cmd.getCreateSource() == null) {
|
||||||
|
cmd.setCreateSource(CreateSourceEnum.MANUAL.getCode());
|
||||||
|
}
|
||||||
return keyProjectService.add(cmd);
|
return keyProjectService.add(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,8 @@ public class SafetyEnvironmentalInspectionAddExe {
|
||||||
queryWrapper.eq("key_project_id", cmd.getKeyProjectId());
|
queryWrapper.eq("key_project_id", cmd.getKeyProjectId());
|
||||||
queryWrapper.ne("apply_status", 0);
|
queryWrapper.ne("apply_status", 0);
|
||||||
queryWrapper.eq("delete_enum", "FALSE");
|
queryWrapper.eq("delete_enum", "FALSE");
|
||||||
|
queryWrapper.orderByDesc("update_time");
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
KeyProjectDO keyProjectDO = keyProjectRepository.getOne(queryWrapper);
|
KeyProjectDO keyProjectDO = keyProjectRepository.getOne(queryWrapper);
|
||||||
List<SafetyEnvironmentalInspectionUserDO> messageUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 2);
|
List<SafetyEnvironmentalInspectionUserDO> messageUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 2);
|
||||||
// todo 可能会导致异步任务被线程池拒绝
|
// todo 可能会导致异步任务被线程池拒绝
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,9 @@ public class SafetyEnvironmentalInspectionDefendAddExe {
|
||||||
BeanUtils.copyProperties(cmd, safetyEnvironmentalInspectionDefendE);
|
BeanUtils.copyProperties(cmd, safetyEnvironmentalInspectionDefendE);
|
||||||
safetyEnvironmentalInspectionDefendE.init();
|
safetyEnvironmentalInspectionDefendE.init();
|
||||||
SafetyEnvironmentalInspectionDO inspectionDO = safetyEnvironmentalInspectionRepository.getByInspectionId(cmd.getInspectionId());
|
SafetyEnvironmentalInspectionDO inspectionDO = safetyEnvironmentalInspectionRepository.getByInspectionId(cmd.getInspectionId());
|
||||||
|
if (inspectionDO == null) {
|
||||||
|
throw new BizException("检查任务不存在");
|
||||||
|
}
|
||||||
Integer type = 3;
|
Integer type = 3;
|
||||||
if (inspectionDO != null && !ObjectUtils.isEmpty(inspectionDO.getDefendFlag()) && inspectionDO.getDefendFlag() == 1){
|
if (inspectionDO != null && !ObjectUtils.isEmpty(inspectionDO.getDefendFlag()) && inspectionDO.getDefendFlag() == 1){
|
||||||
type = 6;
|
type = 6;
|
||||||
|
|
@ -89,6 +92,9 @@ public class SafetyEnvironmentalInspectionDefendAddExe {
|
||||||
// 增加待申辩人
|
// 增加待申辩人
|
||||||
// 查找发起人,作为申辩信息审核人
|
// 查找发起人,作为申辩信息审核人
|
||||||
List<SafetyEnvironmentalInspectionUserDO> initiator = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
List<SafetyEnvironmentalInspectionUserDO> initiator = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
||||||
|
if (initiator == null || initiator.isEmpty()) {
|
||||||
|
throw new BizException("未找到检查发起人");
|
||||||
|
}
|
||||||
SafetyEnvironmentalInspectionUserE inspectionUserE = new SafetyEnvironmentalInspectionUserE();
|
SafetyEnvironmentalInspectionUserE inspectionUserE = new SafetyEnvironmentalInspectionUserE();
|
||||||
inspectionUserE.init(cmd.getInspectionId(), 0, 4, initiator.get(0).getCorpId(), initiator.get(0).getDepartmentId(), initiator.get(0).getUserId());
|
inspectionUserE.init(cmd.getInspectionId(), 0, 4, initiator.get(0).getCorpId(), initiator.get(0).getDepartmentId(), initiator.get(0).getUserId());
|
||||||
safetyEnvironmentalInspectionUserGateway.add(inspectionUserE);
|
safetyEnvironmentalInspectionUserGateway.add(inspectionUserE);
|
||||||
|
|
@ -132,6 +138,9 @@ public class SafetyEnvironmentalInspectionDefendAddExe {
|
||||||
//TODO 站内信 给发起人发归档信息
|
//TODO 站内信 给发起人发归档信息
|
||||||
// 查找发起人,作为归档人
|
// 查找发起人,作为归档人
|
||||||
List<SafetyEnvironmentalInspectionUserDO> initiator = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
List<SafetyEnvironmentalInspectionUserDO> initiator = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
||||||
|
if (initiator == null || initiator.isEmpty()) {
|
||||||
|
throw new BizException("未找到检查发起人");
|
||||||
|
}
|
||||||
Map<String, Object> sendParamsPigeonhole = new HashMap<>();
|
Map<String, Object> sendParamsPigeonhole = new HashMap<>();
|
||||||
sendParamsPigeonhole.put("checkTitle", inspectionDO.getProjectName());
|
sendParamsPigeonhole.put("checkTitle", inspectionDO.getProjectName());
|
||||||
messageNoticeExe.messageNotice(initiator.get(0).getUserId(), messageTemplateConfig.getCheckInitiatorApplyAcceptancePass(), sendParamsPigeonhole);
|
messageNoticeExe.messageNotice(initiator.get(0).getUserId(), messageTemplateConfig.getCheckInitiatorApplyAcceptancePass(), sendParamsPigeonhole);
|
||||||
|
|
@ -139,6 +148,9 @@ public class SafetyEnvironmentalInspectionDefendAddExe {
|
||||||
}
|
}
|
||||||
// 完成当前确认人的待办
|
// 完成当前确认人的待办
|
||||||
List<SafetyEnvironmentalInspectionUserDO> affirmList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), type, ssoUser.getUserId());
|
List<SafetyEnvironmentalInspectionUserDO> affirmList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), type, ssoUser.getUserId());
|
||||||
|
if (affirmList == null || affirmList.isEmpty()) {
|
||||||
|
throw new BizException("当前用户无可确认的检查记录");
|
||||||
|
}
|
||||||
messageNoticeExe.sendMessageCompleteEvent(affirmList.get(0).getId());
|
messageNoticeExe.sendMessageCompleteEvent(affirmList.get(0).getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,8 @@ public class SafetyEnvironmentalInspectionUpdateExe {
|
||||||
queryWrapper.eq("key_project_id", cmd.getKeyProjectId());
|
queryWrapper.eq("key_project_id", cmd.getKeyProjectId());
|
||||||
queryWrapper.ne("apply_status", 0);
|
queryWrapper.ne("apply_status", 0);
|
||||||
queryWrapper.eq("delete_enum", "FALSE");
|
queryWrapper.eq("delete_enum", "FALSE");
|
||||||
|
queryWrapper.orderByDesc("update_time");
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
KeyProjectDO keyProjectDO = keyProjectRepository.getOne(queryWrapper);
|
KeyProjectDO keyProjectDO = keyProjectRepository.getOne(queryWrapper);
|
||||||
List<SafetyEnvironmentalInspectionUserDO> messageUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 2);
|
List<SafetyEnvironmentalInspectionUserDO> messageUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 2);
|
||||||
for (SafetyEnvironmentalInspectionUserDO insUser : messageUserList){
|
for (SafetyEnvironmentalInspectionUserDO insUser : messageUserList){
|
||||||
|
|
@ -268,8 +270,10 @@ public class SafetyEnvironmentalInspectionUpdateExe {
|
||||||
}
|
}
|
||||||
List<SafetyEnvironmentalInspectionUserDO> userList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
List<SafetyEnvironmentalInspectionUserDO> userList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
||||||
// 完成重新发起待办
|
// 完成重新发起待办
|
||||||
|
if (userList != null && !userList.isEmpty()) {
|
||||||
messageNoticeExe.sendMessageCompleteEvent(userList.get(0).getId());
|
messageNoticeExe.sendMessageCompleteEvent(userList.get(0).getId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("报错了", e);
|
log.error("报错了", e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -425,6 +429,8 @@ public class SafetyEnvironmentalInspectionUpdateExe {
|
||||||
queryWrapper.eq("key_project_id", cmd.getKeyProjectId());
|
queryWrapper.eq("key_project_id", cmd.getKeyProjectId());
|
||||||
queryWrapper.ne("apply_status", 0);
|
queryWrapper.ne("apply_status", 0);
|
||||||
queryWrapper.eq("delete_enum", "FALSE");
|
queryWrapper.eq("delete_enum", "FALSE");
|
||||||
|
queryWrapper.orderByDesc("update_time");
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
KeyProjectDO keyProjectDO = keyProjectRepository.getOne(queryWrapper);
|
KeyProjectDO keyProjectDO = keyProjectRepository.getOne(queryWrapper);
|
||||||
List<SafetyEnvironmentalInspectionUserDO> messageUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 5);
|
List<SafetyEnvironmentalInspectionUserDO> messageUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 5);
|
||||||
for (SafetyEnvironmentalInspectionUserDO insUser : messageUserList){
|
for (SafetyEnvironmentalInspectionUserDO insUser : messageUserList){
|
||||||
|
|
@ -437,7 +443,9 @@ public class SafetyEnvironmentalInspectionUpdateExe {
|
||||||
}
|
}
|
||||||
List<SafetyEnvironmentalInspectionUserDO> userList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 4);
|
List<SafetyEnvironmentalInspectionUserDO> userList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 4);
|
||||||
// 完成申辩待办
|
// 完成申辩待办
|
||||||
|
if (userList != null && !userList.isEmpty()) {
|
||||||
messageNoticeExe.sendMessageCompleteEvent(userList.get(0).getId());
|
messageNoticeExe.sendMessageCompleteEvent(userList.get(0).getId());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("报错了", e);
|
log.error("报错了", e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -500,12 +508,16 @@ public class SafetyEnvironmentalInspectionUpdateExe {
|
||||||
List<SafetyEnvironmentalInspectionUserDO> initiator = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
List<SafetyEnvironmentalInspectionUserDO> initiator = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 1);
|
||||||
Map<String, Object> sendParamsPigeonhole = new HashMap<>();
|
Map<String, Object> sendParamsPigeonhole = new HashMap<>();
|
||||||
sendParamsPigeonhole.put("checkTitle", inspectionDO.getProjectName());
|
sendParamsPigeonhole.put("checkTitle", inspectionDO.getProjectName());
|
||||||
|
if (initiator != null && !initiator.isEmpty()) {
|
||||||
messageNoticeExe.messageNotice(initiator.get(0).getUserId(), messageTemplateConfig.getCheckInitiatorApplyAcceptancePass(), sendParamsPigeonhole);
|
messageNoticeExe.messageNotice(initiator.get(0).getUserId(), messageTemplateConfig.getCheckInitiatorApplyAcceptancePass(), sendParamsPigeonhole);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<SafetyEnvironmentalInspectionUserDO> userList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 4);
|
List<SafetyEnvironmentalInspectionUserDO> userList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), 4);
|
||||||
// 完成申辩待办
|
// 完成申辩待办
|
||||||
|
if (userList != null && !userList.isEmpty()) {
|
||||||
messageNoticeExe.sendMessageCompleteEvent(userList.get(0).getId());
|
messageNoticeExe.sendMessageCompleteEvent(userList.get(0).getId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@ public class SafetyEnvironmentalInspectionUserUpdateExe {
|
||||||
SafetyEnvironmentalInspectionUserDO inspectionUserDO = new SafetyEnvironmentalInspectionUserDO();
|
SafetyEnvironmentalInspectionUserDO inspectionUserDO = new SafetyEnvironmentalInspectionUserDO();
|
||||||
BeanUtils.copyProperties(inspectionUserE, inspectionUserDO);
|
BeanUtils.copyProperties(inspectionUserE, inspectionUserDO);
|
||||||
SafetyEnvironmentalInspectionDO inspectionDO = safetyEnvironmentalInspectionRepository.getByInspectionId(cmd.getInspectionId());
|
SafetyEnvironmentalInspectionDO inspectionDO = safetyEnvironmentalInspectionRepository.getByInspectionId(cmd.getInspectionId());
|
||||||
|
if (inspectionDO == null) {
|
||||||
|
throw new BizException("检查任务不存在");
|
||||||
|
}
|
||||||
// 没有申辩过的安全环保检查 safetyEnvironmentalInspectionUser 下一步type 是2 否则 下一步type是
|
// 没有申辩过的安全环保检查 safetyEnvironmentalInspectionUser 下一步type 是2 否则 下一步type是
|
||||||
Integer type = 2;
|
Integer type = 2;
|
||||||
if (inspectionDO != null && !ObjectUtils.isEmpty(inspectionDO.getDefendFlag()) && inspectionDO.getDefendFlag() == 1){
|
if (inspectionDO != null && !ObjectUtils.isEmpty(inspectionDO.getDefendFlag()) && inspectionDO.getDefendFlag() == 1){
|
||||||
|
|
@ -69,6 +72,9 @@ public class SafetyEnvironmentalInspectionUserUpdateExe {
|
||||||
// 修改自己的检查信息
|
// 修改自己的检查信息
|
||||||
safetyEnvironmentalInspectionUserRepository.verifyEdit(inspectionUserDO);
|
safetyEnvironmentalInspectionUserRepository.verifyEdit(inspectionUserDO);
|
||||||
List<SafetyEnvironmentalInspectionUserDO> verifyUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), type, ssoUser.getUserId());
|
List<SafetyEnvironmentalInspectionUserDO> verifyUserList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), type, ssoUser.getUserId());
|
||||||
|
if (verifyUserList == null || verifyUserList.isEmpty()) {
|
||||||
|
throw new BizException("当前用户无可核实的检查记录");
|
||||||
|
}
|
||||||
|
|
||||||
if (cmd.getStatus() == 1){ // 如果通过
|
if (cmd.getStatus() == 1){ // 如果通过
|
||||||
// 查询是否所有人都核实,
|
// 查询是否所有人都核实,
|
||||||
|
|
@ -97,7 +103,8 @@ public class SafetyEnvironmentalInspectionUserUpdateExe {
|
||||||
sendParams.put("initiatorName", inspectionDO.getCreateName());
|
sendParams.put("initiatorName", inspectionDO.getCreateName());
|
||||||
sendParams.put("checkTitle", inspectionDO.getProjectName());
|
sendParams.put("checkTitle", inspectionDO.getProjectName());
|
||||||
messageNoticeExe.messageNotice(inspectionDO.getCreateId(), messageTemplateConfig.getCheckInitiatorApplyCheckNotPass(), sendParams);
|
messageNoticeExe.messageNotice(inspectionDO.getCreateId(), messageTemplateConfig.getCheckInitiatorApplyCheckNotPass(), sendParams);
|
||||||
messageNoticeExe.sendMessageAddEvent(inspectionDO.getCreateId(), "您有一条【安全环保检查】待处理","检查任务核实不通过,请您尽快处理。", inspectionDO.getId(), userList.get(0).getId());
|
Long todoId = userList != null && !userList.isEmpty() ? userList.get(0).getId() : inspectionDO.getId();
|
||||||
|
messageNoticeExe.sendMessageAddEvent(inspectionDO.getCreateId(), "您有一条【安全环保检查】待处理","检查任务核实不通过,请您尽快处理。", inspectionDO.getId(), todoId);
|
||||||
List<SafetyEnvironmentalInspectionUserDO> verifyComList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), type);
|
List<SafetyEnvironmentalInspectionUserDO> verifyComList = safetyEnvironmentalInspectionUserRepository.listAllByInspectionId(cmd.getInspectionId(), type);
|
||||||
for (SafetyEnvironmentalInspectionUserDO verifyCom : verifyComList){
|
for (SafetyEnvironmentalInspectionUserDO verifyCom : verifyComList){
|
||||||
messageNoticeExe.sendMessageCompleteEvent(verifyCom.getId());
|
messageNoticeExe.sendMessageCompleteEvent(verifyCom.getId());
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,9 @@ public class KeyProjectAddExe {
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public KeyProjectCO execute(KeyProjectAddCmd cmd) {
|
public KeyProjectCO execute(KeyProjectAddCmd cmd) {
|
||||||
|
if (cmd.getCreateSource() == null) {
|
||||||
|
cmd.setCreateSource(CreateSourceEnum.MANUAL.getCode());
|
||||||
|
}
|
||||||
List<KeyProjectPenaltyPersonnelAddCmd> penaltyPersonnelAddCmdList = null;
|
List<KeyProjectPenaltyPersonnelAddCmd> penaltyPersonnelAddCmdList = null;
|
||||||
if (cmd.getKeyProjectPenaltyPersonnelAddCmdList() != null) {
|
if (cmd.getKeyProjectPenaltyPersonnelAddCmdList() != null) {
|
||||||
penaltyPersonnelAddCmdList = cmd.getKeyProjectPenaltyPersonnelAddCmdList().stream()
|
penaltyPersonnelAddCmdList = cmd.getKeyProjectPenaltyPersonnelAddCmdList().stream()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.zcloud.key.project.command.query.hidden;
|
package com.zcloud.key.project.command.query.hidden;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
import com.zcloud.key.project.command.convertor.hidden.HiddenPenaltyCoConvertor;
|
import com.zcloud.key.project.command.convertor.hidden.HiddenPenaltyCoConvertor;
|
||||||
import com.zcloud.key.project.dto.clientobject.hidden.HiddenPenaltyCO;
|
import com.zcloud.key.project.dto.clientobject.hidden.HiddenPenaltyCO;
|
||||||
|
|
@ -23,6 +24,7 @@ public class HiddenPenaltyQueryExe {
|
||||||
|
|
||||||
public PageResponse<HiddenPenaltyCO> execute(HiddenPenaltyPageQry qry) {
|
public PageResponse<HiddenPenaltyCO> execute(HiddenPenaltyPageQry qry) {
|
||||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
params.put("currentUserId", AuthContext.getUserId());
|
||||||
PageResponse<HiddenPenaltyDO> pageResponse = hiddenPenaltyRepository.listPage(params);
|
PageResponse<HiddenPenaltyDO> pageResponse = hiddenPenaltyRepository.listPage(params);
|
||||||
List<HiddenPenaltyCO> cos = hiddenPenaltyCoConvertor.converDOsToCOs(pageResponse.getData());
|
List<HiddenPenaltyCO> cos = hiddenPenaltyCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
return PageResponse.of(cos, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
return PageResponse.of(cos, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.zcloud.key.project.command.query.inspection;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import com.zcloud.gbscommon.excelEntity.SafetyEnvironmentalInspectionExportEntity;
|
import com.zcloud.gbscommon.excelEntity.SafetyEnvironmentalInspectionExportEntity;
|
||||||
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
|
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
|
||||||
import com.zcloud.gbscommon.utils.ExcelUtils;
|
import com.zcloud.gbscommon.utils.ExcelUtils;
|
||||||
|
|
@ -127,11 +129,46 @@ public class SafetyEnvironmentalInspectionQueryExe {
|
||||||
*/
|
*/
|
||||||
public PageResponse<SafetyEnvironmentalInspectionCO> execute(SafetyEnvironmentalInspectionPageQry safetyEnvironmentalInspectionPageQry) {
|
public PageResponse<SafetyEnvironmentalInspectionCO> execute(SafetyEnvironmentalInspectionPageQry safetyEnvironmentalInspectionPageQry) {
|
||||||
Map<String, Object> params = PageQueryHelper.toHashMap(safetyEnvironmentalInspectionPageQry);
|
Map<String, Object> params = PageQueryHelper.toHashMap(safetyEnvironmentalInspectionPageQry);
|
||||||
|
fillPendingUserParams(params, safetyEnvironmentalInspectionPageQry);
|
||||||
PageResponse<SafetyEnvironmentalInspectionDO> pageResponse = safetyEnvironmentalInspectionRepository.listPage(params);
|
PageResponse<SafetyEnvironmentalInspectionDO> pageResponse = safetyEnvironmentalInspectionRepository.listPage(params);
|
||||||
List<SafetyEnvironmentalInspectionCO> examCenterCOS = safetyEnvironmentalInspectionCoConvertor.converDOsToCOs(pageResponse.getData());
|
List<SafetyEnvironmentalInspectionCO> examCenterCOS = safetyEnvironmentalInspectionCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void fillPendingUserParams(Map<String, Object> params, SafetyEnvironmentalInspectionPageQry qry) {
|
||||||
|
List<Integer> currentPendingTypeList = resolveCurrentPendingTypeList(qry);
|
||||||
|
if (currentPendingTypeList == null || currentPendingTypeList.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
if (ssoUser == null || ssoUser.getUserId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.put("currentPendingTypeList", currentPendingTypeList);
|
||||||
|
params.put("currentPendingUserId", ssoUser.getUserId());
|
||||||
|
params.put("onlyCurrentPendingUser", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Integer> resolveCurrentPendingTypeList(SafetyEnvironmentalInspectionPageQry qry) {
|
||||||
|
if (qry == null || qry.getStatusList() == null || qry.getStatusList().size() != 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Integer status = qry.getStatusList().get(0);
|
||||||
|
if (status == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (status == 1) {
|
||||||
|
return Arrays.asList(2, 5);
|
||||||
|
}
|
||||||
|
if (status == 2) {
|
||||||
|
return Arrays.asList(3, 6);
|
||||||
|
}
|
||||||
|
if (status == 7) {
|
||||||
|
return Collections.singletonList(4);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void export(Long[] ids, HttpServletResponse httpServletResponse) {
|
public void export(Long[] ids, HttpServletResponse httpServletResponse) {
|
||||||
if (ids == null || ids.length == 0){
|
if (ids == null || ids.length == 0){
|
||||||
throw new BizException("请勾选要导出的数据");
|
throw new BizException("请勾选要导出的数据");
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import com.zcloud.key.project.persistence.repository.project.KeyProjectRepositor
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -256,8 +256,14 @@ public class KeyProjectQueryExe {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 处罚管理数量(相关方未反馈的罚款处罚)
|
// 处罚管理数量:直接复用处罚管理列表口径,统计未处罚数据
|
||||||
Long penaltyCount = hiddenPenaltyRepository.countByUserId(id);
|
Map<String, Object> penaltyParams = new HashMap<>();
|
||||||
|
penaltyParams.put("pageIndex", 1);
|
||||||
|
penaltyParams.put("pageSize", 1);
|
||||||
|
penaltyParams.put("fineFlag", "0");
|
||||||
|
penaltyParams.put("currentUserId", id);
|
||||||
|
int pCount = hiddenPenaltyRepository.listPage(penaltyParams).getTotalCount();
|
||||||
|
Long penaltyCount = (long) pCount;
|
||||||
// 处罚反馈数量
|
// 处罚反馈数量
|
||||||
Long feedbackCount = hiddenPenaltyRepository.countFeedbackByUserId(id);
|
Long feedbackCount = hiddenPenaltyRepository.countFeedbackByUserId(id);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ public class KeyProjectCameraAiCO implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "摄像头名称")
|
@ApiModelProperty(value = "摄像头名称")
|
||||||
private String cameraName;
|
private String cameraName;
|
||||||
|
@ApiModelProperty(value = "摄像头是否在线")
|
||||||
|
private Integer isOnline;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "算法类型ID")
|
@ApiModelProperty(value = "算法类型ID")
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ public class HiddenPageQry extends PageQuery {
|
||||||
private Integer source;
|
private Integer source;
|
||||||
private String startTime;
|
private String startTime;
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
private String keyProjectId;
|
||||||
private String projectName;
|
private String projectName;
|
||||||
private String hiddenFindUserName;
|
private String hiddenFindUserName;
|
||||||
private String rectificationUserName;
|
private String rectificationUserName;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
left join user hfu on hfu.id = hf.find_user_id
|
left join user hfu on hfu.id = hf.find_user_id
|
||||||
left join department hfd on hfd.id = hfu.department_id
|
left join department hfd on hfd.id = hfu.department_id
|
||||||
left join user au on au.id = h.accept_user_id
|
left join user au on au.id = h.accept_user_id
|
||||||
left join safety_environmental_inspection i on i.inspection_id = h.foreign_key and i.status in (3,5) and h.source in (2, 3)
|
left join safety_environmental_inspection i on i.inspection_id = h.foreign_key and i.delete_enum = 'FALSE' and i.status != 0 and h.source in (2, 3)
|
||||||
left join key_project kp on kp.key_project_id = i.key_project_id
|
left join key_project kp on kp.key_project_id = i.key_project_id
|
||||||
left join ai_alarm aa on h.foreign_key = aa.ai_alarm_id and h.source = 1
|
left join ai_alarm aa on h.foreign_key = aa.ai_alarm_id and h.source = 1
|
||||||
left join key_project kp2 on kp2.key_project_id = aa.key_project_id
|
left join key_project kp2 on kp2.key_project_id = aa.key_project_id
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,9 @@
|
||||||
<if test="params.fineFlag != null and params.fineFlag != ''">
|
<if test="params.fineFlag != null and params.fineFlag != ''">
|
||||||
AND hp.fine_flag = #{params.fineFlag}
|
AND hp.fine_flag = #{params.fineFlag}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.currentUserId != null">
|
||||||
|
AND (hp.create_id = #{params.currentUserId} OR hp.penalized_user_id = #{params.currentUserId})
|
||||||
|
</if>
|
||||||
<if test="params.penaltyDesc != null and params.penaltyDesc != ''">
|
<if test="params.penaltyDesc != null and params.penaltyDesc != ''">
|
||||||
AND hp.penalty_desc LIKE CONCAT('%', #{params.penaltyDesc}, '%')
|
AND hp.penalty_desc LIKE CONCAT('%', #{params.penaltyDesc}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -219,10 +222,22 @@
|
||||||
LEFT JOIN hidden_penalty hp ON hp.hidden_id = h.hidden_id AND hp.delete_enum = 'FALSE'
|
LEFT JOIN hidden_penalty hp ON hp.hidden_id = h.hidden_id AND hp.delete_enum = 'FALSE'
|
||||||
WHERE h.delete_enum = 'FALSE'
|
WHERE h.delete_enum = 'FALSE'
|
||||||
AND h.state = 3
|
AND h.state = 3
|
||||||
AND kpp.user_id = #{userId}
|
|
||||||
AND (h.source NOT IN (2, 3) OR i.inspection_id IS NOT NULL)
|
AND (h.source NOT IN (2, 3) OR i.inspection_id IS NOT NULL)
|
||||||
AND (h.source != 1 OR aa.ai_alarm_id IS NOT NULL)
|
AND (h.source != 1 OR aa.ai_alarm_id IS NOT NULL)
|
||||||
AND hp.id IS NULL
|
AND (
|
||||||
|
(
|
||||||
|
hp.id IS NULL
|
||||||
|
AND kpp.user_id = #{userId}
|
||||||
|
)
|
||||||
|
OR
|
||||||
|
(
|
||||||
|
hp.id IS NOT NULL
|
||||||
|
AND hp.penalized_user_id = #{userId}
|
||||||
|
AND hp.fine_flag = 0
|
||||||
|
AND hp.feedback_status = 0
|
||||||
|
AND hp.edit_flag = 0
|
||||||
|
)
|
||||||
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countFeedbackByUserId" resultType="java.lang.Long">
|
<select id="countFeedbackByUserId" resultType="java.lang.Long">
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,8 @@
|
||||||
juruser.name as jurisdictionUserName,
|
juruser.name as jurisdictionUserName,
|
||||||
xgfci.corp_name AS xgfCorpinfoName,
|
xgfci.corp_name AS xgfCorpinfoName,
|
||||||
xgfuser.name as xgfUserName,
|
xgfuser.name as xgfUserName,
|
||||||
count(h.hidden_id) AS uncheckHiddenCount,
|
count(DISTINCT h.hidden_id) AS uncheckHiddenCount,
|
||||||
count(sei.inspection_id) AS unFinishInspectionCount
|
count(DISTINCT sei.inspection_id) AS unFinishInspectionCount
|
||||||
FROM key_project kp
|
FROM key_project kp
|
||||||
LEFT JOIN department fpd ON kp.master_department_id = fpd.id AND fpd.delete_enum = 'FALSE'
|
LEFT JOIN department fpd ON kp.master_department_id = fpd.id AND fpd.delete_enum = 'FALSE'
|
||||||
LEFT JOIN department ci ON kp.jurisdiction_department_id = ci.id AND ci.delete_enum = 'FALSE'
|
LEFT JOIN department ci ON kp.jurisdiction_department_id = ci.id AND ci.delete_enum = 'FALSE'
|
||||||
|
|
@ -114,6 +114,13 @@
|
||||||
left join hidden h on h.foreign_key = sei.inspection_id and h.delete_enum = 'FALSE' and h.state != 3
|
left join hidden h on h.foreign_key = sei.inspection_id and h.delete_enum = 'FALSE' and h.state != 3
|
||||||
<where>
|
<where>
|
||||||
kp.delete_enum = 'FALSE'
|
kp.delete_enum = 'FALSE'
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM key_project kp_latest
|
||||||
|
WHERE kp_latest.delete_enum = 'FALSE'
|
||||||
|
AND kp_latest.key_project_id = kp.key_project_id
|
||||||
|
AND kp_latest.id > kp.id
|
||||||
|
)
|
||||||
<!-- projectName 模糊查询判空 -->
|
<!-- projectName 模糊查询判空 -->
|
||||||
<if test="params.projectName != null and params.projectName != ''">
|
<if test="params.projectName != null and params.projectName != ''">
|
||||||
AND kp.project_name LIKE CONCAT('%', #{params.projectName}, '%')
|
AND kp.project_name LIKE CONCAT('%', #{params.projectName}, '%')
|
||||||
|
|
@ -220,7 +227,7 @@
|
||||||
GROUP_CONCAT(DISTINCT CASE WHEN kpc.camera_type = 2 THEN kpc.camera_id END) AS mobileCameraIdList
|
GROUP_CONCAT(DISTINCT CASE WHEN kpc.camera_type = 2 THEN kpc.camera_id END) AS mobileCameraIdList
|
||||||
FROM corp_info cp
|
FROM corp_info cp
|
||||||
LEFT JOIN key_project kp
|
LEFT JOIN key_project kp
|
||||||
ON cp.id = kp.jurisdiction_corpinfo_id AND kp.delete_enum = 'FALSE' AND kp.apply_status != 0
|
ON cp.id = kp.jurisdiction_corpinfo_id AND kp.delete_enum = 'FALSE' AND kp.apply_status != 0 AND kp.apply_status != 7
|
||||||
left join key_project_camera kpc on kp.key_project_id = kpc.key_project_id AND kpc.delete_enum = 'FALSE'
|
left join key_project_camera kpc on kp.key_project_id = kpc.key_project_id AND kpc.delete_enum = 'FALSE'
|
||||||
LEFT JOIN camera c ON c.camera_id = kpc.camera_id
|
LEFT JOIN camera c ON c.camera_id = kpc.camera_id
|
||||||
left join safety_environmental_inspection sei on cp.id = sei.corp_id AND sei.delete_enum = 'FALSE' and
|
left join safety_environmental_inspection sei on cp.id = sei.corp_id AND sei.delete_enum = 'FALSE' and
|
||||||
|
|
@ -246,38 +253,46 @@
|
||||||
AND cp.use_flag = 1
|
AND cp.use_flag = 1
|
||||||
AND cp.type IN (0, 1, 2, 6)
|
AND cp.type IN (0, 1, 2, 6)
|
||||||
<if test="params.corpinfoName != null and params.corpinfoName != ''">
|
<if test="params.corpinfoName != null and params.corpinfoName != ''">
|
||||||
AND cp.corp_name like concat('%',#{params.co rpinfoName},'%')
|
AND cp.corp_name like concat('%',#{params.corpinfoName},'%')
|
||||||
</if>
|
</if>
|
||||||
GROUP BY cp.id
|
GROUP BY cp.id
|
||||||
order by cp.corp_order ASC,cp.create_time desc
|
order by cp.corp_order ASC,cp.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="keyProjectStatistics" resultType="com.zcloud.key.project.persistence.dataobject.project.KeyProjectStatisticsDO">
|
<select id="keyProjectStatistics" resultType="com.zcloud.key.project.persistence.dataobject.project.KeyProjectStatisticsDO">
|
||||||
select kp.id,
|
select MAX(kp.id) as id,
|
||||||
kp.key_project_id as keyProjectId,
|
kp.key_project_id as keyProjectId,
|
||||||
kp.project_name as projectName,
|
MAX(kp.project_name) as projectName,
|
||||||
kp.project_id as projectId,
|
MAX(kp.project_id) as projectId,
|
||||||
COUNT(DISTINCT CASE WHEN kpc.camera_type = 1 THEN kpc.camera_id END) AS fixedCameraCount,
|
COUNT(DISTINCT CASE WHEN kpc.camera_type = 1 THEN kpc.camera_id END) AS fixedCameraCount,
|
||||||
COUNT(DISTINCT CASE WHEN kpc.camera_type = 2 THEN kpc.camera_id END) AS mobileCameraCount,
|
COUNT(DISTINCT CASE WHEN kpc.camera_type = 2 THEN kpc.camera_id END) AS mobileCameraCount,
|
||||||
COUNT(DISTINCT CASE WHEN kpc.camera_type = 1 AND c.is_online = 1 THEN kpc.camera_id END) AS onlineFixedCameraCount,
|
COUNT(DISTINCT CASE WHEN kpc.camera_type = 1 AND c.is_online = 1 THEN kpc.camera_id END) AS onlineFixedCameraCount,
|
||||||
COUNT(DISTINCT CASE WHEN kpc.camera_type = 2 AND c.is_online = 1 THEN kpc.camera_id END) AS onlineMobileCameraCount,
|
COUNT(DISTINCT CASE WHEN kpc.camera_type = 2 AND c.is_online = 1 THEN kpc.camera_id END) AS onlineMobileCameraCount,
|
||||||
COUNT(DISTINCT sei.id) AS inspectCount,
|
COALESCE(sei_stat.inspectCount, 0) AS inspectCount,
|
||||||
COUNT(DISTINCT h.id) AS hazardCount,
|
COALESCE(sei_stat.hazardCount, 0) AS hazardCount,
|
||||||
GROUP_CONCAT(DISTINCT CASE WHEN kpc.camera_type = 1 THEN kpc.camera_id END) AS fixedCameraIdList,
|
GROUP_CONCAT(DISTINCT CASE WHEN kpc.camera_type = 1 THEN kpc.camera_id END) AS fixedCameraIdList,
|
||||||
GROUP_CONCAT(DISTINCT CASE WHEN kpc.camera_type = 2 THEN kpc.camera_id END) AS mobileCameraIdList
|
GROUP_CONCAT(DISTINCT CASE WHEN kpc.camera_type = 2 THEN kpc.camera_id END) AS mobileCameraIdList
|
||||||
from key_project kp
|
from key_project kp
|
||||||
left join key_project_camera kpc on kp.key_project_id = kpc.key_project_id AND kpc.delete_enum = 'FALSE'
|
left join key_project_camera kpc on kp.key_project_id = kpc.key_project_id AND kpc.delete_enum = 'FALSE'
|
||||||
LEFT JOIN camera c ON c.camera_id = kpc.camera_id
|
LEFT JOIN camera c ON c.camera_id = kpc.camera_id
|
||||||
left join safety_environmental_inspection sei on kp.key_project_id = sei.key_project_id AND sei.delete_enum = 'FALSE' and sei.status != 0
|
LEFT JOIN (
|
||||||
left join hidden h on sei.inspection_id = h.foreign_key AND h.delete_enum = 'FALSE'
|
SELECT
|
||||||
|
key_project_id,
|
||||||
|
COUNT(DISTINCT id) AS inspectCount,
|
||||||
|
SUM(IFNULL(hidden_number, 0)) AS hazardCount
|
||||||
|
FROM safety_environmental_inspection
|
||||||
|
WHERE delete_enum = 'FALSE'
|
||||||
|
AND status != 0
|
||||||
|
GROUP BY key_project_id
|
||||||
|
) sei_stat ON kp.key_project_id = sei_stat.key_project_id
|
||||||
where kp.delete_enum = 'FALSE'
|
where kp.delete_enum = 'FALSE'
|
||||||
and kp.apply_status != 0
|
and kp.apply_status in (0,1,2,4,5,6)
|
||||||
and kp.jurisdiction_corpinfo_id = #{params.jurisdictionCorpinfoId}
|
and kp.jurisdiction_corpinfo_id = #{params.jurisdictionCorpinfoId}
|
||||||
<if test="params.projectName != null and params.projectName != ''">
|
<if test="params.projectName != null and params.projectName != ''">
|
||||||
AND kp.project_name like concat('%',#{params.projectName},'%')
|
AND kp.project_name like concat('%',#{params.projectName},'%')
|
||||||
</if>
|
</if>
|
||||||
GROUP BY kp.id
|
GROUP BY kp.key_project_id
|
||||||
ORDER BY kp.apply_status asc, kp.create_time DESC
|
ORDER BY MAX(kp.apply_status) asc, MAX(kp.create_time) DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,16 @@
|
||||||
xgfd.name as xgf_master_department_name
|
xgfd.name as xgf_master_department_name
|
||||||
from
|
from
|
||||||
ai_alarm aa
|
ai_alarm aa
|
||||||
left join key_project kp on kp.key_project_id = aa.key_project_id
|
left join (
|
||||||
|
select kp1.*
|
||||||
|
from key_project kp1
|
||||||
|
inner join (
|
||||||
|
select key_project_id, max(id) as id
|
||||||
|
from key_project
|
||||||
|
where delete_enum = 'FALSE'
|
||||||
|
group by key_project_id
|
||||||
|
) kp_latest on kp_latest.id = kp1.id
|
||||||
|
) kp on kp.key_project_id = aa.key_project_id
|
||||||
left join user xgfu on xgfu.id = kp.xgf_master_user_id
|
left join user xgfu on xgfu.id = kp.xgf_master_user_id
|
||||||
left join department xgfd on xgfd.id = xgfu.department_id
|
left join department xgfd on xgfd.id = xgfu.department_id
|
||||||
<where>
|
<where>
|
||||||
|
|
@ -43,7 +52,16 @@
|
||||||
h.hidden_id as hidden_uuid
|
h.hidden_id as hidden_uuid
|
||||||
from
|
from
|
||||||
ai_alarm aa
|
ai_alarm aa
|
||||||
left join key_project kp on kp.key_project_id = aa.key_project_id
|
left join (
|
||||||
|
select kp1.*
|
||||||
|
from key_project kp1
|
||||||
|
inner join (
|
||||||
|
select key_project_id, max(id) as id
|
||||||
|
from key_project
|
||||||
|
where delete_enum = 'FALSE'
|
||||||
|
group by key_project_id
|
||||||
|
) kp_latest on kp_latest.id = kp1.id
|
||||||
|
) kp on kp.key_project_id = aa.key_project_id
|
||||||
left join user xgfu on xgfu.id = kp.xgf_master_user_id
|
left join user xgfu on xgfu.id = kp.xgf_master_user_id
|
||||||
left join department xgfd on xgfd.id = xgfu.department_id
|
left join department xgfd on xgfd.id = xgfu.department_id
|
||||||
left join hidden h on h.foreign_key = aa.ai_alarm_id and h.delete_enum = 'FALSE'
|
left join hidden h on h.foreign_key = aa.ai_alarm_id and h.delete_enum = 'FALSE'
|
||||||
|
|
@ -63,7 +81,16 @@
|
||||||
h.hidden_id as hidden_uuid
|
h.hidden_id as hidden_uuid
|
||||||
from
|
from
|
||||||
ai_alarm aa
|
ai_alarm aa
|
||||||
left join key_project kp on kp.key_project_id = aa.key_project_id
|
left join (
|
||||||
|
select kp1.*
|
||||||
|
from key_project kp1
|
||||||
|
inner join (
|
||||||
|
select key_project_id, max(id) as id
|
||||||
|
from key_project
|
||||||
|
where delete_enum = 'FALSE'
|
||||||
|
group by key_project_id
|
||||||
|
) kp_latest on kp_latest.id = kp1.id
|
||||||
|
) kp on kp.key_project_id = aa.key_project_id
|
||||||
left join user xgfu on xgfu.id = kp.xgf_master_user_id
|
left join user xgfu on xgfu.id = kp.xgf_master_user_id
|
||||||
left join department xgfd on xgfd.id = xgfu.department_id
|
left join department xgfd on xgfd.id = xgfu.department_id
|
||||||
left join hidden h on h.foreign_key = aa.ai_alarm_id and h.delete_enum = 'FALSE'
|
left join hidden h on h.foreign_key = aa.ai_alarm_id and h.delete_enum = 'FALSE'
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
kp.jurisdiction_corpinfo_id,
|
kp.jurisdiction_corpinfo_id,
|
||||||
kp.apply_status,
|
kp.apply_status,
|
||||||
xqdwc.corp_name xqdw_corp_name,
|
xqdwc.corp_name xqdw_corp_name,
|
||||||
count(*) as camera_count
|
COUNT(DISTINCT kpc.key_project_camera_id) as camera_count
|
||||||
|
|
||||||
from
|
from
|
||||||
key_project_algorithm kpa
|
key_project_algorithm kpa
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,17 @@
|
||||||
MAX(type) AS max_type
|
MAX(type) AS max_type
|
||||||
FROM safety_environmental_inspection_user
|
FROM safety_environmental_inspection_user
|
||||||
WHERE delete_enum = 'FALSE'
|
WHERE delete_enum = 'FALSE'
|
||||||
|
<choose>
|
||||||
|
<when test="params.currentPendingTypeList != null and params.currentPendingTypeList.size() > 0">
|
||||||
|
AND type IN
|
||||||
|
<foreach item="type" collection="params.currentPendingTypeList" separator="," open="(" close=")">
|
||||||
|
#{type}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
AND type IN (2, 5)
|
AND type IN (2, 5)
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
GROUP BY inspection_id
|
GROUP BY inspection_id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -40,10 +50,16 @@
|
||||||
AND iu.delete_enum = 'FALSE'
|
AND iu.delete_enum = 'FALSE'
|
||||||
AND iu.type = mt.max_type
|
AND iu.type = mt.max_type
|
||||||
AND iu.STATUS = 0
|
AND iu.STATUS = 0
|
||||||
|
<if test="params.currentPendingUserId != null">
|
||||||
|
AND iu.user_id = #{params.currentPendingUserId}
|
||||||
|
</if>
|
||||||
left join user showu on showu.id = iu_show.user_id
|
left join user showu on showu.id = iu_show.user_id
|
||||||
left join corp_info indc on indc.id = i.inspected_corpinfo_id
|
left join corp_info indc on indc.id = i.inspected_corpinfo_id
|
||||||
left join user xmu on xmu.id = i.xgf_master_user_id
|
left join user xmu on xmu.id = i.xgf_master_user_id
|
||||||
where i.delete_enum = 'FALSE'
|
where i.delete_enum = 'FALSE'
|
||||||
|
<if test="params.onlyCurrentPendingUser != null and params.onlyCurrentPendingUser and params.currentPendingUserId != null">
|
||||||
|
and iu.user_id is not null
|
||||||
|
</if>
|
||||||
<if test="params.place != null and params.place != ''">
|
<if test="params.place != null and params.place != ''">
|
||||||
and i.place LIKE CONCAT('%', #{params.place}, '%')
|
and i.place LIKE CONCAT('%', #{params.place}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue