包头1022
This commit is contained in:
parent
c67cb5889f
commit
f3578220ff
@ -1,16 +1,17 @@
|
||||
package com.zhgd.xmgl.modules.baotou.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.metadata.IPage;
|
||||
import com.wflow.workflow.service.ProcessTaskService;
|
||||
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.DeviceMasterScheduleDetail;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.DeviceMasterScheduleYear;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.DeviceUnit;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ProjectScheduleDeviceUnit;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.*;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.vo.CountConstructionStateVo;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.vo.CountFlowVO;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.vo.RankEnterpriseVo;
|
||||
import com.zhgd.xmgl.modules.baotou.security.service.IXzSecurityQualityInspectionRecordService;
|
||||
import com.zhgd.xmgl.modules.baotou.service.*;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
|
||||
@ -21,16 +22,18 @@ import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringRecordService;
|
||||
import com.zhgd.xmgl.modules.environment.service.IAirQualityAnalysisService;
|
||||
import com.zhgd.xmgl.modules.video.service.IVideoItemService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.PersonTypeAndEduStatisticsVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.FlowSeviceUtil;
|
||||
import com.zhgd.xmgl.util.MapUtil;
|
||||
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.apache.commons.collections.MapUtils;
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -38,10 +41,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/homePage")
|
||||
@ -55,6 +55,8 @@ public class HomePageController {
|
||||
@Lazy
|
||||
IPipelineWeldingRecordService pipelineWeldingRecordService;
|
||||
@Autowired
|
||||
FlowSeviceUtil flowSeviceUtil;
|
||||
@Autowired
|
||||
private IContractorAssessmentService contractorAssessmentService;
|
||||
@Autowired
|
||||
private IAirQualityAnalysisService airQualityAnalysisService;
|
||||
@ -88,6 +90,8 @@ public class HomePageController {
|
||||
private IBaseModuleService baseModuleService;
|
||||
@Autowired
|
||||
private IUserModuleService userModuleService;
|
||||
@Autowired
|
||||
private ProcessTaskService taskService;
|
||||
|
||||
@ApiOperation(value = "查询天气", notes = "查询天气", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ -139,6 +143,7 @@ public class HomePageController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "常用功能列表查询账号常用模块信息", notes = "常用功能列表查询账号常用模块信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = false, dataType = "String")
|
||||
@GetMapping(value = "/queryUserModuleList")
|
||||
public Result<List<BaseModule>> queryUserModuleList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(baseModuleService.queryUserModuleList(param));
|
||||
@ -157,7 +162,7 @@ public class HomePageController {
|
||||
|
||||
@ApiOperation(value = "常用功能保存账号常用模块信息", notes = "常用功能保存账号常用模块信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/saveUserModules")
|
||||
public Result saveUserModules(@RequestBody @Validate List<Long> moduleIdList) {
|
||||
public Result saveUserModules(@RequestBody @ApiIgnore List<Long> moduleIdList) {
|
||||
userModuleService.saveUserModules(moduleIdList);
|
||||
return Result.ok();
|
||||
}
|
||||
@ -198,6 +203,15 @@ public class HomePageController {
|
||||
@ApiOperation(value = "进度预览列表查询各装置主进度计划详情信息", notes = "进度预览列表查询各装置主进度计划详情信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/queryScheduleDetailList")
|
||||
public Result<List<DeviceMasterScheduleDetail>> queryDeviceMasterScheduleDetailList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
List<ProjectScheduleDeviceUnit> unitList = projectScheduleDeviceUnitService.list(new LambdaQueryWrapper<ProjectScheduleDeviceUnit>()
|
||||
.eq(ProjectScheduleDeviceUnit::getDeviceUnitName, "全部装置"));
|
||||
Long deviceUnitId;
|
||||
if (CollUtil.isNotEmpty(unitList)) {
|
||||
deviceUnitId = unitList.get(0).getId();
|
||||
} else {
|
||||
deviceUnitId = -1L;
|
||||
}
|
||||
param.put("deviceUnitId", deviceUnitId);
|
||||
return Result.success(deviceMasterScheduleDetailService.queryList(param));
|
||||
}
|
||||
|
||||
@ -213,9 +227,16 @@ public class HomePageController {
|
||||
// @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"),
|
||||
@ApiImplicitParam(name = "queryType", value = "1近7天,2近30天,3指定开始结束时间", paramType = "body", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/countSafe")
|
||||
public Result<ProjectInspectRecordCountVo> getProjectInspectRecordCount(@RequestBody Map<String, Object> map) {
|
||||
String queryType = MapUtils.getString(map, "queryType");
|
||||
if (Objects.equals("1",queryType)) {
|
||||
map.put("inspectStartTime", DateUtil.formatDateTime(DateUtil.offsetDay(new Date(), -7)));
|
||||
} else if (Objects.equals("2", queryType)) {
|
||||
map.put("inspectStartTime", DateUtil.formatDateTime(DateUtil.offsetDay(new Date(), -30)));
|
||||
}
|
||||
return Result.success(xzSecurityQualityInspectionRecordService.getProjectInspectRecordCount(map));
|
||||
}
|
||||
|
||||
@ -234,6 +255,9 @@ public class HomePageController {
|
||||
@ApiOperation(value = "安全管理EPC责任单位统计", notes = "安全管理EPC责任单位统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "queryType", 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 = "/countSafeResponsibleUnit")
|
||||
public Result<List<TrendOneVo>> countResponsibleUnit(@RequestBody Map<String, Object> map) {
|
||||
@ -243,6 +267,9 @@ public class HomePageController {
|
||||
@ApiOperation(value = "质量管理EPC责任单位分析", notes = "质量管理EPC责任单位分析", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "queryType", 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 = "/countQualityResponsibleUnit")
|
||||
public Result<List<TrendOneVo>> countQualityResponsibleUnit(@RequestBody Map<String, Object> map) {
|
||||
@ -261,9 +288,16 @@ public class HomePageController {
|
||||
// @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"),
|
||||
@ApiImplicitParam(name = "queryType", value = "1近7天,2近30天,3指定开始结束时间", paramType = "body", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/countQuality")
|
||||
public Result<ProjectInspectRecordCountVo> countQuality(@RequestBody Map<String, Object> map) {
|
||||
String queryType = MapUtils.getString(map, "queryType");
|
||||
if (Objects.equals("1",queryType)) {
|
||||
map.put("inspectStartTime", DateUtil.formatDateTime(DateUtil.offsetDay(new Date(), -7)));
|
||||
} else if (Objects.equals("2", queryType)) {
|
||||
map.put("inspectStartTime", DateUtil.formatDateTime(DateUtil.offsetDay(new Date(), -30)));
|
||||
}
|
||||
return Result.success(problemService.getProjectInspectRecordCount(map));
|
||||
}
|
||||
|
||||
@ -285,7 +319,7 @@ public class HomePageController {
|
||||
@ApiImplicitParam(name = "type", value = "1本月,2上月", paramType = "body", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/rankEnterprise")
|
||||
public Result<List<EnterpriseInfo>> rankEnterprise(@RequestBody Map<String, Object> map) {
|
||||
public Result<RankEnterpriseVo> rankEnterprise(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(contractorAssessmentDetailService.rankEnterprise(map));
|
||||
}
|
||||
|
||||
@ -294,7 +328,7 @@ public class HomePageController {
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/rankWeldingPassRate")
|
||||
public Result<List<DeviceUnit>> rankWeldingPassRate(@RequestBody Map<String, Object> map) {
|
||||
public Result<List<PipelineWelder>> rankWeldingPassRate(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(pipelineWeldingRecordService.rankWeldingPassRate(map));
|
||||
}
|
||||
|
||||
@ -321,5 +355,28 @@ public class HomePageController {
|
||||
return Result.success(workerInfoService.selectProjectComapnyWorkTotalList(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "待办事项查询待办事项列表", notes = "待办事项查询待办事项列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "param", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "param", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "TenantId", value = "项目sn", paramType = "header", required = true, dataType = "String"),
|
||||
})
|
||||
@GetMapping("/flow/todoList")
|
||||
public Result getUserTodoList(@RequestParam(defaultValue = "20") Integer pageSize,
|
||||
@RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(required = false) String code,
|
||||
@RequestParam(required = false) String[] startTimes,
|
||||
@RequestParam(required = false) String startUser,
|
||||
@RequestParam(required = false) String key) {
|
||||
return Result.success(taskService.getUserTodoList(pageSize, pageNo, code, startTimes, startUser, key));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "待办事项统计", notes = "待办事项统计")
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "param", required = true, dataType = "String")
|
||||
@GetMapping("/flow/count")
|
||||
public Result<CountFlowVO> countFlow(@ApiIgnore @RequestParam Map<String, Object> map) {
|
||||
return Result.success(flowSeviceUtil.countFlow(map));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -65,4 +65,8 @@ public class ContractorAssessmentDetail implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value="单位名称")
|
||||
private java.lang.String enterpriseName ;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "1:监理单位考核;2:EPC承包商考核;3:施工单位考核;")
|
||||
private java.lang.Integer type;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.zhgd.xmgl.modules.baotou.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CountFlowVO {
|
||||
private Integer total;
|
||||
private Integer quality;
|
||||
private Integer safe;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.zhgd.xmgl.modules.baotou.entity.vo;
|
||||
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ContractorAssessmentDetail;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RankEnterpriseVo {
|
||||
private ContractorAssessmentDetail epc;
|
||||
private ContractorAssessmentDetail supervisor;
|
||||
private ContractorAssessmentDetail construction;
|
||||
}
|
||||
@ -51,5 +51,5 @@ public interface ContractorAssessmentDetailMapper extends BaseMapper<ContractorA
|
||||
*/
|
||||
ContractorAssessmentDetail queryById(String id);
|
||||
|
||||
List<EnterpriseInfo> rankEnterprise(Map<String, Object> map);
|
||||
List<ContractorAssessmentDetail> rankEnterprise(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ 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.baotou.entity.DeviceUnit;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PipelineWelder;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PipelineWeldingRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -49,5 +50,5 @@ public interface PipelineWeldingRecordMapper extends BaseMapper<PipelineWeldingR
|
||||
*/
|
||||
PipelineWeldingRecord queryById(String id);
|
||||
|
||||
List<DeviceUnit> rankWeldingPassRate(Map<String, Object> map);
|
||||
List<PipelineWelder> rankWeldingPassRate(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -21,11 +21,12 @@
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="rankEnterprise" resultType="com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo">
|
||||
select distinct ei1.*
|
||||
<select id="rankEnterprise" resultType="com.zhgd.xmgl.modules.baotou.entity.ContractorAssessmentDetail">
|
||||
select t.*,ei1.enterprise_name,ca.type
|
||||
from contractor_assessment_detail t
|
||||
join (select max(t.id) as id,ca.type
|
||||
from contractor_assessment_detail t
|
||||
join contractor_assessment ca on ca.id=t.assessment_id
|
||||
join enterprise_info ei1 on ei1.id=t.enterprise_id
|
||||
where t.project_sn = #{projectSn}
|
||||
<if test="type == '1'.toString() ">
|
||||
and ca.`year_month` = DATE_FORMAT(now(), '%Y-%m')
|
||||
@ -33,6 +34,9 @@
|
||||
<if test="type == '2'.toString() ">
|
||||
and ca.`year_month` = DATE_FORMAT(DATE_SUB(now(), interval 1 month), '%Y-%m')
|
||||
</if>
|
||||
order by t.score desc
|
||||
group by ca.type
|
||||
)t1 on t.id=t1.id
|
||||
join contractor_assessment ca on ca.id=t.assessment_id
|
||||
join enterprise_info ei1 on ei1.id=t.enterprise_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="rankWeldingPassRate" resultType="com.zhgd.xmgl.modules.baotou.entity.DeviceUnit">
|
||||
<select id="rankWeldingPassRate" resultType="com.zhgd.xmgl.modules.baotou.entity.PipelineWelder">
|
||||
select
|
||||
ifnull(round(ifnull(sum(if(t.testing_qualified=1,1,0)),0)/count(*)*100,2),0) as welding_pass_rate,
|
||||
du.device_unit_name
|
||||
|
||||
@ -78,6 +78,20 @@
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and r.project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="queryType == '1'.toString()">
|
||||
and r.inspect_time >= date_sub(current_date, interval 7 day)
|
||||
</if>
|
||||
<if test="queryType == '2'.toString()">
|
||||
and r.inspect_time >= date_sub(current_date, interval 30 day)
|
||||
</if>
|
||||
<if test="queryType == '3'.toString() and inspectTime_begin != null and inspectTime_begin != ''">
|
||||
and r.inspect_time >= #{inspectTime_begin}
|
||||
</if>
|
||||
<if test="queryType == '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.epc_contractor_id
|
||||
order by y desc
|
||||
</select>
|
||||
|
||||
@ -1081,6 +1081,20 @@
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and r.project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="queryType == '1'.toString()">
|
||||
and r.inspect_time >= date_sub(current_date, interval 7 day)
|
||||
</if>
|
||||
<if test="queryType == '2'.toString()">
|
||||
and r.inspect_time >= date_sub(current_date, interval 30 day)
|
||||
</if>
|
||||
<if test="queryType == '3'.toString() and inspectTime_begin != null and inspectTime_begin != ''">
|
||||
and r.inspect_time >= #{inspectTime_begin}
|
||||
</if>
|
||||
<if test="queryType == '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.epc_contractor_id
|
||||
order by y desc
|
||||
</select>
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.baotou.service;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ContractorAssessmentDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.vo.RankEnterpriseVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
@ -53,5 +54,5 @@ public interface IContractorAssessmentDetailService extends IService<ContractorA
|
||||
*/
|
||||
ContractorAssessmentDetail queryById(String id);
|
||||
|
||||
List<EnterpriseInfo> rankEnterprise(Map<String, Object> map);
|
||||
RankEnterpriseVo rankEnterprise(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.baotou.entity.DeviceUnit;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PipelineWelder;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PipelineWeldingRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -52,5 +53,5 @@ public interface IPipelineWeldingRecordService extends IService<PipelineWeldingR
|
||||
*/
|
||||
PipelineWeldingRecord queryById(String id);
|
||||
|
||||
List<DeviceUnit> rankWeldingPassRate(Map<String, Object> map);
|
||||
List<PipelineWelder> rankWeldingPassRate(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1,44 +1,42 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ContractorAssessmentDetail;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.ContractorAssessmentDetailMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IContractorAssessmentDetailService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.util.MapUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
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 com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ContractorAssessmentDetail;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.vo.RankEnterpriseVo;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.ContractorAssessmentDetailMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IContractorAssessmentDetailService;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description: 承包商考核详情
|
||||
* @author: pds
|
||||
* @date: 2024-10-16
|
||||
* @date: 2024-10-16
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ContractorAssessmentDetailServiceImpl extends ServiceImpl<ContractorAssessmentDetailMapper, ContractorAssessmentDetail> implements IContractorAssessmentDetailService {
|
||||
@Autowired
|
||||
private ContractorAssessmentDetailMapper contractorAssessmentDetailMapper;
|
||||
|
||||
@Override
|
||||
public IPage<ContractorAssessmentDetail> queryPageList(HashMap<String, Object> param) {
|
||||
QueryWrapper<ContractorAssessmentDetail> queryWrapper = this.getQueryWrapper(param);
|
||||
Page<ContractorAssessmentDetail> page = PageUtil.getPage(param);
|
||||
IPage<ContractorAssessmentDetail> pageList = baseMapper.queryList(page, queryWrapper,param);
|
||||
IPage<ContractorAssessmentDetail> pageList = baseMapper.queryList(page, queryWrapper, param);
|
||||
pageList.setRecords(this.dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
@ -46,12 +44,12 @@ public class ContractorAssessmentDetailServiceImpl extends ServiceImpl<Contracto
|
||||
@Override
|
||||
public List<ContractorAssessmentDetail> queryList(HashMap<String, Object> param) {
|
||||
QueryWrapper<ContractorAssessmentDetail> queryWrapper = getQueryWrapper(param);
|
||||
return dealList(baseMapper.queryList(queryWrapper,param));
|
||||
return dealList(baseMapper.queryList(queryWrapper, param));
|
||||
}
|
||||
|
||||
private QueryWrapper<ContractorAssessmentDetail> getQueryWrapper(HashMap<String, Object> param) {
|
||||
QueryWrapper<ContractorAssessmentDetail> queryWrapper = QueryGenerator.initPageQueryWrapper(ContractorAssessmentDetail.class, param, true);
|
||||
String orderBy = MapUtils.getString(param,"orderBy");
|
||||
String orderBy = MapUtils.getString(param, "orderBy");
|
||||
if (StrUtil.isNotBlank(orderBy)) {
|
||||
queryWrapper.orderByDesc(orderBy);
|
||||
} else {
|
||||
@ -73,7 +71,7 @@ public class ContractorAssessmentDetailServiceImpl extends ServiceImpl<Contracto
|
||||
@Override
|
||||
public void edit(ContractorAssessmentDetail contractorAssessmentDetail) {
|
||||
ContractorAssessmentDetail oldContractorAssessmentDetail = baseMapper.selectById(contractorAssessmentDetail.getId());
|
||||
if(oldContractorAssessmentDetail==null) {
|
||||
if (oldContractorAssessmentDetail == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(contractorAssessmentDetail);
|
||||
@ -82,7 +80,7 @@ public class ContractorAssessmentDetailServiceImpl extends ServiceImpl<Contracto
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
ContractorAssessmentDetail contractorAssessmentDetail = baseMapper.selectById(id);
|
||||
if(contractorAssessmentDetail==null) {
|
||||
if (contractorAssessmentDetail == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
@ -98,8 +96,19 @@ public class ContractorAssessmentDetailServiceImpl extends ServiceImpl<Contracto
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnterpriseInfo> rankEnterprise(Map<String, Object> map) {
|
||||
return baseMapper.rankEnterprise(map);
|
||||
public RankEnterpriseVo rankEnterprise(Map<String, Object> map) {
|
||||
List<ContractorAssessmentDetail> details = baseMapper.rankEnterprise(map);
|
||||
RankEnterpriseVo vo = new RankEnterpriseVo();
|
||||
for (ContractorAssessmentDetail detail : details) {
|
||||
if (detail.getType() == 1) {
|
||||
vo.setSupervisor(detail);
|
||||
} else if (detail.getType() == 2) {
|
||||
vo.setEpc(detail);
|
||||
} else {
|
||||
vo.setConstruction(detail);
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.DeviceUnit;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PipelineWelder;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PipelineWeldingRecord;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.PipelineWeldingRecordMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IPipelineWeldingRecordService;
|
||||
@ -89,7 +90,7 @@ public class PipelineWeldingRecordServiceImpl extends ServiceImpl<PipelineWeldin
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceUnit> rankWeldingPassRate(Map<String, Object> map) {
|
||||
public List<PipelineWelder> rankWeldingPassRate(Map<String, Object> map) {
|
||||
return baseMapper.rankWeldingPassRate(map);
|
||||
}
|
||||
|
||||
|
||||
@ -203,7 +203,6 @@ public class WorkerAdmissionDetailServiceImpl extends ServiceImpl<WorkerAdmissio
|
||||
String issueTime = certificateDetail.getIssueTime();
|
||||
String effectTime = certificateDetail.getEffectTime();
|
||||
String photoUrl = certificateDetail.getPhotoUrl();
|
||||
String qualificationVerification = certificateDetail.getQualificationVerification();
|
||||
Long workerAdmissionDetailId = certificateDetail.getWorkerAdmissionDetailId();
|
||||
Date createDate = certificateDetail.getCreateDate();
|
||||
Date updateDate = certificateDetail.getUpdateDate();
|
||||
@ -220,6 +219,7 @@ public class WorkerAdmissionDetailServiceImpl extends ServiceImpl<WorkerAdmissio
|
||||
certificate.setPhotoUrl(photoUrl);
|
||||
certificate.setUploadDate(DateUtil.formatDateTime(createDate));
|
||||
certificate.setRemarks("");
|
||||
certificate.setQualificationVerification(certificateDetail.getQualificationVerification());
|
||||
Optional<WorkerAdmissionDetail> find = detailList.stream().filter(o -> Objects.equals(o.getId(), certificateDetail.getWorkerAdmissionDetailId())).findFirst();
|
||||
find.ifPresent(workerAdmissionDetail -> certificate.setIdCard(workerAdmissionDetail.getIdCard()));
|
||||
addCertificates.add(certificate);
|
||||
|
||||
@ -226,8 +226,6 @@ public class WorkerAdmissionServiceImpl extends ServiceImpl<WorkerAdmissionMappe
|
||||
String certificateNumber = FlowUtil.getString(mm, "field9354421203736");
|
||||
String issueTime = FlowUtil.getString(mm, "field2436120887995");
|
||||
String effectTime = FlowUtil.getString(mm, "field7888920890828");
|
||||
String photoUrl = FlowUtil.getJSONString(mm, "field5960144013031");
|
||||
String qualificationVerification = FlowUtil.getJSONString(mm, "field5342644024091");
|
||||
Integer certificateType = FlowUtil.getPullDownInteger(mm, "field9312043914427");
|
||||
Integer issueCompany = FlowUtil.getPullDownInteger(mm, "field1492921345638");
|
||||
WorkerAdmissionCertificateDetail certificateDetail = new WorkerAdmissionCertificateDetail();
|
||||
@ -236,8 +234,8 @@ public class WorkerAdmissionServiceImpl extends ServiceImpl<WorkerAdmissionMappe
|
||||
certificateDetail.setIssueCompany(issueCompany);
|
||||
certificateDetail.setIssueTime(issueTime);
|
||||
certificateDetail.setEffectTime(effectTime);
|
||||
certificateDetail.setPhotoUrl(photoUrl);
|
||||
certificateDetail.setQualificationVerification(qualificationVerification);
|
||||
certificateDetail.setPhotoUrl(FlowUtil.getFileWithStar(mm, "field5960144013031"));
|
||||
certificateDetail.setQualificationVerification(FlowUtil.getFileWithStar(mm, "field5342644024091"));
|
||||
certificateDetail.setProjectSn(projectSn);
|
||||
certificateDetail.setRandom(random);
|
||||
certificateDetails.add(certificateDetail);
|
||||
|
||||
@ -91,6 +91,8 @@ public class BaseModule implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "嵌入外部url")
|
||||
private java.lang.String embedUrl;
|
||||
@ApiModelProperty(value = "常用图标")
|
||||
private java.lang.String commonIcon;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "模块所属菜单")
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -23,10 +24,9 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 模块
|
||||
@ -52,6 +52,8 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
||||
private CompanyConfigServiceImpl companyConfigService;
|
||||
@Autowired
|
||||
private IBaseAuthorityService baseAuthorityService;
|
||||
@Autowired
|
||||
private IBaseModuleService baseModuleService;
|
||||
|
||||
@Override
|
||||
public List<BaseModule> getCompanyModuleList(Map<String, Object> map) {
|
||||
@ -119,7 +121,7 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
||||
throw new OpenAlertException("企业配置不存在");
|
||||
}
|
||||
if (Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.NEW_USER.getValue()) || Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.SUPPLIER.getValue())) {
|
||||
return systemUserService.getUserAuthority(null, SystemUserAccountTypeEnum.PROJECT_ACCOUNT.getValue(), projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType,isApp);
|
||||
return systemUserService.getUserAuthority(null, SystemUserAccountTypeEnum.PROJECT_ACCOUNT.getValue(), projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType, isApp);
|
||||
} else if (Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.PROJECT_ACCOUNT.getValue()) || Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.PROJECT_SUB_ACCOUNT.getValue())) {
|
||||
return systemUserService.getUserAuthority(Long.valueOf(userId), systemUser.getAccountType(), projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType, isApp);
|
||||
} else if (Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.ENTERPRISE_ADMINISTRATOR_ACCOUNT.getValue())
|
||||
@ -134,6 +136,14 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
||||
@Override
|
||||
public List<BaseModule> queryUserModuleList(HashMap<String, Object> param) {
|
||||
param.put("userId", SecurityUtils.getUser().getUserId());
|
||||
return baseModuleMapper.queryUserModuleList(param);
|
||||
param.put("moduleType", 2);
|
||||
Map<String, Object> map = baseModuleService.getModuleAndMenuList(param);
|
||||
List<BaseModule> moduleList = (List<BaseModule>) map.get("moduleList");
|
||||
if (CollUtil.isEmpty(moduleList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Map<Long, BaseModule> userModuleMap = baseModuleMapper.queryUserModuleList(param).stream().collect(Collectors.toMap(BaseModule::getModuleId, Function.identity()));
|
||||
return moduleList.stream().filter(o->userModuleMap.containsKey(o.getModuleId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.exam.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -104,6 +105,20 @@ public class ExamQuestionBankController {
|
||||
Page<ExamQuestionBank> page = PageUtil.getPage(map);
|
||||
queryWrapper.lambda().orderByDesc(ExamQuestionBank::getCreateTime,ExamQuestionBank::getId);
|
||||
IPage<ExamQuestionBank> pageList = examQuestionBankService.page(page, queryWrapper);
|
||||
// List<ExamQuestionBank> records = pageList.getRecords();
|
||||
// if (CollUtil.isNotEmpty(records)) {
|
||||
// List<Long> ids = records.stream().map(ExamQuestionBank::getId).collect(Collectors.toList());
|
||||
// List<ExamQuestionOption> questionOptions = examQuestionOptionService.list(new LambdaQueryWrapper<ExamQuestionOption>()
|
||||
// .in(ExamQuestionOption::getQuestionId, ids));
|
||||
// for (ExamQuestionBank record : records) {
|
||||
// if (Objects.equals(record.getType(),3)) {
|
||||
// Optional<ExamQuestionOption> op = questionOptions.stream().filter(o -> Objects.equals(o.getQuestionId(), record.getId()) && Objects.equals(o.getOptionCode(), record.getOptions())).findFirst();
|
||||
// if (op.isPresent()) {
|
||||
// record.setOptions(op.get().getOptionDesc());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
@ -116,7 +131,7 @@ public class ExamQuestionBankController {
|
||||
@OperLog(operModul = "题目管理", operType = "列表查询", operDesc = "列表查询题目管理信息")
|
||||
@ApiOperation(value = " 列表查询题目管理信息", notes = "列表查询题目管理信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "试题类型(1:单选题;2:多选题;3:填空题;)", paramType = "body"),
|
||||
@ApiImplicitParam(name = "type", value = "试题类型(1:单选题;2:多选题;3:判断题;)", paramType = "body"),
|
||||
@ApiImplicitParam(name = "difficulty", value = "难易程度", paramType = "body")
|
||||
})
|
||||
@PostMapping(value = "/list")
|
||||
@ -437,7 +452,7 @@ public class ExamQuestionBankController {
|
||||
typeName = "多选题";
|
||||
break;
|
||||
case 3 :
|
||||
typeName = "填空题";
|
||||
typeName = "判断题";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@ -448,7 +463,7 @@ public class ExamQuestionBankController {
|
||||
Integer type = 0;
|
||||
String single = "单选题";
|
||||
String many = "多选题";
|
||||
String fill = "填空题";
|
||||
String fill = "判断题";
|
||||
if (single.equals(typeName)) {
|
||||
type = 1;
|
||||
} else if (many.equals(typeName)) {
|
||||
|
||||
@ -52,10 +52,10 @@ public class ExamAnswerQuestion implements Serializable {
|
||||
@ApiModelProperty(value = "试题名称")
|
||||
private String questionName;
|
||||
/**
|
||||
* 试题类型(1:单选题;2:多选题;3:填空题;)
|
||||
* 试题类型(1:单选题;2:多选题;3:判断题;)
|
||||
*/
|
||||
@Excel(name = "试题类型(1:单选题;2:多选题;3:填空题;)", width = 15)
|
||||
@ApiModelProperty(value = "试题类型(1:单选题;2:多选题;3:填空题;)")
|
||||
@Excel(name = "试题类型(1:单选题;2:多选题;3:判断题;)", width = 15)
|
||||
@ApiModelProperty(value = "试题类型(1:单选题;2:多选题;3:判断题;)")
|
||||
private Integer type;
|
||||
/**
|
||||
* 难易程度
|
||||
|
||||
@ -61,6 +61,8 @@ public class SewageAlarmServiceImpl extends ServiceImpl<SewageAlarmMapper, Sewag
|
||||
SewageAlarm conductivity = sewageAlarmMapper.getNewestOne(paramMap);
|
||||
paramMap.put("sewageType", ParamEnum.SewageTypeEnum.WATER_TEMPERATURE.getValue());
|
||||
SewageAlarm waterTemperature = sewageAlarmMapper.getNewestOne(paramMap);
|
||||
paramMap.put("sewageType", ParamEnum.SewageTypeEnum.WATER_LEVEL.getValue());
|
||||
SewageAlarm waterLevel = sewageAlarmMapper.getNewestOne(paramMap);
|
||||
SewageData data = new SewageData();
|
||||
if (conductivity != null) {
|
||||
data.setConductivity(conductivity.getMonitorValue());
|
||||
@ -68,6 +70,9 @@ public class SewageAlarmServiceImpl extends ServiceImpl<SewageAlarmMapper, Sewag
|
||||
if (waterTemperature != null) {
|
||||
data.setWaterTemperature(waterTemperature.getMonitorValue());
|
||||
}
|
||||
if (waterLevel != null) {
|
||||
data.setWaterTemperature(waterLevel.getMonitorValue());
|
||||
}
|
||||
SewageWarnThreshold threshold = sewageWarnThresholdMapper.selectOne(new LambdaQueryWrapper<SewageWarnThreshold>()
|
||||
.eq(SewageWarnThreshold::getDevSn, devSn));
|
||||
if (threshold != null) {
|
||||
|
||||
@ -272,7 +272,7 @@ public class WorkerTask {
|
||||
@RequestMapping("/alarmWorkerBlack")
|
||||
public void alarmWorkerBlack() {
|
||||
log.info("任务开始,对人员的合同信息、资格证书、保险信息到期进行预警,预警后发送消息提示项目管理员账号");
|
||||
List<XzEmergencyPush> pushList = xzEmergencyPushService.list(new LambdaQueryWrapper<XzEmergencyPush>().eq(XzEmergencyPush::getType,2));
|
||||
List<XzEmergencyPush> pushList = xzEmergencyPushService.list(new LambdaQueryWrapper<XzEmergencyPush>().eq(XzEmergencyPush::getType, 2));
|
||||
Map<String, Map<Long, List<XzEmergencyPush>>> projectMap = pushList.stream().collect(Collectors.groupingBy(XzEmergencyPush::getProjectSn, Collectors.groupingBy(XzEmergencyPush::getEnterpriseId)));
|
||||
//资格证书预警
|
||||
List<WorkerInfo> list1 = workerCertificateMapper.getAlarmWorkerCertificateWithHeadquarter();
|
||||
@ -681,29 +681,29 @@ public class WorkerTask {
|
||||
}
|
||||
|
||||
private String getSafeType(Integer level, Integer status) {
|
||||
if (level == 1 && status == 2) {
|
||||
if (Objects.equals(level, 1) && Objects.equals(status, 2)) {
|
||||
return "6";
|
||||
} else if (level == 1 && status == 3) {
|
||||
} else if (Objects.equals(level, 1) && Objects.equals(status, 3)) {
|
||||
return "7";
|
||||
} else if (level == 1 && status == 4) {
|
||||
} else if (Objects.equals(level, 1) && Objects.equals(status, 4)) {
|
||||
return "8";
|
||||
} else if (level == 2 && status == 2) {
|
||||
} else if (Objects.equals(level, 2) && Objects.equals(status, 2)) {
|
||||
return "9";
|
||||
} else if (level == 2 && status == 3) {
|
||||
} else if (Objects.equals(level, 2) && Objects.equals(status, 3)) {
|
||||
return "10";
|
||||
} else if (level == 2 && status == 4) {
|
||||
} else if (Objects.equals(level, 2) && Objects.equals(status, 4)) {
|
||||
return "11";
|
||||
} else if (level == 3 && status == 2) {
|
||||
} else if (Objects.equals(level, 3) && Objects.equals(status, 2)) {
|
||||
return "12";
|
||||
} else if (level == 3 && status == 3) {
|
||||
} else if (Objects.equals(level, 3) && Objects.equals(status, 3)) {
|
||||
return "13";
|
||||
} else if (level == 3 && status == 4) {
|
||||
} else if (Objects.equals(level, 3) && Objects.equals(status, 4)) {
|
||||
return "14";
|
||||
} else if (level == 4 && status == 2) {
|
||||
} else if (Objects.equals(level, 4) && Objects.equals(status, 2)) {
|
||||
return "15";
|
||||
} else if (level == 4 && status == 3) {
|
||||
} else if (Objects.equals(level, 4) && Objects.equals(status, 3)) {
|
||||
return "16";
|
||||
} else if (level == 4 && status == 4) {
|
||||
} else if (Objects.equals(level, 4) && Objects.equals(status, 4)) {
|
||||
return "17";
|
||||
}
|
||||
return "";
|
||||
|
||||
@ -4,14 +4,19 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gexin.fastjson.JSON;
|
||||
import com.gexin.fastjson.JSONArray;
|
||||
import com.gexin.fastjson.JSONObject;
|
||||
import com.wflow.bean.do_.UserDeptDo;
|
||||
import com.wflow.bean.entity.WflowFormData;
|
||||
import com.wflow.bean.entity.WflowModelHistorys;
|
||||
import com.wflow.bean.entity.WflowModels;
|
||||
import com.wflow.bean.entity.WflowSubProcess;
|
||||
import com.wflow.mapper.WflowFormDataMapper;
|
||||
import com.wflow.mapper.WflowModelHistorysMapper;
|
||||
import com.wflow.mapper.WflowModelsMapper;
|
||||
import com.wflow.mapper.WflowSubProcessMapper;
|
||||
import com.wflow.service.OrgRepositoryService;
|
||||
import com.wflow.workflow.UELTools;
|
||||
@ -28,14 +33,18 @@ import com.wflow.workflow.bean.vo.ProcessTaskVo;
|
||||
import com.wflow.workflow.config.WflowGlobalVarDef;
|
||||
import com.wflow.workflow.service.*;
|
||||
import com.wflow.workflow.service.impl.ProcessTaskServiceImpl;
|
||||
import com.wflow.workflow.utils.FlowableUtils;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.vo.CountFlowVO;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.flowable.engine.HistoryService;
|
||||
import org.flowable.engine.RepositoryService;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.engine.runtime.ProcessInstanceQuery;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.flowable.task.api.TaskInfo;
|
||||
@ -47,13 +56,15 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class FlowSeviceUtil {
|
||||
private final static OrgUser UNKNOW_USER = OrgUser.builder().id("5201314").name("人员待定").build();
|
||||
|
||||
@Autowired
|
||||
private WflowModelsMapper wflowModelsMapper;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
@ -96,6 +107,10 @@ public class FlowSeviceUtil {
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ProcessNodeCatchService nodeCatchService;
|
||||
@Autowired
|
||||
private WflowModelHistorysMapper wflowModelHistorysMapper;
|
||||
@Autowired
|
||||
private ProcessModelService modelService;
|
||||
|
||||
/**
|
||||
* 获取下一个待处理的审批节点
|
||||
@ -366,5 +381,55 @@ public class FlowSeviceUtil {
|
||||
foreachNode(node.getChildren(), idSet, progressNodes, instance, vars, tenantId);
|
||||
}
|
||||
|
||||
public CountFlowVO countFlow(Map<String, Object> map) {
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
String userId = SecurityUtils.getUser().getUserId() + "";
|
||||
TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
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();
|
||||
List<Task> taskList = taskQuery.list();
|
||||
Set<String> staterUsers = new HashSet<>();
|
||||
Set<String> instanceIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toSet());
|
||||
Map<String, Object> startDept = FlowableUtils.getProcessVars(instanceIds, "startDept");
|
||||
//把待办任务流程实例一次性取出来,减少查询次数
|
||||
Map<String, ProcessInstance> instanceMap = CollectionUtil.isNotEmpty(taskList) ?
|
||||
runtimeService.createProcessInstanceQuery().processInstanceIds(taskList.stream()
|
||||
.map(Task::getProcessInstanceId).collect(Collectors.toSet()))
|
||||
.list().stream().collect(Collectors.toMap(ProcessInstance::getId, v -> v)) : new HashMap<>();
|
||||
List<String> formIds = taskList.stream().map(task -> {
|
||||
ProcessInstance instance = instanceMap.get(task.getProcessInstanceId());
|
||||
//构造用户id -> 部门id
|
||||
staterUsers.add(instance.getStartUserId() + "_" + startDept.getOrDefault(task.getProcessInstanceId(),
|
||||
//如果没有就从流程变量 owner 里取(之前是存owner变量)
|
||||
FlowableUtils.getOwnerDept(task.getProcessInstanceId(), true)));
|
||||
return instance.getProcessDefinitionKey();
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//取用户信息,减少数据库查询,一次构建
|
||||
if (CollectionUtil.isEmpty(staterUsers)) {
|
||||
formIds = new ArrayList<>();
|
||||
}
|
||||
Map<String, WflowModels> safeMap = wflowModelsMapper.selectList(Wrappers.<WflowModels>lambdaQuery()
|
||||
.eq(WflowModels::getGroupId, 135)).stream().collect(Collectors.toMap(WflowModels::getFormId, Function.identity()));
|
||||
Map<String, WflowModels> qualityMap = wflowModelsMapper.selectList(Wrappers.<WflowModels>lambdaQuery()
|
||||
.eq(WflowModels::getGroupId, 136)).stream().collect(Collectors.toMap(WflowModels::getFormId, Function.identity()));
|
||||
Integer safe = 0;
|
||||
Integer quality = 0;
|
||||
for (String formId : formIds) {
|
||||
if (safeMap.containsKey(formId)) {
|
||||
safe++;
|
||||
} else if (qualityMap.containsKey(formId)) {
|
||||
quality++;
|
||||
}
|
||||
}
|
||||
CountFlowVO vo = new CountFlowVO();
|
||||
vo.setTotal(formIds.size());
|
||||
vo.setSafe(safe);
|
||||
vo.setQuality(quality);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class FlowUtil {
|
||||
|
||||
@ -26,6 +27,25 @@ public class FlowUtil {
|
||||
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : ((Map) ((List) o).get(0)).get("url").toString()).orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件url
|
||||
*
|
||||
* @param map
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public static String getFileWithStar(Map map, String key) {
|
||||
Object o2 = map.get(key);
|
||||
if (o2 == null || "".equals(o2)) {
|
||||
return null;
|
||||
}
|
||||
List<Map> l = (List) o2;
|
||||
List collect = l.stream().map(o1 -> {
|
||||
return o1.get("name").toString() + "*" + o1.get("url").toString();
|
||||
}).collect(Collectors.toList());
|
||||
return StrUtil.join(",", collect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件url完整链接
|
||||
*
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user