文明施工记录、工程质量问题整改及大屏
This commit is contained in:
parent
89ba6ebe95
commit
7167f5a7ae
@ -14,7 +14,6 @@ import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.project.entity.ProjectConfig;
|
||||
import com.zhgd.xmgl.modules.project.service.IProjectConfigService;
|
||||
import com.zhgd.xmgl.modules.video.service.IAiAnalyseHardWareRecordService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.UserDevAuthorityServiceImpl;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.UserEnterpriseServiceImpl;
|
||||
@ -126,10 +125,10 @@ public class DataScopeHandler implements DataPermissionHandler {
|
||||
tables.put("xz_worker_safe_watch_alarm", "enterprise_id");
|
||||
tables.put("dangerous_engineering_record", "responsibility_company_id");
|
||||
tables.put("project_fine_record", "enterprise_id");
|
||||
if (!environmentUtil.isBaise()) {
|
||||
tables.put("car_info", "enterprise_id");
|
||||
tables.put("enterprise_info", "id");
|
||||
}
|
||||
tables.put("car_info", "enterprise_id");
|
||||
tables.put("enterprise_info", "id");
|
||||
tables.put("quality_problem", "enterprise_id");
|
||||
tables.put("civilize_construction", "enterprise_id");
|
||||
return tables;
|
||||
}
|
||||
|
||||
@ -195,6 +194,8 @@ public class DataScopeHandler implements DataPermissionHandler {
|
||||
private HashMap<String, String> getFieldSecurityTables() {
|
||||
HashMap<String, String> tables = new HashMap<>(16);
|
||||
tables.put("xz_security_quality_inspection_record", "device_unit_id");
|
||||
tables.put("quality_problem", "device_id");
|
||||
tables.put("civilize_construction", "device_id");
|
||||
return tables;
|
||||
}
|
||||
|
||||
|
||||
@ -1448,72 +1448,42 @@ public class ParamEnum {
|
||||
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum RainAlarmTypeEnum implements BaseEnum {
|
||||
/**
|
||||
* 风力
|
||||
*/
|
||||
/**
|
||||
* 风力
|
||||
*/
|
||||
WIND_FORCE(1, "风力"),
|
||||
/**
|
||||
* 风速
|
||||
*/
|
||||
/**
|
||||
* 风速
|
||||
*/
|
||||
WIND_SPEED(2, "风速"),
|
||||
/**
|
||||
* 风向
|
||||
*/
|
||||
/**
|
||||
* 风向
|
||||
*/
|
||||
WIND_DIRECTION(3, "风向"),
|
||||
/**
|
||||
* 累计雨量
|
||||
*/
|
||||
/**
|
||||
* 累计雨量
|
||||
*/
|
||||
ACCUMULATED_RAINFALL(4, "累计雨量"),
|
||||
/**
|
||||
* 瞬时雨量
|
||||
*/
|
||||
/**
|
||||
* 瞬时雨量
|
||||
*/
|
||||
INSTANTANEOUS_RAINFALL(5, "瞬时雨量"),
|
||||
/**
|
||||
* 当前雨量
|
||||
*/
|
||||
/**
|
||||
* 当前雨量
|
||||
*/
|
||||
CURRENT_RAINFALL(6, "当前雨量"),
|
||||
/**
|
||||
* 日雨量
|
||||
*/
|
||||
/**
|
||||
* 日雨量
|
||||
*/
|
||||
DAILY_RAINFALL(7, "日雨量"),
|
||||
/**
|
||||
* 空气温度
|
||||
*/
|
||||
/**
|
||||
* 空气温度
|
||||
*/
|
||||
AIR_TEMPERATURE(8, "空气温度"),
|
||||
/**
|
||||
* 空气湿度
|
||||
*/
|
||||
/**
|
||||
* 空气湿度
|
||||
*/
|
||||
AIR_HUMIDITY(9, "空气湿度"),
|
||||
/**
|
||||
* 大气压
|
||||
*/
|
||||
/**
|
||||
* 大气压
|
||||
*/
|
||||
@ -1549,5 +1519,42 @@ public class ParamEnum {
|
||||
}
|
||||
}
|
||||
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum QualityProblemTechnologyEnum implements BaseEnum{
|
||||
ENUM0(1, "土建"),
|
||||
ENUM1(2, "管道"),
|
||||
ENUM2(3, "设备"),
|
||||
ENUM3(4, "电气"),
|
||||
ENUM4(5, "仪表"),
|
||||
ENUM5(6, "其他");
|
||||
|
||||
private Integer value;
|
||||
private String desc;
|
||||
|
||||
QualityProblemTechnologyEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,101 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.CivilizeConstruction;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.SceneExposeSpecial;
|
||||
import com.zhgd.xmgl.modules.baotou.service.ICivilizeConstructionService;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IQualityProblemService;
|
||||
import com.zhgd.xmgl.modules.baotou.service.ISceneExposeSpecialService;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/civilizeConstruction/bigScreen")
|
||||
@Slf4j
|
||||
@Api(tags = "文明施工大屏")
|
||||
public class CivilizeConstructionBigScreenController {
|
||||
@Lazy
|
||||
@Autowired
|
||||
WorkerInfoServiceImpl workerInfoService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IQualityProblemService problemService;
|
||||
@Autowired
|
||||
private ISceneExposeSpecialService sceneExposeSpecialService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ICivilizeConstructionService civilizeConstructionService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询现场会、曝光栏、专题活动信息", notes = "分页列表查询现场会、曝光栏、专题活动信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/sceneExposeSpecial/page")
|
||||
public Result<IPage<SceneExposeSpecial>> querySceneExposeSpecialPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<SceneExposeSpecial> queryWrapper = QueryGenerator.initPageQueryWrapper(SceneExposeSpecial.class, paramMap);
|
||||
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(SceneExposeSpecial::getId));
|
||||
Page page = PageUtil.getPage(paramMap);
|
||||
IPage<SceneExposeSpecial> pageList = sceneExposeSpecialService.page(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "文明施工检查统计", notes = "文明施工检查统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "changeUser", value = "整改人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "itemId", value = "子任务ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "engineeringId", value = "危大工程记录ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "createUser", value = "创建人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "recordType", value = "类型,1隐患问题,2排查记录", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "reviewId", value = "复查人", paramType = "body", required = false, dataType = "String"),
|
||||
// @ApiImplicitParam(name = "status", value = "状态,1无需整改,2待整改,3待复查,4合格", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectEndTime", value = "检查结束时间", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getProjectInspectRecordCount")
|
||||
public Result<ProjectInspectRecordCountVo> getProjectInspectRecordCount(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(civilizeConstructionService.getProjectInspectRecordCount(map));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "文明施工管理", operType = "分页查询", operDesc = "分页列表查询文明施工信息")
|
||||
@ApiOperation(value = "分页列表查询文明施工信息", notes = "分页列表查询文明施工信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/civilizeConstruction/page")
|
||||
public Result<IPage<CivilizeConstruction>> queryCivilizeConstructionPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(civilizeConstructionService.queryPageList(param));
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,10 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.QualityProblem;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -136,4 +139,48 @@ public class CivilizeConstructionController {
|
||||
return Result.success(civilizeConstructionService.queryById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@OperLog(operModul = "文明施工记录", operType = "", operDesc = "工作流添加文明施工记录")
|
||||
@ApiOperation(value = "工作流添加文明施工记录", notes = "工作流添加文明施工记录", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/add")
|
||||
public Result addFromFlow(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流添加文明施工记录:{}", com.gexin.fastjson.JSON.toJSONString(map));
|
||||
try {
|
||||
civilizeConstructionService.addFromFlow(map);
|
||||
} catch (Exception e) {
|
||||
log.error("工作流添加文明施工记录:", e);
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@OperLog(operModul = "文明施工记录", operType = "", operDesc = "工作流更改文明施工记录状态")
|
||||
@ApiOperation(value = "工作流更改文明施工记录状态", notes = "工作流更改文明施工记录状态", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/set/status")
|
||||
public Result setRectification(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流更改文明施工记录状态:{}", JSON.toJSONString(map));
|
||||
String instanceId = MapUtils.getString(map, "instanceId");
|
||||
civilizeConstructionService.update(new LambdaUpdateWrapper<CivilizeConstruction>()
|
||||
.set(CivilizeConstruction::getStatus, MapUtils.getInteger(map, "status"))
|
||||
.eq(CivilizeConstruction::getInstanceId, instanceId)
|
||||
);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "文明施工检查统计", notes = "文明施工检查统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "changeUser", value = "整改人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "itemId", value = "子任务ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "engineeringId", value = "危大工程记录ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "createUser", value = "创建人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "recordType", value = "类型,1隐患问题,2排查记录", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "reviewId", value = "复查人", paramType = "body", required = false, dataType = "String"),
|
||||
// @ApiImplicitParam(name = "status", value = "状态,1无需整改,2待整改,3待复查,4合格", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectEndTime", value = "检查结束时间", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getProjectInspectRecordCount")
|
||||
public Result<ProjectInspectRecordCountVo> getProjectInspectRecordCount(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(civilizeConstructionService.getProjectInspectRecordCount(map));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.wflow.workflow.service.ProcessInstanceService;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IQualityProblemService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.HistoryService;
|
||||
import org.flowable.engine.history.HistoricActivityInstance;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/flow")
|
||||
@Slf4j
|
||||
@Api(tags = "工作流相关Api")
|
||||
public class FlowController {
|
||||
@Autowired
|
||||
private HistoryService historyService;
|
||||
@Autowired
|
||||
private ProcessInstanceService processService;
|
||||
|
||||
@OperLog(operModul = "工作流记录", operType = "", operDesc = "查询工作流记录详情")
|
||||
@ApiOperation(value = "查询工作流记录详情", notes = "查询工作流记录详情", httpMethod = "GET")
|
||||
@GetMapping("/flow/progress/{instanceId}/{nodeId}")
|
||||
public Result getFlowDetail(@PathVariable String instanceId,
|
||||
@PathVariable(required = false) String nodeId) {
|
||||
String nodeId1 = null;
|
||||
List<HistoricActivityInstance> list = historyService.createHistoricActivityInstanceQuery().processInstanceId(instanceId).list();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
nodeId1 = list.get(list.size() - 1).getActivityId();
|
||||
}
|
||||
return Result.success(processService.getInstanceProgress(nodeId1, instanceId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wflow.workflow.service.ProcessInstanceService;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.QualityProblem;
|
||||
import com.zhgd.xmgl.modules.baotou.security.entity.vo.XzSecurityQualityInspectionRecordVo;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IQualityProblemService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringRecordService;
|
||||
import com.zhgd.xmgl.modules.video.service.IAiAnalyseHardWareAlarmRecordService;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.HistoryService;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/qualityProblem/bigScreen")
|
||||
@Slf4j
|
||||
@Api(tags = "工程质量问题整改大屏")
|
||||
public class QualityBigScreenController {
|
||||
@Lazy
|
||||
@Autowired
|
||||
WorkerInfoServiceImpl workerInfoService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IQualityProblemService problemService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IAiAnalyseHardWareAlarmRecordService aiAnalyseHardWareAlarmRecordService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IDangerousEngineeringRecordService dangerousEngineeringRecordService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private RuntimeService runtimeService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private HistoryService historyService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ProcessInstanceService processService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
|
||||
|
||||
@ApiOperation(value = "EPC责任单位分析", notes = "EPC责任单位分析", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countResponsibleUnit")
|
||||
public Result<List<TrendOneVo>> countResponsibleUnit(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(problemService.countResponsibleUnit(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "记录统计", notes = "记录统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "changeUser", value = "整改人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "itemId", value = "子任务ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "engineeringId", value = "危大工程记录ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "createUser", value = "创建人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "recordType", value = "类型,1隐患问题,2排查记录", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "reviewId", value = "复查人", paramType = "body", required = false, dataType = "String"),
|
||||
// @ApiImplicitParam(name = "status", value = "状态,1无需整改,2待整改,3待复查,4合格", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectEndTime", value = "检查结束时间", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getProjectInspectRecordCount")
|
||||
public Result<ProjectInspectRecordCountVo> getProjectInspectRecordCount(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(problemService.getProjectInspectRecordCount(map));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "分页查询", operDesc = "分页列表查询工程质量问题整改信息")
|
||||
@ApiOperation(value = "分页列表查询工程质量问题整改信息", notes = "分页列表查询工程质量问题整改信息", httpMethod="GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<QualityProblem>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(problemService.queryPageList(param));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "涉及技术专业统计", notes = "涉及技术专业统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "type", value = "1近7天,2近30天,3指定开始结束时间", paramType = "body", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "inspectTime_begin", value = "检查开始时间", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectTime_end", value = "检查结束时间", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countTechnology")
|
||||
public Result<SectorVo> countTechnology(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(problemService.countTechnology(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "责任装置分析", notes = "责任装置分析", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countDevice")
|
||||
public Result<List<TrendOneVo>> countDevice(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(problemService.countDevice(map));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,53 +1,38 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gexin.fastjson.JSON;
|
||||
import com.wflow.workflow.service.ProcessInstanceService;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import java.util.HashMap;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.QualityProblem;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IQualityProblemService;
|
||||
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.flowable.engine.HistoryService;
|
||||
import org.flowable.engine.history.HistoricActivityInstance;
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 工程质量问题整改
|
||||
* @author: pds
|
||||
* @date: 2024-10-10
|
||||
* @date: 2024-10-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@ -55,85 +40,139 @@ import com.alibaba.fastjson.JSON;
|
||||
@Slf4j
|
||||
@Api(tags = "工程质量问题整改相关Api")
|
||||
public class QualityProblemController {
|
||||
@Autowired
|
||||
private IQualityProblemService qualityProblemService;
|
||||
@Autowired
|
||||
private IQualityProblemService qualityProblemService;
|
||||
@Autowired
|
||||
private HistoryService historyService;
|
||||
@Autowired
|
||||
private ProcessInstanceService processService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "分页查询", operDesc = "分页列表查询工程质量问题整改信息")
|
||||
@ApiOperation(value = "分页列表查询工程质量问题整改信息", notes = "分页列表查询工程质量问题整改信息", httpMethod="GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<QualityProblem>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(qualityProblemService.queryPageList(param));
|
||||
}
|
||||
@ApiOperation(value = "分页列表查询工程质量问题整改信息", notes = "分页列表查询工程质量问题整改信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<QualityProblem>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(qualityProblemService.queryPageList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "列表查询", operDesc = "列表查询工程质量问题整改信息")
|
||||
@ApiOperation(value = "列表查询工程质量问题整改信息", notes = "列表查询工程质量问题整改信息", httpMethod="GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<QualityProblem>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(qualityProblemService.queryList(param));
|
||||
}
|
||||
@ApiOperation(value = "列表查询工程质量问题整改信息", notes = "列表查询工程质量问题整改信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<QualityProblem>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(qualityProblemService.queryList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param qualityProblem
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param qualityProblem
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "添加", operDesc = "添加工程质量问题整改信息")
|
||||
@ApiOperation(value = "添加工程质量问题整改信息", notes = "添加工程质量问题整改信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<QualityProblem> add(@RequestBody @Validate QualityProblem qualityProblem) {
|
||||
qualityProblemService.add(qualityProblem);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param qualityProblem
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "编辑", operDesc = "编辑工程质量问题整改信息")
|
||||
@ApiOperation(value = "编辑工程质量问题整改信息", notes = "编辑工程质量问题整改信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<QualityProblem> edit(@RequestBody QualityProblem qualityProblem) {
|
||||
qualityProblemService.edit(qualityProblem);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "删除", operDesc = "删除工程质量问题整改信息")
|
||||
@ApiOperation(value = "删除工程质量问题整改信息", notes = "删除工程质量问题整改信息" , httpMethod="POST")
|
||||
@ApiImplicitParam(name = "id", value = "工程质量问题整改ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<QualityProblem> delete(@ApiIgnore @RequestBody HashMap<String ,Object> map) {
|
||||
qualityProblemService.delete(MapUtils.getString(map, "id"));
|
||||
@ApiOperation(value = "添加工程质量问题整改信息", notes = "添加工程质量问题整改信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<QualityProblem> add(@RequestBody @Validate QualityProblem qualityProblem) {
|
||||
qualityProblemService.add(qualityProblem);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param qualityProblem
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "编辑", operDesc = "编辑工程质量问题整改信息")
|
||||
@ApiOperation(value = "编辑工程质量问题整改信息", notes = "编辑工程质量问题整改信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<QualityProblem> edit(@RequestBody QualityProblem qualityProblem) {
|
||||
qualityProblemService.edit(qualityProblem);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "删除", operDesc = "删除工程质量问题整改信息")
|
||||
@ApiOperation(value = "删除工程质量问题整改信息", notes = "删除工程质量问题整改信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "工程质量问题整改ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<QualityProblem> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
qualityProblemService.delete(MapUtils.getString(map, "id"));
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "工程质量问题整改管理", operType = "通过id查询", operDesc = "通过id查询工程质量问题整改信息")
|
||||
@ApiOperation(value = "通过id查询工程质量问题整改信息", notes = "通过id查询工程质量问题整改信息" , httpMethod="GET")
|
||||
@ApiImplicitParam(name = "id", value = "工程质量问题整改ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<QualityProblem> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
return Result.success(qualityProblemService.queryById(id));
|
||||
}
|
||||
@ApiOperation(value = "通过id查询工程质量问题整改信息", notes = "通过id查询工程质量问题整改信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "工程质量问题整改ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<QualityProblem> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.success(qualityProblemService.queryById(id));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "质量问题记录", operType = "", operDesc = "工作流添加质量问题记录")
|
||||
@ApiOperation(value = "工作流添加质量问题记录", notes = "工作流添加质量问题记录", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/add")
|
||||
public Result addFromFlow(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流添加质量问题记录:{}", com.gexin.fastjson.JSON.toJSONString(map));
|
||||
try {
|
||||
qualityProblemService.addFromFlow(map);
|
||||
} catch (Exception e) {
|
||||
log.error("工作流添加质量问题记录:", e);
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@OperLog(operModul = "质量问题记录", operType = "", operDesc = "工作流更改质量问题记录状态")
|
||||
@ApiOperation(value = "工作流更改质量问题记录状态", notes = "工作流更改质量问题记录状态", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/set/status")
|
||||
public Result setRectification(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流更改质量问题记录为整改中:{}", JSON.toJSONString(map));
|
||||
String instanceId = MapUtils.getString(map, "instanceId");
|
||||
qualityProblemService.update(new LambdaUpdateWrapper<QualityProblem>()
|
||||
.set(QualityProblem::getStatus, MapUtils.getInteger(map, "status"))
|
||||
.eq(QualityProblem::getInstanceId, instanceId)
|
||||
);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "记录统计", notes = "记录统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "changeUser", value = "整改人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "itemId", value = "子任务ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "engineeringId", value = "危大工程记录ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "createUser", value = "创建人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "recordType", value = "类型,1隐患问题,2排查记录", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "reviewId", value = "复查人", paramType = "body", required = false, dataType = "String"),
|
||||
// @ApiImplicitParam(name = "status", value = "状态,1无需整改,2待整改,3待复查,4合格", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "inspectEndTime", value = "检查结束时间", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getProjectInspectRecordCount")
|
||||
public Result<ProjectInspectRecordCountVo> getProjectInspectRecordCount(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(qualityProblemService.getProjectInspectRecordCount(map));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,9 +8,11 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 文明施工
|
||||
@ -65,11 +67,6 @@ public class CivilizeConstruction implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "施工单位id")
|
||||
private java.lang.Long constructionUnitId;
|
||||
/**
|
||||
* 设计单位id
|
||||
*/
|
||||
@ApiModelProperty(value = "设计单位id")
|
||||
private java.lang.Long designEnterpriseId;
|
||||
/**
|
||||
* 责任主体
|
||||
*/
|
||||
@ -134,6 +131,47 @@ public class CivilizeConstruction implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateDate;
|
||||
/**
|
||||
* 状态,2待整改,3整改中,5合格,6已撤销
|
||||
*/
|
||||
@Excel(name = "状态,2待整改,3整改中,5合格,6已撤销", width = 15)
|
||||
@ApiModelProperty(value = "状态,2待整改,3整改中,5合格,6已撤销")
|
||||
private java.lang.Integer status;
|
||||
/**
|
||||
* 检查时间
|
||||
*/
|
||||
@Excel(name = "检查时间", width = 15)
|
||||
@ApiModelProperty(value = "检查时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date inspectTime;
|
||||
|
||||
/**
|
||||
* 单位id
|
||||
*/
|
||||
@ApiModelProperty(value = "单位id")
|
||||
private java.lang.Long enterpriseId;
|
||||
/**
|
||||
* 签发部门
|
||||
*/
|
||||
@ApiModelProperty(value = "签发部门")
|
||||
private java.lang.Long issuingDepartment;
|
||||
/**
|
||||
* 签发人
|
||||
*/
|
||||
@ApiModelProperty(value = "签发人")
|
||||
private java.lang.Long issuer;
|
||||
/**
|
||||
* 签发日期
|
||||
*/
|
||||
@ApiModelProperty(value = "签发日期")
|
||||
private java.util.Date issuingDate;
|
||||
/**
|
||||
* 检查人id
|
||||
*/
|
||||
@Excel(name = "检查人id", width = 15)
|
||||
@ApiModelProperty(value = "检查人id")
|
||||
private Long inspectManId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "装置名称")
|
||||
@ -159,4 +197,16 @@ public class CivilizeConstruction implements Serializable {
|
||||
@ApiModelProperty(value = "责任主体")
|
||||
private java.lang.String responsiblePartyName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private java.lang.String enterpriseName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "签发部门名称")
|
||||
private java.lang.String issuingDepartmentName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "签发人名称")
|
||||
private java.lang.String issuerName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "检查人名称")
|
||||
private String inspectManName;
|
||||
}
|
||||
|
||||
@ -4,11 +4,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 工程质量问题整改
|
||||
@ -117,11 +121,15 @@ public class QualityProblem implements Serializable {
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createDate;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateDate;
|
||||
|
||||
/**
|
||||
@ -149,6 +157,33 @@ public class QualityProblem implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "编制人")
|
||||
private java.lang.Long compiler;
|
||||
/**
|
||||
* 状态,2待整改,3整改中,5合格,6已撤销
|
||||
*/
|
||||
@Excel(name = "状态,2待整改,3整改中,5合格,6已撤销", width = 15)
|
||||
@ApiModelProperty(value = "状态,2待整改,3整改中,5合格,6已撤销")
|
||||
private java.lang.Integer status;
|
||||
/**
|
||||
* 检查时间
|
||||
*/
|
||||
@Excel(name = "检查时间", width = 15)
|
||||
@ApiModelProperty(value = "检查时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date inspectTime;
|
||||
/**
|
||||
* 整改时限
|
||||
*/
|
||||
@Excel(name = "整改时限", width = 15)
|
||||
@ApiModelProperty(value = "整改时限")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date changeLimitTime;
|
||||
/**
|
||||
* 单位id
|
||||
*/
|
||||
@ApiModelProperty(value = "单位id")
|
||||
private java.lang.Long enterpriseId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "装置名称")
|
||||
@ -198,5 +233,9 @@ public class QualityProblem implements Serializable {
|
||||
@ApiModelProperty(value = "编制人名称")
|
||||
private java.lang.String compilerName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private java.lang.String enterpriseName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -2,11 +2,15 @@ package com.zhgd.xmgl.modules.baotou.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.CivilizeConstruction;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@ -18,6 +22,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope(includeTable = "civilize_construction")
|
||||
public interface CivilizeConstructionMapper extends BaseMapper<CivilizeConstruction> {
|
||||
|
||||
/**
|
||||
@ -47,4 +52,6 @@ public interface CivilizeConstructionMapper extends BaseMapper<CivilizeConstruct
|
||||
* @return
|
||||
*/
|
||||
CivilizeConstruction queryById(String id);
|
||||
|
||||
ProjectInspectRecordCountVo getProjectInspectRecordCount(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -2,11 +2,17 @@ package com.zhgd.xmgl.modules.baotou.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.QualityProblem;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@ -18,6 +24,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope(includeTable = "quality_problem")
|
||||
public interface QualityProblemMapper extends BaseMapper<QualityProblem> {
|
||||
|
||||
/**
|
||||
@ -47,4 +54,12 @@ public interface QualityProblemMapper extends BaseMapper<QualityProblem> {
|
||||
* @return
|
||||
*/
|
||||
QualityProblem queryById(String id);
|
||||
|
||||
List<TrendOneVo> countResponsibleUnit(Map<String, Object> map);
|
||||
|
||||
ProjectInspectRecordCountVo getProjectInspectRecordCount(Map<String, Object> map);
|
||||
|
||||
List<SectorOneVo> countTechnology(Map<String, Object> map);
|
||||
|
||||
List<TrendOneVo> countDevice(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -8,17 +8,31 @@
|
||||
pg.project_group_name,
|
||||
ei1.enterprise_name as supervising_unit_name,
|
||||
ei2.enterprise_name as epc_contractor_name,
|
||||
ei3.enterprise_name as construction_unit_name,
|
||||
ei4.enterprise_name as design_enterprise_name,
|
||||
du.device_unit_name as device_name
|
||||
ei3.enterprise_name as construction_unit_name
|
||||
,du.device_unit_name as device_name
|
||||
,du.device_unit_name as enterprise_name
|
||||
,du.device_unit_name as issuing_department_name
|
||||
,du.device_unit_name as issuer_name
|
||||
,du.device_unit_name as inspect_man_name
|
||||
from civilize_construction t
|
||||
left join project_group pg on t.project_group_id = pg.id
|
||||
left join enterprise_info ei1 on ei1.id = t.supervising_unit_id
|
||||
left join enterprise_info ei2 on ei2.id = t.epc_contractor_id
|
||||
left join enterprise_info ei3 on ei3.id = t.construction_unit_id
|
||||
left join enterprise_info ei4 on ei4.id = t.design_enterprise_id
|
||||
left join enterprise_info ei6 on ei6.id = t.responsible_party
|
||||
left join enterprise_info ei7 on ei7.id = t.enterprise_id
|
||||
left join xz_project_org po on po.id=t.issuing_department
|
||||
left join system_user su1 on su1.user_id=t.issuer
|
||||
left join system_user su2 on su2.user_id=t.inspect_man_id
|
||||
left join device_unit du on du.id=t.device_id
|
||||
where 1=1
|
||||
<if test="param.instanceIds != null and param.instanceIds != '' and param.instanceIds.size > 0">
|
||||
and t.instance_id in
|
||||
<foreach item="item" index="index" collection="param.instanceIds"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
@ -29,18 +43,72 @@
|
||||
pg.project_group_name,
|
||||
ei1.enterprise_name as supervising_unit_name,
|
||||
ei2.enterprise_name as epc_contractor_name,
|
||||
ei3.enterprise_name as construction_unit_name,
|
||||
ei4.enterprise_name as design_enterprise_name,
|
||||
du.device_unit_name as device_name
|
||||
ei3.enterprise_name as construction_unit_name
|
||||
,du.device_unit_name as device_name
|
||||
,du.device_unit_name as enterprise_name
|
||||
,du.device_unit_name as issuing_department_name
|
||||
,du.device_unit_name as issuer_name
|
||||
,du.device_unit_name as inspect_man_name
|
||||
from civilize_construction t
|
||||
left join project_group pg on t.project_group_id = pg.id
|
||||
left join enterprise_info ei1 on ei1.id = t.supervising_unit_id
|
||||
left join enterprise_info ei2 on ei2.id = t.epc_contractor_id
|
||||
left join enterprise_info ei3 on ei3.id = t.construction_unit_id
|
||||
left join enterprise_info ei4 on ei4.id = t.design_enterprise_id
|
||||
left join enterprise_info ei6 on ei6.id = t.responsible_party
|
||||
left join enterprise_info ei7 on ei7.id = t.enterprise_id
|
||||
left join xz_project_org po on po.id=t.issuing_department
|
||||
left join system_user su1 on su1.user_id=t.issuer
|
||||
left join system_user su2 on su2.user_id=t.inspect_man_id
|
||||
left join device_unit du on du.id=t.device_id
|
||||
)t
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getProjectInspectRecordCount"
|
||||
resultType="com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo">
|
||||
select tp.*,
|
||||
<!--round(IFNULL(TRUNCATE(IFNULL(rectifyCompleteNum, 0) / IFNULL(inspectNum, 0), 4), 0) * 100,2) completeRatio,-->
|
||||
round(IFNULL(TRUNCATE(IFNULL(closeNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2) closeRatio
|
||||
<!--,tp.totalNum - tp.weekInspectNum - tp.monthInspectNum AS otherInspectNum <!–其他数量,就是除了月、周的检查数量–>-->
|
||||
from (
|
||||
SELECT
|
||||
IFNULL(SUM((CASE WHEN a.status != 6 THEN 1 ELSE 0 END)), 0) totalNum,
|
||||
<!--IFNULL(SUM((CASE WHEN a.record_type = 2 THEN 1 ELSE 0 END)), 0) investigateNum,
|
||||
IFNULL(SUM((CASE WHEN a.record_type = 1 THEN 1 ELSE 0 END)), 0) inspectNum,-->
|
||||
IFNULL(SUM((CASE WHEN a.status = 5 THEN 1 ELSE 0 END)), 0) closeNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 5 THEN 1 ELSE 0 END)), 0) rectifyCompleteNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 2 OR a.status = 3 THEN 1 ELSE 0 END)), 0) notCloseNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 3 THEN 1 ELSE 0 END)), 0) rectificatingNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN (a.status = 2 OR a.status = 3)
|
||||
AND now() > a.limited_rectification_end THEN 1
|
||||
ELSE 0 END)), 0) overdueNotCloseNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN a.status = 2 AND DATE_FORMAT(now(), "%Y-%m-%d") > a.limited_rectification_end THEN 1
|
||||
ELSE 0 END)),
|
||||
0) overdueRectificationNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 2 THEN 1 ELSE 0 END)), 0) rectificationNum,
|
||||
IFNULL(SUM((CASE WHEN a.status != 2 and a.status != 6 THEN 1 ELSE 0 END)), 0) rectificationDoneNum,
|
||||
IFNULL(SUM((CASE WHEN a.status != 1 THEN 1 ELSE 0 END)), 0) dangerNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 3 THEN 1 ELSE 0 END)), 0) reviewNum
|
||||
from civilize_construction a
|
||||
WHERE a.project_sn = #{projectSn}
|
||||
<if test="instanceIds != null and instanceIds != '' and instanceIds.size > 0">
|
||||
and a.instance_id in
|
||||
<foreach item="item" index="index" collection="instanceIds"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and a.status = #{status}
|
||||
</if>
|
||||
<if test="inspectStartTime != null and inspectStartTime != ''">
|
||||
and a.inspect_time >= CONCAT(DATE_FORMAT(#{inspectStartTime}, "%Y-%m-%d"), ' 00:00:00')
|
||||
</if>
|
||||
<if test="inspectEndTime != null and inspectEndTime != ''">
|
||||
and a.inspect_time <= CONCAT(DATE_FORMAT(#{inspectEndTime}, "%Y-%m-%d"), ' 23:59:59')
|
||||
</if>
|
||||
) tp
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.baotou.entity.QualityProblem">
|
||||
select * from(select t.*,
|
||||
pg.project_group_name,
|
||||
ei0.enterprise_name,
|
||||
ei1.enterprise_name as supervising_unit_name,
|
||||
ei2.enterprise_name as epc_contractor_name,
|
||||
ei3.enterprise_name as construction_unit_name,
|
||||
@ -16,6 +17,7 @@
|
||||
su3.real_name as compiler_name
|
||||
from quality_problem t
|
||||
left join project_group pg on t.project_group_id = pg.id
|
||||
left join enterprise_info ei0 on ei0.id = t.enterprise_id
|
||||
left join enterprise_info ei1 on ei1.id = t.supervising_unit_id
|
||||
left join enterprise_info ei2 on ei2.id = t.epc_contractor_id
|
||||
left join enterprise_info ei3 on ei3.id = t.construction_unit_id
|
||||
@ -26,12 +28,21 @@
|
||||
left join system_user su1 on su1.user_id=t.issuer
|
||||
left join system_user su2 on su2.user_id=t.copy
|
||||
left join system_user su3 on su3.user_id=t.compiler
|
||||
where 1=1
|
||||
<if test="param.instanceIds != null and param.instanceIds != '' and param.instanceIds.size > 0">
|
||||
and t.instance_id in
|
||||
<foreach item="item" index="index" collection="param.instanceIds"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
) t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="queryById" resultType="com.zhgd.xmgl.modules.baotou.entity.QualityProblem">
|
||||
select * from(select t.*,
|
||||
pg.project_group_name,
|
||||
ei0.enterprise_name,
|
||||
ei1.enterprise_name as supervising_unit_name,
|
||||
ei2.enterprise_name as epc_contractor_name,
|
||||
ei3.enterprise_name as construction_unit_name,
|
||||
@ -44,6 +55,7 @@
|
||||
su3.real_name as compiler_name
|
||||
from quality_problem t
|
||||
left join project_group pg on t.project_group_id = pg.id
|
||||
left join enterprise_info ei0 on ei0.id = t.enterprise_id
|
||||
left join enterprise_info ei1 on ei1.id = t.supervising_unit_id
|
||||
left join enterprise_info ei2 on ei2.id = t.epc_contractor_id
|
||||
left join enterprise_info ei3 on ei3.id = t.construction_unit_id
|
||||
@ -57,4 +69,100 @@
|
||||
) t
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="countResponsibleUnit" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
|
||||
select count(*) y, i.enterprise_name x
|
||||
from quality_problem r
|
||||
join enterprise_info i on i.id = r.epc_contractor_id
|
||||
where 1 = 1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and r.project_sn = #{projectSn}
|
||||
</if>
|
||||
group by r.epc_contractor_id
|
||||
order by y desc
|
||||
</select>
|
||||
|
||||
<select id="getProjectInspectRecordCount"
|
||||
resultType="com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo">
|
||||
select tp.*,
|
||||
<!--round(IFNULL(TRUNCATE(IFNULL(rectifyCompleteNum, 0) / IFNULL(inspectNum, 0), 4), 0) * 100,2) completeRatio,-->
|
||||
round(IFNULL(TRUNCATE(IFNULL(closeNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2) closeRatio
|
||||
<!--,tp.totalNum - tp.weekInspectNum - tp.monthInspectNum AS otherInspectNum <!–其他数量,就是除了月、周的检查数量–>-->
|
||||
from (
|
||||
SELECT
|
||||
IFNULL(SUM((CASE WHEN a.status != 6 THEN 1 ELSE 0 END)), 0) totalNum,
|
||||
<!--IFNULL(SUM((CASE WHEN a.record_type = 2 THEN 1 ELSE 0 END)), 0) investigateNum,
|
||||
IFNULL(SUM((CASE WHEN a.record_type = 1 THEN 1 ELSE 0 END)), 0) inspectNum,-->
|
||||
IFNULL(SUM((CASE WHEN a.status = 5 THEN 1 ELSE 0 END)), 0) closeNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 5 THEN 1 ELSE 0 END)), 0) rectifyCompleteNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 2 OR a.status = 3 THEN 1 ELSE 0 END)), 0) notCloseNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 3 THEN 1 ELSE 0 END)), 0) rectificatingNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN (a.status = 2 OR a.status = 3)
|
||||
AND now() > a.change_limit_time THEN 1
|
||||
ELSE 0 END)), 0) overdueNotCloseNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN a.status = 2 AND DATE_FORMAT(now(), "%Y-%m-%d") > a.change_limit_time THEN 1
|
||||
ELSE 0 END)),
|
||||
0) overdueRectificationNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 2 THEN 1 ELSE 0 END)), 0) rectificationNum,
|
||||
IFNULL(SUM((CASE WHEN a.status != 2 and a.status != 6 THEN 1 ELSE 0 END)), 0) rectificationDoneNum,
|
||||
IFNULL(SUM((CASE WHEN a.status != 1 THEN 1 ELSE 0 END)), 0) dangerNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 3 THEN 1 ELSE 0 END)), 0) reviewNum
|
||||
from quality_problem a
|
||||
WHERE a.project_sn = #{projectSn}
|
||||
<if test="instanceIds != null and instanceIds != '' and instanceIds.size > 0">
|
||||
and a.instance_id in
|
||||
<foreach item="item" index="index" collection="instanceIds"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and a.status = #{status}
|
||||
</if>
|
||||
<if test="inspectStartTime != null and inspectStartTime != ''">
|
||||
and a.inspect_time >= CONCAT(DATE_FORMAT(#{inspectStartTime}, "%Y-%m-%d"), ' 00:00:00')
|
||||
</if>
|
||||
<if test="inspectEndTime != null and inspectEndTime != ''">
|
||||
and a.inspect_time <= CONCAT(DATE_FORMAT(#{inspectEndTime}, "%Y-%m-%d"), ' 23:59:59')
|
||||
</if>
|
||||
) tp
|
||||
</select>
|
||||
|
||||
<select id="countTechnology" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select count(*) count, r.technology as name
|
||||
from quality_problem r
|
||||
where 1 = 1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and r.project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="type == '1'.toString()">
|
||||
and r.inspect_time >= date_sub(current_date, interval 7 day)
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
and r.inspect_time >= date_sub(current_date, interval 30 day)
|
||||
</if>
|
||||
<if test="type == '3'.toString() and inspectTime_begin != null and inspectTime_begin != ''">
|
||||
and r.inspect_time >= #{inspectTime_begin}
|
||||
</if>
|
||||
<if test="type == '3'.toString() and inspectTime_end != null and inspectTime_end != ''">
|
||||
and r.inspect_time <![CDATA[<=]]>
|
||||
if(LENGTH(#{inspectTime_end}) = 10, CONCAT(DATE_FORMAT(#{inspectTime_end}, '%Y-%m-%d'), ' 23:59:59'),
|
||||
#{inspectTime_end})
|
||||
</if>
|
||||
group by r.technology
|
||||
</select>
|
||||
|
||||
<select id="countDevice" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
|
||||
select count(*) y, du.device_unit_name as x
|
||||
from quality_problem r
|
||||
join device_unit du on du.id=r.device_id
|
||||
where 1 = 1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and r.project_sn = #{projectSn}
|
||||
</if>
|
||||
group by r.device_id
|
||||
order by y desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -32,7 +32,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/xzSecurity/bigScreen")
|
||||
@Slf4j
|
||||
@Api(tags = "安全检查记录")
|
||||
@Api(tags = "安全检查记录大屏")
|
||||
public class XzSecurityBigScreenController {
|
||||
@Lazy
|
||||
@Autowired
|
||||
@ -65,7 +65,7 @@ public class XzSecurityBigScreenController {
|
||||
return Result.success(xzSecurityQualityInspectionRecordService.countResponsibleUnit(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目检查记录统计", notes = "项目检查记录统计", httpMethod = "POST")
|
||||
@ApiOperation(value = "安全隐患统计", notes = "安全隐患统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "changeUser", value = "整改人", paramType = "body", required = false, dataType = "String"),
|
||||
|
||||
@ -117,6 +117,7 @@ public class XzSecurityQualityInspectionRecordController {
|
||||
@ApiImplicitParam(name = "orderBy", value = "1整改时间倒序(默认)2按照每条记录的状态的时间倒序", paramType = "body", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "dangerInfoId", value = "隐患库信息id", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "dangerInfoLevel", value = "隐患库层数", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "isMyTodo", value = "是否我的待办1是", paramType = "body", required = false, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = {"/list", "/page"})
|
||||
public Result<XzSecurityRecordVo> queryPageList(@RequestBody Map<String, Object> map) {
|
||||
@ -554,79 +555,40 @@ public class XzSecurityQualityInspectionRecordController {
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@OperLog(operModul = "安全检查记录", operType = "", operDesc = "工作流更改安全检查记录为整改中")
|
||||
@ApiOperation(value = "工作流更改安全检查记录为整改中", notes = "工作流更改安全检查记录为整改中", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/set/re")
|
||||
@OperLog(operModul = "安全检查记录", operType = "", operDesc = "工作流更改安全检查记录状态")
|
||||
@ApiOperation(value = "工作流更改安全检查记录状态", notes = "工作流更改安全检查记录状态", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/set/status")
|
||||
public Result setRectification(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流更改安全检查记录为整改中:{}", JSON.toJSONString(map));
|
||||
String instanceId = MapUtils.getString(map, "instanceId");
|
||||
xzSecurityQualityInspectionRecordService.update(new LambdaUpdateWrapper<XzSecurityQualityInspectionRecord>()
|
||||
.set(XzSecurityQualityInspectionRecord::getStatus, 3)
|
||||
.set(XzSecurityQualityInspectionRecord::getStatus, MapUtils.getInteger(map,"status"))
|
||||
.eq(XzSecurityQualityInspectionRecord::getInstanceId, instanceId)
|
||||
);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@OperLog(operModul = "安全检查记录", operType = "", operDesc = "工作流更改安全检查记录为合格")
|
||||
@ApiOperation(value = "工作流更改安全检查记录为合格", notes = "工作流更改安全检查记录为合格", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/set/pass")
|
||||
public Result setPass(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流更改安全检查记录为整改中:{}", JSON.toJSONString(map));
|
||||
String instanceId = MapUtils.getString(map, "instanceId");
|
||||
xzSecurityQualityInspectionRecordService.update(new LambdaUpdateWrapper<XzSecurityQualityInspectionRecord>()
|
||||
.set(XzSecurityQualityInspectionRecord::getStatus, 5)
|
||||
.eq(XzSecurityQualityInspectionRecord::getInstanceId, instanceId)
|
||||
);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@OperLog(operModul = "安全检查记录", operType = "", operDesc = "工作流更改安全检查记录为已撤销")
|
||||
@ApiOperation(value = "工作流更改安全检查记录为已撤销", notes = "工作流更改安全检查记录为已撤销", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/set/cancel")
|
||||
public Result setCancel(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流更改安全检查记录为已撤销:{}", JSON.toJSONString(map));
|
||||
String instanceId = MapUtils.getString(map, "instanceId");
|
||||
xzSecurityQualityInspectionRecordService.update(new LambdaUpdateWrapper<XzSecurityQualityInspectionRecord>()
|
||||
.set(XzSecurityQualityInspectionRecord::getStatus, 6)
|
||||
.eq(XzSecurityQualityInspectionRecord::getInstanceId, instanceId)
|
||||
);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@OperLog(operModul = "安全检查记录", operType = "", operDesc = "工作流安全检查记录详情")
|
||||
@ApiOperation(value = "工作流安全检查记录详情", notes = "工作流安全检查记录详情", httpMethod = "GET")
|
||||
@GetMapping("/flow/progress/{instanceId}/{nodeId}")
|
||||
public Result getFlowDetail(@PathVariable String instanceId,
|
||||
@PathVariable(required = false) String nodeId) {
|
||||
String nodeId1 = null;
|
||||
List<HistoricActivityInstance> list = historyService.createHistoricActivityInstanceQuery().processInstanceId(instanceId).list();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
nodeId1 = list.get(list.size() - 1).getActivityId();
|
||||
}
|
||||
return Result.success(processService.getInstanceProgress(nodeId1, instanceId));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "安全检查记录", operType = "", operDesc = "工作流设置责任单位")
|
||||
@ApiOperation(value = "工作流设置责任单位", notes = "工作流设置责任单位", httpMethod = "GET")
|
||||
@GetMapping(value = "/flow/set/enterprise")
|
||||
public Result setEnterprise(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
log.info("工作流设置责任单位:{}", JSON.toJSONString(map));
|
||||
try {
|
||||
String instanceId = MapUtils.getString(map, "instanceId");
|
||||
ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, instanceId);
|
||||
List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
|
||||
ProcessProgressVo.ProgressNode node = progress.get(progress.size() - 1);
|
||||
OrgUser user = node.getUser();
|
||||
SystemUser user1 = systemUserService.getById(user.getId());
|
||||
WorkerInfo info = workerInfoService.getById(user1.getWorkerId());
|
||||
xzSecurityQualityInspectionRecordService.update(new LambdaUpdateWrapper<XzSecurityQualityInspectionRecord>()
|
||||
.set(XzSecurityQualityInspectionRecord::getEnterpriseId, info.getEnterpriseId())
|
||||
.eq(XzSecurityQualityInspectionRecord::getInstanceId, instanceId)
|
||||
);
|
||||
} catch (Exception e) {
|
||||
log.error("工作流设置责任单位:", e);
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
// @OperLog(operModul = "安全检查记录", operType = "", operDesc = "工作流设置责任单位")
|
||||
// @ApiOperation(value = "工作流设置责任单位", notes = "工作流设置责任单位", httpMethod = "GET")
|
||||
// @GetMapping(value = "/flow/set/enterprise")
|
||||
// public Result setEnterprise(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
// log.info("工作流设置责任单位:{}", JSON.toJSONString(map));
|
||||
// try {
|
||||
// String instanceId = MapUtils.getString(map, "instanceId");
|
||||
// ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, instanceId);
|
||||
// List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
|
||||
// ProcessProgressVo.ProgressNode node = progress.get(progress.size() - 1);
|
||||
// OrgUser user = node.getUser();
|
||||
// SystemUser user1 = systemUserService.getById(user.getId());
|
||||
// WorkerInfo info = workerInfoService.getById(user1.getWorkerId());
|
||||
// xzSecurityQualityInspectionRecordService.update(new LambdaUpdateWrapper<XzSecurityQualityInspectionRecord>()
|
||||
// .set(XzSecurityQualityInspectionRecord::getEnterpriseId, info.getEnterpriseId())
|
||||
// .eq(XzSecurityQualityInspectionRecord::getInstanceId, instanceId)
|
||||
// );
|
||||
// } catch (Exception e) {
|
||||
// log.error("工作流设置责任单位:", e);
|
||||
// }
|
||||
// return Result.ok();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -195,6 +195,13 @@
|
||||
and t.status != 6
|
||||
<include refid="whereCondition">
|
||||
</include>
|
||||
<if test="param.instanceIds != null and param.instanceIds != '' and param.instanceIds.size > 0">
|
||||
and t.instance_id in
|
||||
<foreach item="item" index="index" collection="param.instanceIds"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.dangerInfoLevel == '1'.toString() and param.dangerInfoId != null and param.dangerInfoId != ''">
|
||||
and t.danger_type_id = #{param.dangerInfoId}
|
||||
</if>
|
||||
@ -302,6 +309,13 @@
|
||||
left join enterprise_info ei3 on ei3.id = t.construction_contractor_id
|
||||
left join device_unit du on du.id = t.device_unit_id
|
||||
WHERE t.project_sn = #{param.projectSn}
|
||||
<if test="param.instanceIds != null and param.instanceIds != '' and param.instanceIds.size > 0">
|
||||
and t.instance_id in
|
||||
<foreach item="item" index="index" collection="param.instanceIds"
|
||||
open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.dangerInfoLevel == '1'.toString() and param.dangerInfoId != null and param.dangerInfoId != ''">
|
||||
and t.danger_type_id = #{param.dangerInfoId}
|
||||
</if>
|
||||
|
||||
@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gexin.fastjson.JSON;
|
||||
import com.gexin.fastjson.TypeReference;
|
||||
import com.wflow.workflow.bean.process.OrgUser;
|
||||
import com.wflow.workflow.bean.vo.ProcessProgressVo;
|
||||
import com.wflow.workflow.service.ProcessInstanceService;
|
||||
@ -71,7 +70,6 @@ import com.zhgd.xmgl.modules.xz.special.service.CountApiService;
|
||||
import com.zhgd.xmgl.push.config.PushPayloads;
|
||||
import com.zhgd.xmgl.util.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.flowable.engine.HistoryService;
|
||||
@ -140,6 +138,8 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
|
||||
@Autowired
|
||||
RuntimeService runtimeService;
|
||||
@Autowired
|
||||
FlowSeviceUtil flowSeviceUtil;
|
||||
@Autowired
|
||||
private QualityRegionMapper qualityRegionMapper;
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
@ -226,32 +226,36 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
|
||||
// map.put(REGION_ID, idList);
|
||||
// }
|
||||
// }
|
||||
if (Objects.equals(MapUtils.getInteger(map, "isMyTodo"), 1)) {
|
||||
List<String> instanceIds = flowSeviceUtil.getMyTodoInstanceIds("wf66f6451c48b718d0aaf27522",projectSn);
|
||||
map.put("instanceIds", instanceIds);
|
||||
}
|
||||
Page<XzSecurityQualityInspectionRecordVo> page = new Page<>(pageNo, pageSize);
|
||||
List<XzSecurityQualityInspectionRecordVo> list = xzSecurityQualityInspectionRecordMapper.selectQualityInspectionRecordPage(page, map).getRecords();
|
||||
List<EntityMap> enterpriseInfoList = enterpriseInfoService.getEnterpriseInfoList(new MapBuilder<String, Object>().put("projectSn", projectSn).build());
|
||||
for (XzSecurityQualityInspectionRecordVo vo : list) {
|
||||
setProblemDescription(vo);
|
||||
//设置总公司名称(总包单位)
|
||||
String mainEnterpriseName;
|
||||
Optional<EntityMap> optional = enterpriseInfoList.stream().filter(e -> Objects.equals(MapUtils.getLong(e, "id"), vo.getEnterpriseId())).findFirst();
|
||||
if (optional.isPresent()) {
|
||||
EntityMap entityMap = optional.get();
|
||||
String ancestors = MapUtils.getString(entityMap, "ancestors");
|
||||
if (ancestors == null || Objects.equals(ancestors, "0")) {
|
||||
mainEnterpriseName = vo.getEnterpriseName();
|
||||
} else {
|
||||
optional = enterpriseInfoList.stream().filter(e -> MapUtils.getString(e, "projectEnterpriseId").equals(ancestors.split(",")[1])).findFirst();
|
||||
if (optional.isPresent()) {
|
||||
mainEnterpriseName = MapUtils.getString(optional.get(), "enterpriseName");
|
||||
} else {
|
||||
mainEnterpriseName = vo.getEnterpriseName();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mainEnterpriseName = vo.getEnterpriseName();
|
||||
}
|
||||
vo.setMainEnterpriseName(mainEnterpriseName);
|
||||
}
|
||||
// List<EntityMap> enterpriseInfoList = enterpriseInfoService.getEnterpriseInfoList(new MapBuilder<String, Object>().put("projectSn", projectSn).build());
|
||||
// for (XzSecurityQualityInspectionRecordVo vo : list) {
|
||||
// setProblemDescription(vo);
|
||||
// //设置总公司名称(总包单位)
|
||||
// String mainEnterpriseName;
|
||||
// Optional<EntityMap> optional = enterpriseInfoList.stream().filter(e -> Objects.equals(MapUtils.getLong(e, "id"), vo.getEnterpriseId())).findFirst();
|
||||
// if (optional.isPresent()) {
|
||||
// EntityMap entityMap = optional.get();
|
||||
// String ancestors = MapUtils.getString(entityMap, "ancestors");
|
||||
// if (ancestors == null || Objects.equals(ancestors, "0")) {
|
||||
// mainEnterpriseName = vo.getEnterpriseName();
|
||||
// } else {
|
||||
// optional = enterpriseInfoList.stream().filter(e -> MapUtils.getString(e, "projectEnterpriseId").equals(ancestors.split(",")[1])).findFirst();
|
||||
// if (optional.isPresent()) {
|
||||
// mainEnterpriseName = MapUtils.getString(optional.get(), "enterpriseName");
|
||||
// } else {
|
||||
// mainEnterpriseName = vo.getEnterpriseName();
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// mainEnterpriseName = vo.getEnterpriseName();
|
||||
// }
|
||||
// vo.setMainEnterpriseName(mainEnterpriseName);
|
||||
// }
|
||||
page.setRecords(list);
|
||||
XzSecurityQualityInspectionRecordTotalVo total = getXzSecurityQualityInspectionRecordTotalVo(map);
|
||||
data.setPage(page);
|
||||
@ -981,8 +985,6 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
|
||||
WorkerInfo info = workerInfoService.getById(user1.getWorkerId());
|
||||
Long creatorId = FlowUtil.getPullDownLong(formData, "creatorId");
|
||||
Long changeId = FlowUtil.getPullDownLong(formData, "changeId");
|
||||
Long reviewId = FlowUtil.getPullDownLong(formData, "reviewId");
|
||||
Long verifyManId = FlowUtil.getPullDownLong(formData, "verifyManId");
|
||||
Long inspectManId = FlowUtil.getPullDownLong(formData, "field7469574611447");
|
||||
// Long taskId = FlowUtil.getPullDownLong(formData, "taskId");
|
||||
// Long itemId = FlowUtil.getPullDownLong(formData, "itemId");
|
||||
@ -1035,8 +1037,8 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
|
||||
record.setCreateTime(createTime);
|
||||
record.setChangeId(changeId);
|
||||
record.setChangeLimitTime(changeLimitTime);
|
||||
record.setReviewId(reviewId);
|
||||
record.setVerifyManId(verifyManId);
|
||||
// record.setReviewId(reviewId);
|
||||
// record.setVerifyManId(verifyManId);
|
||||
record.setInspectManId(inspectManId);
|
||||
record.setInspectTime(inspectTime);
|
||||
record.setRecordType(recordType);
|
||||
|
||||
@ -3,8 +3,11 @@ package com.zhgd.xmgl.modules.baotou.service;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.CivilizeConstruction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文明施工
|
||||
@ -50,4 +53,7 @@ public interface ICivilizeConstructionService extends IService<CivilizeConstruct
|
||||
*/
|
||||
CivilizeConstruction queryById(String id);
|
||||
|
||||
ProjectInspectRecordCountVo getProjectInspectRecordCount(Map<String, Object> map);
|
||||
|
||||
void addFromFlow(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.QualityProblem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 工程质量问题整改
|
||||
@ -50,4 +55,13 @@ public interface IQualityProblemService extends IService<QualityProblem> {
|
||||
*/
|
||||
QualityProblem queryById(String id);
|
||||
|
||||
List<TrendOneVo> countResponsibleUnit(Map<String, Object> map);
|
||||
|
||||
ProjectInspectRecordCountVo getProjectInspectRecordCount(Map<String, Object> map);
|
||||
|
||||
SectorVo countTechnology(Map<String, Object> map);
|
||||
|
||||
List<TrendOneVo> countDevice(Map<String, Object> map);
|
||||
|
||||
void addFromFlow(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1,37 +1,64 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.CivilizeConstruction;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.CivilizeConstructionMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.ICivilizeConstructionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import com.wflow.workflow.bean.process.OrgUser;
|
||||
import com.wflow.workflow.bean.vo.ProcessProgressVo;
|
||||
import com.wflow.workflow.service.ProcessInstanceService;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.CivilizeConstruction;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.CivilizeConstructionMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.ICivilizeConstructionService;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService;
|
||||
import com.zhgd.xmgl.util.FlowSeviceUtil;
|
||||
import com.zhgd.xmgl.util.FlowUtil;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 文明施工
|
||||
* @author: pds
|
||||
* @date: 2024-10-10
|
||||
* @date: 2024-10-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class CivilizeConstructionServiceImpl extends ServiceImpl<CivilizeConstructionMapper, CivilizeConstruction> implements ICivilizeConstructionService {
|
||||
@Autowired
|
||||
SystemUserServiceImpl systemUserService;
|
||||
@Autowired
|
||||
FlowSeviceUtil flowSeviceUtil;
|
||||
@Autowired
|
||||
private CivilizeConstructionMapper civilizeConstructionMapper;
|
||||
@Autowired
|
||||
private RuntimeService runtimeService;
|
||||
@Autowired
|
||||
private ProcessInstanceService processService;
|
||||
@Autowired
|
||||
private IWorkerInfoService workerInfoService;
|
||||
|
||||
@Override
|
||||
public IPage<CivilizeConstruction> queryPageList(HashMap<String, Object> param) {
|
||||
QueryWrapper<CivilizeConstruction> queryWrapper = this.getQueryWrapper(param);
|
||||
if (Objects.equals(MapUtils.getInteger(param, "isMyTodo"), 1)) {
|
||||
List<String> instanceIds = flowSeviceUtil.getMyTodoInstanceIds("wf670735f73afc947a1a819314", MapUtils.getString(param, "projectSn"));
|
||||
param.put("instanceIds", instanceIds);
|
||||
}
|
||||
Page<CivilizeConstruction> page = PageUtil.getPage(param);
|
||||
IPage<CivilizeConstruction> pageList = baseMapper.queryList(page, queryWrapper,param);
|
||||
IPage<CivilizeConstruction> pageList = baseMapper.queryList(page, queryWrapper, param);
|
||||
pageList.setRecords(this.dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
@ -39,7 +66,7 @@ public class CivilizeConstructionServiceImpl extends ServiceImpl<CivilizeConstru
|
||||
@Override
|
||||
public List<CivilizeConstruction> queryList(HashMap<String, Object> param) {
|
||||
QueryWrapper<CivilizeConstruction> queryWrapper = getQueryWrapper(param);
|
||||
return dealList(baseMapper.queryList(queryWrapper,param));
|
||||
return dealList(baseMapper.queryList(queryWrapper, param));
|
||||
}
|
||||
|
||||
private QueryWrapper<CivilizeConstruction> getQueryWrapper(HashMap<String, Object> param) {
|
||||
@ -61,7 +88,7 @@ public class CivilizeConstructionServiceImpl extends ServiceImpl<CivilizeConstru
|
||||
@Override
|
||||
public void edit(CivilizeConstruction civilizeConstruction) {
|
||||
CivilizeConstruction oldCivilizeConstruction = baseMapper.selectById(civilizeConstruction.getId());
|
||||
if(oldCivilizeConstruction==null) {
|
||||
if (oldCivilizeConstruction == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(civilizeConstruction);
|
||||
@ -70,7 +97,7 @@ public class CivilizeConstructionServiceImpl extends ServiceImpl<CivilizeConstru
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
CivilizeConstruction civilizeConstruction = baseMapper.selectById(id);
|
||||
if(civilizeConstruction==null) {
|
||||
if (civilizeConstruction == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
@ -85,4 +112,55 @@ public class CivilizeConstructionServiceImpl extends ServiceImpl<CivilizeConstru
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectInspectRecordCountVo getProjectInspectRecordCount(Map<String, Object> map) {
|
||||
if (Objects.equals(MapUtils.getInteger(map, "isMyTodo"), 1)) {
|
||||
List<String> instanceIds = flowSeviceUtil.getMyTodoInstanceIds("wf670735f73afc947a1a819314", MapUtils.getString(map, "projectSn"));
|
||||
map.put("instanceIds", instanceIds);
|
||||
}
|
||||
return baseMapper.getProjectInspectRecordCount(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFromFlow(Map<String, Object> map) {
|
||||
String instanceId = FlowUtil.getString(map, "instanceId");
|
||||
ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, instanceId);
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
|
||||
Map<String, Object> formData = instanceProgress.getFormData();
|
||||
List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
|
||||
ProcessProgressVo.ProgressNode node = progress.get(progress.size() - 1);
|
||||
OrgUser user = node.getUser();
|
||||
SystemUser user1 = systemUserService.getById(user.getId());
|
||||
WorkerInfo info = workerInfoService.getById(user1.getWorkerId());
|
||||
String projectSn = processInstance.getTenantId();
|
||||
CivilizeConstruction record = new CivilizeConstruction();
|
||||
record.setContractModel(Objects.equals(FlowUtil.getString(formData, "field8651419052293"), "EPC") ? 1 : 2);
|
||||
record.setDeliveryLevel(FlowUtil.getString(formData, "field5228419077026"));
|
||||
record.setDeviceId(FlowUtil.getPullDownLong(formData, "field7489919113760"));
|
||||
record.setProjectGroupId(FlowUtil.getPullDownLong(formData, "field2151319127628"));
|
||||
record.setSupervisingUnitId(FlowUtil.getPullDownLong(formData, "field4504331403377"));
|
||||
record.setEpcContractorId(FlowUtil.getPullDownLong(formData, "field1376519145760"));
|
||||
record.setConstructionUnitId(FlowUtil.getPullDownLong(formData, "field5172619154162"));
|
||||
record.setResponsibleParty(FlowUtil.getPullDownLong(formData, "field1360931401760"));
|
||||
record.setProblemDescription(FlowUtil.getString(formData, "field8509825700626"));
|
||||
record.setExistingProblemDescription(FlowUtil.getString(formData, "field1874225706143"));
|
||||
record.setCorrectiveRequirement(FlowUtil.getString(formData, "field8953725717681"));
|
||||
record.setLimitedRectificationBegin(FlowUtil.getStartDate(formData, "field9452125789909"));
|
||||
record.setLimitedRectificationEnd(FlowUtil.getEndDate(formData, "field9452125789909"));
|
||||
record.setPicUrl(FlowUtil.getJSONString(formData, "field9414831604043"));
|
||||
record.setFileUrl(FlowUtil.getJSONString(formData, "field7318531606326"));
|
||||
record.setInstanceId(instanceId);
|
||||
record.setProjectSn(projectSn);
|
||||
record.setCreateDate(new Date());
|
||||
record.setUpdateDate(new Date());
|
||||
record.setStatus(2);
|
||||
record.setInspectTime(FlowUtil.getDate(formData, "field4043921981532"));
|
||||
record.setEnterpriseId(Optional.ofNullable(info).map(WorkerInfo::getEnterpriseId).orElse(null));
|
||||
record.setIssuingDepartment(FlowUtil.getPullDownLong(formData, "field6945324853448"));
|
||||
record.setIssuer(FlowUtil.getPullDownLong(formData, "field5112124854702"));
|
||||
record.setIssuingDate(FlowUtil.getDate(formData, "field5909824856685"));
|
||||
record.setInspectManId(Long.valueOf(instanceProgress.getStaterUser().getId()));
|
||||
baseMapper.insert(record);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,37 +1,112 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.QualityProblem;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.QualityProblemMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IQualityProblemService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import com.wflow.workflow.bean.process.OrgUser;
|
||||
import com.wflow.workflow.bean.vo.ProcessProgressVo;
|
||||
import com.wflow.workflow.service.ProcessInstanceService;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.call.SanjiangDataCall;
|
||||
import com.zhgd.xmgl.enums.ParamEnum;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.QualityProblem;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.QualityProblemMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.security.mapper.XzSecurityDangerItemRecordMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IQualityProblemService;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringRecordMapper;
|
||||
import com.zhgd.xmgl.modules.exam.service.IExamTrainService;
|
||||
import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareAlarmRecordMapper;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoAuditRecordMapper;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||
import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressContentMapper;
|
||||
import com.zhgd.xmgl.modules.xz.special.service.CountApiService;
|
||||
import com.zhgd.xmgl.util.FlowSeviceUtil;
|
||||
import com.zhgd.xmgl.util.FlowUtil;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 工程质量问题整改
|
||||
* @author: pds
|
||||
* @date: 2024-10-10
|
||||
* @date: 2024-10-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper, QualityProblem> implements IQualityProblemService {
|
||||
@Autowired
|
||||
SanjiangDataCall sanjiangDataCall;
|
||||
@Autowired
|
||||
XzSecurityDangerItemRecordMapper xzSecurityDangerItemRecordMapper;
|
||||
@Autowired
|
||||
SystemUserMapper systemUserMapper;
|
||||
@Autowired
|
||||
WorkerInfoMapper workerInfoMapper;
|
||||
@Autowired
|
||||
XzDeductScoreRecordMapper xzDeductScoreRecordMapper;
|
||||
@Autowired
|
||||
AiAnalyseHardWareAlarmRecordMapper aiAnalyseHardWareAlarmRecordMapper;
|
||||
@Autowired
|
||||
XzTaskProgressContentMapper xzTaskProgressContentMapper;
|
||||
@Autowired
|
||||
DangerousEngineeringRecordMapper dangerousEngineeringRecordMapper;
|
||||
@Autowired
|
||||
WorkerInfoAuditRecordMapper workerInfoAuditRecordMapper;
|
||||
@Autowired
|
||||
XzSecurityDangerItemRecordMapper dangerItemRecordMapper;
|
||||
@Autowired
|
||||
WorkerInfoServiceImpl workerInfoService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
SystemUserServiceImpl systemUserService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
CountApiService countApiService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
IExamTrainService examTrainService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
IEnterpriseInfoService enterpriseInfoService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
RuntimeService runtimeService;
|
||||
@Autowired
|
||||
FlowSeviceUtil flowSeviceUtil;
|
||||
@Autowired
|
||||
private QualityProblemMapper qualityProblemMapper;
|
||||
@Autowired
|
||||
private ProcessInstanceService processService;
|
||||
|
||||
@Override
|
||||
public IPage<QualityProblem> queryPageList(HashMap<String, Object> param) {
|
||||
QueryWrapper<QualityProblem> queryWrapper = this.getQueryWrapper(param);
|
||||
if (Objects.equals(MapUtils.getInteger(param, "isMyTodo"), 1)) {
|
||||
List<String> instanceIds = flowSeviceUtil.getMyTodoInstanceIds("wf67072b923afc947a1a819313",MapUtils.getString(param,"projectSn"));
|
||||
param.put("instanceIds", instanceIds);
|
||||
}
|
||||
Page<QualityProblem> page = PageUtil.getPage(param);
|
||||
IPage<QualityProblem> pageList = baseMapper.queryList(page, queryWrapper,param);
|
||||
IPage<QualityProblem> pageList = baseMapper.queryList(page, queryWrapper, param);
|
||||
pageList.setRecords(this.dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
@ -39,7 +114,7 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
@Override
|
||||
public List<QualityProblem> queryList(HashMap<String, Object> param) {
|
||||
QueryWrapper<QualityProblem> queryWrapper = getQueryWrapper(param);
|
||||
return dealList(baseMapper.queryList(queryWrapper,param));
|
||||
return dealList(baseMapper.queryList(queryWrapper, param));
|
||||
}
|
||||
|
||||
private QueryWrapper<QualityProblem> getQueryWrapper(HashMap<String, Object> param) {
|
||||
@ -61,7 +136,7 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
@Override
|
||||
public void edit(QualityProblem qualityProblem) {
|
||||
QualityProblem oldQualityProblem = baseMapper.selectById(qualityProblem.getId());
|
||||
if(oldQualityProblem==null) {
|
||||
if (oldQualityProblem == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(qualityProblem);
|
||||
@ -70,7 +145,7 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
QualityProblem qualityProblem = baseMapper.selectById(id);
|
||||
if(qualityProblem==null) {
|
||||
if (qualityProblem == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
@ -85,4 +160,92 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrendOneVo> countResponsibleUnit(Map<String, Object> map) {
|
||||
return baseMapper.countResponsibleUnit(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectInspectRecordCountVo getProjectInspectRecordCount(Map<String, Object> map) {
|
||||
if (Objects.equals(MapUtils.getInteger(map, "isMyTodo"), 1)) {
|
||||
List<String> instanceIds = flowSeviceUtil.getMyTodoInstanceIds("wf67072b923afc947a1a819313", MapUtils.getString(map, "projectSn"));
|
||||
map.put("instanceIds", instanceIds);
|
||||
}
|
||||
return baseMapper.getProjectInspectRecordCount(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectorVo countTechnology(Map<String, Object> map) {
|
||||
List<SectorOneVo> vos = baseMapper.countTechnology(map);
|
||||
return SectorVo.getSectorVoByEnum(vos, ParamEnum.QualityProblemTechnologyEnum.values(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrendOneVo> countDevice(Map<String, Object> map) {
|
||||
return baseMapper.countDevice(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFromFlow(Map<String, Object> map) {
|
||||
String instanceId = FlowUtil.getString(map, "instanceId");
|
||||
ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, instanceId);
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
|
||||
Map<String, Object> formData = instanceProgress.getFormData();
|
||||
List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
|
||||
ProcessProgressVo.ProgressNode node = progress.get(progress.size() - 1);
|
||||
OrgUser user = node.getUser();
|
||||
String projectSn = processInstance.getTenantId();
|
||||
Long deviceId = FlowUtil.getPullDownLong(formData, "field4601922872642");
|
||||
Long projectGroupId = FlowUtil.getPullDownLong(formData, "field2588022909627");
|
||||
Long supervisingUnitId = FlowUtil.getPullDownLong(formData, "field2766022923159");
|
||||
Long epcContractorId = FlowUtil.getPullDownLong(formData, "field7950122917092");
|
||||
Long constructionUnitId = FlowUtil.getPullDownLong(formData, "field6697922951246");
|
||||
Long designEnterpriseId = FlowUtil.getPullDownLong(formData, "field2312622927393");
|
||||
Long department = FlowUtil.getPullDownLong(formData, "field3918219183947");
|
||||
Long constructionId = FlowUtil.getPullDownLong(formData, "field7684031361545");
|
||||
Long issuingDepartment = FlowUtil.getPullDownLong(formData, "field4422917358561");
|
||||
Long issuer = FlowUtil.getPullDownLong(formData, "field8051417365627");
|
||||
Long copy = FlowUtil.getPullDownLong(formData, "field3329317399411");
|
||||
Long compiler = FlowUtil.getPullDownLong(formData, "field6351717408729");
|
||||
SystemUser user1 = systemUserService.getById(user.getId());
|
||||
WorkerInfo info = workerInfoService.getById(user1.getWorkerId());
|
||||
String qualityStatement = FlowUtil.getString(formData, "field8130923005511");
|
||||
String qualityRequire = FlowUtil.getString(formData, "field9251523012459");
|
||||
String picUrl = FlowUtil.getJSONString(formData, "field6081631595560");
|
||||
String fileUrl = FlowUtil.getJSONString(formData, "field9809831597710");
|
||||
String deliveryLevel = FlowUtil.getString(formData, "field1119531519328");
|
||||
Integer technology = FlowUtil.getPullDownInteger(formData, "field5714131333262");
|
||||
Date inspectTime = FlowUtil.getDate(formData, "field7006700270795");
|
||||
Date changeLimitTime = FlowUtil.getDate(formData, "field1956800274157");
|
||||
QualityProblem record = new QualityProblem();
|
||||
record.setContractModel(Objects.equals(FlowUtil.getString(formData, "field1145031520759"), "EPC") ? 1 : 2);
|
||||
record.setDeliveryLevel(deliveryLevel);
|
||||
record.setDeviceId(deviceId);
|
||||
record.setProjectGroupId(projectGroupId);
|
||||
record.setSupervisingUnitId(supervisingUnitId);
|
||||
record.setEpcContractorId(epcContractorId);
|
||||
record.setConstructionUnitId(constructionUnitId);
|
||||
record.setDesignEnterpriseId(designEnterpriseId);
|
||||
record.setDepartment(department);
|
||||
record.setTechnology(technology);
|
||||
record.setConstructionId(constructionId);
|
||||
record.setQualityStatement(qualityStatement);
|
||||
record.setQualityRequire(qualityRequire);
|
||||
record.setPicUrl(picUrl);
|
||||
record.setFileUrl(fileUrl);
|
||||
record.setInstanceId(instanceId);
|
||||
record.setProjectSn(projectSn);
|
||||
record.setCreateDate(new Date());
|
||||
record.setUpdateDate(new Date());
|
||||
record.setIssuingDepartment(issuingDepartment);
|
||||
record.setIssuer(issuer);
|
||||
record.setIssuingDate(FlowUtil.getDate(formData, "field2461217378795"));
|
||||
record.setCopy(copy);
|
||||
record.setCompiler(compiler);
|
||||
record.setStatus(2);
|
||||
record.setInspectTime(inspectTime);
|
||||
record.setChangeLimitTime(changeLimitTime);
|
||||
record.setEnterpriseId(Optional.ofNullable(info).map(WorkerInfo::getEnterpriseId).orElse(null));
|
||||
baseMapper.insert(record);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,6 +27,8 @@ public interface IDictionaryItemService extends IService<DictionaryItem> {
|
||||
*/
|
||||
DictionaryItem getDict(String dictionaryEncoding, String data, String projectSn);
|
||||
|
||||
DictionaryItem getDictByRemark(String dictionaryEncoding, String remarks, String projectSn);
|
||||
|
||||
/**
|
||||
* 添加基础字典信息
|
||||
* @param dictionaryItem
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -69,6 +68,21 @@ public class DictionaryItemServiceImpl extends ServiceImpl<DictionaryItemMapper,
|
||||
return map.get(dictionaryEncoding);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public DictionaryItem getDictByRemark(String dictionaryEncoding, String remarks, String projectSn) {
|
||||
String newCode = dictionaryEncoding + "_" + projectSn;
|
||||
LambdaQueryWrapper<DictionaryItem> queryWrapper = new LambdaQueryWrapper<DictionaryItem>()
|
||||
.and(w -> w.eq(DictionaryItem::getDictionaryEncoding, dictionaryEncoding).or().eq(DictionaryItem::getDictionaryEncoding, newCode))
|
||||
.eq(DictionaryItem::getIsEnable, 1)
|
||||
.eq(DictionaryItem::getRemarks, remarks);
|
||||
List<DictionaryItem> dictionaryItems = dictionaryItemMapper.selectList(queryWrapper);
|
||||
Map<String, DictionaryItem> map = dictionaryItems.stream().collect(Collectors.toMap(DictionaryItem::getDictionaryEncoding, dictionaryItem -> dictionaryItem, (o1, o2) -> o1));
|
||||
if (map.containsKey(newCode)) {
|
||||
return map.get(newCode);
|
||||
} else {
|
||||
return map.get(dictionaryEncoding);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(DictionaryItem dictionaryItem) {
|
||||
|
||||
@ -41,4 +41,6 @@ public class ProjectInspectRecordCountVo {
|
||||
private Integer otherInspectNum;
|
||||
@ApiModelProperty(value = "重大隐患数量")
|
||||
private Integer greatFaultLevelNum;
|
||||
@ApiModelProperty("整改中数量")
|
||||
private Integer rectificatingNum;
|
||||
}
|
||||
|
||||
@ -0,0 +1,121 @@
|
||||
package com.zhgd.xmgl.modules.video.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.async.AsyncAiAnalyse;
|
||||
import com.zhgd.xmgl.constant.Cts;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionaryItem;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.impl.DictionaryItemServiceImpl;
|
||||
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareAlarmRecord;
|
||||
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareRecord;
|
||||
import com.zhgd.xmgl.modules.video.entity.VideoItem;
|
||||
import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareAlarmRecordMapper;
|
||||
import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareRecordMapper;
|
||||
import com.zhgd.xmgl.modules.video.service.IVideoItemService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import com.zhgd.xmgl.util.PathUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 华安泰
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/hat")
|
||||
public class HatAlarmServerController {
|
||||
@Lazy
|
||||
@Autowired
|
||||
AiAnalyseHardWareAlarmRecordMapper aiAnalyseHardWareAlarmRecordMapper;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AiAnalyseHardWareRecordMapper aiAnalyseHardWareRecordMapper;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AsyncAiAnalyse asyncAiAnalyse;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private DictionaryItemServiceImpl dictionaryItemService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IVideoItemService videoItemService;
|
||||
|
||||
/**
|
||||
* http报警上报用例
|
||||
* 设备根据用例url配置http报警服务器后,demo作为http服务器可以接收设备推送的报警数据
|
||||
*
|
||||
* @param deviceSn 设备sn
|
||||
* @param alarmInfo 报警消息
|
||||
* @param pics 报警图片
|
||||
*/
|
||||
@PostMapping("/httpAlarmServer")
|
||||
public Result httpAlarmServer(@RequestParam("sn") String deviceSn, @RequestParam("alarm_info") JSONObject alarmInfo, @RequestPart(value = "picture", required = false) MultipartFile[] pics) throws IOException {
|
||||
log.info("华安泰获取ai报警数据 receive alarm from {}, alarm_info: {}", deviceSn, alarmInfo);
|
||||
FileOutputStream fos = null;
|
||||
if (pics == null) {
|
||||
return Result.error("报警图片是空的");
|
||||
}
|
||||
QueryWrapper<AiAnalyseHardWareRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(AiAnalyseHardWareRecord::getHardwareId, deviceSn);
|
||||
AiAnalyseHardWareRecord dev = aiAnalyseHardWareRecordMapper.selectOne(queryWrapper);
|
||||
if (dev == null) {
|
||||
throw new OpenAlertException(MessageUtil.get("EquipmentNumIncorrectErr"));
|
||||
}
|
||||
JSONObject additional = alarmInfo.getJSONObject("additional");
|
||||
AiAnalyseHardWareAlarmRecord aiAnalyseHardWareAlarmRecord = new AiAnalyseHardWareAlarmRecord();
|
||||
aiAnalyseHardWareAlarmRecord.setCreateTime(DateUtil.formatDateTime(new Date(additional.getLong("alarm_time"))));
|
||||
DictionaryItem dict = dictionaryItemService.getDictByRemark("ai_analyse_hard_ware_alarm_record_type", additional.getString("alarm_minor"), dev.getProjectSn());
|
||||
aiAnalyseHardWareAlarmRecord.setAlarmType(Optional.ofNullable(dict).map(m -> Integer.valueOf(m.getData())).orElse(null));
|
||||
aiAnalyseHardWareAlarmRecord.setHardwareId(dev.getHardwareId());
|
||||
aiAnalyseHardWareAlarmRecord.setHardwareName(dev.getHardwareName());
|
||||
List<VideoItem> videoItems = videoItemService.list(new LambdaQueryWrapper<VideoItem>()
|
||||
.eq(VideoItem::getHatAiVideoId, additional.getInt("stream_id"))
|
||||
.eq(VideoItem::getAiHardwareId, deviceSn)
|
||||
.last(Cts.IGNORE_DATA_SCOPE_CONDITION)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(videoItems)) {
|
||||
aiAnalyseHardWareAlarmRecord.setLocation(videoItems.get(0).getVideoName());
|
||||
aiAnalyseHardWareAlarmRecord.setAlarmDesc(videoItems.get(0).getVideoName());
|
||||
}
|
||||
aiAnalyseHardWareAlarmRecord.setProjectSn(dev.getProjectSn());
|
||||
aiAnalyseHardWareAlarmRecord.setStatus(1);
|
||||
byte[] data = pics[1].getBytes();
|
||||
String uuid = alarmInfo.getJSONObject("global_info").getString("data_uuid");
|
||||
String fileName = uuid.replace(':', '_');
|
||||
File dir = new File(PathUtil.getBasePath(), "/hat_ai_http_alarm");
|
||||
dir.mkdir();
|
||||
String name = "/" + fileName + "_" + 1 + ".jpg";
|
||||
try {
|
||||
fos = new FileOutputStream(dir + name, false);
|
||||
fos.write(data);
|
||||
aiAnalyseHardWareAlarmRecord.setImageUrl("hat_ai_http_alarm" + name);
|
||||
|
||||
aiAnalyseHardWareAlarmRecordMapper.insert(aiAnalyseHardWareAlarmRecord);
|
||||
//将数据通过MQTT转发到前台
|
||||
asyncAiAnalyse.sendAiAnalyse(aiAnalyseHardWareAlarmRecord, Cts.PROJECT_LEVEL);
|
||||
} catch (Exception e) {
|
||||
log.error("华安泰获取ai报警错误", e);
|
||||
} finally {
|
||||
if (fos != null) {
|
||||
fos.close();
|
||||
}
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
@ -144,6 +144,16 @@ public class VideoItem implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "企业id(多个,分割)")
|
||||
private String enterpriseIds;
|
||||
/**
|
||||
* 华安泰的ai盒子的摄像头的设备id
|
||||
*/
|
||||
@ApiModelProperty(value = "华安泰的ai盒子的摄像头的设备id")
|
||||
private String hatAiVideoId;
|
||||
/**
|
||||
* AI分析硬件设备id
|
||||
*/
|
||||
@ApiModelProperty(value = "AI分析硬件设备id")
|
||||
private String aiHardwareId;
|
||||
|
||||
/**
|
||||
* 项目sn
|
||||
|
||||
@ -81,11 +81,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
http.authorizeRequests()
|
||||
//请求路径允许访问
|
||||
.antMatchers("/xmgl/hat/httpAlarmServer").permitAll()
|
||||
.antMatchers("/xmgl/xzSecurityQualityInspectionRecord/flow/set/cancel").permitAll()
|
||||
.antMatchers("/xmgl/xzSecurityQualityInspectionRecord/flow/set/enterprise").permitAll()
|
||||
.antMatchers("/xmgl/xzSecurityQualityInspectionRecord/flow/set/pass").permitAll()
|
||||
.antMatchers("/xmgl/xzSecurityQualityInspectionRecord/flow/set/re").permitAll()
|
||||
.antMatchers("/xmgl/xzSecurityQualityInspectionRecord/flow/add").permitAll()
|
||||
.antMatchers("/xmgl/civilizeConstruction/flow/**").permitAll()
|
||||
.antMatchers("/xmgl/qualityProblem/flow/**").permitAll()
|
||||
.antMatchers("/xmgl/xzSecurityQualityInspectionRecord/flow/**").permitAll()
|
||||
.antMatchers("/xmgl/projectSupervisionMonthlyReport/flow/add").permitAll()
|
||||
.antMatchers("/xmgl/mainProjectCompleteDetail/flow/add").permitAll()
|
||||
.antMatchers("/xmgl/workerAdmission/checkParam").permitAll()
|
||||
|
||||
65
src/main/java/com/zhgd/xmgl/util/FlowSeviceUtil.java
Normal file
65
src/main/java/com/zhgd/xmgl/util/FlowSeviceUtil.java
Normal file
@ -0,0 +1,65 @@
|
||||
package com.zhgd.xmgl.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wflow.workflow.bean.vo.ProcessTaskVo;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.tenant.TenantContextHolder;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.runtime.ProcessInstanceQuery;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.flowable.task.api.TaskQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class FlowSeviceUtil {
|
||||
@Lazy
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
/**
|
||||
* 获取我的待办的instanceIdList
|
||||
*
|
||||
* @param code 表单id,安全检查:wf66f6451c48b718d0aaf27522
|
||||
* @return
|
||||
*/
|
||||
public List<String> getMyTodoInstanceIds(String code,String projectSn) {
|
||||
if (SecurityUtils.getUser() == null) {
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add("-1");
|
||||
return list;
|
||||
}
|
||||
String userId = String.valueOf(SecurityUtils.getUser().getUserId());
|
||||
TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
if (StrUtil.isNotBlank(code)) {
|
||||
taskQuery.processDefinitionKey(code);
|
||||
}
|
||||
ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();
|
||||
Set<String> stringSet = processInstanceQuery.list().stream().map(p -> p.getProcessInstanceId()).collect(Collectors.toSet());
|
||||
taskQuery.active().taskTenantId(projectSn)
|
||||
.processInstanceIdIn(stringSet)
|
||||
.taskCandidateOrAssigned(userId)
|
||||
.orderByTaskCreateTime().desc();
|
||||
Page<ProcessTaskVo> page = new Page<>();
|
||||
List<Task> taskList = new ArrayList<>();
|
||||
taskList = taskQuery.list();
|
||||
List<String> list = taskList.stream().map(o -> o.getProcessInstanceId()).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
list.add("-1");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -56,7 +56,18 @@ public class FlowUtil {
|
||||
* @return
|
||||
*/
|
||||
public static Long getPullDownLong(Map map, String key) {
|
||||
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : Convert.toLong(((List) o).get(0))).orElse(null);
|
||||
return Optional.ofNullable(map.get(key)).map(o -> {
|
||||
if ("".equals(o)) {
|
||||
return null;
|
||||
} else {
|
||||
Object value = ((List) o).get(0);
|
||||
if (value instanceof Map) {
|
||||
return MapUtils.getLong(((Map) value), "id");
|
||||
} else {
|
||||
return Convert.toLong(value);
|
||||
}
|
||||
}
|
||||
}).orElse(null);
|
||||
}
|
||||
|
||||
public static String getPullDownManyStr(Map map, String key) {
|
||||
|
||||
@ -113,13 +113,34 @@
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<appender name="flow-all" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${log.path}/zhgd-flow-all.log</file>
|
||||
<!--日志文件输出格式-->
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{requestId}] [%thread] %highlight(%-5level) %method:%L %cyan(%logger{50}) - %highlight(%msg) %n</pattern>
|
||||
<charset>UTF-8</charset> <!-- 设置字符集 -->
|
||||
</encoder>
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志归档 -->
|
||||
<fileNamePattern>${log.path}/all/flow-all-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>8</maxHistory>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<!-- 日志输出级别 -->
|
||||
<logger name="com.zhgd" level="info"/>
|
||||
<logger name="com.zhgd.mybatis.DataScopeInterceptor" level="debug"/>
|
||||
<logger name="java.sql.Connection" level="info"/>
|
||||
<logger name="java.sql.Statement" level="info"/>
|
||||
<logger name="java.sql.PreparedStatement" level="info"/>
|
||||
<logger name="com.wflow" level="info" additivity="true">
|
||||
<appender-ref ref="flow-all"/>
|
||||
</logger>
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
<appender-ref ref="debug"/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user