bug修改
This commit is contained in:
parent
5abc225caf
commit
8136a62e90
|
|
@ -563,7 +563,7 @@ public class SecurityCheckController extends BaseController {
|
|||
@SysLog(title = "隐患整改审批", businessType = OperaType.EXPORT, logType = 0, module = "隐患整改审批->导出隐患整改审批列表数据")
|
||||
public void exportHiddenDangerRectificationApprovalList(HttpServletResponse response, @RequestBody SecurityCheckDto dto) {
|
||||
try {
|
||||
List<HiddenDangerRectificationVo> list = service.getHiddenDangerRectificationApprovalList(dto);
|
||||
List<HiddenDangerRectificationVo> list = service.getHiddenDangerRectificationApprovalListByPage(dto);
|
||||
ExcelUtil<HiddenDangerRectificationVo> util = new ExcelUtil<>(HiddenDangerRectificationVo.class);
|
||||
util.exportExcel(response, list, "隐患整改审批列表导出");
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ public interface SecurityCheckService {
|
|||
* @return 隐患整改审批列表
|
||||
*/
|
||||
List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalList(SecurityCheckDto dto);
|
||||
List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalListByPage(SecurityCheckDto dto);
|
||||
|
||||
/**
|
||||
* 整改方隐患问题整改回传状态修改
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
* @return 隐患问题类别配置列表
|
||||
*/
|
||||
@Override
|
||||
public List<SecurityCheckVo> getHiddenDangerTypeList(SecurityCheckDto dto) {
|
||||
public List<SecurityCheckVo> getHiddenDangerTypeList(SecurityCheckDto dto) {
|
||||
return mapper.getHiddenDangerTypeList(dto);
|
||||
}
|
||||
|
||||
|
|
@ -114,11 +114,11 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
public AjaxResult deleteHiddenDangerTypeForm(String id) {
|
||||
try {
|
||||
int result = mapper.getIsThereARecord(id);
|
||||
if (result > 0){
|
||||
if (result > 0) {
|
||||
return AjaxResult.error("该类型已使用,不可删除!");
|
||||
}
|
||||
mapper.deleteHiddenDangerTypeForm(id);
|
||||
} catch (Exception e){
|
||||
mapper.deleteHiddenDangerTypeForm(id);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return AjaxResult.error("系统异常,请联系管理员");
|
||||
}
|
||||
|
|
@ -165,7 +165,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
String params = allRequestParams.get("params");
|
||||
SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class);
|
||||
result = mapper.whetherThereIsACheckRecord(dto);
|
||||
if (result > 0){
|
||||
if (result > 0) {
|
||||
return AjaxResult.error("该检查记录已存在,请勿重复添加");
|
||||
}
|
||||
//查询最新一条的检查记录编号
|
||||
|
|
@ -213,17 +213,16 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult updateSecurityCheckRecordForm(MultipartFile[] photoList, MultipartFile[] attachmentList, Map<String, String> allRequestParams) {
|
||||
int result = 0;
|
||||
try{
|
||||
try {
|
||||
String params = allRequestParams.get("params");
|
||||
SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class);
|
||||
result = mapper.whetherThereIsACheckRecord(dto);
|
||||
if (result > 0){
|
||||
if (result > 0) {
|
||||
return AjaxResult.error("该检查记录标题已存在,请勿重复添加");
|
||||
}
|
||||
mapper.updateSecurityCheckRecordForm(dto);
|
||||
Long[] fileIds = dto.getFileId();
|
||||
if (fileIds != null && fileIds.length > 0)
|
||||
{
|
||||
if (fileIds != null && fileIds.length > 0) {
|
||||
//删除附件
|
||||
mapper.deleteFiles(dto.getFileId());
|
||||
}
|
||||
|
|
@ -233,10 +232,10 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
if (attachmentList != null && attachmentList.length > 0) {
|
||||
processFiles(attachmentList, dto.getId(), "1", "2");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
return AjaxResult.error("图片或文件格式错误,请重新上传");
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
|
|
@ -247,7 +246,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
/**
|
||||
* 新增隐患
|
||||
*
|
||||
* @param checkPhotoList 现场照片
|
||||
* @param checkPhotoList 现场照片
|
||||
* @param allRequestParams 保存数据
|
||||
* @return 保存结果
|
||||
*/
|
||||
|
|
@ -356,6 +355,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
|
||||
/**
|
||||
* 延期申请撤回
|
||||
*
|
||||
* @param id 隐患整改id
|
||||
* @return 撤回结果
|
||||
*/
|
||||
|
|
@ -393,7 +393,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
|
||||
/**************************************************隐患问题整改********************************************/
|
||||
|
||||
/**
|
||||
/**
|
||||
* 获取隐患问题整改列表
|
||||
*
|
||||
* @param dto 查询条件
|
||||
|
|
@ -403,28 +403,28 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
public List<HiddenProblemsFixVo> getHiddenDangerRectificationList(SecurityCheckDto dto) {
|
||||
RequestEntity entity = new RequestEntity();
|
||||
//数据查询
|
||||
Map<String, String> checkMaps= Maps.newHashMap();
|
||||
if("1".equals(dto.getStatus())){
|
||||
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"));
|
||||
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)){
|
||||
if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) {
|
||||
dto.setDataType(1);
|
||||
dto.setProInsId(proInsId);
|
||||
}
|
||||
}
|
||||
}
|
||||
PageUtils.startPage();
|
||||
List<HiddenProblemsFixVo> list = mapper.getHiddenDangerRectificationList(dto);
|
||||
list.forEach(data->{
|
||||
List<HiddenProblemsFixVo> list = mapper.getHiddenDangerRectificationList(dto);
|
||||
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");
|
||||
}
|
||||
|
|
@ -469,8 +469,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
dto.setIsCheck("1");
|
||||
result = mapper.updateHiddenDangerRectification(dto);
|
||||
Long[] fileIds = dto.getFileId();
|
||||
if (fileIds != null && fileIds.length > 0)
|
||||
{
|
||||
if (fileIds != null && fileIds.length > 0) {
|
||||
//删除附件
|
||||
result = mapper.deleteFiles(dto.getFileId());
|
||||
}
|
||||
|
|
@ -516,28 +515,61 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
public List<HiddenDangerRectificationVo> getHiddenDangerRectificationApprovalList(SecurityCheckDto dto) {
|
||||
RequestEntity entity = new RequestEntity();
|
||||
//数据查询
|
||||
Map<String, String> checkMaps= Maps.newHashMap();
|
||||
if("1".equals(dto.getStatus())){
|
||||
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"));
|
||||
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)){
|
||||
if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) {
|
||||
dto.setDataType(1);
|
||||
dto.setProInsId(proInsId);
|
||||
}
|
||||
}
|
||||
}
|
||||
PageUtils.startPage();
|
||||
List<HiddenDangerRectificationVo> list = mapper.getHiddenDangerRectificationApprovalList(dto);
|
||||
list.forEach(data->{
|
||||
List<HiddenDangerRectificationVo> list = mapper.getHiddenDangerRectificationApprovalList(dto);
|
||||
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())) {
|
||||
data.setIntoStatus("1");
|
||||
}
|
||||
|
|
@ -561,6 +593,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
// }
|
||||
// return list;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 整改方隐患问题整改回传状态修改
|
||||
*
|
||||
|
|
@ -633,7 +666,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
dto.setCheckStatus(checkStatus);
|
||||
mapper.updateHiddenDangerStatus(dto);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
|
|
@ -642,10 +675,11 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
|
||||
/**
|
||||
* 根据当前日期、整改时间和延期时间计算检查状态
|
||||
* @param date 当前日期
|
||||
* @param correctionTime 整改时间
|
||||
* @param delayTime 延期时间
|
||||
* @param isCheck 是否整改
|
||||
*
|
||||
* @param date 当前日期
|
||||
* @param correctionTime 整改时间
|
||||
* @param delayTime 延期时间
|
||||
* @param isCheck 是否整改
|
||||
* @param delayCheckState 延期检查状态
|
||||
* @return 返回一个计算出来的checkStatus字符串
|
||||
*/
|
||||
|
|
@ -692,7 +726,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
return AjaxResult.error("延期时间不能早于期限整改时间");
|
||||
}
|
||||
result = mapper.updateApplicationForExtension(dto);
|
||||
if (result > 0){
|
||||
if (result > 0) {
|
||||
mapper.updateReasonForDelay(dto);
|
||||
}
|
||||
|
||||
|
|
@ -716,28 +750,28 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
public List<PitfallDelayApprovalVo> getReviewOfDeferredApprovalList(SecurityCheckDto dto) {
|
||||
RequestEntity entity = new RequestEntity();
|
||||
//数据查询
|
||||
Map<String, String> checkMaps= Maps.newHashMap();
|
||||
if("1".equals(dto.getStatus()) ){
|
||||
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"));
|
||||
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)){
|
||||
if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) {
|
||||
dto.setDataType(1);
|
||||
dto.setProInsId(proInsId);
|
||||
}
|
||||
}
|
||||
}
|
||||
PageUtils.startPage();
|
||||
List<PitfallDelayApprovalVo> list = mapper.getReviewOfDeferredApprovalList(dto);
|
||||
list.forEach(data->{
|
||||
List<PitfallDelayApprovalVo> list = mapper.getReviewOfDeferredApprovalList(dto);
|
||||
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");
|
||||
}
|
||||
|
|
@ -779,7 +813,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
@Override
|
||||
public void updateHiddenDangerStatus() {
|
||||
List<NewHiddenDangerDto> list = mapper.getHiddenDangersFormList();
|
||||
if (list != null){
|
||||
if (list != null) {
|
||||
for (NewHiddenDangerDto item : list) {
|
||||
//获取当前日期
|
||||
Date currentDate = new Date();
|
||||
|
|
@ -789,9 +823,9 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
String correctionTime = item.getCorrectionTime();
|
||||
//获取延期时间
|
||||
String delayTime = item.getDelayTime();
|
||||
if ("1".equals(item.getIsProcess())){
|
||||
if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())){
|
||||
if (date.compareTo(delayTime) <= 0 && "3".equals(item.getCheckState())){
|
||||
if ("1".equals(item.getIsProcess())) {
|
||||
if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())) {
|
||||
if (date.compareTo(delayTime) <= 0 && "3".equals(item.getCheckState())) {
|
||||
item.setCheckStatus("4");
|
||||
} else if (date.compareTo(delayTime) > 0 && "3".equals(item.getCheckState())) {
|
||||
item.setCheckStatus("8");
|
||||
|
|
@ -803,7 +837,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
} else {
|
||||
if (date.compareTo(correctionTime) <= 0 && "3".equals(item.getCheckState())) {
|
||||
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");
|
||||
} else if (date.compareTo(correctionTime) <= 0 && !"3".equals(item.getCheckState())) {
|
||||
item.setCheckStatus("5");
|
||||
|
|
@ -811,7 +845,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
item.setCheckStatus("1");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())) {
|
||||
//判断延期时间是否大于当前时间
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -850,9 +884,10 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
|
||||
/**
|
||||
* 上传文件到文件服务器
|
||||
* @param files 文件
|
||||
* @param id id
|
||||
* @param bigType 大类 3 违章
|
||||
*
|
||||
* @param files 文件
|
||||
* @param id id
|
||||
* @param bigType 大类 3 违章
|
||||
* @param fileType 文件类型 8、违章照片 9、违章改进照片 10、罚款凭证
|
||||
* @return 是否成功
|
||||
*/
|
||||
|
|
@ -878,13 +913,14 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
|
||||
/**
|
||||
* 保存文件信息
|
||||
*
|
||||
* @param filePath 文件路径
|
||||
* @param id id
|
||||
* @param id id
|
||||
* @param fileSize 文件大小
|
||||
* @param bigType 大类
|
||||
* @param bigType 大类
|
||||
* @param fileType 文件类型
|
||||
* @param fileName 文件名称
|
||||
* @param suffix 文件后缀
|
||||
* @param suffix 文件后缀
|
||||
* @return 是否成功
|
||||
*/
|
||||
private int fileSaving(@NotNull String filePath, String id, long fileSize, String bigType, String fileType, String fileName, String suffix) {
|
||||
|
|
@ -907,7 +943,4 @@ public class SecurityCheckServiceImpl implements SecurityCheckService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
pci.cont_name like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</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}
|
||||
</if>
|
||||
<if test='dataType==1'>
|
||||
|
|
|
|||
Loading…
Reference in New Issue