Browse Source

#mybatis-plus不支持分页参数为-1

zhongwei
yang_shj 5 months ago
parent
commit
193756b64c
  1. 10
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
  2. 5
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
  3. 48
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml
  4. 2
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java
  5. 22
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java
  6. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java
  7. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java
  8. 62
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  9. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java
  10. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
  11. 58
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  12. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardCategoryController.java
  13. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardWorkController.java
  14. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardWorkService.java
  15. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java
  16. 30
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java

10
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java

@ -54,6 +54,16 @@ public class PresonManagementController extends BladeController {
return R.data(page); return R.data(page);
} }
@GetMapping("/managements")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询档案列表", notes = "传入imsDutyClass")
@OperationAnnotation(moduleName = "档案管理",title = "查询档案列表",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,action
= "档案管理")
public R<List<PersonManagemetVo>> managements(PersonManagemetVo param) {
return R.data(iImsPresonManagementService.managements(param));
}
/** /**
* 新增或修改 * 新增或修改
*/ */

5
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java

@ -26,6 +26,11 @@ public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonMan
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "depetIds")List<Long> depetIds, @Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "depetIds")List<Long> depetIds,
@Param(value = "current")Integer current, @Param(value = "size")Integer size) ; @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
List<PersonManagemetVo> managemets(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "depetIds")List<Long> depetIds) ;
Integer getCountByPersonManagemetEntity( Integer getCountByPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime, @Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,

48
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml

@ -70,6 +70,54 @@
</if> </if>
ORDER BY c.CREATE_TIME,BCREATE_TIME DESC ORDER BY c.CREATE_TIME,BCREATE_TIME DESC
</select> </select>
<select id="managemets" resultMap="PersonManagemetMap">
select c.id ,c.name,c.unit_name ,c.sex,c.job ,c.academic_title,c.phone ,c.CREATE_TIME,c.create_dept as create_dept,
b.id as certificatetId,b.person_id,b.type,b.dead_time,b.pic,b.CREATE_TIME as BCREATE_TIME,b.status,
case when b.dead_time is null then null
when b.dead_time &lt; NOW() then "过期" else "未过期" end as isDead
from(
select a.id ,a.name,a.unit_name ,a.sex,a.job ,a.academic_title,a.phone ,a.CREATE_TIME,a.create_dept as create_dept,a.is_deleted
from hzims_person_managemet as a
where a.is_deleted = 0
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like CONCAT('%',#{unitName},'%')
</if>
<if test="sex != null and sex != ''">
and a.sex = #{sex}
</if>
<if test="job != null and job != ''">
and a.job like CONCAT('%',#{job},'%')
</if>
<if test="depetIds != null">
and a.create_dept in
<foreach collection="depetIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="academicTitle != null and academicTitle != ''">
and a.academic_title like CONCAT('%',#{academic_title},'%')
</if>
ORDER BY a.CREATE_TIME
) as c
left join hzims_certificatet as b
on c.id=b.person_id and c.is_deleted = 0
where c.is_deleted = 0
<if test="type != null and type != ''">
and b.type = #{type}
</if>
<if test="deadStartTime != null and type != ''">
and b.dead_time &gt;= #{deadStartTime}
</if>
<if test="deadTime != null and type != ''">
and b.dead_time &lt;= #{deadTime}
</if>
ORDER BY c.CREATE_TIME,BCREATE_TIME DESC
</select>
<!--嵌套查询--> <!--嵌套查询-->
<select id="getCountByPersonManagemetEntity" resultType="Integer"> <select id="getCountByPersonManagemetEntity" resultType="Integer">
select count(DISTINCT(a.id)) select count(DISTINCT(a.id))

2
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java

@ -24,4 +24,6 @@ public interface IImsPresonManagementService extends IService<PersonManagemetEnt
Boolean removeByPersonManagemetVo(PersonManagemetVo personManagemetVo); Boolean removeByPersonManagemetVo(PersonManagemetVo personManagemetVo);
List<PersonManagemetExportVo> exportPersonManagemet(PersonManagemetVo personManagemetVo); List<PersonManagemetExportVo> exportPersonManagemet(PersonManagemetVo personManagemetVo);
List<PersonManagemetVo> managements(PersonManagemetVo param);
} }

22
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java

@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -164,5 +165,26 @@ public class PresonManagementServiceImpl extends ServiceImpl<PersonManagemetMapp
return list; return list;
} }
/**
* 查询档案列表
* @param param
* @return
*/
@Override
public List<PersonManagemetVo> managements(PersonManagemetVo param) {
R<List<Dept>> deptByCurrentUserR = sysClient.getDeptByCurrentUser();
if (!deptByCurrentUserR.isSuccess() || CollectionUtils.isEmpty(deptByCurrentUserR.getData())){
return new ArrayList<>();
}
List<Long> depetIds = deptByCurrentUserR.getData().stream().map(Dept::getId).collect(Collectors.toList());
List<PersonManagemetVo> managemets = baseMapper.managemets(param.getType(), param.getDeadStartTime(), param.getDeadTime(),
param.getName(), param.getUnitName(), param.getSex(), param.getJob(),
param.getAcademicTitle(), param.getStatus(), depetIds);
if(CollectionUtil.isEmpty(managemets)){
return new ArrayList<>();
}
return managemets;
}
} }

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java

