bug修改

This commit is contained in:
liang.chao 2025-06-06 16:15:18 +08:00
parent 5abc225caf
commit 8136a62e90
4 changed files with 112 additions and 78 deletions

View File

@ -563,7 +563,7 @@ public class SecurityCheckController extends BaseController {
@SysLog(title = "隐患整改审批", businessType = OperaType.EXPORT, logType = 0, module = "隐患整改审批->导出隐患整改审批列表数据") @SysLog(title = "隐患整改审批", businessType = OperaType.EXPORT, logType = 0, module = "隐患整改审批->导出隐患整改审批列表数据")
public void exportHiddenDangerRectificationApprovalList(HttpServletResponse response, @RequestBody SecurityCheckDto dto) { public void exportHiddenDangerRectificationApprovalList(HttpServletResponse response, @RequestBody SecurityCheckDto dto) {
try { try {
List<HiddenDangerRectificationVo> list = service.getHiddenDangerRectificationApprovalList(dto); List<HiddenDangerRectificationVo> list = service.getHiddenDangerRectificationApprovalListByPage(dto);
ExcelUtil<HiddenDangerRectificationVo> util = new ExcelUtil<>(HiddenDangerRectificationVo.class); ExcelUtil<HiddenDangerRectificationVo> util = new ExcelUtil<>(HiddenDangerRectificationVo.class);
util.exportExcel(response, list, "隐患整改审批列表导出"); util.exportExcel(response, list, "隐患整改审批列表导出");
} catch (Exception e) { } catch (Exception e) {

View File

@ -134,6 +134,7 @@ public interface SecurityCheckService {
* @return 隐患整改审批列表 * @return 隐患整改审批列表
*/ */
List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalList(SecurityCheckDto dto); List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalList(SecurityCheckDto dto);
List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalListByPage(SecurityCheckDto dto);
/** /**
* 整改方隐患问题整改回传状态修改 * 整改方隐患问题整改回传状态修改

View File

@ -114,11 +114,11 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
public AjaxResult deleteHiddenDangerTypeForm(String id) { public AjaxResult deleteHiddenDangerTypeForm(String id) {
try { try {
int result = mapper.getIsThereARecord(id); int result = mapper.getIsThereARecord(id);
if (result > 0){ if (result > 0) {
return AjaxResult.error("该类型已使用,不可删除!"); return AjaxResult.error("该类型已使用,不可删除!");
} }
mapper.deleteHiddenDangerTypeForm(id); mapper.deleteHiddenDangerTypeForm(id);
} catch (Exception e){ } catch (Exception e) {
log.error(e.toString(), e); log.error(e.toString(), e);
return AjaxResult.error("系统异常,请联系管理员"); return AjaxResult.error("系统异常,请联系管理员");
} }
@ -165,7 +165,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
String params = allRequestParams.get("params"); String params = allRequestParams.get("params");
SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class); SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class);
result = mapper.whetherThereIsACheckRecord(dto); result = mapper.whetherThereIsACheckRecord(dto);
if (result > 0){ if (result > 0) {
return AjaxResult.error("该检查记录已存在,请勿重复添加"); return AjaxResult.error("该检查记录已存在,请勿重复添加");
} }
//查询最新一条的检查记录编号 //查询最新一条的检查记录编号
@ -213,17 +213,16 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult updateSecurityCheckRecordForm(MultipartFile[] photoList, MultipartFile[] attachmentList, Map<String, String> allRequestParams) { public AjaxResult updateSecurityCheckRecordForm(MultipartFile[] photoList, MultipartFile[] attachmentList, Map<String, String> allRequestParams) {
int result = 0; int result = 0;
try{ try {
String params = allRequestParams.get("params"); String params = allRequestParams.get("params");
SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class); SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class);
result = mapper.whetherThereIsACheckRecord(dto); result = mapper.whetherThereIsACheckRecord(dto);
if (result > 0){ if (result > 0) {
return AjaxResult.error("该检查记录标题已存在,请勿重复添加"); return AjaxResult.error("该检查记录标题已存在,请勿重复添加");
} }
mapper.updateSecurityCheckRecordForm(dto); mapper.updateSecurityCheckRecordForm(dto);
Long[] fileIds = dto.getFileId(); Long[] fileIds = dto.getFileId();
if (fileIds != null && fileIds.length > 0) if (fileIds != null && fileIds.length > 0) {
{
//删除附件 //删除附件
mapper.deleteFiles(dto.getFileId()); mapper.deleteFiles(dto.getFileId());
} }
@ -233,10 +232,10 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
if (attachmentList != null && attachmentList.length > 0) { if (attachmentList != null && attachmentList.length > 0) {
processFiles(attachmentList, dto.getId(), "1", "2"); processFiles(attachmentList, dto.getId(), "1", "2");
} }
}catch (Exception e) { } catch (Exception e) {
log.error(e.toString(), e); log.error(e.toString(), e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return AjaxResult.error(); return AjaxResult.error("图片或文件格式错误,请重新上传");
} }
return AjaxResult.success(); return AjaxResult.success();
@ -356,6 +355,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
/** /**
* 延期申请撤回 * 延期申请撤回
*
* @param id 隐患整改id * @param id 隐患整改id
* @return 撤回结果 * @return 撤回结果
*/ */
@ -403,18 +403,18 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
public List<HiddenProblemsFixVo> getHiddenDangerRectificationList(SecurityCheckDto dto) { public List<HiddenProblemsFixVo> getHiddenDangerRectificationList(SecurityCheckDto dto) {
RequestEntity entity = new RequestEntity(); RequestEntity entity = new RequestEntity();
//数据查询 //数据查询
Map<String, String> checkMaps= Maps.newHashMap(); Map<String, String> checkMaps = Maps.newHashMap();
if("1".equals(dto.getStatus())){ if ("1".equals(dto.getStatus())) {
entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid())); entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
AjaxResult ajaxResult = flowTaskService.getStayFlow(entity); AjaxResult ajaxResult = flowTaskService.getStayFlow(entity);
if (ajaxResult.isSuccess()) { if (ajaxResult.isSuccess()) {
List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data"); List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data");
List<String> proInsId=new ArrayList<>(); List<String> proInsId = new ArrayList<>();
data.forEach(map->{ data.forEach(map -> {
proInsId.add((String)map.get("proInsId")); proInsId.add((String) map.get("proInsId"));
checkMaps.put((String)map.get("proInsId"),(String) map.get("finalCheck")); checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck"));
}); });
if(com.bonus.common.core.utils.StringUtils.isNotEmpty(data)){ if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) {
dto.setDataType(1); dto.setDataType(1);
dto.setProInsId(proInsId); dto.setProInsId(proInsId);
} }
@ -422,9 +422,9 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
} }
PageUtils.startPage(); PageUtils.startPage();
List<HiddenProblemsFixVo> list = mapper.getHiddenDangerRectificationList(dto); List<HiddenProblemsFixVo> list = mapper.getHiddenDangerRectificationList(dto);
list.forEach(data->{ list.forEach(data -> {
if("1".equals(data.getStatus()) && dto.getDataType()==1){ if ("1".equals(data.getStatus()) && dto.getDataType() == 1) {
if ("2".equals(data.getIntoStatus())) { if ("2".equals(data.getIntoStatus())) {
data.setIntoStatus("1"); data.setIntoStatus("1");
} }
@ -469,8 +469,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
dto.setIsCheck("1"); dto.setIsCheck("1");
result = mapper.updateHiddenDangerRectification(dto); result = mapper.updateHiddenDangerRectification(dto);
Long[] fileIds = dto.getFileId(); Long[] fileIds = dto.getFileId();
if (fileIds != null && fileIds.length > 0) if (fileIds != null && fileIds.length > 0) {
{
//删除附件 //删除附件
result = mapper.deleteFiles(dto.getFileId()); result = mapper.deleteFiles(dto.getFileId());
} }
@ -516,18 +515,18 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
public List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalList(SecurityCheckDto dto) { public List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalList(SecurityCheckDto dto) {
RequestEntity entity = new RequestEntity(); RequestEntity entity = new RequestEntity();
//数据查询 //数据查询
Map<String, String> checkMaps= Maps.newHashMap(); Map<String, String> checkMaps = Maps.newHashMap();
if("1".equals(dto.getStatus())){ if ("1".equals(dto.getStatus())) {
entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid())); entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
AjaxResult ajaxResult = flowTaskService.getStayFlow(entity); AjaxResult ajaxResult = flowTaskService.getStayFlow(entity);
if (ajaxResult.isSuccess()) { if (ajaxResult.isSuccess()) {
List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data"); List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data");
List<String> proInsId=new ArrayList<>(); List<String> proInsId = new ArrayList<>();
data.forEach(map->{ data.forEach(map -> {
proInsId.add((String)map.get("proInsId")); proInsId.add((String) map.get("proInsId"));
checkMaps.put((String)map.get("proInsId"),(String) map.get("finalCheck")); checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck"));
}); });
if(com.bonus.common.core.utils.StringUtils.isNotEmpty(data)){ if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) {
dto.setDataType(1); dto.setDataType(1);
dto.setProInsId(proInsId); dto.setProInsId(proInsId);
} }
@ -535,9 +534,42 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
} }
PageUtils.startPage(); PageUtils.startPage();
List<HiddenDangerRectificationVo> list = mapper.getHiddenDangerRectificationApprovalList(dto); List<HiddenDangerRectificationVo> list = mapper.getHiddenDangerRectificationApprovalList(dto);
list.forEach(data->{ list.forEach(data -> {
if("1".equals(data.getStatus()) && dto.getDataType()==1){ if ("1".equals(data.getStatus()) && dto.getDataType() == 1) {
if ("2".equals(data.getIntoStatus())) {
data.setIntoStatus("1");
}
data.setFinalCheck(checkMaps.get(data.getProcInsId()));
}
});
return list;
}
@Override
public List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalListByPage(SecurityCheckDto dto) {
RequestEntity entity = new RequestEntity();
//数据查询
Map<String, String> checkMaps = Maps.newHashMap();
if ("1".equals(dto.getStatus())) {
entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
AjaxResult ajaxResult = flowTaskService.getStayFlow(entity);
if (ajaxResult.isSuccess()) {
List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data");
List<String> proInsId = new ArrayList<>();
data.forEach(map -> {
proInsId.add((String) map.get("proInsId"));
checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck"));
});
if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) {
dto.setDataType(1);
dto.setProInsId(proInsId);
}
}
}
List<HiddenDangerRectificationVo> list = mapper.getHiddenDangerRectificationApprovalList(dto);
list.forEach(data -> {
if ("1".equals(data.getStatus()) && dto.getDataType() == 1) {
if ("2".equals(data.getIntoStatus())) { if ("2".equals(data.getIntoStatus())) {
data.setIntoStatus("1"); data.setIntoStatus("1");
} }
@ -561,6 +593,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
// } // }
// return list; // return list;
// } // }
/** /**
* 整改方隐患问题整改回传状态修改 * 整改方隐患问题整改回传状态修改
* *
@ -633,7 +666,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
dto.setCheckStatus(checkStatus); dto.setCheckStatus(checkStatus);
mapper.updateHiddenDangerStatus(dto); mapper.updateHiddenDangerStatus(dto);
} }
}catch (Exception e){ } catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error(e.toString(), e); log.error(e.toString(), e);
} }
@ -642,6 +675,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
/** /**
* 根据当前日期整改时间和延期时间计算检查状态 * 根据当前日期整改时间和延期时间计算检查状态
*
* @param date 当前日期 * @param date 当前日期
* @param correctionTime 整改时间 * @param correctionTime 整改时间
* @param delayTime 延期时间 * @param delayTime 延期时间
@ -692,7 +726,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
return AjaxResult.error("延期时间不能早于期限整改时间"); return AjaxResult.error("延期时间不能早于期限整改时间");
} }
result = mapper.updateApplicationForExtension(dto); result = mapper.updateApplicationForExtension(dto);
if (result > 0){ if (result > 0) {
mapper.updateReasonForDelay(dto); mapper.updateReasonForDelay(dto);
} }
@ -716,18 +750,18 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
public List<PitfallDelayApprovalVo> getReviewOfDeferredApprovalList(SecurityCheckDto dto) { public List<PitfallDelayApprovalVo> getReviewOfDeferredApprovalList(SecurityCheckDto dto) {
RequestEntity entity = new RequestEntity(); RequestEntity entity = new RequestEntity();
//数据查询 //数据查询
Map<String, String> checkMaps= Maps.newHashMap(); Map<String, String> checkMaps = Maps.newHashMap();
if("1".equals(dto.getStatus()) ){ if ("1".equals(dto.getStatus())) {
entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid())); entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
AjaxResult ajaxResult = flowTaskService.getStayFlow(entity); AjaxResult ajaxResult = flowTaskService.getStayFlow(entity);
if (ajaxResult.isSuccess()) { if (ajaxResult.isSuccess()) {
List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data"); List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data");
List<String> proInsId=new ArrayList<>(); List<String> proInsId = new ArrayList<>();
data.forEach(map->{ data.forEach(map -> {
proInsId.add((String)map.get("proInsId")); proInsId.add((String) map.get("proInsId"));
checkMaps.put((String)map.get("proInsId"),(String) map.get("finalCheck")); checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck"));
}); });
if(com.bonus.common.core.utils.StringUtils.isNotEmpty(data)){ if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) {
dto.setDataType(1); dto.setDataType(1);
dto.setProInsId(proInsId); dto.setProInsId(proInsId);
} }
@ -735,9 +769,9 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
} }
PageUtils.startPage(); PageUtils.startPage();
List<PitfallDelayApprovalVo> list = mapper.getReviewOfDeferredApprovalList(dto); List<PitfallDelayApprovalVo> list = mapper.getReviewOfDeferredApprovalList(dto);
list.forEach(data->{ list.forEach(data -> {
if("1".equals(data.getStatus()) && dto.getDataType()==1){ if ("1".equals(data.getStatus()) && dto.getDataType() == 1) {
if ("2".equals(data.getIntoStatus())) { if ("2".equals(data.getIntoStatus())) {
data.setIntoStatus("1"); data.setIntoStatus("1");
} }
@ -779,7 +813,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
@Override @Override
public void updateHiddenDangerStatus() { public void updateHiddenDangerStatus() {
List<NewHiddenDangerDto> list = mapper.getHiddenDangersFormList(); List<NewHiddenDangerDto> list = mapper.getHiddenDangersFormList();
if (list != null){ if (list != null) {
for (NewHiddenDangerDto item : list) { for (NewHiddenDangerDto item : list) {
//获取当前日期 //获取当前日期
Date currentDate = new Date(); Date currentDate = new Date();
@ -789,9 +823,9 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
String correctionTime = item.getCorrectionTime(); String correctionTime = item.getCorrectionTime();
//获取延期时间 //获取延期时间
String delayTime = item.getDelayTime(); String delayTime = item.getDelayTime();
if ("1".equals(item.getIsProcess())){ if ("1".equals(item.getIsProcess())) {
if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())){ if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())) {
if (date.compareTo(delayTime) <= 0 && "3".equals(item.getCheckState())){ if (date.compareTo(delayTime) <= 0 && "3".equals(item.getCheckState())) {
item.setCheckStatus("4"); item.setCheckStatus("4");
} else if (date.compareTo(delayTime) > 0 && "3".equals(item.getCheckState())) { } else if (date.compareTo(delayTime) > 0 && "3".equals(item.getCheckState())) {
item.setCheckStatus("8"); item.setCheckStatus("8");
@ -803,7 +837,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
} else { } else {
if (date.compareTo(correctionTime) <= 0 && "3".equals(item.getCheckState())) { if (date.compareTo(correctionTime) <= 0 && "3".equals(item.getCheckState())) {
item.setCheckStatus("2"); item.setCheckStatus("2");
} else if (date.compareTo(correctionTime) > 0 &&"3".equals(item.getCheckState())) { } else if (date.compareTo(correctionTime) > 0 && "3".equals(item.getCheckState())) {
item.setCheckStatus("6"); item.setCheckStatus("6");
} else if (date.compareTo(correctionTime) <= 0 && !"3".equals(item.getCheckState())) { } else if (date.compareTo(correctionTime) <= 0 && !"3".equals(item.getCheckState())) {
item.setCheckStatus("5"); item.setCheckStatus("5");
@ -811,7 +845,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
item.setCheckStatus("1"); item.setCheckStatus("1");
} }
} }
}else { } else {
if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())) { if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())) {
//判断延期时间是否大于当前时间 //判断延期时间是否大于当前时间
if (date.compareTo(delayTime) < 0 && "2".equals(item.getIsCheck())) { if (date.compareTo(delayTime) < 0 && "2".equals(item.getIsCheck())) {
@ -837,7 +871,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
} }
} }
if (item.getCheckStatus() != null && !item.getCheckStatus().isEmpty()){ if (item.getCheckStatus() != null && !item.getCheckStatus().isEmpty()) {
mapper.updateHiddenDangerStatus(item); mapper.updateHiddenDangerStatus(item);
} }
} }
@ -850,6 +884,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
/** /**
* 上传文件到文件服务器 * 上传文件到文件服务器
*
* @param files 文件 * @param files 文件
* @param id id * @param id id
* @param bigType 大类 3 违章 * @param bigType 大类 3 违章
@ -878,6 +913,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
/** /**
* 保存文件信息 * 保存文件信息
*
* @param filePath 文件路径 * @param filePath 文件路径
* @param id id * @param id id
* @param fileSize 文件大小 * @param fileSize 文件大小
@ -907,7 +943,4 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
} }
} }

View File

@ -68,7 +68,7 @@
pci.cont_name like concat('%',#{keyWord},'%') pci.cont_name like concat('%',#{keyWord},'%')
) )
</if> </if>
<if test="status != null and status != '' and status != 1 and status != '1' and status != '2' and status != 2 "> <if test="status != null and status != ''">
and lpc.into_status = #{status} and lpc.into_status = #{status}
</if> </if>
<if test='dataType==1'> <if test='dataType==1'>