bug修改
This commit is contained in:
parent
7102984088
commit
d09fb2ff7d
@ -25,13 +25,20 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTrainRecordsByWorkerId" resultType="com.zhgd.xmgl.modules.exam.vo.ExamTrainRecordVo">
|
<select id="getTrainRecordsByWorkerId" resultType="com.zhgd.xmgl.modules.exam.vo.ExamTrainRecordVo">
|
||||||
select if(et.course_id is null,ec.start_exam_time,r.begin_time) as start_exam_time,
|
select ec.start_exam_time as start_exam_time,
|
||||||
if(et.course_id is null,ec.score,null) as score,
|
ec.score as score,
|
||||||
if(et.course_id is null,ec.is_pass, null) as is_pass,
|
ec.is_pass as is_pass,
|
||||||
|
et.title
|
||||||
|
from exam_train et
|
||||||
|
left join exam_train_record ec on ec.train_id = et.id and ec.total_score is not null
|
||||||
|
where ec.worker_id = #{workerId} and et.project_sn=#{projectSn}
|
||||||
|
union all
|
||||||
|
select r.begin_time as start_exam_time,
|
||||||
|
null as score,
|
||||||
|
null as is_pass,
|
||||||
et.title
|
et.title
|
||||||
from exam_train et
|
from exam_train et
|
||||||
left join exam_train_record ec on ec.train_id = et.id and ec.score is not null
|
|
||||||
left join exam_course_record r on r.train_id=et.id and r.begin_time is not null
|
left join exam_course_record r on r.train_id=et.id and r.begin_time is not null
|
||||||
where ec.worker_id = #{workerId} and ec.project_sn=#{projectSn}
|
where r.worker_id = #{workerId} and et.project_sn=#{projectSn}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -10,10 +10,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -114,5 +111,14 @@ public class QualityRegionController {
|
|||||||
return Result.success(qualityRegionService.queryById(map));
|
return Result.success(qualityRegionService.queryById(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperLog(operModul = "区域管理", operType = "查询", operDesc = "查询项目子账号绑定的唯一区域")
|
||||||
|
@ApiOperation(value = "查询项目子账号绑定的唯一区域", notes = "查询项目子账号绑定的唯一区域", httpMethod = "GET")
|
||||||
|
@GetMapping(value = "/queryBindRegion")
|
||||||
|
public Result<QualityRegion> queryBindRegion() {
|
||||||
|
return Result.success(qualityRegionService.queryBindRegion());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,6 +88,8 @@ public class QualityRegion implements Serializable {
|
|||||||
private Date createTime;
|
private Date createTime;
|
||||||
@ApiModelProperty(value = "祖级列表")
|
@ApiModelProperty(value = "祖级列表")
|
||||||
private java.lang.String ancestors;
|
private java.lang.String ancestors;
|
||||||
|
@ApiModelProperty(value = "区域的项目子账号id")
|
||||||
|
private java.lang.Long belongUserId;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<QualityRegion> children;
|
private List<QualityRegion> children;
|
||||||
|
|||||||
@ -32,4 +32,6 @@ public interface QualityRegionMapper extends BaseMapper<QualityRegion> {
|
|||||||
void updateAncestors(@Param("oldAncestor") String oldAncestor, @Param("newAncestor") String newAncestor, @Param("projectSn") String projectSn, @Param("id") Long id);
|
void updateAncestors(@Param("oldAncestor") String oldAncestor, @Param("newAncestor") String newAncestor, @Param("projectSn") String projectSn, @Param("id") Long id);
|
||||||
|
|
||||||
List<QualityRegion> selectBySnAndNumberOneList(@Param("sn") String projectSn, @Param("regionSet") Set<String> regionSet);
|
List<QualityRegion> selectBySnAndNumberOneList(@Param("sn") String projectSn, @Param("regionSet") Set<String> regionSet);
|
||||||
|
|
||||||
|
List<QualityRegion> queryBindRegion(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,4 +90,11 @@
|
|||||||
group by `region_name`
|
group by `region_name`
|
||||||
HAVING COUNT(region_name) = 1
|
HAVING COUNT(region_name) = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryBindRegion" resultType="com.zhgd.xmgl.modules.quality.entity.QualityRegion">
|
||||||
|
select qr.*
|
||||||
|
from quality_region qr
|
||||||
|
join system_user su on qr.belong_user_id=su.user_id
|
||||||
|
where su.user_id=#{userId} and su.account_type=6
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -49,4 +49,6 @@ public interface IQualityRegionService extends IService<QualityRegion> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
QualityRegion queryById(Map<String, Object> map);
|
QualityRegion queryById(Map<String, Object> map);
|
||||||
|
|
||||||
|
QualityRegion queryBindRegion();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import com.zhgd.xmgl.modules.quality.service.IQualityRegionService;
|
|||||||
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareRecord;
|
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareRecord;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||||
import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl;
|
import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl;
|
||||||
|
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||||
import com.zhgd.xmgl.util.ListUtils;
|
import com.zhgd.xmgl.util.ListUtils;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
@ -269,6 +270,17 @@ public class QualityRegionServiceImpl extends ServiceImpl<QualityRegionMapper, Q
|
|||||||
return qualityRegion;
|
return qualityRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QualityRegion queryBindRegion() {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("userId", SecurityUtils.getUser().getUserId());
|
||||||
|
List<QualityRegion> qualityRegions = baseMapper.queryBindRegion(map);
|
||||||
|
if (qualityRegions.size() > 1) {
|
||||||
|
throw new OpenAlertException("此账号绑定过多区域");
|
||||||
|
}
|
||||||
|
return qualityRegions.size() == 0 ? null : qualityRegions.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
private void deleteRegion(Long id) {
|
private void deleteRegion(Long id) {
|
||||||
QueryWrapper<QualityRegion> queryWrapper = new QueryWrapper();
|
QueryWrapper<QualityRegion> queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.lambda().eq(QualityRegion::getParentRegion, id);
|
queryWrapper.lambda().eq(QualityRegion::getParentRegion, id);
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.worker.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.zhgd.annotation.DataScope;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerSafeEducation;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerSafeEducation;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.dto.EduTypeCountDTO;
|
import com.zhgd.xmgl.modules.worker.entity.dto.EduTypeCountDTO;
|
||||||
@ -35,6 +36,7 @@ public interface WorkerSafeEducationMapper extends BaseMapper<WorkerSafeEducatio
|
|||||||
|
|
||||||
List<EntityMap> selectWorkerSafeEducationByIDCardList(Map<String, Object> map);
|
List<EntityMap> selectWorkerSafeEducationByIDCardList(Map<String, Object> map);
|
||||||
|
|
||||||
|
@DataScope(includeTable = "worker_info")
|
||||||
int getProjectSafeEducationPersonToltal(Map<String, Object> map);
|
int getProjectSafeEducationPersonToltal(Map<String, Object> map);
|
||||||
|
|
||||||
List<EntityMap> exportExcelWorkerEducation(WorkerSafeEducation workerSafeEducation);
|
List<EntityMap> exportExcelWorkerEducation(WorkerSafeEducation workerSafeEducation);
|
||||||
|
|||||||
@ -2587,6 +2587,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
|||||||
for (JSONObject jo : list3) {
|
for (JSONObject jo : list3) {
|
||||||
rtList.add(new TrainRecordVo(DateUtil.formatDate(DateUtil.parse(jo.getString("study_time"))), jo.getString("edu_course_name"), jo.getDouble("score"), getIsPass(jo.getInteger("is_qualified"))));
|
rtList.add(new TrainRecordVo(DateUtil.formatDate(DateUtil.parse(jo.getString("study_time"))), jo.getString("edu_course_name"), jo.getDouble("score"), getIsPass(jo.getInteger("is_qualified"))));
|
||||||
}
|
}
|
||||||
|
rtList.sort((o1, o2) -> o2.getDate().compareTo(o1.getDate()));
|
||||||
return rtList;
|
return rtList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
|
|||||||
private void querySelfEnterpriseIfSub(QueryWrapper<XzEmergencyRecord> queryWrapper) {
|
private void querySelfEnterpriseIfSub(QueryWrapper<XzEmergencyRecord> queryWrapper) {
|
||||||
UserInfo user = SecurityUtils.getUser();
|
UserInfo user = SecurityUtils.getUser();
|
||||||
if (Objects.equals(user.getAccountType(), ParamEnum.SystemUserAccountTypeEnum.PROJECT_SUB_ACCOUNT.getValue())) {
|
if (Objects.equals(user.getAccountType(), ParamEnum.SystemUserAccountTypeEnum.PROJECT_SUB_ACCOUNT.getValue())) {
|
||||||
queryWrapper.apply(" ei.id = (select enterprise_id from xz_emergency_push where find_in_set({0},emergency_manager_id))", user.getUserId());
|
queryWrapper.apply(" ei.id in (select enterprise_id from xz_emergency_push where find_in_set({0},emergency_manager_id))", user.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -247,20 +247,8 @@ public class XzHikvisionSyncServiceImpl extends ServiceImpl<XzHikvisionSyncMappe
|
|||||||
List<UfaceDev> ufaceDevs = ufaceDevMapper.selectList(qw);
|
List<UfaceDev> ufaceDevs = ufaceDevMapper.selectList(qw);
|
||||||
ThreadLocalUtil.addInKey(Cts.TL_HK_SYNC_ID, id);
|
ThreadLocalUtil.addInKey(Cts.TL_HK_SYNC_ID, id);
|
||||||
projectUfaceConfigService.buildAndSendOneWorkerAndDevForHk(ufaceDevs, workerInfo, xzHikvisionSync.getOperate(), xzHikvisionSync.getDeviceSn(), projectSn, true);
|
projectUfaceConfigService.buildAndSendOneWorkerAndDevForHk(ufaceDevs, workerInfo, xzHikvisionSync.getOperate(), xzHikvisionSync.getDeviceSn(), projectSn, true);
|
||||||
String redisKey = Cts.HK_SYNC_AUTH_SUCCESS_KEY + id;
|
|
||||||
Object success = redisRepository.get(redisKey);
|
|
||||||
redisRepository.del(redisKey);
|
|
||||||
//if (!Objects.equals(success,1)) {
|
|
||||||
// throw new OpenAlertException("重试失败");
|
|
||||||
//}
|
|
||||||
//return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//XzHikvisionSync xzHikvisionSync1 = baseMapper.selectById(id);
|
|
||||||
//if (!Objects.equals(xzHikvisionSync1.getIsSuccess(), 1)) {
|
|
||||||
// throw new OpenAlertException("重试失败");
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,22 +1,34 @@
|
|||||||
package com.zhgd.xmgl.modules.xz.special.controller;
|
package com.zhgd.xmgl.modules.xz.special.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
|
import com.zhgd.xmgl.enums.ParamEnum;
|
||||||
|
import com.zhgd.xmgl.modules.worker.service.impl.UserEnterpriseServiceImpl;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.*;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialByFinalStatusVo;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialVo;
|
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialVo;
|
||||||
import com.zhgd.xmgl.modules.xz.special.service.IXzBlindPlatePlugSafeService;
|
import com.zhgd.xmgl.modules.xz.special.service.*;
|
||||||
|
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||||
|
import com.zhgd.xmgl.util.NumberUtils;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/xmgl/xzSpecial")
|
@RequestMapping("/xmgl/xzSpecial")
|
||||||
@ -24,7 +36,24 @@ import java.util.Map;
|
|||||||
@Api(tags = "星纵-特种作业统计Api")
|
@Api(tags = "星纵-特种作业统计Api")
|
||||||
public class CountApiController {
|
public class CountApiController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IXzBlindPlatePlugSafeService xzBlindPlatePlugSafeService;
|
IXzBlindPlatePlugSafeService xzBlindPlatePlugSafeService;
|
||||||
|
@Resource
|
||||||
|
IXzGroundSafetService iXzGroundSafetService;
|
||||||
|
@Resource
|
||||||
|
IXzHighJobSafeService iXzHighJobSafeService;
|
||||||
|
@Resource
|
||||||
|
IXzHoistSafetyWorkService iXzHoistSafetyWorkService;
|
||||||
|
@Resource
|
||||||
|
IXzLimitSpaceSafeService iXzLimitSpaceSafeService;
|
||||||
|
@Resource
|
||||||
|
IXzOpenCircuitSafeService iXzOpenCircuitSafeService;
|
||||||
|
@Resource
|
||||||
|
IXzSpecialOperationFireSafetyService iXzSpecialOperationFireSafetyService;
|
||||||
|
@Resource
|
||||||
|
IXzTemporaryElectricitySafeService xzTemporaryElectricitySafeService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private UserEnterpriseServiceImpl userEnterpriseService;
|
||||||
|
|
||||||
@ApiOperation(value = "统计特殊作业数量", notes = "统计特殊作业数量", httpMethod = "POST")
|
@ApiOperation(value = "统计特殊作业数量", notes = "统计特殊作业数量", httpMethod = "POST")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ -35,5 +64,107 @@ public class CountApiController {
|
|||||||
return Result.success(xzBlindPlatePlugSafeService.countAllSpecial(param));
|
return Result.success(xzBlindPlatePlugSafeService.countAllSpecial(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "统计特殊作业情况", notes = "统计特殊作业情况", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/countSpecialByFinalStatus")
|
||||||
|
public Result<CountSpecialByFinalStatusVo> countSpecialByFinalStatus(@ApiIgnore @RequestBody Map<String, Object> param) {
|
||||||
|
String projectSn = MapUtils.getString(param, "projectSn");
|
||||||
|
List<String> enterpriseIds = userEnterpriseService.getEnterpriseIdsIfSubProject();
|
||||||
|
Integer accountType = SecurityUtils.getUser().getAccountType();
|
||||||
|
boolean isSubAccount = Objects.equals(accountType, ParamEnum.SystemUserAccountTypeEnum.PROJECT_SUB_ACCOUNT.getValue());
|
||||||
|
ArrayList<CountSpecialByFinalStatusVo.GroupByType> groupByTypes = new ArrayList<>();
|
||||||
|
List<XzBlindPlatePlugSafe> n1 = xzBlindPlatePlugSafeService.list(new LambdaQueryWrapper<XzBlindPlatePlugSafe>()
|
||||||
|
.eq(XzBlindPlatePlugSafe::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzBlindPlatePlugSafe::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
List<XzGroundSafet> n2 = iXzGroundSafetService.list(new LambdaQueryWrapper<XzGroundSafet>()
|
||||||
|
.eq(XzGroundSafet::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzGroundSafet::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
List<XzHighJobSafe> n3 = iXzHighJobSafeService.list(new LambdaQueryWrapper<XzHighJobSafe>()
|
||||||
|
.eq(XzHighJobSafe::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzHighJobSafe::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
List<XzHoistSafetyWork> n4 = iXzHoistSafetyWorkService.list(new LambdaQueryWrapper<XzHoistSafetyWork>()
|
||||||
|
.eq(XzHoistSafetyWork::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzHoistSafetyWork::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
List<XzLimitSpaceSafe> n5 = iXzLimitSpaceSafeService.list(new LambdaQueryWrapper<XzLimitSpaceSafe>()
|
||||||
|
.eq(XzLimitSpaceSafe::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzLimitSpaceSafe::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
List<XzOpenCircuitSafe> n6 = iXzOpenCircuitSafeService.list(new LambdaQueryWrapper<XzOpenCircuitSafe>()
|
||||||
|
.eq(XzOpenCircuitSafe::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzOpenCircuitSafe::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
List<XzSpecialOperationFireSafety> n7 = iXzSpecialOperationFireSafetyService.list(new LambdaQueryWrapper<XzSpecialOperationFireSafety>()
|
||||||
|
.eq(XzSpecialOperationFireSafety::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzSpecialOperationFireSafety::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
List<XzTemporaryElectricitySafe> n8 = xzTemporaryElectricitySafeService.list(new LambdaQueryWrapper<XzTemporaryElectricitySafe>()
|
||||||
|
.eq(XzTemporaryElectricitySafe::getProjectSn, projectSn)
|
||||||
|
.in(isSubAccount, XzTemporaryElectricitySafe::getJobApplicationUnit, enterpriseIds)
|
||||||
|
);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType1 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType1.setName("盲板抽堵作业");
|
||||||
|
byType1.setNum((long) n1.size());
|
||||||
|
byType1.setComplete(n1.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType1);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType2 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType2.setName("动土作业");
|
||||||
|
byType2.setNum((long) n2.size());
|
||||||
|
byType2.setComplete(n2.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType2);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType3 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType3.setName("高处作业");
|
||||||
|
byType3.setNum((long) n3.size());
|
||||||
|
byType3.setComplete(n3.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType3);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType4 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType4.setName("吊装安全作业");
|
||||||
|
byType4.setNum((long) n4.size());
|
||||||
|
byType4.setComplete(n4.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType4);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType5 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType5.setName("受限空间作业");
|
||||||
|
byType5.setNum((long) n5.size());
|
||||||
|
byType5.setComplete(n5.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType5);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType6 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType6.setName("断路作业");
|
||||||
|
byType6.setNum((long) n6.size());
|
||||||
|
byType6.setComplete(n6.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType6);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType7 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType7.setName("动火作业");
|
||||||
|
byType7.setNum((long) n7.size());
|
||||||
|
byType7.setComplete(n7.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType7);
|
||||||
|
CountSpecialByFinalStatusVo.GroupByType byType8 = new CountSpecialByFinalStatusVo.GroupByType();
|
||||||
|
byType8.setName("临时用电作业");
|
||||||
|
byType8.setNum((long) n8.size());
|
||||||
|
byType8.setComplete(n8.stream().filter(b -> Objects.equals(b.getFinalAcceptanceStatus(), 2)).count());
|
||||||
|
groupByTypes.add(byType8);
|
||||||
|
|
||||||
|
long sum = groupByTypes.stream().map(CountSpecialByFinalStatusVo.GroupByType::getNum).mapToLong(value -> value).sum();
|
||||||
|
Long running = 0L;
|
||||||
|
Long complete = 0L;
|
||||||
|
for (CountSpecialByFinalStatusVo.GroupByType type : groupByTypes) {
|
||||||
|
type.setRunning(type.getNum() - type.getComplete());
|
||||||
|
running += type.getRunning();
|
||||||
|
complete += type.getComplete();
|
||||||
|
type.setRatio(NumberUtils.occupyRate(type.getNum(), sum, 2));
|
||||||
|
}
|
||||||
|
CountSpecialByFinalStatusVo rtVo = new CountSpecialByFinalStatusVo();
|
||||||
|
CountSpecialByFinalStatusVo.Total total = new CountSpecialByFinalStatusVo.Total();
|
||||||
|
total.setRunning(running);
|
||||||
|
total.setComplete(complete);
|
||||||
|
rtVo.setTotal(total);
|
||||||
|
rtVo.setGroupByType(groupByTypes);
|
||||||
|
return Result.success(rtVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.zhgd.xmgl.modules.xz.special.entity.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CountSpecialByFinalStatusVo {
|
||||||
|
private Total total;
|
||||||
|
private List<GroupByType> groupByType;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Total {
|
||||||
|
private Long running;
|
||||||
|
private Long complete;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class GroupByType {
|
||||||
|
private String name;
|
||||||
|
private Long running;
|
||||||
|
private Long num;
|
||||||
|
private Long complete;
|
||||||
|
private Double ratio;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.xz.special.service;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.XzBlindPlatePlugSafe;
|
import com.zhgd.xmgl.modules.xz.special.entity.XzBlindPlatePlugSafe;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialByFinalStatusVo;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialVo;
|
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialVo;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -71,4 +72,5 @@ public interface IXzBlindPlatePlugSafeService extends IService<XzBlindPlatePlugS
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CountSpecialVo> countAllSpecial(Map<String, Object> param);
|
List<CountSpecialVo> countAllSpecial(Map<String, Object> param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import com.zhgd.xmgl.modules.worker.service.IUserEnterpriseService;
|
|||||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
|
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
|
||||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
|
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.XzBlindPlatePlugSafe;
|
import com.zhgd.xmgl.modules.xz.special.entity.XzBlindPlatePlugSafe;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialByFinalStatusVo;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialVo;
|
import com.zhgd.xmgl.modules.xz.special.entity.vo.CountSpecialVo;
|
||||||
import com.zhgd.xmgl.modules.xz.special.mapper.XzBlindPlatePlugSafeMapper;
|
import com.zhgd.xmgl.modules.xz.special.mapper.XzBlindPlatePlugSafeMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.special.mapper.XzGasAnalyzeMapper;
|
import com.zhgd.xmgl.modules.xz.special.mapper.XzGasAnalyzeMapper;
|
||||||
@ -151,6 +152,7 @@ public class XzBlindPlatePlugSafeServiceImpl extends ServiceImpl<XzBlindPlatePlu
|
|||||||
return rtList;
|
return rtList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void fillEmtpy(CountSpecialVo vo) {
|
private void fillEmtpy(CountSpecialVo vo) {
|
||||||
if (vo.getTotalNum() == null) {
|
if (vo.getTotalNum() == null) {
|
||||||
vo.setTotalNum(0);
|
vo.setTotalNum(0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user