@ -40,6 +40,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
/** /**
@ -100,6 +101,16 @@ public class ImsDutyRecController extends BladeController {
return R.data(pages); return R.data(pages);
} }
@OperationAnnotation(moduleName = "值班管理",title = "交接班记录",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "查询交接班记录")
@GetMapping("/dutyRecs")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "查询交接班记录", notes = "传入entity")
public R<List<ImsDutyRecVO>> dutyRecs(ImsDutyRecVO vo) {
return R.data(imsDutyRecService.dutyRecs(vo));
}
/** /**
*开始工作流程 *开始工作流程

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java

@ -139,4 +139,6 @@ public interface IImsDutyRecService extends IService<ImsDutyRecEntity> {
Boolean dealDutyRecFlow(ImsDutyRecDTO recDTO); Boolean dealDutyRecFlow(ImsDutyRecDTO recDTO);
R<ImsDutyLogEntity> getDutyLog(ImsDutyLogEntity imsDutyLogEntity); R<ImsDutyLogEntity> getDutyLog(ImsDutyLogEntity imsDutyLogEntity);
List<ImsDutyRecVO> dutyRecs(ImsDutyRecVO vo);
} }

62
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

@ -7,9 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
@ -36,7 +35,6 @@ import com.hnac.hzims.operational.duty.vo.ImsRecVo;
import com.hnac.hzims.operational.duty.vo.ImsSchedulingVo; import com.hnac.hzims.operational.duty.vo.ImsSchedulingVo;
import com.hnac.hzims.operational.duty.wrapper.ImsDutyRecWrapper; import com.hnac.hzims.operational.duty.wrapper.ImsDutyRecWrapper;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.ticket.allTicket.dto.TicketStatisticDTO;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient; import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient;
@ -45,7 +43,6 @@ import com.hnac.hzinfo.inspect.plan.feign.IInspectPlanClient;
import com.hnac.hzinfo.inspect.plan.vo.PlanVO; import com.hnac.hzinfo.inspect.plan.vo.PlanVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv; import org.springblade.core.tool.support.Kv;
@ -65,7 +62,6 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.xml.ws.WebServiceException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.sql.Time; import java.sql.Time;
@ -1611,6 +1607,62 @@ public class ImsDutyRecServiceImpl extends ServiceImpl<ImsDutyRecMapper, ImsDuty
return R.data(dutyLogEntity); return R.data(dutyLogEntity);
} }
/**
* 交接班记录查询
* @param vo
* @return
*/
@Override
public List<ImsDutyRecVO> dutyRecs(ImsDutyRecVO vo) {
List<ImsDutyRecEntity> recs = this.list(new LambdaQueryWrapper<ImsDutyRecEntity>() {{
orderByDesc(ImsDutyRecEntity::getExecTime);
if (StringUtil.isNotBlank(vo.getDutyInfo())) {
like(ImsDutyRecEntity::getDutyInfo, vo.getDutyInfo());
}
if (StringUtil.isNotBlank(vo.getAcceptInfo())) {
like(ImsDutyRecEntity::getAcceptInfo, vo.getAcceptInfo());
}
if (StringUtil.isNotBlank(vo.getLeftProblem())) {
like(ImsDutyRecEntity::getLeftProblem, vo.getLeftProblem());
}
if (StringUtil.isNotBlank(vo.getStartDate())) {
ge(ImsDutyRecEntity::getExecTime, vo.getStartDate());
}
if (StringUtil.isNotBlank(vo.getEndDate())) {
le(ImsDutyRecEntity::getExecTime, vo.getEndDate());
}
if (ObjectUtil.isNotEmpty(vo.getCreateDept())) {
eq(ImsDutyRecEntity::getCreateDept, vo.getCreateDept());
}
}});
List<ImsDutyRecVO> records = ImsDutyRecWrapper.build().listVO(recs);
if (CollectionUtil.isEmpty(records)) {
return new ArrayList<>();
}
return records.stream().peek(record->{
ImsSchedulingVo imsSchedulingVo = imsDutyMainService.getByIdOneV2(record.getDutyId(), null);
record.setHeadDutyMainVo(imsSchedulingVo);
ImsSchedulingVo carryDutyMainVo = imsDutyMainMapper.selectByPreDutyIdOne(Optional.ofNullable(imsSchedulingVo).map(ImsSchedulingVo::getId).orElse(null));
if (ObjectUtil.isNotEmpty(carryDutyMainVo)){
if (StringUtil.isBlank(carryDutyMainVo.getGroupName())){
carryDutyMainVo.setGroupName("临时班组");
}
}
record.setCarryDutyMainVo(carryDutyMainVo);
// 机构名称
R<String> result = sysClient.getDeptName(record.getCreateDept());
if (result.isSuccess() && ObjectUtil.isNotEmpty(result.getData())) {
record.setStationName(result.getData());
}
Long dutyId = record.getDutyId();
ImsDutyLogEntity dutyLogEntity = imsDutyLogService.getOne(new LambdaQueryWrapper<ImsDutyLogEntity>() {{
eq(ImsDutyLogEntity::getDutyId, dutyId);
last(" limit 1;");
}});
record.setImsDutyLogEntity(dutyLogEntity);
}).collect(Collectors.toList());
}
private String getManagerName(ImsDutyMainEntity mainEntity) { private String getManagerName(ImsDutyMainEntity mainEntity) {
String managerName=""; String managerName="";

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java

@ -53,12 +53,19 @@ public class StationController extends BladeController {
@OperationAnnotation( @OperationAnnotation(
moduleName = "站点管理", moduleName = "站点管理",
title = "站点管理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, title = "站点管理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE,
action = "分页查询站点管理列表") action = "分页查询 站点管理列表")
public R<IPage<StationVO>> list(StationEntity entity, Query query) { public R<IPage<StationVO>> list(StationEntity entity, Query query) {
IPage<StationVO> vos = stationService.list(entity, query); IPage<StationVO> vos = stationService.list(entity, query);
return R.data(vos); return R.data(vos);
} }
@RequestMapping(value = "/stations", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 10)
@ApiOperation(value = "站点列表查询", notes = "传入StationEntity")
public R<List<StationVO>> stations(StationEntity entity) {
return R.data(stationService.stations(entity));
}
/** /**
* 新增 * 新增
*/ */

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java

@ -140,4 +140,6 @@ public interface IStationService extends IService<StationEntity> {
boolean updateBatchSort(List<StationEntity> req); boolean updateBatchSort(List<StationEntity> req);
List<HomeMapStationVo> homeMapStationVo(); List<HomeMapStationVo> homeMapStationVo();
List<StationVO> stations(StationEntity entity);
} }

58
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.hnac.hzims.fdp.feign.IQuestionClient; import com.hnac.hzims.fdp.feign.IQuestionClient;
import com.hnac.hzims.operational.OperationalConstants; import com.hnac.hzims.operational.OperationalConstants;
@ -35,10 +36,7 @@ import com.hnac.hzinfo.sdk.v5.project.ProjectClient;
import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO; import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
@ -795,4 +793,58 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, StationEntity
return mapStation; return mapStation;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
/**
* 站点列表查询
* @param entity
* @return
*/
@Override
public List<StationVO> stations(StationEntity entity) {
LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<StationEntity>() {{
if (StringUtil.isNotBlank(entity.getCode())) {
like(StationEntity::getCode, "%".concat(entity.getCode()).concat("%"));
}
if (StringUtil.isNotBlank(entity.getName())) {
like(StationEntity::getName, "%".concat(entity.getName()).concat("%"));
}
if (ObjectUtil.isNotEmpty(entity.getType())) {
eq(StationEntity::getType, entity.getType());
}
if (ObjectUtil.isNotEmpty(entity.getEnableControl())) {
eq(StationEntity::getEnableControl, entity.getEnableControl());
}
if (ObjectUtil.isNotEmpty(entity.getRefDomain())) {
eq(StationEntity::getRefDomain, entity.getRefDomain());
}
if (ObjectUtil.isNotEmpty(entity.getRefBasin())) {
eq(StationEntity::getRefBasin, entity.getRefBasin());
}
if (ObjectUtil.isNotEmpty(entity.getRefArea())) {
eq(StationEntity::getRefArea, entity.getRefArea());
}
if (ObjectUtil.isNotEmpty(entity.getAreaCode())) {
eq(StationEntity::getAreaCode, entity.getAreaCode());
}
if (ObjectUtil.isNotEmpty(entity.getRefDept())) {
eq(StationEntity::getRefDept, entity.getRefDept());
}
if (ObjectUtil.isNotEmpty(entity.getRemark())) {
like(StationEntity::getRemark, "%".concat(entity.getRemark()).concat("%"));
}
if (ObjectUtil.isNotEmpty(entity.getStartDate())) {
ge(StationEntity::getCreateTime, entity.getStartDate());
}
if (ObjectUtil.isNotEmpty(entity.getEndDate())) {
le(StationEntity::getCreateTime, entity.getEndDate());
}
}};
queryWrapper.orderByDesc(StationEntity::getSort);
queryWrapper.orderByDesc(StationEntity::getUpdateTime);
List<StationEntity> stations = this.list(queryWrapper);
if(CollectionUtil.isEmpty(stations)){
return new ArrayList<>();
}
return StationWrapper.builder().listVO(stations);
}
} }

