bug修复

This commit is contained in:
guoshengxiong 2025-08-27 17:47:11 +08:00
parent c9747cfbef
commit afdea2e5bb
27 changed files with 226 additions and 83 deletions

View File

@ -14,7 +14,7 @@ import com.alibaba.fastjson.JSONObject;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.xmgl.call.api.OcrManufacturer;
import com.zhgd.xmgl.modules.ocr.entity.OcrConfig;
import com.zhgd.xmgl.util.Fileutils;
import com.zhgd.xmgl.util.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
@ -63,8 +63,8 @@ public class SmartJavaAIOcrCall implements OcrManufacturer {
recModelConfig.setRecModelEnum(CommonRecModelEnum.PP_OCR_V5_MOBILE_REC_MODEL);
//指定识别模型位置需要更改为自己的模型路径下载地址请查看文档
// recModelConfig.setRecModelPath("/Users/xxx/Documents/develop/model/ocr/PP-OCRv5_mobile_rec_infer/PP-OCRv5_mobile_rec_infer.onnx");
Fileutils.getExportTemplateFile("/models/ocr/dict.txt");
recModelConfig.setRecModelPath(Fileutils.getExportTemplateFile("/models/ocr/PP-OCRv5_mobile_rec_infer.onnx").getAbsolutePath());
FileUtils.getExportTemplateFile("/models/ocr/dict.txt");
recModelConfig.setRecModelPath(FileUtils.getExportTemplateFile("/models/ocr/PP-OCRv5_mobile_rec_infer.onnx").getAbsolutePath());
recModelConfig.setDevice(device);
recModelConfig.setTextDetModel(getDetectionModel());
return OcrModelFactory.getInstance().getRecModel(recModelConfig);
@ -81,7 +81,7 @@ public class SmartJavaAIOcrCall implements OcrManufacturer {
config.setModelEnum(CommonDetModelEnum.PP_OCR_V5_MOBILE_DET_MODEL);
//指定模型位置需要更改为自己的模型路径下载地址请查看文档
// config.setDetModelPath("/Users/xxx/Documents/develop/model/ocr/PP-OCRv5_mobile_det_infer/PP-OCRv5_mobile_det_infer.onnx");
config.setDetModelPath(Fileutils.getExportTemplateFile("/models/ocr/PP-OCRv5_mobile_det_infer.onnx").getAbsolutePath());
config.setDetModelPath(FileUtils.getExportTemplateFile("/models/ocr/PP-OCRv5_mobile_det_infer.onnx").getAbsolutePath());
config.setDevice(device);
return OcrModelFactory.getInstance().getDetModel(config);
}

View File

@ -163,7 +163,7 @@ public class ApiController {
public Result<List<String>> getFileList(@RequestBody Map<String, Object> map) {
Result<List<String>> result = new Result<List<String>>();
try {
result.setResult(Fileutils.getFileNameList(path, MapUtils.getString(map, "startTime"), MapUtils.getString(map, "endTime")));
result.setResult(FileUtils.getFileNameList(path, MapUtils.getString(map, "startTime"), MapUtils.getString(map, "endTime")));
result.setSuccess(true);
} catch (Exception e) {
log.error("error", e);

View File

@ -173,6 +173,8 @@ public class SystemUserController {
@ApiImplicitParam(name = "roleName", required = false, value = "角色名称", paramType = "body"),
@ApiImplicitParam(name = "isSupervisingRoleName", required = false, value = "1监理角色名称的人", paramType = "body"),
@ApiImplicitParam(name = "safeQualityRegionIdForDuty", required = false, value = "安全区域id多个分割查责任人", paramType = "body"),
@ApiImplicitParam(name = "teamIdList", required = false, value = "班组idList", paramType = "body"),
@ApiImplicitParam(name = "departmentIdList", required = false, value = "部门idList", paramType = "body"),
})
@PostMapping(value = "/getProjectChilderSystemUserList")
public Result<List<SystemUser>> getProjectChilderSystemUserList(@RequestBody Map<String, Object> map) {

View File

@ -66,6 +66,24 @@
<where>
and t.sn = #{param.projectSn}
and t.account_type = 6
<if test="(param.departmentIdList != null and param.departmentIdList != '' and param.departmentIdList.size() != 0) or
(param.teamIdList != null and param.teamIdList != '' and param.teamIdList.size() != 0)">
and (1=0
<if test="param.departmentIdList != null and param.departmentIdList != '' and param.departmentIdList.size() != 0">
or c1.id in
<foreach collection="param.departmentIdList" index="index" item="item" open="(" separator=","
close=")">
#{item}
</foreach>
</if>
<if test="param.teamIdList != null and param.teamIdList != '' and param.teamIdList.size() != 0">
or b1.id in
<foreach collection="param.teamIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
</if>
<if test="param.departmentTeamName != null and param.departmentTeamName != ''">
and (b1.team_name like CONCAT(CONCAT('%', #{param.departmentTeamName}), '%') or c1.department_name like
CONCAT(CONCAT('%', #{param.departmentTeamName}), '%'))

View File

@ -237,7 +237,7 @@ public class OcrBuildLogController {
map.put("updateTime", logVo.getUpdateTime());
map.put("projectSn", logVo.getProjectSn());
map.put("uploaderId", logVo.getUploaderId());
String url = Fileutils.getExportTemplateFile("word/ocr施工日志导出模版.docx").getAbsolutePath();
String url = FileUtils.getExportTemplateFile("word/ocr施工日志导出模版.docx").getAbsolutePath();
File wordFile = new File(wordDir, logVo.getConstructionAreaNames() + DateUtil.formatDate(logVo.getDate()) + ".docx");
EasyPoiUtil.exportNewLineWord(map, url, wordFile);
EasyPoiUtil.wordToPdfExport(wordFile, new File(dir, logVo.getConstructionAreaNames() + DateUtil.formatDate(logVo.getDate()) + ".pdf").getAbsolutePath());

View File

@ -23,7 +23,7 @@ import com.zhgd.xmgl.modules.risk.service.IRiskListDetailService;
import com.zhgd.xmgl.modules.risk.service.IRiskListLibraryService;
import com.zhgd.xmgl.modules.risk.service.IRiskListPotentialAccidentTypeService;
import com.zhgd.xmgl.util.ExcelUtils;
import com.zhgd.xmgl.util.Fileutils;
import com.zhgd.xmgl.util.FileUtils;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -365,7 +365,7 @@ public class RiskListDetailController {
Map<Integer, Map<String, Object>> root = new HashMap<>(4);
root.put(0, firstSheetMap);
putOtherSheets(sn, root);
templateUrl = Fileutils.getExportTemplateFile("excel/风险清单详情导出模板.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/风险清单详情导出模板.xlsx").getAbsolutePath();
// templateUrl = new File("C:\\Users\\Administrator\\IdeaProjects\\wisdomisite-with-flowjar\\tmp\\风险清单详情导出模板.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl, root.keySet().toArray(new Integer[]{}));
Workbook workbook = ExcelExportUtil.exportExcel(root, params);

View File

@ -447,7 +447,7 @@ public class RiskListLibraryController {
Map<Integer, Map<String, Object>> root = new HashMap<>(4);
root.put(0, firstSheetMap);
putOtherSheets(sn, root);
templateUrl = Fileutils.getExportTemplateFile("excel/风险清单库导出模板.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/风险清单库导出模板.xlsx").getAbsolutePath();
// templateUrl = new File("C:\\Users\\Administrator\\IdeaProjects\\wisdomisite-with-flowjar\\tmp\\风险清单库导出模板.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl, root.keySet().toArray(new Integer[]{}));
Workbook workbook = ExcelExportUtil.exportExcel(root, params);

View File

@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.risk.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
@ -30,7 +31,7 @@ import com.zhgd.xmgl.modules.risk.service.IRiskListSourceService;
import com.zhgd.xmgl.security.entity.UserInfo;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.ExcelUtils;
import com.zhgd.xmgl.util.Fileutils;
import com.zhgd.xmgl.util.FileUtils;
import com.zhgd.xmgl.util.MapBuilder;
import com.zhgd.xmgl.util.RefUtil;
import io.swagger.annotations.Api;
@ -274,15 +275,23 @@ public class RiskListPointController {
@ApiOperation(value = "风险点清单导出excel记录", notes = "风险点清单导出excel记录", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "pointIds", value = "管控清单风险点ids多个,分割)", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pointIds", value = "管控清单风险点ids多个,分割)", paramType = "body", required = false, dataType = "Integer"),
})
@PostMapping(value = "/exportRiskPointXls")
public void exportRiskPointXls(HttpServletResponse response, @RequestBody HashMap<String, Object> param) {
String templateUrl = null;
try {
Map<String, Object> map = new HashMap<>();
List<RiskListPoint> points = riskListPointService.list(new LambdaQueryWrapper<RiskListPoint>()
.in(RiskListPoint::getId, StrUtil.split(MapUtils.getString(param, "pointIds"), ",")));
List<RiskListPointVo> points;
String pointIds = MapUtils.getString(param, "pointIds");
if (StrUtil.isNotBlank(pointIds)) {
points = riskListPointService.list(new LambdaQueryWrapper<RiskListPoint>()
.in(RiskListPoint::getId, StrUtil.split(pointIds, ","))).stream().map(o -> BeanUtil.toBean(o, RiskListPointVo.class)).collect(Collectors.toList());
} else {
param.put("pageNo", 1);
param.put("pageSize", -1);
points = riskListPointService.queryPageList(param).getRecords();
}
List<Map<String, Object>> listMap = new ArrayList<>();
for (int i = 0; i < points.size(); i++) {
Map<String, Object> objectMap = new HashMap<>();
@ -294,7 +303,7 @@ public class RiskListPointController {
listMap.add(objectMap);
}
map.put("listMap", listMap);
templateUrl = Fileutils.getExportTemplateFile("excel/风险点清单导出模板.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/风险点清单导出模板.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
//设置下拉

View File

@ -528,7 +528,7 @@ public class RiskListSourceController {
} else {
tempFileName = "静态危险源辨识清单导出模板.xlsx";
}
templateUrl = Fileutils.getExportTemplateFile("excel/" + tempFileName).getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/" + tempFileName).getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
//合并列
@ -570,7 +570,7 @@ public class RiskListSourceController {
listMap.add(objectMap);
}
map.put("listMap", listMap);
templateUrl = Fileutils.getExportTemplateFile("excel/危险源清单导出模板.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/危险源清单导出模板.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
ExcelUtils.downLoadExcel("危险源清单导出模板.xlsx", response, workbook);
@ -649,7 +649,7 @@ public class RiskListSourceController {
listMap.add(objectMap);
}
map.put("listMap", listMap);
templateUrl = Fileutils.getExportTemplateFile("excel/隐患排查计划导出模板.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/隐患排查计划导出模板.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
//设置下拉

View File

@ -12,13 +12,14 @@ import java.util.List;
@Data
public class RiskListSourceUnbuiltAddDto extends RiskListSourceUnbuilt {
/**
* 区域和风险点List
* 区域和风险点List传这个或sourceIdList
*/
@ApiModelProperty("区域和风险点List传这个或sourceIdList")
private List<RegionPoint> regionPointList;
/**
* 危险源idList
* 危险源idList传这个或regionPointList
*/
@ApiModelProperty("危险源idList")
@ApiModelProperty("危险源idList传这个或regionPointList")
private List<String> sourceIdList;
@Data

View File

@ -4,6 +4,8 @@ import com.zhgd.xmgl.modules.risk.entity.RiskListPoint;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class RiskListPointVo extends RiskListPoint {
/**
@ -16,5 +18,10 @@ public class RiskListPointVo extends RiskListPoint {
*/
@ApiModelProperty(value = "我的待办的危险源数(未排查)")
private java.lang.Integer hazardSourceNumberTodo;
/**
* 我的待办的危险源idList未排查
*/
@ApiModelProperty(value = "我的待办的危险源idList未排查")
private List<Long> hazardSourceNumberTodoIdList;
}

View File

@ -27,10 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -115,26 +112,19 @@ public class RiskListPointServiceImpl extends ServiceImpl<RiskListPointMapper, R
.put("isMySourceToDo", MapUtils.getInteger(param, "isMySourceToDo"))
.put("isMySourceToDoForWorkable", MapUtils.getInteger(param, "isMySourceToDoForWorkable"))
.build());
//pointId到我的待办风险源数量
Map<Long, Integer> pointIdMap = sourceVos.stream().collect(Collectors.groupingBy(RiskListSource::getPointId)).entrySet().stream()
.map(m -> {
List<RiskListSourceVo> voList = m.getValue();
long count = voList.stream().filter(riskListSourceVo -> {
//pointId到我的待办风险源idList
Map<Long, List<RiskListSource>> pointIdMap = sourceVos.stream().filter(sourceVo -> {
List<Long> areaIdList;
if (Objects.equals(isMySourceToDo, 1)) {
areaIdList = riskListSourceVo.getUnCheckAreaIdList();
areaIdList = sourceVo.getUnCheckAreaIdList();
} else {
areaIdList = riskListSourceVo.getUnWorkableAreaIdList();
areaIdList = sourceVo.getUnWorkableAreaIdList();
}
return areaIdList.contains(regionIds);
}).count();
Map<String, String> rm = new HashMap<>();
rm.put("pid", String.valueOf(m.getKey()));
rm.put("num", String.valueOf(count));
return rm;
}).collect(Collectors.toMap(m -> MapUtils.getLong(m, "pid"), o -> MapUtils.getInteger(o, "num"), (o1, o2) -> o1));
}).collect(Collectors.groupingBy(RiskListSource::getPointId));
list = list.stream().filter(p -> pointIdMap.containsKey(p.getId())).peek(p -> {
p.setHazardSourceNumberTodo(pointIdMap.get(p.getId()));
p.setHazardSourceNumberTodo(Optional.ofNullable(pointIdMap.get(p.getId())).map(m -> m.size()).orElse(null));
p.setHazardSourceNumberTodoIdList(Optional.ofNullable(pointIdMap.get(p.getId())).map(m -> m.stream().map(RiskListSource::getId).collect(Collectors.toList())).orElse(null));
}).collect(Collectors.toList());
}
}

View File

@ -117,7 +117,7 @@ public class DepartmentInfoController {
@ApiOperation(value = "列表查询劳务人员部门信息", notes = "列表查询劳务人员部门信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseId", value = "企业ID", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "enterpriseId", value = "企业ID(多个,分割)", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "body", required = false, dataType = "String"),
})

View File

@ -116,7 +116,7 @@ public class TeamInfoController {
@ApiOperation(value = "列表查询劳务人员班组信息", notes = "列表查询劳务人员班组信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseId", value = "企业ID", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "enterpriseId", value = "企业ID(多个,分割)", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "isSpecial", value = "1是特殊工种0不是", paramType = "body", required = false, dataType = "String"),

View File

@ -601,7 +601,7 @@ public class WorkerAttendanceController {
listMap.add(objectMap);
}
map.put("listMap", listMap);
templateUrl = Fileutils.getExportTemplateFile("excel/人员考勤记录导出.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/人员考勤记录导出.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
ExcelUtils.exportPicture(workbook, 0, imageBytesList, 1, 8, 1);

View File

@ -36,7 +36,7 @@ import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.EasyPoiUtil;
import com.zhgd.xmgl.util.ExcelUtils;
import com.zhgd.xmgl.util.Fileutils;
import com.zhgd.xmgl.util.FileUtils;
import com.zhgd.xmgl.util.PathUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -410,7 +410,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
map.put("title", project.getProjectName() + "工时统计表(" + minDate + "~" + maxDate + "");
map.put("listMap", listMap);
map.put("date", "导出时间:" + DateUtil.format(new Date(), "yyyy年MM月dd日"));
templateUrl = Fileutils.getExportTemplateFile("excel/考勤工时统计表导出模板.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/考勤工时统计表导出模板.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl);
//开启横向遍历 开启横向遍历 开启横向遍历
params.setColForEach(true);
@ -473,7 +473,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
map.put("listMap", listMap);
map.put("date", "导出时间:" + DateUtil.format(new Date(), "yyyy年MM月dd日"));
templateUrl = Fileutils.getExportTemplateFile("excel/考勤异常工时统计表导出模板.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/考勤异常工时统计表导出模板.xlsx").getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl);
//开启横向遍历 开启横向遍历 开启横向遍历
params.setColForEach(true);
@ -748,7 +748,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
sheetMap.put("listMap", listMap);
root.put(j++, sheetMap);
}
templateUrl = Fileutils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
String outputTemplateFilePath = PathUtil.getBasePath() + "/temp/" + IdUtil.randomUUID() + ".xlsx";
EasyPoiUtil.cloneSheetMultipleTimes(templateUrl, outputTemplateFilePath, "1", dateTimes.size() - 1);
TemplateExportParams params = new TemplateExportParams(outputTemplateFilePath, true);
@ -931,7 +931,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
for (int i = 11 + dateTimes.size(); i < 11 + 31; i++) {
delColIndexes.add(i);
}
templateUrl = Fileutils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
if (CollUtil.isNotEmpty(delColIndexes)) {
ExcelUtils.removeColumns(templateUrl, 0, delColIndexes);
}
@ -1046,7 +1046,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
sheetMap2.put("enterpriseName", enterpriseName);
root.put(1, sheetMap2);
sheetNames.add(enterpriseName + "考勤报表");
templateUrl = Fileutils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl, true);
params.setColForEach(true);
params.setSheetName(sheetNames.toArray(new String[]{}));
@ -1100,7 +1100,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
sheetMap.put("totalAttendanceDay", vo.getTotalAttendanceDay());
sheetNames.add(vo.getWorkerName());
}
templateUrl = Fileutils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
String outputTemplateFilePath = PathUtil.getBasePath() + "/temp/" + IdUtil.randomUUID() + ".xlsx";
EasyPoiUtil.cloneSheetMultipleTimes(templateUrl, outputTemplateFilePath, "1", sheetNames.size() - 1);
TemplateExportParams params = new TemplateExportParams(outputTemplateFilePath, true);
@ -1175,7 +1175,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
sheetMap.put("projectName", project.getProjectName());
root.put(0, sheetMap);
sheetNames.add(project.getProjectName());
templateUrl = Fileutils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/workerDailyAttendanceStatisticsV2/" + tempSheetName).getAbsolutePath();
TemplateExportParams params = new TemplateExportParams(templateUrl, true);
params.setSheetName(sheetNames.toArray(new String[]{}));
Workbook workbook = ExcelExportUtil.exportExcel(root, params);

View File

@ -20,7 +20,7 @@
and a.charge_person_name like CONCAT('%',#{chargePersonName},'%')
</if>
<if test="enterpriseId != null and enterpriseId != ''">
and a.enterprise_id=#{enterpriseId}
and FIND_IN_SET(a.enterprise_id,#{enterpriseId})
</if>
<if test="userEnterpriseId != null and userEnterpriseId != ''">
and FIND_IN_SET(a.enterprise_id,#{userEnterpriseId})

View File

@ -11,7 +11,7 @@
join worker_type wt on wt.id=ti.worker_type_id
WHERE wi.project_sn=#{projectSn}
<if test="enterpriseId != null and enterpriseId != ''">
and wi.enterprise_id=#{enterpriseId}
and FIND_IN_SET(wi.enterprise_id,#{enterpriseId})
</if>
<if test="isSpecial != null and isSpecial != ''">
and wt.is_special = #{isSpecial}
@ -36,7 +36,7 @@
and wt.id = #{workerTypeId}
</if>
<if test="enterpriseId != null and enterpriseId != ''">
and a.enterprise_id=#{enterpriseId}
and FIND_IN_SET(a.enterprise_id,#{enterpriseId})
</if>
<if test="userEnterpriseId != null and userEnterpriseId != ''">
and FIND_IN_SET(a.enterprise_id,#{userEnterpriseId})

View File

@ -711,7 +711,7 @@ public class XzSecurityQualityInspectionRecordController {
listMap.add(objectMap);
}
map.put("listMap", listMap);
templateUrl = Fileutils.getExportTemplateFile("excel/潮州项目隐患统计汇总表.xlsx").getAbsolutePath();
templateUrl = FileUtils.getExportTemplateFile("excel/潮州项目隐患统计汇总表.xlsx").getAbsolutePath();
root.put(0, map);
TemplateExportParams params = new TemplateExportParams(templateUrl, true);
Workbook workbook = ExcelExportUtil.exportExcel(root, params);

View File

@ -53,7 +53,11 @@ public class XzSecurityQualityInspectionRecordDraftController {
@ApiOperation(value = " 分页列表查询安全管理草稿信息", notes = "分页列表查询安全管理草稿信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"),
@ApiImplicitParam(name = "reportWorkerIdList", value = "人员idList", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "reportDepartmentIdList", value = "部门idList", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "reportTeamIdList", value = "班组idList", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "reportEnterpriseIdList", value = "单位idList", paramType = "body", required = false, dataType = "Integer"),
})
@PostMapping(value = "/page")
public Result<IPage<XzSecurityQualityInspectionRecordDraftVo>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> param) {

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.xz.security.entity.dto;
import com.zhgd.xmgl.modules.risk.entity.dto.RiskListSourceUnbuiltAddDto;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -12,13 +13,14 @@ import java.util.List;
@Data
public class XzSecurityQualityInspectionRecordSourceAddDto extends XzSecurityQualityInspectionRecord {
/**
* 区域和风险点List
* 区域和风险点List传这个或sourceIdList
*/
@ApiModelProperty("区域和风险点List传这个或sourceIdList")
private List<RegionPoint> regionPointList;
/**
* 危险源idList
* 危险源idList传这个或regionPointList
*/
@ApiModelProperty("危险源idList")
@ApiModelProperty("危险源idList传这个或regionPointList")
private List<String> sourceIdList;
@Data

View File

@ -18,6 +18,37 @@
<if test="param.projectSn != null and param.projectSn != ''">
and t.project_sn = #{param.projectSn}
</if>
<if test="param.reportEnterpriseIdList != null and param.reportEnterpriseIdList.size() > 0">
and t.report_enterprise in
<foreach collection="param.reportEnterpriseIdList" index="index" item="item" open="(" separator=","
close=")">
#{item}
</foreach>
</if>
<if test="(param.reportDepartmentIdList != null and param.reportDepartmentIdList != '' and param.reportDepartmentIdList.size() != 0) or
(param.reportTeamIdList != null and param.reportTeamIdList != '' and param.reportTeamIdList.size() != 0)">
and (1=0
<if test="param.reportDepartmentIdList != null and param.reportDepartmentIdList != '' and param.reportDepartmentIdList.size() != 0">
or t.report_department_team_id in
<foreach collection="param.reportDepartmentIdList" index="index" item="item" open="(" separator=","
close=")">
#{item}
</foreach>
</if>
<if test="param.reportTeamIdList != null and param.reportTeamIdList != '' and param.reportTeamIdList.size() != 0">
or t.report_department_team_id in
<foreach collection="param.reportTeamIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
</if>
<if test="param.reportWorkerIdList != null and param.reportWorkerIdList != '' and param.reportWorkerIdList.size() != 0">
and g.user_id in
<foreach collection="param.reportWorkerIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by t.inspect_time desc
)t
${ew.customSqlSegment}

View File

@ -1112,7 +1112,7 @@
<select id="countSmallByDutyMajor" resultType="com.zhgd.xmgl.base.entity.vo.echarts.ChartItemBo">
select r.duty_major as x_type
,t2.id as y_type
,t2.danger_name as y_name
,count(*) as y_val
from xz_security_quality_inspection_record r
join xz_security_danger_type_record t on t.id=r.danger_type_id
@ -1126,7 +1126,7 @@
<if test="endDate != null and endDate != ''">
and r.create_time <![CDATA[<=]]> concat(#{endDate},' 23:59:59')
</if>
group by r.duty_major,t2.id
group by r.duty_major,t2.danger_name
</select>
<select id="countBigByDutyMajor" resultType="com.zhgd.xmgl.base.entity.vo.echarts.ChartItemBo">

View File

@ -164,11 +164,13 @@ public class XzSecurityDangerFieldServiceImpl extends ServiceImpl<XzSecurityDang
.eq(XzSecurityDangerField::getRecordType, dto.getRecordType())
.eq(XzSecurityDangerField::getCompanyProjectType, dto.getCompanyProjectType())
);
int i = 0;
for (XzSecurityDangerField field : dto.getFieldList()) {
field.setId(null);
field.setSn(dto.getSn());
field.setRecordType(dto.getRecordType());
field.setCompanyProjectType(dto.getCompanyProjectType());
field.setSort(++i);
this.save(field);
}
saveReviewVerify(dto.getSn(), dto.getCompanyProjectType());

View File

@ -1269,7 +1269,7 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
ChartItemBo::getXType,
item -> {
Map<String, Number> innerMap = new HashMap<>();
innerMap.put(item.getYType(), item.getYVal());
innerMap.put(item.getYName(), item.getYVal());
return innerMap;
},
(existingMap, newMap) -> {
@ -1282,10 +1282,16 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
List<SeriesItem> seriesItems = xzSecurityDangerTypeRecordService.list(new LambdaQueryWrapper<XzSecurityDangerTypeRecord>()
.eq(XzSecurityDangerTypeRecord::getLevel, 2)
.eq(XzSecurityDangerTypeRecord::getSn, headquartersSn)
).stream().map(o -> {
).stream().collect(Collectors.toMap(
XzSecurityDangerTypeRecord::getDangerName,
record -> record,
(existing, replacement) -> existing
))
.values()
.stream().map(o -> {
SeriesItem item = new SeriesItem();
item.setName(o.getDangerName());
List<Number> data = dictList.stream().map(d -> Optional.ofNullable(allMap.get(d.getData())).map(m -> m.get(o.getId() + "")).orElse(null)).collect(Collectors.toList());
List<Number> data = dictList.stream().map(d -> Optional.ofNullable(allMap.get(d.getData())).map(m -> m.get(o.getDangerName() + "")).orElse(null)).collect(Collectors.toList());
item.setData(data);
return item;
}).collect(Collectors.toList());

View File

@ -41,10 +41,10 @@ import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerReviewVerifySe
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityRectifyRecordService;
import com.zhgd.xmgl.push.config.PushPayloads;
import com.zhgd.xmgl.util.FileUtils;
import com.zhgd.xmgl.util.TimeUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
@ -158,6 +158,12 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl<XzSec
XzSecurityQualityInspectionRecordVo tempRecord = xzSecurityQualityInspectionRecordService.queryById(record.getQualityId());
String enterpriseNames = tempRecord.getEnterpriseNames();
if (Objects.equals(record.getType(), XzSecurityQualityRectifyRecordTypeEnum.RECTIFIED.getValue())) {
List<FileUtils.FileObj> oldImages = FileUtils.parseUrlString(tempRecord.getRectifyAfterImage());
List<FileUtils.FileObj> fileObjs = FileUtils.parseUrlString(record.getFileUrl());
if (CollUtil.isNotEmpty(fileObjs)) {
oldImages.addAll(fileObjs);
}
tempRecord.setRectifyAfterImage(FileUtils.toUrlString(oldImages, 1));
//已整改时候需要复查
if (Objects.equals(record.getStatus(), XzSecurityQualityRectifyRecordStatusEnum.RECTIFIED.getValue())) {
XzSecurityQualityRectifyRecordTypeEnum recordTypeEnum = xzSecurityDangerReviewVerifyService.getNextStepOnSuccess(record.getType(), tempRecord.getProjectSn());
@ -305,7 +311,7 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl<XzSec
InputStream inputStream = classPathResource.getInputStream();
String filePath = basePath + fileName;
FileUtil.del(filePath);
FileUtils.copyInputStreamToFile(inputStream, new File(filePath));
org.apache.commons.io.FileUtils.copyInputStreamToFile(inputStream, new File(filePath));
TemplateExportParams params = new TemplateExportParams(filePath);
Map<String, Object> rtMap = new HashMap<String, Object>(16);

View File

@ -1,6 +1,10 @@
package com.zhgd.xmgl.util;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.IOUtils;
@ -17,7 +21,7 @@ import java.util.*;
import java.util.stream.Collectors;
@Slf4j
public class Fileutils {
public class FileUtils {
public static void main(String[] args) {
@ -125,6 +129,67 @@ public class Fileutils {
}
/**
* 解析字符串附件格式如xxx*xxxx,xxx*xxxx
*
* @param fileUrl
* @return
*/
public static List<FileObj> parseUrlString(String fileUrl) {
if (StrUtil.isBlank(fileUrl)) {
return new ArrayList<>();
}
if (fileUrl.contains("[") && fileUrl.contains("]")) {
List<FileJsonObj> jsonObjs = JSON.parseArray(fileUrl, FileJsonObj.class);
return jsonObjs.stream().map(o -> new FileObj(o.getName(), o.getUrl())).collect(Collectors.toList());
} else {
return Arrays.stream(fileUrl.split(",")).map(s -> {
if (s.contains("*")) {
String[] split = s.split("\\*");
return new FileObj(split[0], split[1]);
} else {
return new FileObj(s, s);
}
}).collect(Collectors.toList());
}
}
/**
* 转换成字符串附件格式如xxx*xxxx,xxx*xxxx
*
* @param fileObjs
* @param convertType 1:如xxx*xxxx,xxx*xxxx
* @return
*/
public static String toUrlString(List<FileObj> fileObjs, int convertType) {
if (CollUtil.isEmpty(fileObjs)) {
return null;
}
if (convertType == 1) {
return fileObjs.stream().map(fileObj -> fileObj.getFileName() + "*" + fileObj.getFileUrl()).collect(Collectors.joining(","));
}
return null;
}
@Data
public static class FileJsonObj {
private String name;
private String url;
private Long uid;
private String status;
}
@Data
public static class FileObj {
private String fileName;
private String fileUrl;
public FileObj(String fileName, String fileUrl) {
this.fileName = fileName;
this.fileUrl = fileUrl;
}
}
//根据文件修改时间进行比较的内部类
static class CompratorByLastModified implements Comparator<File> {
@Override