9
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardCategoryController.java

@ -15,6 +15,8 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* @author ysj * @author ysj
@ -77,6 +79,13 @@ public class HazardCategoryController {
return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity))); return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
} }
@GetMapping("/categorys")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "查询列表", notes = "查询条件:entity")
public R<List<HazardCategory>> categorys(HazardCategory entity) {
return R.data(service.list(Condition.getQueryWrapper(entity)));
}
/** /**
* 是否存在危险源 * 是否存在危险源

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardWorkController.java

@ -79,6 +79,14 @@ public class HazardWorkController {
// return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity))); // return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
} }
@GetMapping("/hazardWorks")
@ApiOperationSupport(order = 60)
@ApiOperation(value = "查询列表", notes = "查询条件:item")
public R<List<HazardWorkVO>> hazardWorks(HazardWork entity) {
return R.data(service.hazardWorks(entity));
}
@GetMapping("/getCheckItemByDutyPerson") @GetMapping("/getCheckItemByDutyPerson")
@ApiOperationSupport(order = 70) @ApiOperationSupport(order = 70)
@ApiOperation(value = "根据负责人ID获取对应区域下的风险排查项") @ApiOperation(value = "根据负责人ID获取对应区域下的风险排查项")

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardWorkService.java

@ -26,4 +26,6 @@ public interface HazardWorkService extends IService<HazardWork> {
* @return 作业区域页面 * @return 作业区域页面
*/ */
IPage<HazardWorkVO> getHazardWorkPage(HazardWork entity, Query query); IPage<HazardWorkVO> getHazardWorkPage(HazardWork entity, Query query);
List<HazardWorkVO> hazardWorks(HazardWork entity);
} }

1
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java

@ -149,5 +149,4 @@ public class HazardCategoryServiceImpl extends ServiceImpl<HazardCategoryMapper,
public List<CategorySourceVo> sourcesByCategory(Integer stationType) { public List<CategorySourceVo> sourcesByCategory(Integer stationType) {
return this.baseMapper.sourcesByCategory(stationType); return this.baseMapper.sourcesByCategory(stationType);
} }
} }

30
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java

@ -3,6 +3,7 @@ package com.hnac.hzims.safeproduct.risk.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.risk.entity.Correlation; import com.hnac.hzims.safeproduct.risk.entity.Correlation;
import com.hnac.hzims.safeproduct.risk.entity.HazardCategory; import com.hnac.hzims.safeproduct.risk.entity.HazardCategory;
import com.hnac.hzims.safeproduct.risk.entity.HazardSource; import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
@ -17,7 +18,6 @@ import com.hnac.hzims.safeproduct.risk.vo.PersonalCheckItemVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -124,4 +124,32 @@ public class HazardWorkServiceImpl extends ServiceImpl<HazardWorkMapper, HazardW
page.setPages(hazardWorkPage.getPages()); page.setPages(hazardWorkPage.getPages());
return page; return page;
} }
@Override
public List<HazardWorkVO> hazardWorks(HazardWork entity) {
List<HazardWork> works = this.list(Condition.getQueryWrapper(entity));
if(CollectionUtil.isEmpty(works)){
return new ArrayList<>();
}
// 负责人和分管领导名称
return works.stream().map(work->{
HazardWorkVO hazardWork = new HazardWorkVO();
BeanUtil.copyProperties(work, hazardWork);
Long headId = work.getHead();
if (headId != null) {
R<User> header = userClient.userInfoById(headId);
if (header.isSuccess()) {
hazardWork.setHeadName(header.getData().getRealName());
}
}
Long manageId = work.getManage();
if (manageId != null) {
R<User> manager = userClient.userInfoById(manageId);
if (manager.isSuccess()) {
hazardWork.setManagerName(manager.getData().getRealName());
}
}
return hazardWork;
}).collect(Collectors.toList());
}
} }

Loading…
Cancel
Save